From 74167b183e83f1231c4baca5425c14fa214720aa Mon Sep 17 00:00:00 2001 From: Cameron Date: Sun, 16 Dec 2012 20:59:14 -0800 Subject: [PATCH] New page-menu and template --- e107_admin/cpage.php | 2 +- e107_core/templates/page_template.php | 28 +++++++++++++++------------ e107_plugins/page/page_menu.php | 26 +++++++++++++++++++++++++ 3 files changed, 43 insertions(+), 13 deletions(-) create mode 100644 e107_plugins/page/page_menu.php diff --git a/e107_admin/cpage.php b/e107_admin/cpage.php index 20d5f87d4..2e37e0d71 100644 --- a/e107_admin/cpage.php +++ b/e107_admin/cpage.php @@ -530,7 +530,7 @@ class page_admin_ui extends e_admin_ui // fixed - last parameter (allinfo) should be false as getLayout method is returning non-usable formatted array $templates = e107::getLayouts('', 'page', 'front', '', false, false); - $templates['menu'] = "Sidebar"; // ie. a MENU item. //TODO + // $templates['menu'] = "Sidebar"; // ie. a MENU item. //TODO $text .= " diff --git a/e107_core/templates/page_template.php b/e107_core/templates/page_template.php index 5c2f7029b..5da2ca6e8 100644 --- a/e107_core/templates/page_template.php +++ b/e107_core/templates/page_template.php @@ -77,21 +77,25 @@ $sc_style['CPAGENAV|default']['post'] = ''; #### No table render example template #### - $PAGE_TEMPLATE['custom']['start'] = '
'; - - $PAGE_TEMPLATE['custom']['body'] = ''; - - $PAGE_TEMPLATE['custom']['authorize'] = ' - + $PAGE_TEMPLATE['custom']['start'] = '
'; + $PAGE_TEMPLATE['custom']['body'] = ''; + $PAGE_TEMPLATE['custom']['authorize'] = ' '; - $PAGE_TEMPLATE['custom']['restricted'] = ' - + $PAGE_TEMPLATE['custom']['restricted'] = ' '; - $PAGE_TEMPLATE['custom']['end'] = '
'; + $PAGE_TEMPLATE['custom']['end'] = '
'; + $PAGE_TEMPLATE['custom']['noTableRender'] = true; + $PAGE_TEMPLATE['custom']['tableRender'] = ''; - - $PAGE_TEMPLATE['custom']['noTableRender'] = true; - $PAGE_TEMPLATE['custom']['tableRender'] = ''; + +#### Panel Template - Used by e107_plugins/page/page_menu.php + $PAGE_TEMPLATE['panel']['start'] = ''; + $PAGE_TEMPLATE['panel']['body'] = '{CPAGEBODY}'; + $PAGE_TEMPLATE['panel']['authorize'] = ''; + $PAGE_TEMPLATE['panel']['restricted'] = ''; + $PAGE_TEMPLATE['panel']['end'] = ''; + $PAGE_TEMPLATE['panel']['noTableRender'] = false; + $PAGE_TEMPLATE['panel']['tableRender'] = ''; diff --git a/e107_plugins/page/page_menu.php b/e107_plugins/page/page_menu.php new file mode 100644 index 000000000..674e8c111 --- /dev/null +++ b/e107_plugins/page/page_menu.php @@ -0,0 +1,26 @@ +retrieve("SELECT * FROM #page WHERE page_class IN (".USERCLASS_LIST.") AND FIND_IN_SET('panel', page_template) LIMIT 3", true); + +//TODO Use shortcodes and template. +foreach($data as $row) +{ + $title = $tp->toHtml($row['page_title'],false,'TITLE'); + $body = $tp->toHtml($row['page_text'],true,'BODY'); + + + $ns->tablerender($title, $body,'page-menu'); // check for $mode == 'page-menu' in tablestyle() if you need a simple 'echo' without rendering styles. +} + + +?> \ No newline at end of file