1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-20 13:21:54 +02:00

Smarter page navigation menu

This commit is contained in:
SecretR
2013-02-14 13:06:16 +02:00
parent b9a452e793
commit cd2fbaa3d6
3 changed files with 65 additions and 7 deletions

View File

@@ -12,7 +12,32 @@ if (!defined('e107_INIT')) { exit; }
$template = e107::getCoreTemplate('page','nav');
$text = e107::getParser()->parseTemplate("{PAGE_NAVIGATION}", true);
// auto mode - detect the current location
if(empty($parm))
{
$request = e107::getRegistry('core/pages/request');
$parm = array();
if($request && is_array($request))
{
switch ($request['action'])
{
case 'listChapters':
$parm['book'] = $request['id'];
break;
case 'listPages':
$parm['chapter'] = $request['id'];
break;
case 'showPage':
$parm['page'] = $request['id'];
break;
}
}
if($parm) $parm = http_build_query($parm);
}
$text = e107::getParser()->parseTemplate("{PAGE_NAVIGATION={$parm}}", true);
e107::getRender()->tablerender($template['caption'], $text, 'page-navigation-menu');