1 | <?php |
||
6 | class GridFieldWorkflowRestrictedEditButton implements GridField_ColumnProvider { |
||
|
|||
7 | |||
8 | /** |
||
9 | * Add a column |
||
10 | * |
||
11 | * @param type $gridField |
||
12 | * @param array $columns |
||
13 | */ |
||
14 | public function augmentColumns($gridField, &$columns) { |
||
18 | |||
19 | /** |
||
20 | * Append a 'disabled' CSS class to GridField rows whose WorkflowInstance records are not viewable/editable |
||
21 | * by the current user. |
||
22 | * |
||
23 | * This is used to visually "grey out" records and it's leveraged in some overriding JavaScript, to maintain an ability |
||
24 | * to click the target object's hyperlink. |
||
25 | * |
||
26 | * @param GridField $gridField |
||
27 | * @param DataObject $record |
||
28 | * @param string $columnName |
||
29 | * @return array |
||
30 | */ |
||
31 | public function getColumnAttributes($gridField, $record, $columnName) { |
||
44 | |||
45 | /** |
||
46 | * Add the title |
||
47 | * |
||
48 | * @param GridField $gridField |
||
49 | * @param string $columnName |
||
50 | * @return array |
||
51 | */ |
||
52 | public function getColumnMetadata($gridField, $columnName) { |
||
53 | if($columnName == 'Actions') { |
||
54 | return array('title' => ''); |
||
55 | } |
||
56 | } |
||
57 | |||
58 | /** |
||
59 | * Which columns are handled by this component |
||
60 | * |
||
61 | * @param type $gridField |
||
62 | * @return type |
||
63 | */ |
||
64 | public function getColumnsHandled($gridField) { |
||
67 | |||
68 | /** |
||
69 | * @param GridField $gridField |
||
70 | * @param DataObject $record |
||
71 | * @param string $columnName |
||
72 | * |
||
73 | * @return string - the HTML for the column |
||
74 | */ |
||
75 | public function getColumnContent($gridField, $record, $columnName) { |
||
81 | } |
||
82 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.