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