1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 04:38:27 +01:00

New page-menu and template

This commit is contained in:
Cameron 2012-12-16 20:59:14 -08:00
parent d684bab28c
commit 74167b183e
3 changed files with 43 additions and 13 deletions

View File

@ -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 .= "
<tr>

View File

@ -77,21 +77,25 @@ $sc_style['CPAGENAV|default']['post'] = '</div>';
#### No table render example template ####
$PAGE_TEMPLATE['custom']['start'] = '<div class="cpage_body">';
$PAGE_TEMPLATE['custom']['body'] = '';
$PAGE_TEMPLATE['custom']['authorize'] = '
$PAGE_TEMPLATE['custom']['start'] = '<div class="cpage_body">';
$PAGE_TEMPLATE['custom']['body'] = '';
$PAGE_TEMPLATE['custom']['authorize'] = '
';
$PAGE_TEMPLATE['custom']['restricted'] = '
$PAGE_TEMPLATE['custom']['restricted'] = '
';
$PAGE_TEMPLATE['custom']['end'] = '</div>';
$PAGE_TEMPLATE['custom']['end'] = '</div>';
$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'] = '';

View File

@ -0,0 +1,26 @@
<?php
if (!defined('e107_INIT')) { exit; }
$sql = e107::getDb();
$ns = e107::getRender();
$tp = e107::getParser();
$template = e107::getCoreTemplate('page','panel');
//TODO Limits and cache etc.
$data = $sql->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.
}
?>