progressText = __('Processing please wait...', 'duplicator'); $this->uniqid = substr(uniqid('',true),0,14) . rand(); $this->id = 'dup-dlg-'.$this->uniqid; $this->okText = __('OK', 'duplicator'); $this->cancelText = __('Cancel', 'duplicator'); } /** * Gets the unique id that is assigned to each instance of a dialog * * @return int 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 int The unique ID of the message */ public function getMessageID() { return "{$this->id}_message"; } /** * Initialize the alert base html code used to display when needed * * @return string The html content used for the alert dialog */ public function initAlert() { $onClickClose = ''; if (!is_null($this->jscallback)) { $onClickClose .= $this->jscallback.';'; } $onClickClose .= 'tb_remove();'; $html = '
'; echo $html; } /** * Shows the alert base JS code used to display when needed * * @return string The javascript content used for the alert dialog */ public function showAlert() { $this->width = is_numeric($this->width) ? $this->width : 500; $this->height = is_numeric($this->height) ? $this->height : 175; $html = "tb_show('".esc_js($this->title)."', '#TB_inline?width=".esc_js($this->width)."&height=".esc_js($this->height)."&inlineId=".esc_js($this->id)."');\n" . "var styleData = jQuery('#TB_window').attr('style') + 'height: ".esc_js($this->height)."px !important';\n" . "jQuery('#TB_window').attr('style', styleData);"; echo $html; } /** * Shows the confirm base JS code used to display when needed * * @return string The javascript content used for the confirm dialog */ 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 = "__DUP_UI_Dialog_".$this->uniqid; $progress_func2 = ";{$progress_func1}(this)"; $progress_data = "