1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-04 13:47:31 +02:00

Code cleanup and PHPDoc

This commit is contained in:
Cameron
2019-06-06 14:25:58 -07:00
parent be627b8c7b
commit 4ae90b62b3
2 changed files with 6 additions and 44 deletions

View File

@@ -40,6 +40,8 @@ class page_shortcodes extends e_shortcode
/** /**
* Page Navigation * Page Navigation
* @example {PAGE_NAVIGATION: template=navdoc&auto=1} in your Theme template. * @example {PAGE_NAVIGATION: template=navdoc&auto=1} in your Theme template.
* @example {PAGE_NAVIGATION: chapter=4}
* @example {PAGE_NAVIGATION: book=3&pages=true}
*/ */
function sc_page_navigation($parm=null) // TODO when No $parm provided, auto-detect based on URL which book/chapters to display. function sc_page_navigation($parm=null) // TODO when No $parm provided, auto-detect based on URL which book/chapters to display.
{ {
@@ -90,7 +92,7 @@ class page_shortcodes extends e_shortcode
$parm = ''; $parm = '';
} }
/** @var page_sitelink $links */
$links = e107::getAddon('page', 'e_sitelink'); $links = e107::getAddon('page', 'e_sitelink');
$data = $links->pageNav($parm); $data = $links->pageNav($parm);

View File

@@ -13,52 +13,12 @@ if (!defined('e107_INIT')) { exit; }
//FIXME XXX - This menu should call the {PAGE_NAVIGATION} shortcode instead of duplicating its code and automatically display all links.
$parm = eHelper::scParams($parm); $parm = eHelper::scParams($parm);
$tmpl = e107::getCoreTemplate('chapter','nav',true,true); // always merge and allow override $tmpl = e107::getCoreTemplate('chapter','nav',true,true); // always merge and allow override
$template = $tmpl['showPage']; $template = $tmpl['showPage'];
/*
$request = e107::getRegistry('core/page/request');
if($request && is_array($request))
{
switch ($request['action'])
{
case 'listChapters':
$parm['cbook'] = $request['id'];
$template = $tmpl['listChapters'];
break;
case 'listPages':
$parm['cchapter'] = $request['id'];
$template = $tmpl['listPages'];
break;
case 'showPage':
$parm['cpage'] = $request['id'];
break;
}
}
$expandable = vartrue($parm['expandable']);
if($parm) $parm = http_build_query($parm, null, '&');
else $parm = '';
### Retrieve
$links = e107::getAddon('page', 'e_sitelink');
$data = $links->pageNav($parm);
if(isset($data['title']) && !vartrue($template['noAutoTitle']))
{
// use chapter title
$template['caption'] = $data['title'];
$data = $data['body'];
}
if(empty($data)) return;
$text = e107::getNav()->render($data, $template) ;*/
$pg = new page_shortcodes; $pg = new page_shortcodes;
$text = $pg->sc_page_navigation($parm); $text = $pg->sc_page_navigation($parm);
@@ -68,12 +28,12 @@ $text = $pg->sc_page_navigation($parm);
* Expandable menu support. * Expandable menu support.
* @see jquery.page.navigation.js . activate with expandable=1 in the page-navigation menu. * @see jquery.page.navigation.js . activate with expandable=1 in the page-navigation menu.
* For best results include: e107::css('page', 'css/page.navigation.css', 'jquery'); in theme.php * For best results include: e107::css('page', 'css/page.navigation.css', 'jquery'); in theme.php
*/ *//*
if($expandable) if($expandable)
{ {
e107::js('page','js/jquery.page.navigation.js','jquery'); e107::js('page','js/jquery.page.navigation.js','jquery');
$template['caption'] .= "<span class='btn-group pull-right'><a class='btn btn-default btn-secondary btn-xs btn-mini' id='page-nav-expand'>+</a><a class='btn btn-default btn-secondary btn-xs btn-mini' id='page-nav-collapse'>-</a></span>"; $template['caption'] .= "<span class='btn-group pull-right'><a class='btn btn-default btn-secondary btn-xs btn-mini' id='page-nav-expand'>+</a><a class='btn btn-default btn-secondary btn-xs btn-mini' id='page-nav-collapse'>-</a></span>";
} }*/
### Render ### Render