mirror of
https://github.com/e107inc/e107.git
synced 2025-08-02 12:48:26 +02:00
Custom-Page navigation menu and shortcode added.
This commit is contained in:
@@ -88,7 +88,7 @@ $NAVIGATION_TEMPLATE['side']['start'] = '<ul class="nav nav-list"><li class=
|
|||||||
$NAVIGATION_TEMPLATE['side']['item'] = '<li><a href="{LINK_URL}">{LINK_NAME}</a></li>
|
$NAVIGATION_TEMPLATE['side']['item'] = '<li><a href="{LINK_URL}">{LINK_NAME}</a></li>
|
||||||
';
|
';
|
||||||
|
|
||||||
$NAVIGATION_TEMPLATE['side']['item_submenu'] = '<li class="nav-header">{LINK_NAME}</li>{LINK_SUB}
|
$NAVIGATION_TEMPLATE['side']['item_submenu'] = '<li class="nav-header">{LINK_NAME}{LINK_SUB}</li>
|
||||||
';
|
';
|
||||||
|
|
||||||
$NAVIGATION_TEMPLATE['side']['item_active'] = '<li class="active"><a href="{LINK_URL}">{LINK_NAME}</a></li>
|
$NAVIGATION_TEMPLATE['side']['item_active'] = '<li class="active"><a href="{LINK_URL}">{LINK_NAME}</a></li>
|
||||||
@@ -99,11 +99,16 @@ $NAVIGATION_TEMPLATE['side']['end'] = '</ul>
|
|||||||
|
|
||||||
$NAVIGATION_TEMPLATE['side']['submenu_start'] = '';
|
$NAVIGATION_TEMPLATE['side']['submenu_start'] = '';
|
||||||
|
|
||||||
$NAVIGATION_TEMPLATE['side']['submenu_item'] = '<li><a href="{LINK_URL}">{LINK_NAME}</a></li>
|
$NAVIGATION_TEMPLATE['side']['submenu_item'] = '<li><a href="{LINK_URL}">{LINK_NAME}</a></li>';
|
||||||
';
|
|
||||||
|
|
||||||
$NAVIGATION_TEMPLATE['side']['submenu_item_active'] = '<li class="active"><a href="{LINK_URL}">{LINK_NAME}</a></li>
|
$NAVIGATION_TEMPLATE['side']['submenu_loweritem'] = '
|
||||||
';
|
<li role="menuitem" class="dropdown-submenu">
|
||||||
|
<a href="{LINK_URL}">{LINK_IMAGE}{LINK_NAME}</a>
|
||||||
|
{LINK_SUB}
|
||||||
|
</li>
|
||||||
|
';
|
||||||
|
|
||||||
|
$NAVIGATION_TEMPLATE['side']['submenu_item_active'] = '<li class="active"><a href="{LINK_URL}">{LINK_NAME}</a></li>';
|
||||||
|
|
||||||
$NAVIGATION_TEMPLATE['side']['submenu_end'] = '';
|
$NAVIGATION_TEMPLATE['side']['submenu_end'] = '';
|
||||||
|
|
||||||
|
@@ -1,10 +1,15 @@
|
|||||||
<?php
|
<?php
|
||||||
/*
|
/*
|
||||||
* Copyright (C) e107 Inc (e107.org), Licensed under GNU GPL (http://www.gnu.org/licenses/gpl.txt)
|
* e107 website system
|
||||||
* $Id$
|
*
|
||||||
*
|
* Copyright (C) 2008-2013 e107 Inc (e107.org)
|
||||||
* Page tempaltes - under construction
|
* Released under the terms and conditions of the
|
||||||
*/
|
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (!defined('e107_INIT')) { exit; }
|
||||||
|
|
||||||
global $sc_style;
|
global $sc_style;
|
||||||
|
|
||||||
$sc_style['CPAGEAUTHOR|default']['pre'] = '';
|
$sc_style['CPAGEAUTHOR|default']['pre'] = '';
|
||||||
@@ -97,5 +102,87 @@ $sc_style['CPAGENAV|default']['post'] = '</div>';
|
|||||||
$PAGE_TEMPLATE['panel']['restricted'] = '';
|
$PAGE_TEMPLATE['panel']['restricted'] = '';
|
||||||
$PAGE_TEMPLATE['panel']['end'] = '';
|
$PAGE_TEMPLATE['panel']['end'] = '';
|
||||||
$PAGE_TEMPLATE['panel']['noTableRender'] = false;
|
$PAGE_TEMPLATE['panel']['noTableRender'] = false;
|
||||||
$PAGE_TEMPLATE['panel']['tableRender'] = '';
|
// $PAGE_TEMPLATE['panel']['tableRender'] = ''; // needed?
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Used by {PAGE_NAVIGATION} shortcode - uses Sitelink/Navigation Shortcodes eg. {LINK_NAME} */
|
||||||
|
|
||||||
|
$PAGE_TEMPLATE['nav']['caption'] = "Articles";
|
||||||
|
|
||||||
|
$PAGE_TEMPLATE['nav']['start'] = '<ul>';
|
||||||
|
|
||||||
|
// Main Link
|
||||||
|
$PAGE_TEMPLATE['nav']['item'] = '
|
||||||
|
<li>
|
||||||
|
<a role="button" href="{LINK_URL}" >
|
||||||
|
{LINK_NAME}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
';
|
||||||
|
|
||||||
|
// Main Link which has a sub menu.
|
||||||
|
$PAGE_TEMPLATE['nav']['item_submenu'] = '
|
||||||
|
<li>
|
||||||
|
<a role="button" href="{LINK_URL}" >
|
||||||
|
{LINK_NAME}
|
||||||
|
</a>
|
||||||
|
{LINK_SUB}
|
||||||
|
</li>
|
||||||
|
';
|
||||||
|
|
||||||
|
$PAGE_TEMPLATE['nav']['item_submenu_active'] = '
|
||||||
|
<li class="active">
|
||||||
|
<a role="button" href="{LINK_URL}">
|
||||||
|
{LINK_IMAGE} {LINK_NAME}
|
||||||
|
</a>
|
||||||
|
{LINK_SUB}
|
||||||
|
</li>
|
||||||
|
';
|
||||||
|
|
||||||
|
$PAGE_TEMPLATE['nav']['item_active'] = '
|
||||||
|
<li class="active">
|
||||||
|
<a crole="button" href="{LINK_URL}">
|
||||||
|
{LINK_IMAGE} {LINK_NAME}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
';
|
||||||
|
|
||||||
|
$PAGE_TEMPLATE['nav']['end'] = '</ul>';
|
||||||
|
|
||||||
|
$PAGE_TEMPLATE['nav']['item_active'] = '
|
||||||
|
<li class="active">
|
||||||
|
<a role="button" href="{LINK_URL}">
|
||||||
|
{LINK_IMAGE} {LINK_NAME}
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
';
|
||||||
|
|
||||||
|
$PAGE_TEMPLATE['nav']['end'] = '</ul>';
|
||||||
|
|
||||||
|
|
||||||
|
$PAGE_TEMPLATE['nav']['submenu_start'] = '<ul id="{LINK_PARENT}" role="menu" >';
|
||||||
|
|
||||||
|
|
||||||
|
$PAGE_TEMPLATE['nav']['submenu_item'] = '
|
||||||
|
<li role="menuitem" >
|
||||||
|
<a href="{LINK_URL}">{LINK_IMAGE}{LINK_NAME}</a>
|
||||||
|
{LINK_SUB}
|
||||||
|
</li>
|
||||||
|
';
|
||||||
|
|
||||||
|
$PAGE_TEMPLATE['nav']['submenu_loweritem'] = '
|
||||||
|
<li role="menuitem" >
|
||||||
|
<a href="{LINK_URL}">{LINK_IMAGE}{LINK_NAME}</a>
|
||||||
|
{LINK_SUB}
|
||||||
|
</li>
|
||||||
|
';
|
||||||
|
|
||||||
|
$PAGE_TEMPLATE['nav']['submenu_item_active'] = '
|
||||||
|
<li role="menuitem" class="active">
|
||||||
|
<a href="{LINK_URL}">{LINK_IMAGE}{LINK_NAME}</a>
|
||||||
|
{LINK_SUB}
|
||||||
|
</li>
|
||||||
|
';
|
||||||
|
|
||||||
|
$PAGE_TEMPLATE['nav']['submenu_end'] = '</ul>';
|
||||||
|
@@ -1407,10 +1407,8 @@ class e_navigation
|
|||||||
$sc = e107::getScBatch('navigation');
|
$sc = e107::getScBatch('navigation');
|
||||||
$sc->template = $template;
|
$sc->template = $template;
|
||||||
$ret = $template['start'];
|
$ret = $template['start'];
|
||||||
|
|
||||||
|
|
||||||
foreach ($data as $_data)
|
foreach ($data as $_data)
|
||||||
{
|
{
|
||||||
$sc->setVars($_data);
|
$sc->setVars($_data);
|
||||||
$active = ($this->isActive($_data)) ? "_active" : "";
|
$active = ($this->isActive($_data)) ? "_active" : "";
|
||||||
$itemTmpl = count($_data['link_sub']) > 0 ? $template['item_submenu'.$active] : $template['item'.$active];
|
$itemTmpl = count($_data['link_sub']) > 0 ? $template['item_submenu'.$active] : $template['item'.$active];
|
||||||
@@ -1529,6 +1527,11 @@ class navigation_shortcodes extends e_shortcode
|
|||||||
{
|
{
|
||||||
return e107::getParser()->toHtml($this->var['link_name'],false,'defs');
|
return e107::getParser()->toHtml($this->var['link_name'],false,'defs');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function sc_link_parent($parm='')
|
||||||
|
{
|
||||||
|
return intval($this->var['link_parent']);
|
||||||
|
}
|
||||||
|
|
||||||
function sc_link_url($parm='')
|
function sc_link_url($parm='')
|
||||||
{
|
{
|
||||||
|
@@ -2,28 +2,14 @@
|
|||||||
/*
|
/*
|
||||||
* e107 website system
|
* e107 website system
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008-2009 e107 Inc (e107.org)
|
* Copyright (C) 2008-2013 e107 Inc (e107.org)
|
||||||
* Released under the terms and conditions of the
|
* Released under the terms and conditions of the
|
||||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||||
*
|
*
|
||||||
* Sitelinks configuration module - gsitemap
|
|
||||||
*
|
|
||||||
* $Source: /cvs_backup/e107_0.8/e107_plugins/page/e_sitelink.php,v $
|
|
||||||
* $Revision$
|
|
||||||
* $Date$
|
|
||||||
* $Author$
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
//require_once("../../class2.php");
|
|
||||||
|
|
||||||
if (!defined('e107_INIT')) { exit; }
|
if (!defined('e107_INIT')) { exit; }
|
||||||
/*if(!plugInstalled('gsitemap'))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}*/
|
|
||||||
//$pg = new page_sitelinks;
|
|
||||||
//$pg->myfunction();
|
|
||||||
|
|
||||||
|
|
||||||
class page_sitelinks // include plugin-folder in the name.
|
class page_sitelinks // include plugin-folder in the name.
|
||||||
{
|
{
|
||||||
@@ -47,7 +33,7 @@ class page_sitelinks // include plugin-folder in the name.
|
|||||||
$sql = e107::getDb();
|
$sql = e107::getDb();
|
||||||
$sublinks = array();
|
$sublinks = array();
|
||||||
$arr = array();
|
$arr = array();
|
||||||
$query = "SELECT p.*, c.* FROM #page AS p LEFT JOIN #page_chapters AS c ON p.page_chapter = c.chapter_id ORDER BY c.chapter_order,p.page_order";
|
$query = "SELECT p.*, c.* FROM #page AS p LEFT JOIN #page_chapters AS c ON p.page_chapter = c.chapter_id ORDER BY c.chapter_order,p.page_order";
|
||||||
$data = $sql->retrieve($query, true);
|
$data = $sql->retrieve($query, true);
|
||||||
|
|
||||||
foreach($data as $row)
|
foreach($data as $row)
|
||||||
@@ -56,7 +42,7 @@ class page_sitelinks // include plugin-folder in the name.
|
|||||||
$sublinks[$pid][] = array(
|
$sublinks[$pid][] = array(
|
||||||
'link_id' => $row['page_id'],
|
'link_id' => $row['page_id'],
|
||||||
'link_name' => $row['page_title'],
|
'link_name' => $row['page_title'],
|
||||||
'link_url' => 'page.php?'.$row['page_id'],
|
'link_url' => vartrue($row['page_sef'],'page.php?'.$row['page_id']),
|
||||||
'link_description' => '',
|
'link_description' => '',
|
||||||
'link_button' => '',
|
'link_button' => '',
|
||||||
'link_category' => '',
|
'link_category' => '',
|
||||||
@@ -67,7 +53,7 @@ class page_sitelinks // include plugin-folder in the name.
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$books = $sql->retrieve("page_chapters","*",1, true);
|
$books = $sql->retrieve("page_chapters","*", 1, true);
|
||||||
|
|
||||||
foreach($books as $row)
|
foreach($books as $row)
|
||||||
{
|
{
|
||||||
@@ -75,7 +61,7 @@ class page_sitelinks // include plugin-folder in the name.
|
|||||||
$arr[] = array(
|
$arr[] = array(
|
||||||
'link_id' => $row['chapter_id'],
|
'link_id' => $row['chapter_id'],
|
||||||
'link_name' => $row['chapter_name'],
|
'link_name' => $row['chapter_name'],
|
||||||
'link_url' => 'page.php?'.$row['chapter_id'],
|
'link_url' => vartrue($row['chapter_sef'],'#'),
|
||||||
'link_description' => '',
|
'link_description' => '',
|
||||||
'link_button' => '',
|
'link_button' => '',
|
||||||
'link_category' => '',
|
'link_category' => '',
|
||||||
|
Reference in New Issue
Block a user