mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
3c516b7b97
API CHANGE: Simplified state handling so that it's just a key store. Affectors are replaced with GridField_ActionProviders. API CHANGE: Removed GridField state manipulation actions instead opting for GridField_ActionProvider actions. API CHANGE: Removed support for modifiers that add "body" rows, instead having core support for generating the body rows hardcoded into the GridField. API CHANGE: Allow modification of columns across the whole GridField with the GridField_ColumnProvider interface. API CHANGE: Renamed GridField_AlterAction to GridField_Action, and added actionName/args parameters, since it can be used for all actions (including batch actions and row actions) API CHANGE: Removed GridFieldRow class.
89 lines
1.3 KiB
PHP
89 lines
1.3 KiB
PHP
<?php
|
|
/**
|
|
* Description of GridFieldConfig
|
|
*
|
|
*/
|
|
class GridFieldConfig {
|
|
|
|
/**
|
|
*
|
|
* @return GridFieldConfig
|
|
*/
|
|
public static function create(){
|
|
return new GridFieldConfig();
|
|
}
|
|
|
|
/**
|
|
*
|
|
* @var ArrayList
|
|
*/
|
|
protected $components = null;
|
|
|
|
/**
|
|
*
|
|
* @var int
|
|
*/
|
|
protected $checkboxes = null;
|
|
|
|
/**
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $affectors = array();
|
|
|
|
/**
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $decorators = array();
|
|
|
|
/**
|
|
*
|
|
*/
|
|
public function __construct() {
|
|
;
|
|
}
|
|
|
|
public function addComponent(GridFieldComponent $component) {
|
|
$this->getComponents()->push($component);
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
*
|
|
* @return ArrayList
|
|
*/
|
|
public function getComponents() {
|
|
if(!$this->components) {
|
|
$this->components = new ArrayList();
|
|
}
|
|
return $this->components;
|
|
}
|
|
|
|
public function setCheckboxes($row=0){
|
|
$this->checkboxes = $row;
|
|
return $this;
|
|
}
|
|
|
|
public function getCheckboxes() {
|
|
return $this->checkboxes;
|
|
}
|
|
|
|
public function addAffector(GridState_Affector $affector) {
|
|
$this->affectors[] = $affector;
|
|
return $this;
|
|
}
|
|
|
|
public function getAffectors() {
|
|
return $this->affectors;
|
|
}
|
|
|
|
public function addDecorator($decorator) {
|
|
$this->decorators[] = $decorator;
|
|
}
|
|
|
|
public function getDecorators() {
|
|
return $this->decorators;
|
|
}
|
|
}
|