本文整理汇总了PHP中ObjectLock::manageObjectLock方法的典型用法代码示例。如果您正苦于以下问题:PHP ObjectLock::manageObjectLock方法的具体用法?PHP ObjectLock::manageObjectLock怎么用?PHP ObjectLock::manageObjectLock使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjectLock
的用法示例。
在下文中一共展示了ObjectLock::manageObjectLock方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
/** Display item with tabs
*
* @since version 0.85
*
* @param $options array
**/
function display($options = array())
{
global $CFG_GLPI;
if (isset($options['id']) && !$this->isNewID($options['id'])) {
if (!$this->getFromDB($options['id'])) {
Html::displayNotFoundError();
}
}
// in case of lefttab layout, we couldn't see "right error" message
if ($this->get_item_to_display_tab) {
if (isset($_GET["id"]) && $_GET["id"] && !$this->can($_GET["id"], READ)) {
// This triggers from a profile switch.
// If we don't have right, redirect instead to central page
if (isset($_SESSION['_redirected_from_profile_selector']) && $_SESSION['_redirected_from_profile_selector']) {
unset($_SESSION['_redirected_from_profile_selector']);
Html::redirect($CFG_GLPI['root_doc'] . "/front/central.php");
}
html::displayRightError();
}
}
// try to lock object
// $options must contains the id of the object, and if locked by manageObjectLock will contains 'locked' => 1
ObjectLock::manageObjectLock(get_class($this), $options);
$this->showNavigationHeader($options);
if (!self::isLayoutExcludedPage() && self::isLayoutWithMain()) {
if (!isset($options['id'])) {
$options['id'] = 0;
}
$this->showPrimaryForm($options);
}
$this->showTabsContent($options);
}
示例2: display
/** Display item with tabs
*
* @since version 0.85
*
* @param $options array
**/
function display($options = array())
{
global $CFG_GLPI;
if (isset($options['id']) && !$this->isNewID($options['id'])) {
if (!$this->getFromDB($options['id'])) {
Html::displayNotFoundError();
}
}
// in case of lefttab layout, we couldn't see "right error" message
if ($this->get_item_to_display_tab) {
if (isset($_GET["id"]) && $_GET["id"] && !$this->can($_GET["id"], READ)) {
html::displayRightError();
}
}
// try to lock object
// $options must contains the id of the object, and if locked by manageObjectLock will contains 'locked' => 1
ObjectLock::manageObjectLock(get_class($this), $options);
$this->showNavigationHeader($options);
if (!self::isLayoutExcludedPage() && self::isLayoutWithMain()) {
if (!isset($options['id'])) {
$options['id'] = 0;
}
$this->showPrimaryForm($options);
}
$this->showTabsContent($options);
}