当前位置: 首页>>代码示例>>PHP>>正文


PHP DataObject::canDelete方法代码示例

本文整理汇总了PHP中DataObject::canDelete方法的典型用法代码示例。如果您正苦于以下问题:PHP DataObject::canDelete方法的具体用法?PHP DataObject::canDelete怎么用?PHP DataObject::canDelete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DataObject的用法示例。


在下文中一共展示了DataObject::canDelete方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: canDelete

 public function canDelete($member = null)
 {
     if ($this->getType() == 'Presentation') {
         return false;
     }
     return parent::canDelete($member);
 }
开发者ID:rbowen,项目名称:openstack-org,代码行数:7,代码来源:SummitEventType.php

示例2: getColumnContent

 /**
  *
  * @param GridField $gridField
  * @param DataObject $record
  * @param string $columnName
  * @return string - the HTML for the column
  */
 public function getColumnContent($gridField, $record, $columnName)
 {
     if ($this->removeRelation) {
         $field = GridField_FormAction::create($gridField, 'UnlinkRelation' . $record->ID, false, "unlinkrelation", array('RecordID' => $record->ID))->addExtraClass('gridfield-button-unlink')->setAttribute('title', _t('GridAction.UnlinkRelation', "Unlink"))->setAttribute('data-icon', 'chain--minus');
     } else {
         if (!$record->canDelete()) {
             return;
         }
         $field = GridField_FormAction::create($gridField, 'DeleteRecord' . $record->ID, false, "deleterecord", array('RecordID' => $record->ID))->addExtraClass('gridfield-button-delete')->setAttribute('title', _t('GridAction.Delete', "Delete"))->setAttribute('data-icon', 'cross-circle')->setDescription(_t('GridAction.DELETE_DESCRIPTION', 'Delete'));
     }
     //add a class to the field to if it is the last gridfield in the list
     $numberOfRelations = $record->Pages()->Count();
     $field->addExtraClass('dms-delete')->setAttribute('data-pages-count', $numberOfRelations)->removeExtraClass('gridfield-button-delete');
     //remove the base gridfield behaviour
     //set a class telling JS what kind of warning to display when clicking the delete button
     if ($numberOfRelations > 1) {
         $field->addExtraClass('dms-delete-link-only');
     } else {
         $field->addExtraClass('dms-delete-last-warning');
     }
     //set a class to show if the document is hidden
     if ($record->isHidden()) {
         $field->addExtraClass('dms-document-hidden');
     }
     return $field->Field();
 }
开发者ID:helpfulrobot,项目名称:silverstripe-dms,代码行数:33,代码来源:DMSGridFieldDeleteAction.php

示例3: canDelete

 public function canDelete($member = null)
 {
     if (Summit::isDefaultEventType($this->Type)) {
         return false;
     }
     return parent::canDelete($member);
 }
开发者ID:OpenStackweb,项目名称:openstack-org,代码行数:7,代码来源:SummitEventType.php

示例4: getColumnContent

 /**
  *
  * @param GridField $gridField
  * @param DataObject $record
  * @param string $columnName
  * @return string - the HTML for the column
  */
 public function getColumnContent($gridField, $record, $columnName)
 {
     if (!$record->IsDeletedFromStage && $record->canDelete() && !$record->isPublished()) {
         $field = GridField_FormAction::create($gridField, 'DeleteFromStage' . $record->ID, false, "deletefromstage", array('RecordID' => $record->ID))->addExtraClass('gridfield-button-deletedraft')->setAttribute('title', _t('PublishableGridFieldAction.DELETE', 'Delete draft'))->setAttribute('data-icon', 'decline')->setDescription(_t('PublishableGridFieldAction.DELETE_DESC', 'Remove this item from the draft site'));
         return $field->Field();
     }
     return;
 }
开发者ID:helpfulrobot,项目名称:studiobonito-silverstripe-publishable,代码行数:15,代码来源:PublishableGridFieldDeleteAction.php

示例5: getColumnContent

 /**
  * @param GridField $gridField
  * @param DataObject $record
  * @param string $columnName
  * @return string - the HTML for the column
  */
 public function getColumnContent($gridField, $record, $columnName)
 {
     if (!$record->canDelete()) {
         return;
     }
     $field = GridField_FormAction::create($gridField, 'SoftDeleteRecord' . $record->ID, false, "softdeleterecord", array('RecordID' => $record->ID))->addExtraClass('gridfield-button-delete')->setAttribute('title', _t('GridAction.Delete', "Delete"))->setAttribute('data-icon', 'cross-circle')->setDescription(_t('GridAction.DELETE_DESCRIPTION', 'Delete'));
     return $field->Field();
 }
开发者ID:lekoala,项目名称:silverstripe-softdelete,代码行数:14,代码来源:GridFieldSoftDeleteAction.php

示例6: canDelete

 public function canDelete($member = null)
 {
     $this->beforeExtending(__FUNCTION__, function ($member = null) {
         if ($this->Parent && $this->Parent->canDelete($member)) {
             return true;
         }
     });
     return parent::canDelete($member);
 }
开发者ID:spekulatius,项目名称:ss-social-feed,代码行数:9,代码来源:SocialFeed_Profile.php

示例7: canDelete

 public function canDelete($member = null)
 {
     if ($this->Readonly) {
         return false;
     }
     // forms are using this handler...
     if ($this->FormCount()) {
         return false;
     }
     return parent::canDelete($member);
 }
开发者ID:helpfulrobot,项目名称:briceburg-silverstripe-flexiform,代码行数:11,代码来源:FlexiFormHandler.php

示例8: canDelete

 /**
  * Checks to see if the given member can delete this object or not
  * @param {Member} $member Member instance or member id to check
  * @return {bool} Returns boolean true or false depending if the user can delete this object
  */
 public function canDelete($member = null)
 {
     $parentResult = parent::canDelete($member);
     if ($parentResult == false || $this->UserLanguage == false) {
         return false;
     }
     if ($this->Folders()->count() > 0 || $this->Snippets()->count() > 0) {
         return false;
     }
     return true;
 }
开发者ID:helpfulrobot,项目名称:undefinedoffset-silverstripe-codebank,代码行数:16,代码来源:SnippetLanguage.php

示例9: canDelete

 public function canDelete($member = null)
 {
     return parent::canDelete($member);
 }
开发者ID:ivoba,项目名称:silverstripe-framework,代码行数:4,代码来源:GridFieldDeleteActionTest.php

示例10: canDelete

 public function canDelete($member = null)
 {
     $method = __FUNCTION__;
     $this->beforeExtending(__FUNCTION__, function ($member) use($method) {
         if (!$this->checkIfHasGlobalMenuPermission($member)) {
             return false;
         }
         if (singleton('SiteTree')->{$method}($member)) {
             return true;
         }
     });
     return parent::canDelete($member);
 }
开发者ID:milkyway-multimedia,项目名称:ss-linkable-menus,代码行数:13,代码来源:LinkableMenu.php

示例11: getColumnContent

 /**
  *
  * @param GridField $gridField
  * @param DataObject $record
  * @param string $columnName
  * @return string - the HTML for the column
  */
 public function getColumnContent($gridField, $record, $columnName)
 {
     if ($this->removeRelation) {
         if (!$record->canEdit()) {
             return;
         }
         $field = GridField_FormAction::create($gridField, 'UnlinkRelation' . $record->ID, _t('GridAction.UnlinkRelation', "Unlink"), "unlinkrelation", array('RecordID' => $record->ID))->addExtraClass('gridfield-button-unlink')->setAttribute('title', _t('GridAction.UnlinkRelation', "Unlink"))->setAttribute('data-icon', 'chain--minus');
     } else {
         if (!$record->canDelete()) {
             return;
         }
         $field = GridField_FormAction::create($gridField, 'DeleteRecord' . $record->ID, _t('GridAction.Delete', "Delete"), "deleterecord", array('RecordID' => $record->ID))->addExtraClass('gridfield-button-delete')->setAttribute('title', _t('GridAction.Delete', "Delete"))->setAttribute('data-icon', 'cross-circle')->setDescription(_t('GridAction.DELETE_DESCRIPTION', 'Delete'));
     }
     return $field->Field();
 }
开发者ID:congaaids,项目名称:silverstripe-framework,代码行数:22,代码来源:GridFieldDeleteAction.php

示例12: canDelete

 public function canDelete($member = null)
 {
     $can = parent::canDelete($member);
     $queueditems = $this->SendRecipientQueue();
     if ($queueditems->count()) {
         foreach ($queueditems as $queueditem) {
             $can = $can && !($queueditem->Status === 'Scheduled' && $queueditem->Status === 'InProgress');
         }
     }
     return $can;
 }
开发者ID:helpfulrobot,项目名称:silverstripe-newsletter,代码行数:11,代码来源:Recipient.php

示例13: canDelete

 public function canDelete($member = null)
 {
     $can = parent::canDelete($member);
     if ($this->Status !== 'Sending') {
         return $can;
     } else {
         return false;
     }
 }
开发者ID:helpfulrobot,项目名称:silverstripe-newsletter,代码行数:9,代码来源:Newsletter.php

示例14: canDelete

 public function canDelete($member = null)
 {
     $first = $this->Pages()->first();
     return $first ? $first->canDelete() : parent::canDelete($member);
 }
开发者ID:helpfulrobot,项目名称:silverstripe-australia-silverstripe-question-answer,代码行数:5,代码来源:QuestionAnswerObject.php

示例15: canDelete

 public function canDelete($member = null)
 {
     $this->beforeExtending(__METHOD__, function ($member) {
         if (!$this->checkIfHasGlobalMenuPermission($member)) {
             return false;
         }
     });
     return parent::canDelete($member);
 }
开发者ID:helpfulrobot,项目名称:milkyway-multimedia-ss-linkable-menus,代码行数:9,代码来源:LinkableMenu.php


注:本文中的DataObject::canDelete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。