progressText = __('Processing please wait...', 'duplicator'); $this->uniqid = substr(uniqid('',true),0,14) . rand(); $this->id = 'dup-dlg-'.$this->uniqid; } /** * 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"; } /** * Initilizes the alert base html code used to display when needed * * @return string The html content used for the alert dialog */ public function initAlert() { $ok = __('OK', 'duplicator'); $html = <<
{$this->message}

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 : 475; $this->height = is_numeric($this->height) ? $this->height : 125; echo "tb_show('{$this->title}', '#TB_inline?width={$this->width}&height={$this->height}&inlineId={$this->id}');"; } /** * Shows the confirm base js code used to display when needed * * @return string The javascript content used for the confirm dialog */ public function initConfirm() { $ok = __('OK', 'duplicator'); $cancel = __('Cancel', 'duplicator'); $progress_data = ''; $progress_func2 = ''; //Enable the progress spinner if ($this->progressOn) { $progress_func1 = "__DUP_UI_Dialog_".$this->uniqid; $progress_func2 = ";{$progress_func1}(this)"; $progress_data = << {$this->progressText} HTML; } $html = <<
{$this->message}

{$progress_data}
HTML; 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 showConfirm() { $this->width = is_numeric($this->width) ? $this->width : 500; $this->height = is_numeric($this->height) ? $this->height : 150; echo "tb_show('{$this->title}', '#TB_inline?width={$this->width}&height={$this->height}&inlineId={$this->id}');"; } }