progressText = __('Processing please wait...', 'duplicator-pro'); $this->uniqid = ++self::$uniqueIdCounter; $this->id = 'dpro-dlg-' . $this->uniqid; $this->okText = __('OK', 'duplicator-pro'); $this->cancelText = __('Cancel', 'duplicator-pro'); } /** * * @return int */ public function getUniqueIdCounter() { return $this->uniqid; } /** * Gets the unique id that is assigned to each instance of a dialog * * @return string The unique ID of this dialog */ public function getID() { return $this->id; } /** * Gets the unique id that is assigned to each instance of a dialogs message text * * @return string The unique ID of the message */ public function getMessageID() { return "{$this->id}_message"; } /** * Display The html content used for the alert dialog * * @return void */ public function initAlert() { ?>
title); $id = esc_js($this->id); $html = "tb_show('" . $title . "', '#TB_inline?width=" . $this->width . "&height=" . $this->height . "&inlineId=" . $id . "');" . "var styleData = jQuery('#TB_window').attr('style') + 'height: " . $this->height . "px !important';\n" . "jQuery('#TB_window').attr('style', styleData);" . "DuplicatorTooltip.reload();"; echo $html; } /** * Close tick box * * @param boolean $echo if true echo javascript else return string * * @return string */ public function closeAlert($echo = true) { $onClickClose = ''; if (!is_null($this->jsCallback)) { $onClickClose .= $this->jsCallback . ';'; } $onClickClose .= 'tb_remove();'; if ($echo) { echo $onClickClose; return ''; } else { return $onClickClose; } } /** * js code to update html message content from js var name * * @param string $jsVarName js var name * * @return void */ public function updateMessage($jsVarName) { $js = '$("#' . $this->getID() . '_message").html(' . $jsVarName . ');'; echo $js; } /** * js code to update textarea content from js var name * * @param string $jsVarName js var name * * @return void */ public function updateTextareaMessage($jsVarName) { $js = '$("#' . $this->getID() . '_textarea").val(' . $jsVarName . ');'; echo $js; } /** * Shows the confirm base JS code used to display when needed * * @return void */ public function initConfirm() { $progress_data = ''; $progress_func2 = ''; $onClickConfirm = ''; if (!is_null($this->jsCallback)) { $onClickConfirm .= $this->jsCallback . ';'; } //Enable the progress spinner if ($this->progressOn) { $progress_func1 = "__dpro_dialog_" . $this->uniqid; $progress_func2 = ";{$progress_func1}(this)"; $progress_data = <<