diff --git a/code/BlogTree.php b/code/BlogTree.php index a04633fc..fe39f60a 100644 --- a/code/BlogTree.php +++ b/code/BlogTree.php @@ -113,8 +113,8 @@ function getCMSFields() { "INHERIT" => "Take value from parent Blog Tree" ))); - //$fields->addFieldToTab("Root.Widgets", new CheckboxField("InheritSideBar", 'Inherit Sidebar From Parent')); - //$fields->addFieldToTab("Root.Widgets", new WidgetAreaEditor("SideBar")); + $fields->addFieldToTab("Root.Widgets", new CheckboxField("InheritSideBar", 'Inherit Sidebar From Parent')); + if (class_exists('WidgetAreaEditor')) $fields->addFieldToTab("Root.Widgets", new WidgetAreaEditor("SideBar")); return $fields; } @@ -151,7 +151,7 @@ public function BlogHolderIDs() { * @param string $where * @return DataObjectSet */ - public function Entries($tag = '', $date = '', $retrieveCallback = null, $filter = '') { + public function Entries($limit = '', $tag = '', $date = '', $retrieveCallback = null, $filter = '') { $tagCheck = ''; $dateCheck = ''; @@ -213,7 +213,9 @@ public function Entries($tag = '', $date = '', $retrieveCallback = null, $filter ->where($filter) ->sort($order); - return new PaginatedList($entries, Controller::curr()->request); + $list = new PaginatedList($entries, Controller::curr()->request); + $list->setPageLength($limit); + return $list; } } @@ -263,14 +265,10 @@ function BlogEntries($limit = null) { else if(isset($_GET['authorID'])) { $filter .= " \"BlogEntry\".\"AuthorID\" = '". Convert::raw2sql($_GET['authorID']). "'"; } - - $start = isset($_GET['start']) ? (int) $_GET['start'] : 0; - + $date = $this->SelectedDate(); - $list = $this->Entries($this->SelectedTag(), ($date) ? $date : '', null, $filter); - $list->setPageLength($limit); - return $list; + return $this->Entries($limit, $this->SelectedTag(), ($date) ? $date : '', null, $filter); } /**