mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
canEdit function checking deleting (merged from branches/2.2.0@45907, r45011)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@46090 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
ca4c0a5ede
commit
25aaf25c23
@ -51,7 +51,7 @@ class HasManyComplexTableField_Item extends ComplexTableField_Item {
|
||||
$joinVal = $this->item->{$this->parent->joinField};
|
||||
$parentID = $this->parent->getControllerID();
|
||||
|
||||
if( $this->parent->IsReadOnly || ! $this->Can( 'edit' ) || ( $joinVal > 0 && $joinVal != $parentID ) )
|
||||
if( $this->parent->IsReadOnly || ( $joinVal > 0 && $joinVal != $parentID ) )
|
||||
return "<input class=\"checkbox\" type=\"checkbox\" name=\"$name\" value=\"{$this->item->ID}\" disabled=\"disabled\"/>";
|
||||
else if( $joinVal == $parentID )
|
||||
return "<input class=\"checkbox\" type=\"checkbox\" name=\"$name\" value=\"{$this->item->ID}\" checked=\"checked\"/>";
|
||||
|
@ -121,7 +121,7 @@ class HasOneComplexTableField_Item extends ComplexTableField_Item {
|
||||
$joinVal = $this->parent->getControllerJoinID();
|
||||
$childID = $this->item->ID;
|
||||
|
||||
if( $this->parent->IsReadOnly || ! $this->Can( 'edit' ) )
|
||||
if( $this->parent->IsReadOnly )
|
||||
return "<input class=\"radio\" type=\"radio\" name=\"$name\" value=\"{$this->item->ID}\" disabled=\"disabled\"/>";
|
||||
else if( $joinVal == $childID )
|
||||
return "<input class=\"radio\" type=\"radio\" name=\"$name\" value=\"{$this->item->ID}\" checked=\"checked\"/>";
|
||||
|
@ -74,7 +74,7 @@ class ManyManyComplexTableField_Item extends ComplexTableField_Item {
|
||||
function MarkingCheckbox() {
|
||||
$name = $this->parent->Name() . '[]';
|
||||
|
||||
if( $this->parent->IsReadOnly || ! $this->Can( 'edit' ) )
|
||||
if( $this->parent->IsReadOnly )
|
||||
return "<input class=\"checkbox\" type=\"checkbox\" name=\"$name\" value=\"{$this->item->ID}\" disabled=\"disabled\"/>";
|
||||
else if( $this->item->{$this->parent->joinField} )
|
||||
return "<input class=\"checkbox\" type=\"checkbox\" name=\"$name\" value=\"{$this->item->ID}\" checked=\"checked\"/>";
|
||||
|
Loading…
Reference in New Issue
Block a user