本文整理汇总了PHP中CIBlockElement::WF_UnLock方法的典型用法代码示例。如果您正苦于以下问题:PHP CIBlockElement::WF_UnLock方法的具体用法?PHP CIBlockElement::WF_UnLock怎么用?PHP CIBlockElement::WF_UnLock使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CIBlockElement
的用法示例。
在下文中一共展示了CIBlockElement::WF_UnLock方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
CIBlockElement::WF_Lock($ID);
}
}
break;
case "unlock":
if ($TYPE=="E")
{
if ($bWorkflow && !CIBlockElementRights::UserHasRightTo($IBLOCK_ID, $ID, "element_edit"))
{
$lAdmin->AddGroupError(GetMessage("IBLIST_A_UPDERR_ACCESS", array("#ID#" => $ID)), $TYPE.$ID);
continue;
}
if ($bBizproc)
call_user_func(array(ENTITY, "UnlockDocument"), $ID, "");
else
CIBlockElement::WF_UnLock($ID);
}
break;
case 'clear_counter':
if ($TYPE=="E")
{
if(CIBlockElementRights::UserHasRightTo($IBLOCK_ID, $ID, "element_edit"))
{
$obE = new CIBlockElement();
$arFields = array('SHOW_COUNTER' => false, 'SHOW_COUNTER_START' => false);
if(!$obE->Update($ID, $arFields, false, false))
$lAdmin->AddGroupError(GetMessage("IBLIST_A_SAVE_ERROR", array("#ID#" => $ID, "#ERROR_MESSAGE#" => $obE->LAST_ERROR)), $TYPE.$ID);
}
else
{
$lAdmin->AddGroupError(GetMessage("IBLIST_A_UPDERR_ACCESS", array("#ID#" => $ID)), $TYPE.$ID);
示例2: _set_lock
//.........这里部分代码省略.........
return "400 bad request";
} elseif ($this->check_creator && $this->arParams["is_file"] === true && $this->arParams["element_array"]["CREATED_BY"] != $GLOBALS["USER"]->GetID()) {
return $this->ThrowAccessDenied(__LINE__);
} elseif ($this->arParams["parent_id"] !== false) {
$options1 = array('path' => $options["path"], 'content_length' => 0, 'content_type' => "", 'WF_COMMENTS' => GetMessage("WD_FILE_IS_CREATED_BY_LOCK"));
$stat = $this->PUT($options1);
if ($stat === false) {
return $this->ThrowAccessDenied(__LINE__);
} elseif (is_string($stat)) {
return $stat;
} else {
if (is_resource($stat) && get_resource_type($stat) == 'stream') {
fclose($stat);
}
if (!$this->CheckWebRights("", array("action" => "create", "arElement" => $this->arParams))) {
return $this->ThrowAccessDenied(__LINE__);
}
$this->put_commit($options1);
}
$ID = intVal($options1["ELEMENT_ID"]);
if ($ID <= 0) {
return "409 Conflict";
} else {
return "200 OK";
}
} else {
return $arProps;
// 404 not found
}
}
return $arProps;
// error in _get_lock
}
$ID = $this->arParams['item_id'];
$is_dir = $this->arParams["is_dir"];
if ($lock) {
if ($is_dir && !empty($options["depth"])) {
return "409 Conflict";
} elseif (!$is_dir && CIBlockElement::WF_IsLocked($ID, $locked_by, $date_lock)) {
return false;
}
$options["timeout"] = time() + 300;
// 5min. hardcoded
if (isset($options["update"])) {
$token = $options["update"];
$arProps["LOCK"] = is_array($arProps["LOCK"]) ? $arProps["LOCK"] : array();
if (array_key_exists($token, $arProps["LOCK"]) && strlen($arProps["LOCK"][$token]["exclusivelock"]) > 0) {
$arProps["LOCK"][$token]["expires"] = $options["timeout"];
$arProps["LOCK"][$token]["modified"] = time();
if (array_key_exists("owner", $arProps["LOCK"][$token])) {
$options["owner"] = $arProps["LOCK"][$token]["owner"];
}
$options["scope"] = $arProps["LOCK"][$token]["exclusivelock"] ? "exclusive" : "shared";
$options["type"] = $arProps["LOCK"][$token]["exclusivelock"] ? "write" : "read";
if ($bFirstElement) {
$arProps["FIRST"] = "Y";
}
CIBlockElement::SetPropertyValues($ID, $this->IBLOCK_ID, serialize($arProps), "WEBDAV_INFO");
CIBlockElement::WF_Lock($ID);
$this->_onEvent('Lock', $ID);
return true;
} else {
return false;
}
}
$arProps["LOCK"][$options["locktoken"]] = array("created" => time(), "modified" => time(), "owner" => $options["owner"], "expires" => $options["timeout"], "locktoken" => $options["locktoken"], "exclusivelock" => $options["scope"] === "exclusive" ? 1 : 0);
} else {
if (!empty($options["token"])) {
$token = $options["token"];
unset($arProps["LOCK"][$token]);
} else {
unset($arProps["LOCK"]);
}
if ($this->workflow == 'bizproc' && $GLOBALS['USER']->CanDoOperation('webdav_change_settings')) {
$arDocId = $this->wfParams["DOCUMENT_TYPE"];
$arDocId[2] = $ID;
$arStates = CBPDocument::GetDocumentStates($this->wfParams["DOCUMENT_TYPE"], $arDocId);
foreach ($arStates as $workflowId => $arState) {
CIBlockDocumentWebdav::UnlockDocument($ID, $workflowId);
}
}
}
if ($is_dir) {
$se = new CIBlockSection();
$x = $se->Update($ID, array("DESCRIPTION" => serialize($arProps)));
} else {
if ($lock && $bFirstElement) {
$arProps["FIRST"] = "Y";
}
CIBlockElement::SetPropertyValues($ID, $this->IBLOCK_ID, serialize($arProps), "WEBDAV_INFO");
if ($lock) {
CIBlockElement::WF_Lock($ID, $this->workflow == "workflow");
} else {
CIBlockElement::WF_UnLock($ID, $this->workflow == "workflow");
}
$this->_onEvent($lock ? 'Lock' : 'Unlock', $ID);
$x = true;
}
return $x ? $lock ? "200 OK" : "204 No Content" : "409 Conflict";
}