本文整理汇总了PHP中CBPDocument::IsAdmin方法的典型用法代码示例。如果您正苦于以下问题:PHP CBPDocument::IsAdmin方法的具体用法?PHP CBPDocument::IsAdmin怎么用?PHP CBPDocument::IsAdmin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBPDocument
的用法示例。
在下文中一共展示了CBPDocument::IsAdmin方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$f_ID,
array("IBlockId" => $IBLOCK_ID, "UserGroups" => $USER->GetUserGroupArray(), "AllUserGroups" => $arRes["CURENT_USER_GROUPS"], "DocumentStates" => $arDocumentStates)
);
if ($bStartWorkflowPermission)
{
$arActions[] = array(
"ICON" => "",
"TEXT" => GetMessage("IBLIST_BP_START"),
"ACTION" => $lAdmin->ActionRedirect('iblock_start_bizproc.php?document_id='.$f_ID.'&document_type=iblock_'.$IBLOCK_ID.'&back_url='.urlencode($APPLICATION->GetCurPageParam("", array("mode", "table_id"))).''),
);
}
if ($lockStatus == "red")
{
if (CBPDocument::IsAdmin())
{
$arActions[] = Array(
"ICON" => "unlock",
"TEXT" => GetMessage("IBLIST_A_UNLOCK"),
"TITLE" => GetMessage("IBLIST_A_UNLOCK_ALT"),
"ACTION" => "if(confirm('".GetMessageJS("IBLIST_A_UNLOCK_CONFIRM")."')) ".$lAdmin->ActionDoGroup($f_TYPE.$f_ID, "unlock", $sThisSectionUrl),
);
}
}
elseif ($bWritePermission)
{
$arActions[] = array(
"ICON" => "edit",
"TEXT" => GetMessage("IBLOCK_CHANGE"),
"DEFAULT" => true,
示例2: _get_file_info_arr
function _get_file_info_arr(&$res, $arParams = array())
{
global $USER;
static $arFiles = array();
static $arBPTemplateStates = array();
static $arBPParamRequired = array();
$trashID = $this->GetMetaID('TRASH');
if ($this->workflow == 'bizproc') {
if (!isset($arBPParamRequired[$this->IBLOCK_ID])) {
$arBPParamRequired[$this->IBLOCK_ID] = $this->IsBpParamRequired();
}
}
$info = array();
if (!in_array($res["ID"], $arFiles)) {
$res["SHOW"] = array();
$res["PERMISSION"] = $this->permission;
$res['SHOW']['SHARED'] = $res['SHARED'];
$res["~NAME"] = $res["NAME"];
$res['USER_FIELDS'] = $this->GetUfFields($res['ID']);
if ($this->permission >= "U") {
$res["SHOW"]["RIGHTS"] = $this->e_rights && (isset($res['E_RIGHTS']['element_rights_edit']) || $GLOBALS['USER']->CanDoOperation('webdav_change_settings')) ? "Y" : "N";
if ($this->workflow == 'workflow') {
$original = $res;
$LAST_ID = CIBlockElement::WF_GetLast($res['ID']);
if ($LAST_ID != $res['ID']) {
$db_res = CIBlockElement::GetList(array(), array("ID" => $LAST_ID, "SHOW_HISTORY" => "Y"), false, array("nTopCount" => 1), $this->wfParams["selected_fields"]);
$res = $db_res->GetNext();
$res["FILE"]["FILE_SIZE"] = $this->GetFileSize($res);
if ($this->e_rights) {
$res['E_RIGHTS'] = $this->GetPermission('ELEMENT', $res['ID']);
}
}
$res["ORIGINAL"] = $original;
$res["PERMISSION"] = $original["PERMISSION"];
$res["REAL_ID"] = $res["ID"];
$res["ID"] = $original["ID"];
$res["PROPERTY_WEBDAV_INFO_VALUE"] = $original["PROPERTY_WEBDAV_INFO_VALUE"];
$res["PROPERTY_WEBDAV_INFO_VALUE_ID"] = $original["PROPERTY_WEBDAV_INFO_VALUE_ID"];
$res["TAGS"] = $original["TAGS"];
$res["~TAGS"] = $original["~TAGS"];
$res["PREVIEW_TEXT"] = $original["PREVIEW_TEXT"];
$res["~PREVIEW_TEXT"] = $original["~PREVIEW_TEXT"];
$res["NAME"] = $original["NAME"];
$res["~NAME"] = $original["~NAME"];
$res["LOCK_STATUS"] = $original["LOCK_STATUS"];
$res["LOCKED_USER_NAME"] = $original["LOCKED_USER_NAME"];
$res["WF_LOCKED_BY"] = $original["WF_LOCKED_BY"];
$res["WF_DATE_LOCK"] = $original["WF_DATE_LOCK"];
$res["LAST_ID"] = $LAST_ID;
$res["TYPE"] = "E";
$res["SHOW"]["COPY"] = "Y";
$res["STATUS_ID"] = CIBlockElement::WF_GetCurrentStatus($LAST_ID, $res["STATUS_TITLE"]);
$res["STATUS_PERMISSION"] = CIBlockElement::WF_GetStatusPermission($res["STATUS_ID"]);
if ($res["STATUS_PERMISSION"] >= 2 || ($this->e_rights ? isset($res['E_RIGHTS']['element_edit_any_wf_status']) : $this->permission >= "W")) {
$res["SHOW"]["UNLOCK"] = $res['LOCK_STATUS'] == "yellow" || $res['LOCK_STATUS'] == "red" && CWorkflow::IsAdmin() ? "Y" : "N";
$res["SHOW"]["LOCK"] = $res['LOCK_STATUS'] == "green" ? "Y" : "N";
$res["PERMISSION"] = $res['LOCK_STATUS'] == "red" && !CWorkflow::IsAdmin() ? "R" : $res["PERMISSION"];
// Edit History Delete
if ($res['ORIGINAL']['WF_NEW'] == "Y" || $res["WF_STATUS_ID"] <= 1) {
$res["SHOW"]["HISTORY"] = $res["SHOW"]["DELETE"] = $res["SHOW"]["EDIT"] = $this->check_creator && $res["CREATED_BY"] != $GLOBALS["USER"]->GetId() ? "N" : "Y";
} elseif ($res["WF_STATUS_ID"] > 1) {
$res["SHOW"]["HISTORY"] = $res["SHOW"]["EDIT"] = $this->check_creator && $res["CREATED_BY"] != $GLOBALS["USER"]->GetId() ? "N" : "Y";
$res["SHOW"]["DELETE"] = $res["SHOW"]["EDIT"] == "Y" && $res["PERMISSION"] > "U" ? "Y" : "N";
}
if ($res["LOCK_STATUS"] == "red") {
$res["SHOW"]["UNLOCK"] = CWorkflow::IsAdmin() ? "Y" : "N";
$res["SHOW"]["EDIT"] = "N";
$res["SHOW"]["DELETE"] = "N";
} elseif ($this->check_creator && $res["CREATED_BY"] != $GLOBALS["USER"]->GetId()) {
$res["SHOW"]["UNLOCK"] = "N";
$res["SHOW"]["LOCK"] = "N";
$res["SHOW"]["DELETE"] = "N";
$res["SHOW"]["EDIT"] = "N";
}
}
if ($res["STATUS_PERMISSION"] >= 2 || ($this->e_rights ? isset($res['E_RIGHTS']['element_delete']) : $this->permission >= "W")) {
$res["PERMISSION"] = $res['LOCK_STATUS'] == "red" && !CWorkflow::IsAdmin() ? "R" : $res["PERMISSION"];
if ($res['ORIGINAL']['WF_NEW'] == "Y" || $res["WF_STATUS_ID"] <= 1) {
$res["SHOW"]["DELETE"] = $this->check_creator && $res["CREATED_BY"] != $GLOBALS["USER"]->GetId() ? "N" : "Y";
} elseif ($res["WF_STATUS_ID"] > 1) {
$res["SHOW"]["DELETE"] = $this->check_creator && $res["CREATED_BY"] != $GLOBALS["USER"]->GetId() && $res["PERMISSION"] > "U" ? "N" : "Y";
}
}
} elseif ($this->workflow == "bizproc") {
if ($this->e_rights) {
$res["PERMISSION"] = $res["E_RIGHTS"];
}
if ($res['LOCK_STATUS'] != "red") {
$res['LOCK_STATUS_BP'] = call_user_func(array($this->wfParams["DOCUMENT_TYPE"][1], "IsDocumentLocked"), $res["ID"] | $res["item_id"], "") ? "red" : "green";
$res['LOCK_STATUS'] = $res['LOCK_STATUS_BP'] == "red" ? "red" : $res['LOCK_STATUS'];
}
$res["PERMISSION"] = $res['LOCK_STATUS'] == "red" ? "R" : $res["PERMISSION"];
$res["USER_GROUPS"] = $this->USER["GROUPS"];
if ($res["CREATED_BY"] == $GLOBALS["USER"]->GetID()) {
$res["USER_GROUPS"][] = "Author";
}
$res["DOCUMENT_ID"] = $this->wfParams["DOCUMENT_TYPE"];
$res["DOCUMENT_ID"][2] = $res["ID"] | $res["item_id"];
$res["~arDocumentStates"] = CBPDocument::GetDocumentStates($this->wfParams["DOCUMENT_TYPE"], $res["DOCUMENT_ID"]);
$res["arDocumentStates"] = array();
//.........这里部分代码省略.........