2013-07-21 12:23:35 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
2014-02-16 06:19:26 +01:00
|
|
|
* GridField config necessary for managing a SiteTree object.
|
2013-07-21 12:23:35 +02:00
|
|
|
*
|
|
|
|
* @package silverstripe
|
|
|
|
* @subpackage blog
|
|
|
|
*
|
2014-02-16 06:19:26 +01:00
|
|
|
* @author Michael String <github@michaelstrong.co.uk>
|
2013-07-21 12:23:35 +02:00
|
|
|
**/
|
2013-08-11 00:34:46 +02:00
|
|
|
class GridFieldConfig_BlogPost extends GridFieldConfig {
|
2013-07-21 12:23:35 +02:00
|
|
|
|
|
|
|
public function __construct($itemsPerPage = null) {
|
|
|
|
parent::__construct($itemsPerPage);
|
|
|
|
$this->addComponent(new GridFieldButtonRow('before'));
|
2013-08-11 00:34:46 +02:00
|
|
|
$this->addComponent(new GridFieldBlogPostAddNewButton('buttons-before-left'));
|
2013-07-21 12:23:35 +02:00
|
|
|
$this->addComponent(new GridFieldToolbarHeader());
|
|
|
|
$this->addComponent($sort = new GridFieldSortableHeader());
|
|
|
|
$this->addComponent($filter = new GridFieldFilterHeader());
|
|
|
|
$this->addComponent(new GridFieldDataColumns());
|
|
|
|
$this->addComponent(new GridFieldSiteTreeEditButton());
|
|
|
|
$this->addComponent(new GridFieldPageCount('toolbar-header-right'));
|
|
|
|
$this->addComponent($pagination = new GridFieldPaginator($itemsPerPage));
|
2013-08-11 00:34:46 +02:00
|
|
|
$this->addComponent(new GridFieldBlogPostState());
|
2013-07-21 12:23:35 +02:00
|
|
|
|
2013-08-11 00:34:46 +02:00
|
|
|
$pagination->setThrowExceptionOnBadDataType(true);
|
2013-07-21 12:23:35 +02:00
|
|
|
}
|
|
|
|
}
|