From 7d505b8629f80b1544c3c619adc56f9e80f8ccec Mon Sep 17 00:00:00 2001 From: Cameron Date: Thu, 30 May 2013 14:16:49 -0700 Subject: [PATCH] Book listing template added. --- e107_admin/cpage.php | 26 +++++-- e107_core/templates/chapter_template.php | 5 +- e107_core/xml/default_install.xml | 1 + e107_plugins/page/e_shortcode.php | 18 ++++- e107_plugins/page/e_sitelink.php | 12 ++-- .../bootstrap/templates/chapter_template.php | 24 ++++--- page.php | 67 ++++++++++++++----- 7 files changed, 113 insertions(+), 40 deletions(-) diff --git a/e107_admin/cpage.php b/e107_admin/cpage.php index e4678d0da..8d9d50982 100644 --- a/e107_admin/cpage.php +++ b/e107_admin/cpage.php @@ -414,7 +414,7 @@ class page_admin_ui extends e_admin_ui 'page_chapter' => array('title'=> 'Book/Chapter', 'tab' => 0, 'type' => 'dropdown', 'width' => '20%', 'filter' => true, 'batch'=>true, 'inline'=>true), 'page_template' => array('title'=> LAN_TEMPLATE, 'tab' => 0, 'type' => 'dropdown', 'width' => 'auto','filter' => true, 'batch'=>true, 'inline'=>true, 'writeParms'=>''), - + 'page_author' => array('title'=> LAN_AUTHOR, 'tab' => 0, 'type' => 'user', 'data'=>'int','width' => 'auto', 'thclass' => 'left'), 'page_text' => array('title'=> CUSLAN_9, 'tab' => 0, 'type' => 'bbarea', 'data'=>'str', 'width' => '30%', 'readParms' => 'expand=...&truncate=50&bb=1', 'writeParms'=>'media=page'), @@ -449,8 +449,10 @@ class page_admin_ui extends e_admin_ui protected $fieldpref = array("page_id","page_title","page_chapter","page_template","page_author","page_class"); protected $prefs = array( - 'listPages' => array('title'=> CUSLAN_29, 'type'=>'boolean'), - 'pageCookieExpire' => array('title'=> CUSLAN_30, 'type'=>'number') //TODO Set default value to 84600 + 'listPages' => array('title'=> CUSLAN_29, 'type'=>'boolean'), + 'listBooks' => array('title'=> 'List Books/Chapters', 'type'=>'boolean'), + 'listBooksTemplate' => array('title'=> 'List Books/Chapters Template', 'type'=>'dropdown'), + 'pageCookieExpire' => array('title'=> CUSLAN_30, 'type'=>'number') //TODO Set default value to 84600 ); protected $books = array(); @@ -496,10 +498,24 @@ class page_admin_ui extends e_admin_ui $this->fields['page_template']['writeParms'] = $this->templates; $this->fields['menu_template']['writeParms'] = e107::getLayouts('', 'menu', 'front', '', true, false); + + $tmp = e107::getLayouts('', 'chapter', 'front', '', true, false); + $tmpl = array(); + foreach($tmp as $key=>$val) + { + if(substr($key,0,3) != 'nav') + { + $tmpl[$key] = $val; + } + } + + + $this->prefs['listBooksTemplate']['writeParms'] = $tmpl; + $sql = e107::getDb(); + + $sql->gen("SELECT chapter_id,chapter_name,chapter_parent FROM #page_chapters ORDER BY chapter_parent asc, chapter_order"); - - while($row = $sql->fetch()) { $cat = $row['chapter_id']; diff --git a/e107_core/templates/chapter_template.php b/e107_core/templates/chapter_template.php index a7971bb8d..cacfb2fdb 100644 --- a/e107_core/templates/chapter_template.php +++ b/e107_core/templates/chapter_template.php @@ -20,7 +20,9 @@ $CHAPTER_TEMPLATE['default']['listChapters']['start'] = "