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


PHP Node::checkPermission方法代碼示例

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


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

示例1: on_get_actions

 /**
  * Добавляет специфичные действия для типов документов.
  *
  * @mcms_message ru.molinos.cms.node.actions
  */
 public static function on_get_actions(Context $ctx, Node $node)
 {
     $result = array();
     if ($node->id and $node->checkPermission(ACL::CREATE)) {
         $result['clone'] = array('href' => "api/node/clone.rpc?id={$node->id}&destination=CURRENT", 'title' => t('Клонировать'));
     }
     return $result;
 }
開發者ID:umonkey,項目名稱:molinos-cms,代碼行數:13,代碼來源:class.cloneapi.php

示例2: on_get_actions

 /**
  * Добавление действия ко всем документам.
  * @mcms_message ru.molinos.cms.node.actions
  */
 public static function on_get_actions(Context $ctx, Node $node)
 {
     if ($node instanceof FileNode or !$node->checkPermission(ACL::UPDATE)) {
         return;
     }
     $count = Node::count(array('class' => 'file', 'deleted' => 0, 'tags' => $node->id), $node->getDB());
     if ($count) {
         return array('attach' => array('href' => "admin/node/attach?id={$node->id}&destination=CURRENT", 'title' => t('Управление файлами'), 'scope' => 'edit'));
     } else {
         return array('attach' => array('href' => "admin/create/file?sendto={$node->id}&destination=CURRENT", 'title' => t('Добавить файлы'), 'scope' => 'edit'));
     }
 }
開發者ID:umonkey,項目名稱:molinos-cms,代碼行數:16,代碼來源:class.extrafiles.php

示例3: on_preview_tags

 /**
  * Добавляет информацию о разделах в предварительный просмотр.
  * @mcms_message ru.molinos.cms.hook.preview.xml
  */
 public static function on_preview_tags(Node $node)
 {
     if (!$node->checkPermission(ACL::UPDATE)) {
         return;
     }
     if ($data = $node->getDB()->getResultsKV("id", "name", "SELECT `id`, `name` FROM `node` WHERE `deleted` = 0 AND `class` = 'tag' AND `id` IN (SELECT `tid` FROM `node__rel` WHERE `nid` = ?)", array($node->id))) {
         $result = array();
         foreach ($data as $k => $v) {
             $result[] = html::em('a', array('href' => "admin/node/{$k}?destination=CURRENT"), html::plain($v));
         }
         $result = html::em('value', html::cdata(implode(', ', $result)));
         return html::em('field', array('html' => true, 'title' => t('Находится в разделах'), 'editurl' => "admin/structure/taxonomy/setup?node={$node->id}&destination=" . urlencode(MCMS_REQUEST_URI)), $result);
     }
 }
開發者ID:umonkey,項目名稱:molinos-cms,代碼行數:18,代碼來源:class.taxonomyadmin.php

示例4: on_get_actions

 /**
  * Ручное обновление XML через меню с действиями.
  * @mcms_message ru.molinos.cms.node.actions
  */
 public static function on_get_actions(Context $ctx, Node $node)
 {
     if ($node->checkPermission(ACL::UPDATE)) {
         return array('refresh' => array('href' => 'nodeapi/refresh?node=' . $node->id . '&destination=CURRENT', 'title' => 'Обновить XML', 'icon' => 'dump'));
     }
 }
開發者ID:umonkey,項目名稱:molinos-cms,代碼行數:10,代碼來源:class.cascader.php


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