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:
Andrew O'Neil 2007-12-02 21:23:33 +00:00
parent ca4c0a5ede
commit 25aaf25c23
3 changed files with 3 additions and 3 deletions

View File

@ -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\"/>";

View File

@ -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\"/>";

View File

@ -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\"/>";