mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
BUGFIX Fixed partial merge from nzct (originally from r47039, partially merged in r60440)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@60723 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
3942a9b609
commit
16a5b9b745
@ -1200,6 +1200,31 @@ class TableListField_Item extends ViewableData {
|
|||||||
return $this->parent->Can($mode);
|
return $this->parent->Can($mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns all row-based actions not disallowed through permissions.
|
||||||
|
* See TableListField->Action for a similiar dummy-function to work
|
||||||
|
* around template-inheritance issues.
|
||||||
|
*
|
||||||
|
* @return DataObjectSet
|
||||||
|
*/
|
||||||
|
function Actions() {
|
||||||
|
$allowedActions = new DataObjectSet();
|
||||||
|
foreach($this->parent->actions as $actionName => $actionSettings) {
|
||||||
|
if($this->parent->Can($actionName)) {
|
||||||
|
$allowedActions->push(new ArrayData(array(
|
||||||
|
'Name' => $actionName,
|
||||||
|
'Link' => $this->{ucfirst($actionName).'Link'}(),
|
||||||
|
'Icon' => $actionSettings['icon'],
|
||||||
|
'Label' => $actionSettings['label'],
|
||||||
|
'Class' => $actionSettings['class'],
|
||||||
|
'Default' => ($actionName == $this->parent->defaultAction),
|
||||||
|
)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $allowedActions;
|
||||||
|
}
|
||||||
|
|
||||||
function Link() {
|
function Link() {
|
||||||
return Controller::join_links($this->parent->Link() . "item/" . $this->item->ID);
|
return Controller::join_links($this->parent->Link() . "item/" . $this->item->ID);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user