當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Permissions::canDuplicateTreeNode方法代碼示例

本文整理匯總了PHP中Permissions::canDuplicateTreeNode方法的典型用法代碼示例。如果您正苦於以下問題:PHP Permissions::canDuplicateTreeNode方法的具體用法?PHP Permissions::canDuplicateTreeNode怎麽用?PHP Permissions::canDuplicateTreeNode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Permissions的用法示例。


在下文中一共展示了Permissions::canDuplicateTreeNode方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 public function __construct(Category $category)
 {
     parent::__construct($category);
     $p = new \Permissions($category);
     if ($p->canAddCategoryTreeNode()) {
         $this->addItem(new AddCategoryItem($category));
     }
     if ($p->canAddTopicTreeNode()) {
         $this->addItem(new AddTopicItem($category));
     }
     if ($p->canEditTreeNode()) {
         $this->addItem(new EditCategoryItem($category));
     }
     if ($p->canDuplicateTreeNode()) {
         $this->addItem(new CloneItem($category));
     }
     if ($p->canEditTreeNodePermissions() || $p->canDeleteTreeNode()) {
         $this->addItem(new DividerItem());
     }
     if ($p->canEditTreeNodePermissions()) {
         $this->addItem(new EditPermissionsItem($category));
     }
     if ($p->canDeleteTreeNode()) {
         $this->addItem(new DeleteItem($category));
     }
 }
開發者ID:ppiedaderawnet,項目名稱:concrete5,代碼行數:26,代碼來源:CategoryMenu.php

示例2: __construct

 public function __construct(Topic $topic)
 {
     parent::__construct($topic);
     $p = new \Permissions($topic);
     if ($p->canEditTreeNode()) {
         $this->addItem(new EditTopicItem($topic));
     }
     if ($p->canDuplicateTreeNode()) {
         $this->addItem(new CloneItem($topic));
     }
     if ($p->canEditTreeNodePermissions() || $p->canDeleteTreeNode()) {
         $this->addItem(new DividerItem());
     }
     if ($p->canEditTreeNodePermissions()) {
         $this->addItem(new EditPermissionsItem($topic));
     }
     if ($p->canDeleteTreeNode()) {
         $this->addItem(new DeleteItem($topic));
     }
 }
開發者ID:ppiedaderawnet,項目名稱:concrete5,代碼行數:20,代碼來源:TopicMenu.php

示例3: canAccess

 protected function canAccess()
 {
     $node = $this->getNode();
     $np = new \Permissions($node);
     return $np->canDuplicateTreeNode();
 }
開發者ID:ppiedaderawnet,項目名稱:concrete5,代碼行數:6,代碼來源:duplicate.php

示例4: die

<?php

defined('C5_EXECUTE') or die("Access Denied.");
$form = Loader::helper('form');
$node = \Concrete\Core\Tree\Node\Node::getByID(Loader::helper('security')->sanitizeInt($_REQUEST['treeNodeID']));
$np = new Permissions($node);
$tree = $node->getTreeObject();
$parent = $node->getTreeNodeParentObject();
$pp = new Permissions($parent);
if (is_object($node) && $pp->canDuplicateTreeNode()) {
    $newnode = $node->duplicate($parent);
    $r = new stdClass();
    $r->treeNodeParentID = $parent->getTreeNodeID();
    Loader::helper("ajax")->sendResult($r);
}
開發者ID:ceko,項目名稱:concrete5-1,代碼行數:15,代碼來源:node.php


注:本文中的Permissions::canDuplicateTreeNode方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。