MINOR Don't duplicate pagination defaults from GridFieldPaginator in GridFieldConfig

This commit is contained in:
Ingo Schommer 2012-03-05 13:30:07 +01:00
parent 6798d40709
commit ea31e1798a
2 changed files with 11 additions and 9 deletions

View File

@ -101,7 +101,7 @@ class GridFieldConfig_Base extends GridFieldConfig {
* @param int $itemsPerPage - How many items per page should show up per page
* @return GridFieldConfig_Base
*/
public static function create($itemsPerPage=15){
public static function create($itemsPerPage=null){
return new GridFieldConfig_Base($itemsPerPage);
}
@ -109,7 +109,7 @@ class GridFieldConfig_Base extends GridFieldConfig {
*
* @param int $itemsPerPage - How many items per page should show up
*/
public function __construct($itemsPerPage=15) {
public function __construct($itemsPerPage=null) {
$this->addComponent(new GridFieldTitle());
$this->addComponent(new GridFieldSortableHeader());
$this->addComponent(new GridFieldFilter());
@ -128,7 +128,7 @@ class GridFieldConfig_RecordEditor extends GridFieldConfig {
* @param int $itemsPerPage - How many items per page should show up
* @return GridFieldConfig_RecordEditor
*/
public static function create($itemsPerPage=15){
public static function create($itemsPerPage=null){
return new GridFieldConfig_RecordEditor($itemsPerPage);
}
@ -136,7 +136,8 @@ class GridFieldConfig_RecordEditor extends GridFieldConfig {
*
* @param int $itemsPerPage - How many items per page should show up
*/
public function __construct($itemsPerPage=15) {
public function __construct($itemsPerPage=null) {
$this->addComponent(new GridFieldTitle());
$this->addComponent(new GridFieldSortableHeader());
$this->addComponent(new GridFieldFilter());
$this->addComponent(new GridFieldDefaultColumns());
@ -169,15 +170,16 @@ class GridFieldConfig_RelationEditor extends GridFieldConfig {
* @param int $itemsPerPage - How many items per page should show up
* @return GridFieldConfig_RelationEditor
*/
public static function create($itemsPerPage=15){
return new GridFieldConfig_RelationEditor($itemsPerPage=15);
public static function create($itemsPerPage=null){
return new GridFieldConfig_RelationEditor($itemsPerPage);
}
/**
*
* @param int $itemsPerPage - How many items per page should show up
*/
public function __construct($itemsPerPage=15) {
public function __construct($itemsPerPage=null) {
$this->addComponent(new GridFieldTitle());
$this->addComponent(new GridFieldRelationAdd());
$this->addComponent(new GridFieldSortableHeader());
$this->addComponent(new GridFieldFilter());

View File

@ -31,8 +31,8 @@ class GridFieldPaginator implements GridField_HTMLProvider, GridField_DataManipu
*
* @param int $itemsPerPage - How many items should be displayed per page
*/
public function __construct($itemsPerPage=15) {
$this->itemsPerPage = $itemsPerPage;
public function __construct($itemsPerPage=null) {
if($itemsPerPage) $this->itemsPerPage = $itemsPerPage;
}
/**