当前位置: 首页>>代码示例>>PHP>>正文


PHP CIBlockSectionRights::UserHasRightTo方法代码示例

本文整理汇总了PHP中CIBlockSectionRights::UserHasRightTo方法的典型用法代码示例。如果您正苦于以下问题:PHP CIBlockSectionRights::UserHasRightTo方法的具体用法?PHP CIBlockSectionRights::UserHasRightTo怎么用?PHP CIBlockSectionRights::UserHasRightTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CIBlockSectionRights的用法示例。


在下文中一共展示了CIBlockSectionRights::UserHasRightTo方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: executeComponent

 public function executeComponent()
 {
     global $USER, $APPLICATION;
     $this->setFrameMode(false);
     if (!CModule::IncludeModule('lists')) {
         ShowError(Loc::getMessage("CC_BLL_MODULE_NOT_INSTALLED"));
         return;
     }
     $this->arResult["BIZPROC"] = (bool) CModule::includeModule("bizproc");
     $this->arResult["DISK"] = (bool) CModule::includeModule("disk");
     $this->listsPerm = CListPermissions::CheckAccess($USER, $this->arParams["~IBLOCK_TYPE_ID"], $this->arResult["IBLOCK_ID"], $this->arParams["~SOCNET_GROUP_ID"]);
     if ($this->listsPerm < 0) {
         switch ($this->listsPerm) {
             case CListPermissions::WRONG_IBLOCK_TYPE:
                 ShowError(GetMessage("CC_BLL_WRONG_IBLOCK_TYPE"));
                 return;
             case CListPermissions::WRONG_IBLOCK:
                 ShowError(GetMessage("CC_BLL_WRONG_IBLOCK"));
                 return;
             case CListPermissions::LISTS_FOR_SONET_GROUP_DISABLED:
                 ShowError(GetMessage("CC_BLL_LISTS_FOR_SONET_GROUP_DISABLED"));
                 return;
             default:
                 ShowError(GetMessage("CC_BLL_UNKNOWN_ERROR"));
                 return;
         }
     } elseif ($this->listsPerm < CListPermissions::CAN_READ && !(CIBlockRights::UserHasRightTo($this->arResult["IBLOCK_ID"], $this->arResult["IBLOCK_ID"], "element_read") || CIBlockSectionRights::UserHasRightTo($this->arResult["IBLOCK_ID"], $this->arResult["SECTION_ID"], "section_element_bind"))) {
         ShowError(GetMessage("CC_BLL_ACCESS_DENIED"));
         return;
     }
     if (!(!$this->arResult["IS_SOCNET_GROUP_CLOSED"] && ($this->listsPerm > CListPermissions::CAN_READ || CIBlockSectionRights::UserHasRightTo($this->arResult["IBLOCK_ID"], $this->arResult["SECTION_ID"], "element_read") || CIBlockSectionRights::UserHasRightTo($this->arResult["IBLOCK_ID"], $this->arResult["SECTION_ID"], "section_element_bind")))) {
         ShowError(GetMessage("CC_BLL_ACCESS_DENIED"));
         return;
     }
     $this->createDataExcel();
     $APPLICATION->RestartBuffer();
     header("Content-Type: application/vnd.ms-excel");
     header("Content-Disposition: filename=list_" . $this->arIBlock["ID"] . ".xls");
     $this->IncludeComponentTemplate();
     $r = $APPLICATION->EndBufferContentMan();
     echo $r;
     include $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_after.php";
     die;
 }
开发者ID:webgksupport,项目名称:alpina,代码行数:44,代码来源:class.php

示例2: CheckSectionOperation

 public static function CheckSectionOperation($intIBlockID, $intSectionID, $strOperation, $strAccess)
 {
     $intIBlockID = intval($intIBlockID);
     if ($intIBlockID <= 0) {
         return false;
     }
     $intSectionID = intval($intSectionID);
     if ($intSectionID < 0) {
         return false;
     }
     if (!self::$boolCheck) {
         self::CheckExtRights();
     }
     if (self::$boolExtRights) {
         return CIBlockSectionRights::UserHasRightTo($intIBlockID, $intSectionID, $strOperation);
     } else {
         return CIBlock::GetPermission($intIBlockID) >= $strAccess;
     }
 }
开发者ID:Hawkart,项目名称:megatv,代码行数:19,代码来源:iblock_rights.php

示例3: intval

<?php

if ($USER->CanDoOperation('catalog_price')) {
    $IBLOCK_ID = intval($IBLOCK_ID);
    if (0 >= $IBLOCK_ID) {
        return;
    }
    $MENU_SECTION_ID = intval($MENU_SECTION_ID);
    $ID = intval($ID);
    $PRODUCT_ID = 0 < $ID ? CIBlockElement::GetRealElement($ID) : 0;
    $boolPriceRights = false;
    if (0 < $PRODUCT_ID) {
        $boolPriceRights = CIBlockElementRights::UserHasRightTo($IBLOCK_ID, $PRODUCT_ID, "element_edit_price");
    } else {
        $boolPriceRights = CIBlockSectionRights::UserHasRightTo($IBLOCK_ID, $MENU_SECTION_ID, "element_edit_price");
    }
    if ($boolPriceRights) {
        include GetLangFileName($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/catalog/lang/", "/templates/product_edit_action.php");
        $arCatalogBasePrices = array();
        $arCatalogPrices = array();
        $CAT_ROW_COUNTER = IntVal($CAT_ROW_COUNTER);
        if ($CAT_ROW_COUNTER < 0) {
            $strWarning .= GetMessage("C2IT_INTERNAL_ERROR") . "<br>";
        }
        $arCatalogBaseGroup = CCatalogGroup::GetBaseGroup();
        if (!$arCatalogBaseGroup) {
            $strWarning .= GetMessage("C2IT_NO_BASE_TYPE") . "<br>";
        }
        $CAT_VAT_ID = intval($CAT_VAT_ID);
        $CAT_VAT_INCLUDED = !isset($CAT_VAT_INCLUDED) || $CAT_VAT_INCLUDED == 'N' ? 'N' : 'Y';
        $bUseExtForm = isset($_POST['price_useextform']) && $_POST['price_useextform'] == 'Y';
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:product_edit_validator.php

示例4: ShowError

            ShowError(GetMessage("CC_BLF_WRONG_IBLOCK_TYPE"));
            return;
        case CListPermissions::WRONG_IBLOCK:
            ShowError(GetMessage("CC_BLF_WRONG_IBLOCK"));
            return;
        case CListPermissions::LISTS_FOR_SONET_GROUP_DISABLED:
            ShowError(GetMessage("CC_BLF_LISTS_FOR_SONET_GROUP_DISABLED"));
            return;
        default:
            ShowError(GetMessage("CC_BLF_UNKNOWN_ERROR"));
            return;
    }
} elseif ($ELEMENT_ID > 0 && $lists_perm <= CListPermissions::CAN_READ && !CIBlockElementRights::UserHasRightTo($IBLOCK_ID, $ELEMENT_ID, "element_read")) {
    ShowError(GetMessage("CC_BLF_ACCESS_DENIED"));
    return;
} elseif ($SECTION_ID > 0 && $lists_perm <= CListPermissions::CAN_READ && !CIBlockSectionRights::UserHasRightTo($IBLOCK_ID, $SECTION_ID, "section_read")) {
    ShowError(GetMessage("CC_BLF_ACCESS_DENIED"));
    return;
}
$arIBlock = CIBlock::GetArrayByID(intval($arParams["~IBLOCK_ID"]));
$arResult["FILES"] = array();
$arResult["ELEMENT"] = false;
$arResult["SECTION"] = false;
if ($ELEMENT_ID > 0) {
    $rsElement = CIBlockElement::GetList(array(), array("IBLOCK_ID" => $arIBlock["ID"], "=ID" => $ELEMENT_ID, "CHECK_PERMISSIONS" => "N"), false, false, array("ID", $arParams["FIELD_ID"]));
    while ($ar = $rsElement->GetNext()) {
        if (isset($ar[$arParams["FIELD_ID"]])) {
            $arResult["FILES"][] = $ar[$arParams["FIELD_ID"]];
        } elseif (isset($ar[$arParams["FIELD_ID"] . "_VALUE"])) {
            if (is_array($ar[$arParams["FIELD_ID"] . "_VALUE"])) {
                $arResult["FILES"] = array_merge($arResult["FILES"], $ar[$arParams["FIELD_ID"] . "_VALUE"]);
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:component.php

示例5: array

	}
	if (empty($aContext))
	{
		$aContext[] = array(
			"TEXT" => htmlspecialcharsbx($arIBlock["ELEMENT_ADD"]),
			"ICON" => "btn_new",
			"LINK" => CIBlock::GetAdminElementEditLink($IBLOCK_ID, 0, array(
				'IBLOCK_SECTION_ID'=>$find_section_section,
				'find_section_section'=>$find_section_section,
				'from' => 'iblock_list_admin'
			)),
		);
	}
}

if(CIBlockSectionRights::UserHasRightTo($IBLOCK_ID, $find_section_section, "section_section_bind") && $arIBTYPE["SECTIONS"]!="N")
{
	$aContext[] = array(
		"TEXT" => htmlspecialcharsbx($arIBlock["SECTION_ADD"]),
		"ICON" => ($boolBtnNew ? "" : "btn_new"),
		"LINK" => CIBlock::GetAdminSectionEditLink($IBLOCK_ID, 0, array(
			'IBLOCK_SECTION_ID'=>$find_section_section,
			'find_section_section'=>$find_section_section,
			'from' => 'iblock_list_admin',
		)),
	);
}

if(strlen($sLastFolder)>0)
{
	$aContext[] = Array(
开发者ID:nycmic,项目名称:bittest,代码行数:31,代码来源:iblock_list_admin.php

示例6: array

if ($object == "user") {
    $arFilter["CREATED_BY"] = $object_id;
} else {
    $arFilter["SOCNET_GROUP_ID"] = $object_id;
}
$arLibrary = array();
$db_res = CIBlockSection::GetList(array(), $arFilter, false, array("ID", "UF_USE_BP", 'UF_USE_EXT_SERVICES'));
if (!($db_res && ($arLibrary = $db_res->GetNext()))) {
    $popupWindow->ShowError(GetMessage("SONET_WEBDAV_NOT_EXISTS"));
} else {
    $arLibrary["UF_USE_BP"] = $arLibrary["UF_USE_BP"] == "N" ? "N" : "Y";
    $arLibrary["UF_USE_EXT_SERVICES"] = CWebDavIblock::resolveDefaultUseExtServices($arLibrary["UF_USE_EXT_SERVICES"]);
}
if (CIBlock::GetArrayByID($IBLOCK_ID, "RIGHTS_MODE") === "E") {
    $sectionID = $arLibrary['ID'];
    $bSectionPerms = CIBlockSectionRights::UserHasRightTo($IBLOCK_ID, $sectionID, 'section_rights_edit');
} else {
    $bSectionPerms = $arParams["PERMISSION"] > 'W';
}
if (!$bSectionPerms) {
    return;
}
//Save permissions
if ($_SERVER["REQUEST_METHOD"] == "POST" && !check_bitrix_sessid()) {
    CUtil::JSPostUnescape();
    $strWarning = GetMessage("MAIN_SESSION_EXPIRED");
} elseif ($_SERVER["REQUEST_METHOD"] == "POST") {
    $arRequestParams = array('SOCNET_GROUP_ID', 'SOCNET_TYPE', 'SOCNET_ID');
    foreach ($arRequestParams as $param) {
        if (isset($_REQUEST[$param])) {
            $arParams[$param] = $_REQUEST[$param];
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:webdav_settings.php

示例7: foreach

             if (strlen($vv["ID"]) > 0) {
                 $arTasks = CBPDocument::GetUserTasksForWorkflow($USER->GetID(), $vv["ID"]);
                 foreach ($arTasks as $arTask) {
                     $arStr[$vv["TEMPLATE_ID"]] .= GetMessage("IBEL_A_BP_TASK") . ":<br /><a href=\"bizproc_task.php?id=" . $arTask["ID"] . "\" title=\"" . $arTask["DESCRIPTION"] . "\">" . $arTask["NAME"] . "</a><br /><br />";
                 }
             }
         }
         $str = "";
         foreach ($arStr as $k => $v) {
             $row->AddViewField("WF_" . $k, $v);
             $str .= "<b>" . (strlen($arStr1[$k]) > 0 ? $arStr1[$k] : GetMessage("IBEL_A_BP_PROC")) . "</b>:<br />" . $v . "<br />";
         }
         $row->AddViewField("BIZPROC", $str);
     }
 }
 $boolIBlockElementAdd = CIBlockSectionRights::UserHasRightTo($intSubIBlockID, $find_section_section, "section_element_bind");
 $availQuantityTrace = COption::GetOptionString("catalog", "default_quantity_trace", 'N');
 $arQuantityTrace = array("D" => GetMessage("IBEL_DEFAULT_VALUE") . " (" . ($availQuantityTrace == 'Y' ? GetMessage("IBEL_YES_VALUE") : GetMessage("IBEL_NO_VALUE")) . ")", "Y" => GetMessage("IBEL_YES_VALUE"), "N" => GetMessage("IBEL_NO_VALUE"));
 $arElementOps = CIBlockElementRights::UserHasRightTo($intSubIBlockID, array_keys($arRows), "", CIBlockRights::RETURN_OPERATIONS);
 foreach ($arRows as $f_ID => $row) {
     $edit_url = '/bitrix/admin/iblock_subelement_edit.php?WF=Y&type=' . urlencode($strSubIBlockType) . '&IBLOCK_ID=' . $intSubIBlockID . '&lang=' . LANGUAGE_ID . '&PRODUCT_ID=' . $ID . '&ID=' . $row->arRes['orig']['ID'] . '&TMP_ID=' . $strSubTMP_ID . $sThisSectionUrl;
     if (array_key_exists("PREVIEW_PICTURE", $arSelectedFieldsMap)) {
         $row->AddViewField("PREVIEW_PICTURE", CFile::ShowFile($row->arRes['PREVIEW_PICTURE'], 100000, 50, 50, true));
     }
     if (array_key_exists("DETAIL_PICTURE", $arSelectedFieldsMap)) {
         $row->AddViewField("DETAIL_PICTURE", CFile::ShowFile($row->arRes['DETAIL_PICTURE'], 100000, 50, 50, true));
     }
     if (array_key_exists("PREVIEW_TEXT", $arSelectedFieldsMap)) {
         $row->AddViewField("PREVIEW_TEXT", $row->arRes["PREVIEW_TEXT_TYPE"] == "text" ? htmlspecialcharsex($row->arRes["PREVIEW_TEXT"]) : HTMLToTxt($row->arRes["PREVIEW_TEXT"]));
     }
     if (array_key_exists("DETAIL_TEXT", $arSelectedFieldsMap)) {
开发者ID:,项目名称:,代码行数:31,代码来源:

示例8: ShowError

            ShowError(GetMessage("CC_BLEE_WRONG_IBLOCK"));
            return;
        case CListPermissions::LISTS_FOR_SONET_GROUP_DISABLED:
            ShowError(GetMessage("CC_BLEE_LISTS_FOR_SONET_GROUP_DISABLED"));
            return;
        default:
            ShowError(GetMessage("CC_BLEE_UNKNOWN_ERROR"));
            return;
    }
} elseif ($ELEMENT_ID > 0 && $lists_perm < CListPermissions::CAN_READ && !CIBlockElementRights::UserHasRightTo($IBLOCK_ID, $ELEMENT_ID, "element_read") || $ELEMENT_ID == 0 && $lists_perm < CListPermissions::CAN_READ && !CIBlockSectionRights::UserHasRightTo($IBLOCK_ID, $SECTION_ID, "section_element_bind")) {
    ShowError(GetMessage("CC_BLEE_ACCESS_DENIED"));
    return;
}
$arParams["CAN_EDIT"] = !$arResult["IS_SOCNET_GROUP_CLOSED"] && ($ELEMENT_ID > 0 && ($lists_perm >= CListPermissions::CAN_WRITE || CIBlockElementRights::UserHasRightTo($IBLOCK_ID, $ELEMENT_ID, "element_edit")) || $ELEMENT_ID == 0 && ($lists_perm >= CListPermissions::CAN_WRITE || CIBlockSectionRights::UserHasRightTo($IBLOCK_ID, $SECTION_ID, "section_element_bind")));
$arResult["CAN_EDIT_RIGHTS"] = !$arResult["IS_SOCNET_GROUP_CLOSED"] && ($ELEMENT_ID > 0 && CIBlockElementRights::UserHasRightTo($IBLOCK_ID, $ELEMENT_ID, "element_rights_edit") || $ELEMENT_ID == 0 && CIBlockSectionRights::UserHasRightTo($IBLOCK_ID, $SECTION_ID, "element_rights_edit"));
$arResult["CAN_ADD_ELEMENT"] = !$arResult["IS_SOCNET_GROUP_CLOSED"] && ($lists_perm > CListPermissions::CAN_READ || CIBlockSectionRights::UserHasRightTo($IBLOCK_ID, $SECTION_ID, "section_element_bind"));
$arResult["CAN_DELETE_ELEMENT"] = !$arResult["IS_SOCNET_GROUP_CLOSED"] && $ELEMENT_ID > 0 && ($lists_perm >= CListPermissions::CAN_WRITE || CIBlockElementRights::UserHasRightTo($IBLOCK_ID, $ELEMENT_ID, "element_delete"));
$arResult["IBLOCK_PERM"] = $lists_perm;
$arResult["USER_GROUPS"] = $USER->GetUserGroupArray();
$arIBlock = CIBlock::GetArrayByID(intval($arParams["~IBLOCK_ID"]));
$arResult["~IBLOCK"] = $arIBlock;
$arResult["IBLOCK"] = htmlspecialcharsex($arIBlock);
$arResult["IBLOCK_ID"] = $arIBlock["ID"];
if (isset($arParams["SOCNET_GROUP_ID"]) && $arParams["SOCNET_GROUP_ID"] > 0) {
    $arParams["SOCNET_GROUP_ID"] = intval($arParams["SOCNET_GROUP_ID"]);
} else {
    $arParams["SOCNET_GROUP_ID"] = "";
}
$arResult["GRID_ID"] = "lists_list_elements_" . $arResult["IBLOCK_ID"];
if ($ELEMENT_ID) {
    $arResult["FORM_ID"] = "lists_element_edit_" . $arResult["IBLOCK_ID"];
开发者ID:webgksupport,项目名称:alpina,代码行数:31,代码来源:component.php

示例9: LocalRedirect

    }
    if (!isset($_POST["AJAX_CALL"])) {
        LocalRedirect($arResult["LIST_SECTION_URL"]);
    }
}
$grid_options = new CGridOptions($arResult["GRID_ID"]);
$rsSections = CIBlockSection::GetList(array("left_margin" => "asc"), array("IBLOCK_ID" => $arResult["IBLOCK_ID"], "GLOBAL_ACTIVE" => "Y", "SECTION_ID" => $arResult["SECTION_ID"], "CHECK_PERMISSIONS" => $lists_perm >= CListPermissions::IS_ADMIN ? "N" : "Y"));
$rsSections->NavStart($grid_options->GetNavParams(), false);
$arResult["SECTIONS_ROWS"] = array();
while ($data = $rsSections->GetNext()) {
    $aCols = array("NAME" => '<a href="' . str_replace(array("#list_id#", "#section_id#", "#group_id#"), array($data["IBLOCK_ID"], $data["ID"], $arParams["SOCNET_GROUP_ID"]), $arParams['LIST_SECTIONS_URL']) . '">' . $data["NAME"] . '</a>');
    $aActions = array();
    if (!$arResult["IS_SOCNET_GROUP_CLOSED"] && ($lists_perm >= CListPermissions::CAN_WRITE || CIBlockSectionRights::UserHasRightTo($data["IBLOCK_ID"], $data["ID"], "section_edit"))) {
        $aActions[] = array("ICONCLASS" => "edit", "TEXT" => GetMessage("CC_BLS_SECTION_ACTION_MENU_RENAME"), "ONCLICK" => "renameSection('form_section_add', '" . CUtil::JSEscape(GetMessage("CC_BLS_NEW_SECTION_NAME_PROMPT")) . "', " . $data["ID"] . ", '" . CUtil::JSEscape($data["NAME"]) . "');", "DEFAULT" => true);
    }
    if (!$arResult["IS_SOCNET_GROUP_CLOSED"] && ($lists_perm >= CListPermissions::CAN_WRITE || CIBlockSectionRights::UserHasRightTo($data["IBLOCK_ID"], $data["ID"], "section_delete"))) {
        $aActions[] = array("ICONCLASS" => "delete", "TEXT" => GetMessage("CC_BLS_SECTION_ACTION_MENU_DELETE"), "ONCLICK" => "bxGrid_" . $arResult["GRID_ID"] . ".DeleteItem('" . $data["ID"] . "', '" . GetMessage("CC_BLS_SECTION_DELETE_PROPMT") . "')");
        $canDelete = true;
    } else {
        $canDelete = false;
    }
    $arResult["SECTIONS_ROWS"][] = array("id" => $data["ID"], "data" => $data, "actions" => $aActions, "columns" => $aCols, "canDelete" => $canDelete);
}
$rsSections->bShowAll = false;
$arResult["NAV_OBJECT"] = $rsSections;
if (defined("BX_AJAX_PARAM_ID")) {
    $return_url = $APPLICATION->GetCurPageParam("", array(BX_AJAX_PARAM_ID));
} else {
    $return_url = $APPLICATION->GetCurPageParam();
}
$this->IncludeComponentTemplate();
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:component.php

示例10: array

			$ID,
			GetMessage("IBEL_E_RIGHTS_SECTION_TITLE"),
			"SUB_RIGHTS",
			$obRights->GetRightsList(),
			$obRights->GetRights(array("count_overwrited" => true, "parents" => array())),
			false, /*$bForceInherited=*/($ID <= 0) || $bCopy
		);
	$tabControl->EndCustomField("RIGHTS", $htmlHidden);
endif;

$bDisabled =
	($view=="Y")
	|| ($bWorkflow && $prn_LOCK_STATUS=="red")
	|| (
		(($ID <= 0) || $bCopy)
		&& !CIBlockSectionRights::UserHasRightTo($IBLOCK_ID, 0, "section_element_bind")
	)
	|| (
		(($ID > 0) && !$bCopy)
		&& !CIBlockElementRights::UserHasRightTo($IBLOCK_ID, $ID, "element_edit")
	)
	|| (
		$bBizproc
		&& !$canWrite
	)
;

if ($ID > 0 && !$bSubCopy && BX_SUB_SETTINGS)
{
	if (!$ajaxReload)
	{
开发者ID:akniyev,项目名称:arteva.ru,代码行数:31,代码来源:iblock_subelement_edit.php

示例11: ShowError

        case CListPermissions::WRONG_IBLOCK:
            ShowError(GetMessage("CC_BLEE_WRONG_IBLOCK"));
            return;
        case CListPermissions::LISTS_FOR_SONET_GROUP_DISABLED:
            ShowError(GetMessage("CC_BLEE_LISTS_FOR_SONET_GROUP_DISABLED"));
            return;
        default:
            ShowError(GetMessage("CC_BLEE_UNKNOWN_ERROR"));
            return;
    }
} elseif ($ELEMENT_ID > 0 && $lists_perm < CListPermissions::CAN_READ && !CIBlockElementRights::UserHasRightTo($IBLOCK_ID, $ELEMENT_ID, "element_read") || $ELEMENT_ID == 0 && $lists_perm < CListPermissions::CAN_READ && !CIBlockSectionRights::UserHasRightTo($IBLOCK_ID, $SECTION_ID, "section_element_bind")) {
    ShowError(GetMessage("CC_BLEE_ACCESS_DENIED"));
    return;
}
$arParams["CAN_EDIT"] = $ELEMENT_ID > 0 && ($lists_perm >= CListPermissions::CAN_WRITE || CIBlockElementRights::UserHasRightTo($IBLOCK_ID, $ELEMENT_ID, "element_edit")) || $ELEMENT_ID == 0 && ($lists_perm >= CListPermissions::CAN_WRITE || CIBlockSectionRights::UserHasRightTo($IBLOCK_ID, $SECTION_ID, "section_element_bind"));
$arResult["CAN_EDIT_RIGHTS"] = $ELEMENT_ID > 0 && CIBlockElementRights::UserHasRightTo($IBLOCK_ID, $ELEMENT_ID, "element_rights_edit") || $ELEMENT_ID == 0 && CIBlockSectionRights::UserHasRightTo($IBLOCK_ID, $SECTION_ID, "element_rights_edit");
$arResult["IBLOCK_PERM"] = $lists_perm;
$arResult["USER_GROUPS"] = $USER->GetUserGroupArray();
$arIBlock = CIBlock::GetArrayByID(intval($arParams["~IBLOCK_ID"]));
$arResult["~IBLOCK"] = $arIBlock;
$arResult["IBLOCK"] = htmlspecialcharsex($arIBlock);
$arResult["IBLOCK_ID"] = $arIBlock["ID"];
if (isset($arParams["SOCNET_GROUP_ID"]) && $arParams["SOCNET_GROUP_ID"] > 0) {
    $arParams["SOCNET_GROUP_ID"] = intval($arParams["SOCNET_GROUP_ID"]);
} else {
    $arParams["SOCNET_GROUP_ID"] = "";
}
$arResult["GRID_ID"] = "lists_list_elements_" . $arResult["IBLOCK_ID"];
$arResult["FORM_ID"] = "lists_element_edit";
$bBizproc = CModule::IncludeModule("bizproc") && $arIBlock["BIZPROC"] != "N";
$arResult["~LISTS_URL"] = str_replace(array("#group_id#"), array($arParams["SOCNET_GROUP_ID"]), $arParams["~LISTS_URL"]);
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:component.php

示例12: LocalRedirect

    }
    if (!isset($_POST["AJAX_CALL"])) {
        LocalRedirect($arResult["LIST_SECTION_URL"]);
    }
}
$grid_options = new CGridOptions($arResult["GRID_ID"]);
$rsSections = CIBlockSection::GetList(array("left_margin" => "asc"), array("IBLOCK_ID" => $arResult["IBLOCK_ID"], "GLOBAL_ACTIVE" => "Y", "SECTION_ID" => $arResult["SECTION_ID"], "CHECK_PERMISSIONS" => $lists_perm >= CListPermissions::IS_ADMIN ? "N" : "Y"));
$rsSections->NavStart($grid_options->GetNavParams(), false);
$arResult["SECTIONS_ROWS"] = array();
while ($data = $rsSections->GetNext()) {
    $aCols = array("NAME" => '<a href="' . str_replace(array("#list_id#", "#section_id#", "#group_id#"), array($data["IBLOCK_ID"], $data["ID"], $arParams["SOCNET_GROUP_ID"]), $arParams['LIST_SECTIONS_URL']) . '">' . $data["NAME"] . '</a>');
    $aActions = array();
    if ($lists_perm >= CListPermissions::CAN_WRITE || CIBlockSectionRights::UserHasRightTo($data["ID"], $data["ID"], "section_edit")) {
        $aActions[] = array("ICONCLASS" => "edit", "TEXT" => GetMessage("CC_BLS_SECTION_ACTION_MENU_RENAME"), "ONCLICK" => "renameSection('form_section_add', '" . CUtil::JSEscape(GetMessage("CC_BLS_NEW_SECTION_NAME_PROMPT")) . "', " . $data["ID"] . ", '" . CUtil::JSEscape($data["NAME"]) . "');", "DEFAULT" => true);
    }
    if ($lists_perm >= CListPermissions::CAN_WRITE || CIBlockSectionRights::UserHasRightTo($data["ID"], $data["ID"], "section_delete")) {
        $aActions[] = array("ICONCLASS" => "delete", "TEXT" => GetMessage("CC_BLS_SECTION_ACTION_MENU_DELETE"), "ONCLICK" => "bxGrid_" . $arResult["GRID_ID"] . ".DeleteItem('" . $data["ID"] . "', '" . GetMessage("CC_BLS_SECTION_DELETE_PROPMT") . "')");
    }
    $arResult["SECTIONS_ROWS"][] = array("id" => $data["ID"], "data" => $data, "actions" => $aActions, "columns" => $aCols);
}
$rsSections->bShowAll = false;
$arResult["NAV_OBJECT"] = $rsSections;
if (defined("BX_AJAX_PARAM_ID")) {
    $return_url = $APPLICATION->GetCurPageParam("", array(BX_AJAX_PARAM_ID));
} else {
    $return_url = $APPLICATION->GetCurPageParam();
}
$this->IncludeComponentTemplate();
$APPLICATION->SetTitle(GetMessage("CC_BLS_PAGE_TITLE", array("#NAME#" => $arResult["IBLOCK"]["NAME"])));
$APPLICATION->AddChainItem($arResult["IBLOCK"]["NAME"], CHTTP::urlAddParams(str_replace(array("#list_id#", "#section_id#", "#group_id#"), array($arResult["IBLOCK_ID"], 0, $arParams["SOCNET_GROUP_ID"]), $arParams["~LIST_URL"]), array("list_section_id" => "")));
$APPLICATION->AddChainItem(GetMessage("CC_BLS_CHAIN_TITLE", array("#NAME#" => $arResult["IBLOCK"]["NAME"])), str_replace(array("#list_id#", "#section_id#", "#group_id#"), array($arResult["IBLOCK_ID"], 0, $arParams["SOCNET_GROUP_ID"]), $arParams["~LIST_SECTIONS_URL"]));
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:component.php

示例13: array

<?php

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
CUtil::InitJSCore(array("window"));
$arToolbar = array();
if (isset($arResult["LIST_COPY_ELEMENT_URL"])) {
    if ($arResult["IBLOCK_PERM"] > CListPermissions::CAN_READ || CIBlockSectionRights::UserHasRightTo($arResult["IBLOCK"]["ID"], intval($arResult["SECTION_ID"]), "section_element_bind")) {
        $arToolbar[] = array("TEXT" => GetMessage("CT_BLEE_TOOLBAR_COPY_ELEMENT"), "TITLE" => GetMessage("CT_BLEE_TOOLBAR_COPY_ELEMENT_TITLE"), "LINK" => $arResult["LIST_COPY_ELEMENT_URL"], "ICON" => "");
    }
}
if ($arResult["ELEMENT_ID"] && ($arResult["IBLOCK_PERM"] >= CListPermissions::CAN_WRITE || CIBlockElementRights::UserHasRightTo($arResult["IBLOCK"]["ID"], $arResult["ELEMENT_ID"], "element_delete"))) {
    $arToolbar[] = array("TEXT" => $arResult["IBLOCK"]["ELEMENT_DELETE"], "TITLE" => GetMessage("CT_BLEE_TOOLBAR_DELETE_TITLE"), "LINK" => "javascript:jsDelete('form_" . $arResult["FORM_ID"] . "', '" . GetMessage("CT_BLEE_TOOLBAR_DELETE_WARNING") . "')", "ICON" => "btn-delete-element");
}
if (count($arToolbar)) {
    $arToolbar[] = array("SEPARATOR" => "Y");
}
$arToolbar[] = array("TEXT" => $arResult["IBLOCK"]["ELEMENTS_NAME"], "TITLE" => GetMessage("CT_BLEE_TOOLBAR_LIST_TITLE"), "LINK" => $arResult["LIST_SECTION_URL"], "ICON" => "btn-view-elements");
$APPLICATION->IncludeComponent("bitrix:main.interface.toolbar", "", array("BUTTONS" => $arToolbar), $component, array("HIDE_ICONS" => "Y"));
$arTabElement = array();
foreach ($arResult["FIELDS"] as $FIELD_ID => $arField) {
    if ($FIELD_ID == "ACTIVE_FROM" || $FIELD_ID == "ACTIVE_TO") {
        $arTabElement[] = array("id" => $FIELD_ID, "name" => $arField["NAME"], "required" => $arField["IS_REQUIRED"] == "Y" ? true : false, "type" => "date");
    } elseif ($FIELD_ID == "PREVIEW_PICTURE" || $FIELD_ID == "DETAIL_PICTURE") {
        $obFile = new CListFile($arResult["IBLOCK_ID"], $arResult["ELEMENT_FIELDS"]["IBLOCK_SECTION_ID"], $arResult["ELEMENT_ID"], $FIELD_ID, $arResult["FORM_DATA"][$FIELD_ID]);
        $obFile->SetSocnetGroup($arParams["SOCNET_GROUP_ID"]);
        $obFileControl = new CListFileControl($obFile, $FIELD_ID);
        $html = $obFileControl->GetHTML(array('max_size' => 102400, 'max_width' => 150, 'max_height' => 150, 'url_template' => $arParams["~LIST_FILE_URL"], 'a_title' => GetMessage("CT_BLEE_ENLARGE"), 'download_text' => GetMessage("CT_BLEE_DOWNLOAD")));
        $arTabElement[] = array("id" => $FIELD_ID, "name" => $arField["NAME"], "required" => $arField["IS_REQUIRED"] == "Y" ? true : false, "type" => "custom", "value" => $html);
    } elseif ($FIELD_ID == "PREVIEW_TEXT" || $FIELD_ID == "DETAIL_TEXT") {
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:template.php

示例14: GetMessage

    }
}
if (!CModule::IncludeModule('iblock')) {
    echo GetMessage("INTR_ABSENCE_BITRIX24_MODULE");
} else {
    if ($_SERVER["REQUEST_METHOD"] === "GET" && isset($_GET["action"]) && $_GET["action"] == "delete" && check_bitrix_sessid()) {
        if (CIBlockElementRights::UserHasRightTo($iblockID, intval($_GET["absenceID"]), "element_delete")) {
            DeleteAbsence($_GET["absenceID"]);
        }
        die;
    }
    $ID = 1;
    if ($_SERVER["REQUEST_METHOD"] === "POST" && check_bitrix_sessid()) {
        if (isset($_POST['absence_element_id']) && CIBlockElementRights::UserHasRightTo($iblockID, intval($_POST['absence_element_id']), 'element_edit')) {
            $ID = EditAbsence($_POST);
        } elseif (!isset($_POST['absence_element_id']) && CIBlockSectionRights::UserHasRightTo($iblockID, 0, "section_element_bind")) {
            $ID = AddAbsence($_POST);
        } else {
            die('error:<li>' . GetMessage('INTR_USER_ERR_NO_RIGHT') . '</li>');
        }
        if (is_array($ID)) {
            $arErrors = $ID;
            foreach ($arErrors as $key => $val) {
                if (strlen($val) <= 0) {
                    unset($arErrors[$key]);
                }
            }
            $ID = 0;
            die('error:<li>' . implode('</li><li>', $arErrors)) . '</li>';
        } elseif (isset($_POST['absence_element_id'])) {
            die("close");
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:absence.php

示例15: array

<?php

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
$arToolbar = array();
if ($arResult["IBLOCK_PERM"] > CListPermissions::CAN_READ || CIBlockSectionRights::UserHasRightTo($arResult["IBLOCK"]["ID"], intval($arResult["SECTION_ID"]), "section_element_bind")) {
    $arToolbar[] = array("TEXT" => $arResult["IBLOCK"]["ELEMENT_ADD"], "TITLE" => GetMessage("CT_BLL_TOOLBAR_ADD_ELEMENT_TITLE"), "LINK" => $arResult["LIST_NEW_ELEMENT_URL"], "ICON" => "btn-add-element");
}
if ($arResult["IBLOCK_PERM"] >= CListPermissions::CAN_WRITE || CIBlockSectionRights::UserHasRightTo($arResult["IBLOCK"]["ID"], intval($arResult["SECTION_ID"]), "section_edit") || CIBlockSectionRights::UserHasRightTo($arResult["IBLOCK"]["ID"], intval($arResult["SECTION_ID"]), "section_section_bind")) {
    $arToolbar[] = array("TEXT" => GetMessage("CT_BLL_TOOLBAR_EDIT_SECTION"), "TITLE" => GetMessage("CT_BLL_TOOLBAR_EDIT_SECTION_TITLE"), "LINK" => $arResult["LIST_SECTION_URL"], "ICON" => "btn-edit-sections");
}
if ($arParams["CAN_EDIT"]) {
    if (count($arToolbar)) {
        $arToolbar[] = array("SEPARATOR" => true);
    }
    if ($arResult["IBLOCK"]["BIZPROC"] == "Y" && $arParams["CAN_EDIT_BIZPROC"]) {
        $arToolbar[] = array("TEXT" => GetMessage("CT_BLL_TOOLBAR_BIZPROC"), "TITLE" => GetMessage("CT_BLL_TOOLBAR_BIZPROC_TITLE"), "LINK" => $arResult["BIZPROC_WORKFLOW_ADMIN_URL"], "ICON" => "btn-list-bizproc");
    }
    $arToolbar[] = array("TEXT" => GetMessage("CT_BLL_TOOLBAR_LIST"), "TITLE" => GetMessage("CT_BLL_TOOLBAR_LIST_TITLE"), "LINK" => $arResult["LIST_EDIT_URL"], "ICON" => "btn-edit-list");
}
if (IsModuleInstalled('intranet') && CBXFeatures::IsFeatureEnabled('intranet_sharepoint')) {
    if ($arIcons = $APPLICATION->IncludeComponent('bitrix:sharepoint.link', '', array('IBLOCK_ID' => $arParams['IBLOCK_ID'], 'OUTPUT' => 'N'), null, array('HIDE_ICONS' => 'Y'))) {
        if (count($arIcons['LINKS']) > 0) {
            $arMenu = array();
            foreach ($arIcons['LINKS'] as $link) {
                $arMenu[] = array('TEXT' => $link['TEXT'], 'ONCLICK' => $link['ONCLICK'], 'ICONCLASS' => $link['ICON']);
            }
            $arToolbar[] = array('TEXT' => 'SharePoint', 'ICON' => 'bx-sharepoint', 'MENU' => $arMenu);
        }
    }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:31,代码来源:template.php


注:本文中的CIBlockSectionRights::UserHasRightTo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。