Source of file GridFieldConfig.php
Size: 3,953 Bytes - Last Modified: 2021-12-23T10:47:54+00:00
/var/www/docs.ssmods.com/process/src/code/admin/GridFieldConfig.php
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 | <?php /** * Grid field basic configuration * * @todo Review the configs * * @author Frank Mullenger <frankmullenger@gmail.com> * @copyright Copyright (c) 2011, Frank Mullenger * @package swipestripe * @subpackage admin */ class GridFieldConfig_Basic extends GridFieldConfig { /** * Constructor * * @param Int $itemsPerPage How many items on each page to display */ public function __construct($itemsPerPage=null) { $this->addComponent(new GridFieldButtonRow('before')); $this->addComponent(new GridFieldAddNewButton('buttons-before-left')); $this->addComponent(new GridFieldToolbarHeader()); $this->addComponent($sort = new GridFieldSortableHeader()); $this->addComponent($filter = new GridFieldFilterHeader()); $this->addComponent(new GridFieldDataColumns()); $this->addComponent(new GridFieldEditButton()); $this->addComponent(new GridFieldDeleteAction()); $this->addComponent(new GridFieldPageCount('toolbar-header-right')); $this->addComponent($pagination = new GridFieldPaginator($itemsPerPage)); $this->addComponent(new GridFieldDetailForm()); $sort->setThrowExceptionOnBadDataType(false); $filter->setThrowExceptionOnBadDataType(false); $pagination->setThrowExceptionOnBadDataType(false); } } /** * Grid field basic sortable configuration * * @todo Review the configs * * @author Frank Mullenger <frankmullenger@gmail.com> * @copyright Copyright (c) 2011, Frank Mullenger * @package swipestripe * @subpackage admin */ class GridFieldConfig_BasicSortable extends GridFieldConfig { /** * Constructor * * @param Int $itemsPerPage How many items on each page to display */ public function __construct($itemsPerPage = null) { $this->addComponent(new GridFieldButtonRow('before')); $this->addComponent(new GridFieldAddNewButton('buttons-before-left')); $this->addComponent(new GridFieldToolbarHeader()); $this->addComponent($sort = new GridFieldSortableHeader()); $this->addComponent($filter = new GridFieldFilterHeader()); $this->addComponent(new GridFieldDataColumns()); $this->addComponent(new GridFieldEditButton()); $this->addComponent(new GridFieldDeleteAction()); $this->addComponent(new GridFieldDetailForm()); if (class_exists('GridFieldSortableRows')) { $this->addComponent(new GridFieldSortableRows('SortOrder')); } $this->addComponent($pagination = new GridFieldPaginator($itemsPerPage)); $this->addComponent(new GridFieldPageCount('toolbar-header-right')); $pagination->setThrowExceptionOnBadDataType(false); $sort->setThrowExceptionOnBadDataType(false); $filter->setThrowExceptionOnBadDataType(false); } } /** * Grid field basic has many configuration * * @todo Review the configs * * @author Frank Mullenger <frankmullenger@gmail.com> * @copyright Copyright (c) 2011, Frank Mullenger * @package swipestripe * @subpackage admin */ class GridFieldConfig_HasManyRelationEditor extends GridFieldConfig { /** * Constructor * * @param Int $itemsPerPage How many items on each page to display */ public function __construct($itemsPerPage=null) { $this->addComponent(new GridFieldButtonRow('before')); $this->addComponent(new GridFieldAddNewButton('buttons-before-left')); $this->addComponent(new GridFieldToolbarHeader()); $this->addComponent($sort = new GridFieldSortableHeader()); $this->addComponent($filter = new GridFieldFilterHeader()); $this->addComponent(new GridFieldDataColumns()); $this->addComponent(new GridFieldEditButton()); $this->addComponent(new GridFieldDeleteAction()); $this->addComponent($pagination = new GridFieldPaginator($itemsPerPage)); $detailForm = new GridFieldDetailForm(); $detailForm->setItemRequestClass('GridFieldDetailForm_HasManyItemRequest'); $this->addComponent($detailForm); $sort->setThrowExceptionOnBadDataType(false); $filter->setThrowExceptionOnBadDataType(false); $pagination->setThrowExceptionOnBadDataType(false); } } |