diff --git a/e107_admin/cpage.php b/e107_admin/cpage.php
index a69858974..f9d298897 100644
--- a/e107_admin/cpage.php
+++ b/e107_admin/cpage.php
@@ -128,11 +128,14 @@ class page_chapters_ui extends e_admin_ui
'chapter_icon' => array('title'=> LAN_ICON, 'type' => 'icon', 'data' => 'str', 'width' => '100px', 'thclass' => 'center', 'class'=>'center', 'readParms'=>'thumb=60&thumb_urlraw=0&thumb_aw=60','readonly'=>FALSE, 'batch' => FALSE, 'filter'=>FALSE),
'chapter_parent' => array('title'=> "Book", 'type' => 'dropdown', 'width' => 'auto', 'thclass' => 'left', 'readonly'=>FALSE, 'filter'=>true),
'chapter_name' => array('title'=> "Book or Chapter Title", 'type' => 'method', 'width' => 'auto', 'thclass' => 'left', 'readonly'=>FALSE),
+ 'chapter_template' => array('title'=> LAN_TEMPLATE, 'type' => 'dropdown', 'width' => 'auto','filter' => true, 'batch'=>true, 'inline'=>true, 'writeParms'=>''),
+
'chapter_meta_description' => array('title'=> LAN_DESCRIPTION, 'type' => 'textarea', 'width' => 'auto', 'thclass' => 'left','readParms' => 'expand=...&truncate=150&bb=1', 'readonly'=>FALSE),
'chapter_meta_keywords' => array('title'=> "Meta Keywords", 'type' => 'text', 'width' => 'auto', 'thclass' => 'left', 'readonly'=>FALSE),
'chapter_sef' => array('title'=> "SEF Url String", 'type' => 'text', 'width' => 'auto', 'readonly'=>FALSE), // Display name
'chapter_manager' => array('title'=> "Can be edited by", 'type' => 'userclass', 'width' => 'auto', 'data' => 'int','batch'=>TRUE, 'filter'=>TRUE),
'chapter_order' => array('title'=> LAN_ORDER, 'type' => 'text', 'width' => 'auto', 'thclass' => 'right', 'class'=> 'right' ),
+
'options' => array('title'=> LAN_OPTIONS, 'type' => 'method', 'width' => '10%', 'forced'=>TRUE, 'thclass' => 'left last', 'class' => 'left', 'readParms'=>'sort=1')
);
@@ -153,9 +156,23 @@ class page_chapters_ui extends e_admin_ui
$this->books[$bk] = $row['chapter_name'];
}
- asort($this->books);
+ asort($this->books);
$this->fields['chapter_parent']['writeParms'] = $this->books;
+
+
+ $tmp = e107::getLayouts('', 'chapter', 'front', '', true, false);
+ $tmpl = array();
+ foreach($tmp as $key=>$val)
+ {
+ if(substr($key,0,3) != 'nav')
+ {
+ $tmpl[$key] = $val;
+ }
+ }
+
+ $this->fields['chapter_template']['writeParms'] = $tmpl; // e107::getLayouts('', 'chapter', 'front', '', true, false); // e107::getLayouts('', 'page', 'books', 'front', true, false);
+
}
diff --git a/e107_core/sql/core_sql.php b/e107_core/sql/core_sql.php
index c6f69bdd5..16afa23f0 100644
--- a/e107_core/sql/core_sql.php
+++ b/e107_core/sql/core_sql.php
@@ -410,6 +410,7 @@ CREATE TABLE page_chapters (
chapter_manager tinyint(3) unsigned NOT NULL default '254',
chapter_icon varchar(250) NOT NULL default '',
chapter_order tinyint(3) unsigned NOT NULL default '0',
+ chapter_template varchar(50) NOT NULL default '',
PRIMARY KEY (chapter_id),
KEY chapter_order (chapter_order)
) ENGINE=MyISAM;
diff --git a/e107_core/templates/chapter_template.php b/e107_core/templates/chapter_template.php
new file mode 100644
index 000000000..a7971bb8d
--- /dev/null
+++ b/e107_core/templates/chapter_template.php
@@ -0,0 +1,105 @@
+";
+$CHAPTER_TEMPLATE['default']['listPages']['item'] = "
{CPAGETITLE}";
+$CHAPTER_TEMPLATE['default']['listPages']['end'] = "";
+
+$CHAPTER_TEMPLATE['default']['listChapters']['start'] = "";
+$CHAPTER_TEMPLATE['default']['listChapters']['item'] = "{CHAPTER_NAME}
{PAGES}";
+$CHAPTER_TEMPLATE['default']['listChapters']['end'] = "
";
+
+
+
+
+
+$CHAPTER_TEMPLATE['nav']['listChapters']['caption'] = "Articles";
+
+$CHAPTER_TEMPLATE['nav']['listChapters']['start'] = '';
+
+$CHAPTER_TEMPLATE['nav']['listChapters']['item'] = '
+ -
+
+ {LINK_NAME}
+
+
+ ';
+
+
+$CHAPTER_TEMPLATE['nav']['listChapters']['item_submenu'] = '
+ -
+
+ {LINK_NAME}
+
+ {LINK_SUB}
+
+ ';
+
+$CHAPTER_TEMPLATE['nav']['listChapters']['item_submenu_active'] = '
+ -
+
+ {LINK_IMAGE} {LINK_NAME}
+
+ {LINK_SUB}
+
+ ';
+
+$CHAPTER_TEMPLATE['nav']['listChapters']['item_active'] = '
+ -
+
+ {LINK_IMAGE} {LINK_NAME}
+
+
+ ';
+
+$CHAPTER_TEMPLATE['nav']['listChapters']['end'] = '
';
+
+
+$CHAPTER_TEMPLATE['nav']['listChapters']['submenu_start'] = '';
+
+
+$CHAPTER_TEMPLATE['nav']['listChapters']['submenu_item'] = '
+ -
+ {LINK_IMAGE}{LINK_NAME}
+ {LINK_SUB}
+
+ ';
+
+$CHAPTER_TEMPLATE['nav']['listChapters']['submenu_loweritem'] = '
+ -
+ {LINK_IMAGE}{LINK_NAME}
+ {LINK_SUB}
+
+ ';
+$CHAPTER_TEMPLATE['nav']['listChapters']['submenu_loweritem_active'] = '
+ -
+ {LINK_IMAGE}{LINK_NAME}
+ {LINK_SUB}
+
+ ';
+
+$CHAPTER_TEMPLATE['nav']['listChapters']['submenu_item_active'] = '
+ -
+ {LINK_IMAGE}{LINK_NAME}
+ {LINK_SUB}
+
+ ';
+
+$CHAPTER_TEMPLATE['nav']['listChapters']['submenu_end'] = '
';
+
+
+$CHAPTER_TEMPLATE['nav']['listPages'] = $CHAPTER_TEMPLATE['nav']['listChapters'];
+$CHAPTER_TEMPLATE['nav']['showPage'] = $CHAPTER_TEMPLATE['nav']['listChapters'];
+
+?>
\ No newline at end of file
diff --git a/e107_core/templates/page_template.php b/e107_core/templates/page_template.php
index 67b3cce9a..3a27e60ba 100644
--- a/e107_core/templates/page_template.php
+++ b/e107_core/templates/page_template.php
@@ -96,96 +96,7 @@ $sc_style['CPAGENAV|default']['post'] = '';
-
-
-/* Used by {PAGE_NAVIGATION} shortcode - uses Sitelink/Navigation Shortcodes eg. {LINK_NAME} */
-
- $PAGE_TEMPLATE['nav']['caption'] = "Articles";
-
- $PAGE_TEMPLATE['nav']['start'] = '';
-
-// Main Link
- $PAGE_TEMPLATE['nav']['item'] = '
- -
-
- {LINK_NAME}
-
-
- ';
-
-// Main Link which has a sub menu.
- $PAGE_TEMPLATE['nav']['item_submenu'] = '
- -
-
- {LINK_NAME}
-
- {LINK_SUB}
-
- ';
-
- $PAGE_TEMPLATE['nav']['item_submenu_active'] = '
- -
-
- {LINK_IMAGE} {LINK_NAME}
-
- {LINK_SUB}
-
- ';
-
- $PAGE_TEMPLATE['nav']['item_active'] = '
- -
-
- {LINK_IMAGE} {LINK_NAME}
-
-
- ';
-
- $PAGE_TEMPLATE['nav']['end'] = '
';
-
-
- $PAGE_TEMPLATE['nav']['submenu_start'] = '';
-
-
- $PAGE_TEMPLATE['nav']['submenu_item'] = '
- -
- {LINK_IMAGE}{LINK_NAME}
- {LINK_SUB}
-
- ';
-
- $PAGE_TEMPLATE['nav']['submenu_loweritem'] = '
- -
- {LINK_IMAGE}{LINK_NAME}
- {LINK_SUB}
-
- ';
- $PAGE_TEMPLATE['nav']['submenu_loweritem_active'] = '
- -
- {LINK_IMAGE}{LINK_NAME}
- {LINK_SUB}
-
- ';
-
- $PAGE_TEMPLATE['nav']['submenu_item_active'] = '
- -
- {LINK_IMAGE}{LINK_NAME}
- {LINK_SUB}
-
- ';
-
- $PAGE_TEMPLATE['nav']['submenu_end'] = '
';
-
-
-
- $PAGE_TEMPLATE['listPages']['start'] = "";
- $PAGE_TEMPLATE['listPages']['item'] = "- {CPAGETITLE}
";
- $PAGE_TEMPLATE['listPages']['end'] = "
";
-
-
- $PAGE_TEMPLATE['listChapters']['start'] = "";
- $PAGE_TEMPLATE['listChapters']['item'] = "{CHAPTER_NAME}
{PAGES}";
- $PAGE_TEMPLATE['listChapters']['end'] = "
";
diff --git a/e107_plugins/page/e_shortcode.php b/e107_plugins/page/e_shortcode.php
index 4b4eb1b27..62ee3e626 100644
--- a/e107_plugins/page/e_shortcode.php
+++ b/e107_plugins/page/e_shortcode.php
@@ -33,8 +33,10 @@ class page_shortcodes extends e_shortcode
function sc_page_navigation($parm='') // TODO when No $parm provided, auto-detect based on URL which book/chapters to display.
{
// $parm = eHelper::scParams($parm);
-
- $template = e107::getCoreTemplate('page',vartrue($parm['template'],'nav'), true, true); // always merge
+
+ $tmpl = e107::getCoreTemplate('chapter', vartrue($parm['template'],'nav'), true, true); // always merge
+
+ $template = $tmpl['showPage'];
$request = $this->request;
@@ -44,10 +46,12 @@ class page_shortcodes extends e_shortcode
{
case 'listChapters':
$parm['cbook'] = $request['id'];
+ $template = $tmpl['listChapters'];
break;
case 'listPages':
$parm['cchapter'] = $request['id'];
+ $template = $tmpl['listPages'];
break;
case 'showPage':
@@ -67,8 +71,8 @@ class page_shortcodes extends e_shortcode
$links = e107::getAddon('page', 'e_sitelink');
- $data = $links->pageNav($parm);
+ $data = $links->pageNav($parm);
if(isset($data['title']) && !vartrue($template['noAutoTitle']))
{
diff --git a/e107_plugins/page/e_sitelink.php b/e107_plugins/page/e_sitelink.php
index e268a8091..ce17fe955 100644
--- a/e107_plugins/page/e_sitelink.php
+++ b/e107_plugins/page/e_sitelink.php
@@ -111,6 +111,7 @@ class page_sitelink // include plugin-folder in the name.
if(vartrue($options['chapter']))
{
//$filter = "chapter_id > ".intval($options['chapter']);
+
$title = $sql->retrieve('page_chapters', 'chapter_name', 'chapter_id='.intval($options['chapter']));
$outArray = array();
if(!$title) return e107::getNav()->compile($_pdata, $outArray, $options['chapter']);
@@ -121,6 +122,7 @@ class page_sitelink // include plugin-folder in the name.
$title = false;
if(vartrue($options['book']))
{
+
// XXX discuss the idea here
//$filter = "chapter_id > ".intval($options['book']);
$filter = "chapter_parent = ".intval($options['book']);
@@ -132,6 +134,7 @@ class page_sitelink // include plugin-folder in the name.
$books = $sql->retrieve("SELECT * FROM #page_chapters WHERE ".$filter." ORDER BY chapter_order ASC" , true);
foreach($books as $row)
{
+
$arr[] = array(
'link_id' => $row['chapter_id'],
'link_name' => $row['chapter_name'],
@@ -146,11 +149,12 @@ class page_sitelink // include plugin-folder in the name.
'link_parent' => $row['chapter_parent'],
'link_open' => '',
'link_class' => 0,
- 'link_sub' => varset($sublinks[$row['chapter_id']]),
+ 'link_sub' => (!vartrue($options['book']) && !vartrue($options['auto'])) ? varset($sublinks[$row['chapter_id']]) : '', //XXX always test with docs template in bootstrap before changing.
'link_active' => $row['chapter_parent'] == 0 ? $options['cbook'] && $options['cbook'] == $row['chapter_id'] : $options['cchapter'] && $options['cchapter'] == $row['chapter_id'],
);
}
+
$outArray = array();
$parent = vartrue($options['book']) ? $options['book'] : 0;
$ret = e107::getNav()->compile($arr, $outArray, $parent);
diff --git a/e107_plugins/page/page_navigation_menu.php b/e107_plugins/page/page_navigation_menu.php
index 7aa056baa..0c81fedc5 100644
--- a/e107_plugins/page/page_navigation_menu.php
+++ b/e107_plugins/page/page_navigation_menu.php
@@ -15,7 +15,9 @@ if (!defined('e107_INIT')) { exit; }
$parm = eHelper::scParams($parm);
-$template = e107::getCoreTemplate('page','nav',false,true); // always merge
+$tmpl = e107::getCoreTemplate('chapter','nav',false,true); // always merge
+
+$template = $tmpl['showPage'];
$request = e107::getRegistry('core/pages/request');
if($request && is_array($request))
@@ -24,10 +26,12 @@ if($request && is_array($request))
{
case 'listChapters':
$parm['cbook'] = $request['id'];
+ $template = $tmpl['listChapters'];
break;
case 'listPages':
$parm['cchapter'] = $request['id'];
+ $template = $tmpl['listPages'];
break;
case 'showPage':
diff --git a/e107_themes/bootstrap/templates/chapter_template.php b/e107_themes/bootstrap/templates/chapter_template.php
new file mode 100644
index 000000000..b12e468e9
--- /dev/null
+++ b/e107_themes/bootstrap/templates/chapter_template.php
@@ -0,0 +1,55 @@
+
+
+ {CPAGEBODY}
+
+ ';
+ $CHAPTER_TEMPLATE['docs']['listPages']['end'] = '';
+
+
+ $CHAPTER_TEMPLATE['docs']['listChapters']['start'] = '';
+ $CHAPTER_TEMPLATE['docs']['listChapters']['item'] = "{CHAPTER_NAME}
+ {CHAPTER_DESCRIPTION}
+ ";
+ $CHAPTER_TEMPLATE['docs']['listChapters']['end'] = "";
+
+
+
+
+
+
+
+ $CHAPTER_TEMPLATE['navdocs']['listChapters']['caption'] = " ";
+
+ $CHAPTER_TEMPLATE['navdocs']['listChapters']['start'] = '';
+
+ $CHAPTER_TEMPLATE['navdocs']['listChapters']['item'] = '
+ -
+
+ {LINK_NAME}
+
+
+ ';
+
+
+ $CHAPTER_TEMPLATE['navdocs']['listPages'] = $CHAPTER_TEMPLATE['navdocs']['listChapters'];
+ $CHAPTER_TEMPLATE['navdocs']['showPage'] = $CHAPTER_TEMPLATE['navdocs']['listChapters'];
+
+
+
+
+
+?>
\ No newline at end of file
diff --git a/e107_themes/bootstrap/templates/page_template.php b/e107_themes/bootstrap/templates/page_template.php
index ea57f8e6d..72ff1e8d0 100644
--- a/e107_themes/bootstrap/templates/page_template.php
+++ b/e107_themes/bootstrap/templates/page_template.php
@@ -1,83 +1,14 @@
- - Download
- - File structure
- - What's included
- - HTML template
- - Examples
- - What next?
-
- */
- $PAGE_TEMPLATE['navdoc']['caption'] = " ";
-
- $PAGE_TEMPLATE['navdoc']['start'] = '';
-
-// Main Link
- $PAGE_TEMPLATE['navdoc']['item'] = '
- -
-
- {LINK_NAME}
-
-
- ';
-
-// Main Link which has a sub menu.
- $PAGE_TEMPLATE['navdoc']['item_submenu'] = '
- -
-
- {LINK_NAME}
-
- {LINK_SUB}
-
- ';
-
- $PAGE_TEMPLATE['navdoc']['item_submenu_active'] = '
- -
-
- {LINK_IMAGE} {LINK_NAME}
-
- {LINK_SUB}
-
- ';
-
- $PAGE_TEMPLATE['navdoc']['item_active'] = '
- -
-
- {LINK_IMAGE} {LINK_NAME}
-
-
- ';
-
- $PAGE_TEMPLATE['navdoc']['end'] = '
';
-
-
- $PAGE_TEMPLATE['navdoc']['submenu_start'] = '';
- $PAGE_TEMPLATE['navdoc']['submenu_item'] = '';
- $PAGE_TEMPLATE['navdoc']['submenu_loweritem'] = '';
- $PAGE_TEMPLATE['navdoc']['submenu_loweritem_active'] = '';
- $PAGE_TEMPLATE['navdoc']['submenu_item_active'] = '';
- $PAGE_TEMPLATE['navdoc']['submenu_end'] = '';
-
-
-
- $PAGE_TEMPLATE['listPages']['start'] = '';
- $PAGE_TEMPLATE['listPages']['item'] = '
-
- ';
- $PAGE_TEMPLATE['listPages']['end'] = '';
-
-
- $PAGE_TEMPLATE['listChapters']['start'] = '';
- $PAGE_TEMPLATE['listChapters']['item'] = "{CHAPTER_NAME}
- {CHAPTER_DESCRIPTION}
- ";
- $PAGE_TEMPLATE['listChapters']['end'] = "";
+ * e107 website system
+ *
+ * Copyright (C) 2008-2013 e107 Inc (e107.org)
+ * Released under the terms and conditions of the
+ * GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
+ *
+*/
+
+
diff --git a/e107_themes/bootstrap/theme.php b/e107_themes/bootstrap/theme.php
index 8c9e26811..c7023d22d 100644
--- a/e107_themes/bootstrap/theme.php
+++ b/e107_themes/bootstrap/theme.php
@@ -430,7 +430,7 @@ $HEADER['docs'] = <<