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_content_form; $content_form = $maintenance_page_content_form; $interface_form = new interface_form('admin_opac_maintenance_form'); $checked = ''; if ($this->active) { $checked = 'checked="checked"'; } $content_form = str_replace('!!maintenance_page_activate_checked!!', $checked, $content_form); $content_form = str_replace('!!maintenance_page_content_title!!', $this->content['title'], $content_form); $content_form = str_replace('!!maintenance_page_content_body!!', $this->content['body'], $content_form); $content_form = str_replace('!!maintenance_page_content_style!!', $this->content['style'], $content_form); $interface_form->set_content_form($content_form); return $interface_form->get_display(); } 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('/