Merge pull request #31 from frankmullenger/ss3-fixes

FIX: SS3 related updates.
This commit is contained in:
Will Rossiter 2012-07-05 20:47:44 -07:00
commit 6dd0e7dd06

View File

@ -114,7 +114,7 @@ class BlogTree extends Page {
)));
$fields->addFieldToTab("Root.Widgets", new CheckboxField("InheritSideBar", 'Inherit Sidebar From Parent'));
$fields->addFieldToTab("Root.Widgets", new WidgetAreaEditor("SideBar"));
if (class_exists('WidgetAreaEditor')) $fields->addFieldToTab("Root.Widgets", new WidgetAreaEditor("SideBar"));
return $fields;
}
@ -208,8 +208,14 @@ class BlogTree extends Page {
// By specifying a callback, you can alter the SQL, or sort on something other than date.
if($retrieveCallback) return call_user_func($retrieveCallback, 'BlogEntry', $filter, $limit, $order);
return DataObject::get('BlogEntry', $filter, $order, '', $limit);
$entries = BlogEntry::get()
->where($filter)
->sort($order);
$list = new PaginatedList($entries, Controller::curr()->request);
$list->setPageLength($limit);
return $list;
}
}
@ -259,12 +265,10 @@ class BlogTree_Controller extends Page_Controller {
else if(isset($_GET['authorID'])) {
$filter .= " \"BlogEntry\".\"AuthorID\" = '". Convert::raw2sql($_GET['authorID']). "'";
}
$start = isset($_GET['start']) ? (int) $_GET['start'] : 0;
$date = $this->SelectedDate();
return $this->Entries("$start,$limit", $this->SelectedTag(), ($date) ? $date : '', null, $filter);
return $this->Entries($limit, $this->SelectedTag(), ($date) ? $date : '', null, $filter);
}
/**