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


PHP entity::relationship_has_lock方法代码示例

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


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

示例1: init

 function init()
 {
     if (!$this->should_run()) {
         trigger_error('Associator module needs an ID to run; none provided.');
         return;
     }
     reason_include_once('classes/filter.php');
     reason_include_once('content_listers/associate.php');
     include_once CARL_UTIL_INC . 'basic/misc.php';
     $this->head_items->add_javascript(JQUERY_URL, true);
     $this->head_items->add_stylesheet(REASON_ADMIN_CSS_DIRECTORY . 'assoc.css');
     $this->head_items->add_javascript(WEB_JAVASCRIPT_PATH . 'table_update.js');
     $this->head_items->add_javascript(WEB_JAVASCRIPT_PATH . 'associator.js');
     $this->get_associations();
     if (empty($this->associations[$this->admin_page->rel_id])) {
         trigger_error($this->admin_page->rel_id . ' is not a valid relationship type id');
         die;
     }
     $current_assoc = $this->associations[$this->admin_page->rel_id];
     $type = new entity($current_assoc['e_id']);
     // save the type entity in an object scope
     $this->rel_type = carl_clone($type);
     $this->admin_page->title = 'Selecting ' . $type->get_value('name');
     $entity = new entity($this->admin_page->id);
     $user = new entity($this->admin_page->user_id);
     if (!$entity->user_can_edit_relationship($this->admin_page->rel_id, $user, $this->_rel_direction)) {
         $this->_locked = true;
     } elseif ($entity->relationship_has_lock($this->admin_page->rel_id, $this->_rel_direction) && reason_user_has_privs($this->admin_page->user_id, 'manage_locks')) {
         $this->_show_lock_info = true;
     }
     $this->get_views($type->id());
     if (empty($this->views)) {
         //add generic lister if not already present
         $this->views = array();
     } else {
         reset($this->views);
         $c = current($this->views);
         if ($c) {
             $lister = $c->id();
             $this->admin_page->request['lister'] = $lister;
         } else {
             $lister = '';
         }
     }
     $lister = isset($lister) ? $lister : '';
     $this->get_viewer($this->admin_page->site_id, $type->id(), $lister);
     $this->filter = new filter();
     $this->filter->set_page($this->admin_page);
     $this->filter->grab_fields($this->viewer->filters);
 }
开发者ID:hunter2814,项目名称:reason_package,代码行数:50,代码来源:associator.php


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