active_filename = $base_path.'/opac_css/temp/.maintenance'; $this->content_filename = $base_path.'/opac_css/temp/maintenance.html'; } public function fetch_data() { $this->active = false; if (file_exists($this->active_filename)) { $this->active = true; } $this->fetch_content(); } public function get_form() { global $maintenance_page_form, $base_path, $pmb_javascript_office_editor, $charset; $form = ''; if ($pmb_javascript_office_editor) { $form.= $pmb_javascript_office_editor; $form.= ""; } $form.= $maintenance_page_form; $checked = ''; if ($this->active) { $checked = 'checked="checked"'; } $form = str_replace('!!maintenance_page_activate_checked!!', $checked, $form); $form = str_replace('!!maintenance_page_content_title!!', $this->content['title'], $form); $form = str_replace('!!maintenance_page_content_body!!', $this->content['body'], $form); $form = str_replace('!!maintenance_page_content_style!!', $this->content['style'], $form); return $form; } public function get_values_from_form() { global $maintenance_page_activate; global $maintenance_page_content_body; global $maintenance_page_content_title; global $maintenance_page_content_style; $this->active = ($maintenance_page_activate*1 ? true : false); $this->content['body'] = stripslashes($maintenance_page_content_body); $this->content['title'] = stripslashes($maintenance_page_content_title); $this->content['style'] = stripslashes($maintenance_page_content_style); } public function save() { if ($this->active && !file_exists($this->active_filename)) { touch($this->active_filename); } if (!$this->active && file_exists($this->active_filename)) { unlink($this->active_filename); } file_put_contents($this->content_filename, $this->build_page()); } protected function fetch_content() { $this->content = array(); if (file_exists($this->content_filename)) { $html = file_get_contents($this->content_filename); $matches = array(); preg_match('/