本文整理汇总了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);
}