'100%', 'height' => '260px', 'form_name' => 'inputform', 'type' => "html", 'class' => 'm-t-20', ]; if ((isset($_COOKIE['custom_pages_tinymce']) && $_COOKIE['custom_pages_tinymce'] == 1) || fusion_get_settings('tinymce_enabled')) { self::$textarea_options = [ "type" => "tinymce", "tinymce" => "advanced", "class" => "m-t-20", "height" => "400px", ]; } } public function display_page() { if (isset($_POST['cancel'])) { redirect(FUSION_SELF.fusion_get_aidlink()); } add_to_title(self::$locale['global_201'].self::$locale['page_0100']); BreadCrumbs::getInstance()->addBreadCrumb(['link' => ADMIN.'custom_pages.php'.fusion_get_aidlink(), 'title' => self::$locale['page_0100']]); $tree = dbquery_tree_full(DB_CUSTOM_PAGES, 'page_id', 'page_cat'); $tree_index = tree_index($tree); make_page_breadcrumbs($tree_index, $tree, 'page_id', 'page_title', 'pref'); self::$is_editing = (isset($_GET['action']) && $_GET['action'] == 'edit') ? 1 : 0; if (self::$current_section == "cp2") { BreadCrumbs::getInstance()->addBreadCrumb(['link' => ADMIN.'custom_pages.php'.fusion_get_aidlink(), 'title' => self::$is_editing ? self::$locale['page_0201'] : self::$locale['page_0200']]); } else if (self::$current_section == 'compose_frm') { // there are 3 sections switch (self::getComposerMode()) { case 'pg_settings': $title = self::$locale['page_0202']; break; case 'pg_composer': $title = self::$locale['page_0203']; break; default: $title = self::$locale['page_0204']; } BreadCrumbs::getInstance()->addBreadCrumb(['link' => FUSION_REQUEST, 'title' => $title]); } $tab_title['title'][] = self::$current_section == 'compose_frm' ? self::$locale['back'] : self::$locale['page_0205']; $tab_title['id'][] = 'cp1'; $tab_title['icon'][] = self::$current_section == 'compose_frm' ? 'fa fa-arrow-left' : ''; if (self::$current_section == 'compose_frm') { $tab_title['title'][] = self::$is_editing ? self::$locale['page_0201'] : self::$locale['page_0200']; $tab_title['id'][] = 'compose_frm'; $tab_title['icon'][] = 'fa fa-pencil'; } $tab_active = self::$current_section; switch (self::$current_action) { case 'edit': if (!empty(self::$current_pageId)) { self::$data = self::load_customPage(self::$current_pageId); if (empty(self::$data)) { redirect(FUSION_SELF.fusion_get_aidlink()); } fusion_confirm_exit(); opentable(self::$locale['page_0201']); } else { redirect(FUSION_SELF.fusion_get_aidlink()); } break; case 'delete': if (!empty(self::$current_pageId)) { self::delete_customPage(self::$current_pageId); dbquery("DELETE FROM ".DB_CUSTOM_PAGES_GRID." WHERE page_id=".self::$current_pageId); dbquery("DELETE FROM ".DB_CUSTOM_PAGES_CONTENT." WHERE page_id=".self::$current_pageId); addNotice('success', self::$locale['page_0400']); } redirect(FUSION_SELF.fusion_get_aidlink()); break; default: opentable(self::$locale['page_0100']); } echo opentab($tab_title, $tab_active, 'cpa', TRUE, '', 'section', ['action', 'cpid']); if (self::$current_section == "compose_frm") { PageComposer::displayContent(); } else { PageList::displayContent(); } echo closetab(); echo closetable(); } /** * Get page administration mode * * @return string */ public static function getComposerMode() { if (empty(self::$composerMode)) { self::$composerMode = isset($_GET['composer_tab']) && in_array($_GET['composer_tab'], self::$allowed_composer_mode) ? $_GET['composer_tab'] : 'pg_content'; } return (string)self::$composerMode; } }