mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
Merge pull request #1003 from tractorcow/pulls/3.1-configurable-paging
API Ability to configure paging for assets / pages
This commit is contained in:
commit
66919ed0cc
@ -16,6 +16,14 @@ class AssetAdmin extends LeftAndMain implements PermissionProvider{
|
||||
|
||||
private static $tree_class = 'Folder';
|
||||
|
||||
/**
|
||||
* Amount of results showing on a single page.
|
||||
*
|
||||
* @config
|
||||
* @var int
|
||||
*/
|
||||
private static $page_length = 15;
|
||||
|
||||
/**
|
||||
* @config
|
||||
* @see Upload->allowedMaxFileSize
|
||||
@ -152,7 +160,7 @@ JS
|
||||
new GridFieldSortableHeader(),
|
||||
new GridFieldFilterHeader(),
|
||||
new GridFieldDataColumns(),
|
||||
new GridFieldPaginator(15),
|
||||
new GridFieldPaginator(self::config()->page_length),
|
||||
new GridFieldEditButton(),
|
||||
new GridFieldDeleteAction(),
|
||||
new GridFieldDetailForm(),
|
||||
|
@ -27,6 +27,14 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
||||
|
||||
private static $subitem_class = "Member";
|
||||
|
||||
/**
|
||||
* Amount of results showing on a single page.
|
||||
*
|
||||
* @config
|
||||
* @var int
|
||||
*/
|
||||
private static $page_length = 15;
|
||||
|
||||
private static $allowed_actions = array(
|
||||
'buildbrokenlinks',
|
||||
'deleteitems',
|
||||
@ -726,7 +734,7 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
||||
$gridFieldConfig = GridFieldConfig::create()->addComponents(
|
||||
new GridFieldSortableHeader(),
|
||||
new GridFieldDataColumns(),
|
||||
new GridFieldPaginator(15)
|
||||
new GridFieldPaginator(self::config()->page_length)
|
||||
);
|
||||
if($parentID){
|
||||
$gridFieldConfig->addComponent(
|
||||
|
Loading…
Reference in New Issue
Block a user