本文整理汇总了PHP中CIBlockSectionRights类的典型用法代码示例。如果您正苦于以下问题:PHP CIBlockSectionRights类的具体用法?PHP CIBlockSectionRights怎么用?PHP CIBlockSectionRights使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CIBlockSectionRights类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: canRead
public function canRead($userId)
{
if (!Loader::includeModule("iblock")) {
return false;
}
$iblockId = $this->entityId;
return \CIBlockRights::userHasRightTo($iblockId, $iblockId, "element_read") || \CIBlockSectionRights::userHasRightTo($iblockId, 0, "section_element_bind");
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:8,代码来源:iblockworkflowconnector.php
示例2: 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
示例3: 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
示例4: checkPermission
protected function checkPermission()
{
global $USER;
$this->listPerm = CListPermissions::checkAccess($USER, $this->iblockTypeId, $this->iblockId, $this->socnetGroupId);
if ($this->listPerm < 0) {
switch ($this->listPerm) {
case CListPermissions::WRONG_IBLOCK_TYPE:
$this->errorCollection->add(array(new Error(Loc::getMessage('LISTS_LAC_WRONG_IBLOCK_TYPE'))));
break;
case CListPermissions::WRONG_IBLOCK:
$this->errorCollection->add(array(new Error(Loc::getMessage('LISTS_LAC_WRONG_IBLOCK'))));
break;
case CListPermissions::LISTS_FOR_SONET_GROUP_DISABLED:
$this->errorCollection->add(array(new Error(Loc::getMessage('LISTS_LAC_SONET_GROUP_DISABLED'))));
break;
default:
$this->errorCollection->add(array(new Error(Loc::getMessage('LISTS_LAC_UNKNOWN_ERROR'))));
break;
}
} elseif ($this->listPerm < CListPermissions::CAN_READ && !(CIBlockRights::userHasRightTo($this->iblockId, $this->iblockId, "element_read") || CIBlockSectionRights::userHasRightTo($this->iblockId, $this->sectionId, "section_element_bind"))) {
$this->errorCollection->add(array(new Error(Loc::getMessage('LISTS_LAC_ACCESS_DENIED'))));
}
}
开发者ID:webgksupport,项目名称:alpina,代码行数:23,代码来源:ajax.php
示例5: CIBlockElementRights
if($arShowTabs['edit_rights']):
$tabControl->BeginNextFormTab();
if($ID > 0)
{
$obRights = new CIBlockElementRights($IBLOCK_ID, $ID);
$htmlHidden = '';
foreach($obRights->GetRights() as $RIGHT_ID => $arRight)
$htmlHidden .= '
<input type="hidden" name="RIGHTS[][RIGHT_ID]" value="'.htmlspecialcharsbx($RIGHT_ID).'">
<input type="hidden" name="RIGHTS[][GROUP_CODE]" value="'.htmlspecialcharsbx($arRight["GROUP_CODE"]).'">
<input type="hidden" name="RIGHTS[][TASK_ID]" value="'.htmlspecialcharsbx($arRight["TASK_ID"]).'">
';
}
else
{
$obRights = new CIBlockSectionRights($IBLOCK_ID, $MENU_SECTION_ID);
$htmlHidden = '';
}
$tabControl->BeginCustomField("RIGHTS", GetMessage("IBEL_E_RIGHTS_FIELD"));
IBlockShowRights(
'element',
$IBLOCK_ID,
$ID,
GetMessage("IBEL_E_RIGHTS_SECTION_TITLE"),
"RIGHTS",
$obRights->GetRightsList(),
$obRights->GetRights(array("count_overwrited" => true, "parents" => $str_IBLOCK_ELEMENT_SECTION)),
false, /*$bForceInherited=*/($ID <= 0) || $bCopy
);
$tabControl->EndCustomField("RIGHTS", $htmlHidden);
开发者ID:ASDAFF,项目名称:entask.ru,代码行数:31,代码来源:iblock_element_edit.php
示例6: 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
示例7: IndexIBlockSection
function IndexIBlockSection($arFields, $entity_id, $entity_type, $feature, $operation, $path_template)
{
$rSection = CIBlockSection::GetByID($arFields['ID']);
$arSection = $rSection->Fetch();
$path = array();
$rsPath = CIBlockSection::GetNavChain($arFields["IBLOCK_ID"], $arFields['ID']);
while ($arPath = $rsPath->Fetch()) {
$path[] = $arPath['NAME'];
}
$path = implode("/", array_slice($path, 1));
$ID = intval($arFields["ID"]);
$IBLOCK_ID = intval($arFields["IBLOCK_ID"]);
$arItem = array();
if ($entity_type == "G") {
$url = str_replace(array("#group_id#", "#user_alias#", "#section_id#", "#element_id#", "#action#", "#task_id#", "#name#", "#path#"), array($entity_id, "group_" . $entity_id, $arFields["IBLOCK_SECTION"], $arFields["ID"], "view", $arFields["ID"], urlencode($arFields["NAME"]), $path), $path_template);
} else {
$url = str_replace(array("#user_id#", "#user_alias#", "#section_id#", "#element_id#", "#action#", "#task_id#", "#path#"), array($entity_id, "user_" . $entity_id, $arFields["IBLOCK_SECTION"], $arFields["ID"], "view", $arFields["ID"], $path), $path_template);
}
$body = "";
$title = $arFields["NAME"];
$arPermissions = $this->GetSearchGroups($entity_type, $entity_id, $feature, $operation);
if (CIBlock::GetArrayByID($IBLOCK_ID, "RIGHTS_MODE") == "E") {
$obSectionRights = new CIBlockSectionRights($IBLOCK_ID, $arFields["ID"]);
$arPermissions = $obSectionRights->GetGroups(array("section_read"));
}
$arSearchIndexParams = $this->GetSearchParams($entity_type, $entity_id, $feature, $operation);
CSearch::Index("socialnetwork", 'S' . $ID, array("LAST_MODIFIED" => ConvertTimeStamp(time() + CTimeZone::GetOffset(), "FULL"), "TITLE" => $title, "BODY" => $body, "SITE_ID" => array(SITE_ID => $url), "PARAM1" => CIBlock::GetArrayByID($IBLOCK_ID, "IBLOCK_TYPE_ID"), "PARAM2" => $IBLOCK_ID, "PARAM3" => $feature, "TAGS" => "", "PERMISSIONS" => $arPermissions, "PARAMS" => $arSearchIndexParams), true);
if (defined("BX_COMP_MANAGED_CACHE")) {
$GLOBALS["CACHE_MANAGER"]->ClearByTag("sonet_search_" . $entity_type . "_" . $entity_id);
}
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:search.php
示例8: array
}
if ($PRODUCT_ID > 0) {
$bReadOnly = !($USER->CanDoOperation('catalog_price') && CIBlockElementRights::UserHasRightTo($IBLOCK_ID, $PRODUCT_ID, "element_edit_price"));
if ($arMainCatalog['SUBSCRIPTION'] == 'Y') {
$arProductSelect = array('ID', 'QUANTITY', 'QUANTITY_RESERVED', 'QUANTITY_TRACE_ORIG', 'VAT_ID', 'VAT_INCLUDED', 'CAN_BUY_ZERO_ORIG', 'PRICE_TYPE', 'RECUR_SCHEME_TYPE', 'RECUR_SCHEME_LENGTH', 'TRIAL_PRICE_ID', 'WITHOUT_ORDER', 'PURCHASING_PRICE', 'PURCHASING_CURRENCY', 'BARCODE_MULTI', 'SUBSCRIBE_ORIG', 'TYPE');
} else {
$arProductSelect = array('ID', 'QUANTITY', 'QUANTITY_RESERVED', 'QUANTITY_TRACE_ORIG', 'WEIGHT', 'WIDTH', 'LENGTH', 'HEIGHT', 'MEASURE', 'VAT_ID', 'VAT_INCLUDED', 'CAN_BUY_ZERO_ORIG', 'PURCHASING_PRICE', 'PURCHASING_CURRENCY', 'BARCODE_MULTI', 'SUBSCRIBE_ORIG', 'TYPE');
}
$rsProducts = CCatalogProduct::GetList(array(), array('ID' => $PRODUCT_ID), false, false, $arProductSelect);
$arBaseProduct = $rsProducts->Fetch();
if ($bCopy) {
$arBaseProduct['QUANTITY'] = '';
$arBaseProduct['QUANTITY_RESERVED'] = '';
}
} else {
$bReadOnly = !($USER->CanDoOperation('catalog_price') && CIBlockSectionRights::UserHasRightTo($IBLOCK_ID, $MENU_SECTION_ID, "element_edit_price"));
}
if (empty($arBaseProduct)) {
$arBaseProduct = $arDefProduct;
}
$productIsSet = CBXFeatures::IsFeatureEnabled('CatCompleteSet') && ($arBaseProduct['TYPE'] == CCatalogProduct::TYPE_SET || $arShowTabs['product_set']);
$bDiscount = $USER->CanDoOperation('catalog_discount');
$bStore = $USER->CanDoOperation('catalog_store');
$bUseStoreControl = COption::GetOptionString('catalog', 'default_use_store_control') == 'Y';
$bEnableReservation = COption::GetOptionString('catalog', 'enable_reservation') != 'N';
$availQuantityTrace = COption::GetOptionString("catalog", "default_quantity_trace");
$availCanBuyZero = COption::GetOptionString("catalog", "default_can_buy_zero");
$availNegativeAmountGlobal = COption::GetOptionString("catalog", "allow_negative_amount");
$strGlobalSubscribe = COption::GetOptionString("catalog", "default_subscribe");
$arExtraList = array();
$l = CExtra::GetList(array("NAME" => "ASC"));
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:product_edit.php
示例9: array
$arBPStart[] = array("TEXT" => $arWorkflowTemplate["NAME"], "ONCLICK" => "jsUtils.Redirect(arguments, '" . CUtil::JSEscape($url) . "')");
}
}
}
$url = str_replace(array("#list_id#", "#section_id#", "#element_id#", "#group_id#"), array($arIBlock["ID"], intval($arResult["SECTION_ID"]), intval($data["~ID"]), $arParams["SOCNET_GROUP_ID"]), $arParams["LIST_ELEMENT_URL"]);
if ($arResult["ANY_SECTION"]) {
$url = CHTTP::urlAddParams($url, array("list_section_id" => ""));
}
$aActions = array();
if (!$arResult["IS_SOCNET_GROUP_CLOSED"] && ($lists_perm >= CListPermissions::CAN_WRITE || CIBlockElementRights::UserHasRightTo($IBLOCK_ID, $data["~ID"], "element_edit"))) {
$aActions[] = array("ICONCLASS" => "edit", "TEXT" => GetMessage("CC_BLL_ELEMENT_ACTION_MENU_EDIT"), "ONCLICK" => "jsUtils.Redirect(arguments, '" . CUtil::JSEscape($url) . "')", "DEFAULT" => true);
$arResult["ELEMENTS_CAN_MOVE"][] = $data["ID"];
} else {
$aActions[] = array("ICONCLASS" => "view", "TEXT" => GetMessage("CC_BLL_ELEMENT_ACTION_MENU_VIEW"), "ONCLICK" => "jsUtils.Redirect(arguments, '" . CUtil::JSEscape($url) . "')", "DEFAULT" => true);
}
if (!$arResult["IS_SOCNET_GROUP_CLOSED"] && ($lists_perm > CListPermissions::CAN_READ || CIBlockSectionRights::UserHasRightTo($IBLOCK_ID, intval($arResult["SECTION_ID"]), "section_element_bind"))) {
$urlCopy = CHTTP::urlAddParams(str_replace(array("#list_id#", "#section_id#", "#element_id#", "#group_id#"), array($arIBlock["ID"], intval($arResult["SECTION_ID"]), 0, $arParams["SOCNET_GROUP_ID"]), $arParams["LIST_ELEMENT_URL"]), array("copy_id" => $data["~ID"]), array("skip_empty" => true, "encode" => true));
$aActions[] = array("TEXT" => GetMessage("CC_BLL_ELEMENT_ACTION_MENU_COPY"), "ONCLICK" => "jsUtils.Redirect(arguments, '" . CUtil::JSEscape($urlCopy) . "')");
}
if (count($arBPStart) && !$arResult["IS_SOCNET_GROUP_CLOSED"] && ($lists_perm >= CListPermissions::CAN_BIZPROC || CIBlockElementRights::UserHasRightTo($IBLOCK_ID, $data["~ID"], "element_bizproc_start"))) {
$aActions[] = array("TEXT" => GetMessage("CC_BLL_ELEMENT_ACTION_MENU_START_BP"), "MENU" => $arBPStart);
}
if (CModule::IncludeModule("bizproc")) {
if (!empty($documentStates)) {
$currentUserGroups = $GLOBALS["USER"]->GetUserGroupArray();
if ($data["CREATED_BY"] == $GLOBALS["USER"]->GetID()) {
$currentUserGroups[] = "author";
}
$listProcesses = array();
$backUrl = $APPLICATION->GetCurPageParam();
foreach ($documentStates as $documentState) {
开发者ID:webgksupport,项目名称:alpina,代码行数:31,代码来源:component.php
示例10: GroupERights
static function GroupERights($iblockID)
{
if (CIBlock::GetArrayByID($iblockID, "RIGHTS_MODE") === "E") {
return;
}
$arGroups = self::GetGroups($iblockID);
foreach ($arGroups as $groupID => $group) {
foreach (self::$ops as $op => $opTrans) {
$arGroups[$groupID]["Operations"][$op] = CSocNetFeaturesPerms::GetOperationPerm(SONET_ENTITY_GROUP, $groupID, 'files', $op);
}
}
$arTasks = CWebDavIblock::GetTasks();
// set e rights
$arFields = array('RIGHTS_MODE' => 'E', 'GROUP_ID' => array());
$ib = new CIBlock();
$res = $ib->Update($iblockID, $arFields);
$ibr = new CIBlockRights($iblockID);
$rights = array();
$rights['n0'] = array('GROUP_CODE' => 'G1', 'DO_CLEAN' => 'Y', 'TASK_ID' => $arTasks['X']);
// admins
$rights['n1'] = array('GROUP_CODE' => 'G2', 'DO_CLEAN' => 'Y', 'TASK_ID' => $arTasks['D']);
// nobody
$ibr->SetRights($rights);
foreach ($arGroups as $groupID => $group) {
$sectionID = $group['SECTION'];
$ibrs = new CIBlockSectionRights($iblockID, $sectionID);
$rights = array();
$i = 0;
foreach ($group["Operations"] as $op => $subj) {
// 'Operations' =>
// array
// 'view' => string 'A' (length=1)
// 'write_limited' => string 'Z' (length=1)
// 'bizproc' => null
// 'write' => string 'Z' (length=1)
//
// A>Только владелец группы
// E>Владелец группы и модераторы группы
// K>Все члены группы
// L>Авторизованные пользователи
// N>Все посетители
if ($subj) {
if ($subj == "N") {
$sSubj = "G2";
} elseif ($subj == "L") {
$sSubj = "AU";
} else {
$sSubj = "SG{$groupID}_{$subj}";
}
$rights[$sSubj] = $arTasks[self::$ops[$op]];
if (self::$ops[$op] == 'E') {
$rights["CR"] = $arTasks['W'];
}
}
}
$rights["SG{$groupID}_A"] = $arTasks["X"];
// admin of group
$arRights = array();
$i = 0;
foreach ($rights as $subj => $task) {
$arRights['n' . $i++] = array('GROUP_CODE' => $subj, 'TASK_ID' => $task, 'DO_CLEAN' => 'NOT');
}
$ibrs->SetRights($arRights);
}
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:65,代码来源:iblocksocnet.php
示例11: UpdateSearch
function UpdateSearch($ID, $bOverWrite = false)
{
if (!CModule::IncludeModule("search")) {
return;
}
global $DB;
$ID = Intval($ID);
static $arGroups = array();
static $arSITE = array();
$strSql = "\n\t\t\tSELECT BS.ID, BS.NAME, BS.DESCRIPTION_TYPE, BS.DESCRIPTION, BS.XML_ID as EXTERNAL_ID,\n\t\t\t\tBS.CODE, BS.IBLOCK_ID, B.IBLOCK_TYPE_ID,\n\t\t\t\t" . $DB->DateToCharFunction("BS.TIMESTAMP_X") . " as LAST_MODIFIED,\n\t\t\t\tB.CODE as IBLOCK_CODE, B.XML_ID as IBLOCK_EXTERNAL_ID, B.SECTION_PAGE_URL,\n\t\t\t\tB.ACTIVE as ACTIVE1,\n\t\t\t\tBS.GLOBAL_ACTIVE as ACTIVE2,\n\t\t\t\tB.INDEX_SECTION, B.RIGHTS_MODE\n\t\t\tFROM b_iblock_section BS, b_iblock B\n\t\t\tWHERE BS.IBLOCK_ID=B.ID\n\t\t\t\tAND BS.ID=" . $ID;
$dbrIBlockSection = $DB->Query($strSql);
if ($arIBlockSection = $dbrIBlockSection->Fetch()) {
$IBLOCK_ID = $arIBlockSection["IBLOCK_ID"];
$SECTION_URL = "=ID=" . $arIBlockSection["ID"] . "&EXTERNAL_ID=" . $arIBlockSection["EXTERNAL_ID"] . "&IBLOCK_TYPE_ID=" . $arIBlockSection["IBLOCK_TYPE_ID"] . "&IBLOCK_ID=" . $arIBlockSection["IBLOCK_ID"] . "&IBLOCK_CODE=" . $arIBlockSection["IBLOCK_CODE"] . "&IBLOCK_EXTERNAL_ID=" . $arIBlockSection["IBLOCK_EXTERNAL_ID"] . "&CODE=" . $arIBlockSection["CODE"];
if ($arIBlockSection["ACTIVE1"] != "Y" || $arIBlockSection["ACTIVE2"] != "Y" || $arIBlockSection["INDEX_SECTION"] != "Y") {
CSearch::DeleteIndex("iblock", "S" . $arIBlockSection["ID"]);
return;
}
if (!array_key_exists($IBLOCK_ID, $arGroups)) {
$arGroups[$IBLOCK_ID] = array();
$strSql = "SELECT GROUP_ID " . "FROM b_iblock_group " . "WHERE IBLOCK_ID= " . $IBLOCK_ID . " " . "\tAND PERMISSION>='R' " . "ORDER BY GROUP_ID";
$dbrIBlockGroup = $DB->Query($strSql);
while ($arIBlockGroup = $dbrIBlockGroup->Fetch()) {
$arGroups[$IBLOCK_ID][] = $arIBlockGroup["GROUP_ID"];
if ($arIBlockGroup["GROUP_ID"] == 2) {
break;
}
}
}
if (!array_key_exists($IBLOCK_ID, $arSITE)) {
$arSITE[$IBLOCK_ID] = array();
$strSql = "SELECT SITE_ID " . "FROM b_iblock_site " . "WHERE IBLOCK_ID= " . $IBLOCK_ID;
$dbrIBlockSite = $DB->Query($strSql);
while ($arIBlockSite = $dbrIBlockSite->Fetch()) {
$arSITE[$IBLOCK_ID][] = $arIBlockSite["SITE_ID"];
}
}
$BODY = $arIBlockSection["DESCRIPTION_TYPE"] == "html" ? CSearch::KillTags($arIBlockSection["DESCRIPTION"]) : $arIBlockSection["DESCRIPTION"];
$BODY .= $GLOBALS["USER_FIELD_MANAGER"]->OnSearchIndex("IBLOCK_" . $arIBlockSection["IBLOCK_ID"] . "_SECTION", $arIBlockSection["ID"]);
if ($arIBlockSection["RIGHTS_MODE"] !== "E") {
$arPermissions = $arGroups[$IBLOCK_ID];
} else {
$obSectionRights = new CIBlockSectionRights($IBLOCK_ID, $arIBlockSection["ID"]);
$arPermissions = $obSectionRights->GetGroups(array("section_read"));
}
CSearch::Index("iblock", "S" . $ID, array("LAST_MODIFIED" => $arIBlockSection["LAST_MODIFIED"], "TITLE" => $arIBlockSection["NAME"], "PARAM1" => $arIBlockSection["IBLOCK_TYPE_ID"], "PARAM2" => $IBLOCK_ID, "SITE_ID" => $arSITE[$IBLOCK_ID], "PERMISSIONS" => $arPermissions, "URL" => $SECTION_URL, "BODY" => $BODY), $bOverWrite);
}
}
开发者ID:,项目名称:,代码行数:48,代码来源:
示例12: intval
<?php
/** @global CUser $USER */
/** @global int $ID */
use Bitrix\Main, Bitrix\Main\Localization\Loc;
if ($USER->CanDoOperation('catalog_price')) {
$IBLOCK_ID = intval($IBLOCK_ID);
if (0 >= $IBLOCK_ID) {
return;
}
$MENU_SECTION_ID = intval($MENU_SECTION_ID);
$ID = (int) $ID;
$PRODUCT_ID = 0 < $ID ? CIBlockElement::GetRealElement($ID) : 0;
$boolPriceRights = $PRODUCT_ID > 0 ? CIBlockElementRights::UserHasRightTo($IBLOCK_ID, $PRODUCT_ID, "element_edit_price") : CIBlockSectionRights::UserHasRightTo($IBLOCK_ID, $MENU_SECTION_ID, "element_edit_price");
if ($boolPriceRights) {
Loc::loadMessages($_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/catalog/templates/product_edit_action.php');
$arCatalogBasePrices = array();
$arCatalogPrices = array();
$CAT_ROW_COUNTER = intval($CAT_ROW_COUNTER);
if ($CAT_ROW_COUNTER < 0) {
$strWarning .= Loc::getMessage("C2IT_INTERNAL_ERROR") . "<br>";
}
$arCatalogBaseGroup = CCatalogGroup::GetBaseGroup();
if (!$arCatalogBaseGroup) {
$strWarning .= Loc::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';
if (!$bUseExtForm) {
$CAT_ROW_COUNTER = 0;
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:product_edit_validator.php
示例13: array
$aContext = array();
$boolBtnNew = false;
if (CIBlockSectionRights::UserHasRightTo($IBLOCK_ID, $find_section_section, "section_element_bind")) {
$boolBtnNew = true;
if (CModule::IncludeModule('catalog')) {
CCatalogAdminTools::setProductFormParams();
$arCatalogBtns = CCatalogAdminTools::getIBlockElementMenu($IBLOCK_ID, $arCatalog, array('IBLOCK_SECTION_ID' => $find_section_section, 'find_section_section' => $find_section_section, 'from' => 'iblock_section_admin'));
if (!empty($arCatalogBtns)) {
$aContext = $arCatalogBtns;
}
}
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_section_admin')), "TITLE" => GetMessage("IBSEC_A_ADDEL_TITLE"));
}
}
if (CIBlockSectionRights::UserHasRightTo($IBLOCK_ID, $find_section_section, "section_section_bind")) {
$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_section_admin')), "TITLE" => GetMessage("IBSEC_A_SECTADD_PRESS"));
}
if (defined("CATALOG_PRODUCT")) {
if ($find_section_section > 0) {
$rsParent = CIBlockSection::GetList(array(), array("=ID" => $find_section_section), false, array("ID", "IBLOCK_SECTION_ID"));
if ($arParent = $rsParent->Fetch()) {
$aContext[] = array("TEXT" => GetMessage("IBSEC_A_UP"), "LINK" => CIBlock::GetAdminSectionListLink($IBLOCK_ID, array('find_section_section' => intval($arParent["IBLOCK_SECTION_ID"]))), "TITLE" => GetMessage("IBSEC_A_UP_TITLE"));
}
}
} else {
$aContext[] = array("TEXT" => htmlspecialcharsbx($arIBlock["ELEMENTS_NAME"]), "LINK" => htmlspecialcharsbx(CIBlock::GetAdminElementListLink($IBLOCK_ID, array('find_section_section' => $find_section_section))), "TITLE" => GetMessage("IBSEC_A_LISTEL_TITLE"));
if ($_GET["tree"] == "Y") {
$aContext[] = array("TEXT" => GetMessage("IBSEC_A_NOT_TREE"), "LINK" => CIBlock::GetAdminSectionListLink($IBLOCK_ID, array('find_section_section' => $find_section_section, 'tree' => 'N')), "TITLE" => GetMessage("IBSEC_A_NOT_TREE_TITLE"));
} else {
$aContext[] = array("TEXT" => GetMessage("IBSEC_A_TREE"), "LINK" => CIBlock::GetAdminSectionListLink($IBLOCK_ID, array('find_section_section' => $find_section_section, 'tree' => 'Y')), "TITLE" => GetMessage("IBSEC_A_TREE_TITLE"));
开发者ID:spas-viktor,项目名称:books,代码行数:31,代码来源:iblock_section_admin.php
示例14: 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
示例15: CIBlockSectionRights
$tabControl->BeginNextFormTab();
if($ID > 0)
{
$obSectionRights = new CIBlockSectionRights($IBLOCK_ID, $ID);
$htmlHidden = '';
foreach($obSectionRights->GetRights() as $RIGHT_ID => $arRight)
$htmlHidden .= '
<input type="hidden" name="RIGHTS[][RIGHT_ID]" value="'.htmlspecialcharsbx($RIGHT_ID).'">
<input type="hidden" name="RIGHTS[][GROUP_CODE]" value="'.htmlspecialcharsbx($arRight["GROUP_CODE"]).'">
<input type="hidden" name="RIGHTS[][TASK_ID]" value="'.htmlspecialcharsbx($arRight["TASK_ID"]).'">
';
}
else
{
$obSectionRights = new CIBlockSectionRights($IBLOCK_ID, $str_IBLOCK_SECTION_ID);
$htmlHidden = '';
}
$tabControl->BeginCustomField("RIGHTS", GetMessage("IBSEC_E_RIGHTS_FIELD"));
IBlockShowRights(
'section',
$IBLOCK_ID,
$ID,
GetMessage("IBSEC_E_RIGHTS_SECTION_TITLE"),
"RIGHTS",
$obSectionRights->GetRightsList(),
$obSectionRights->GetRights(array("count_overwrited" => true, "parent" => $str_IBLOCK_SECTION_ID)),
true, /*$bForceInherited=*/($ID <= 0)
);
$tabControl->EndCustomField("RIGHTS", $htmlHidden);
开发者ID:ASDAFF,项目名称:entask.ru,代码行数:31,代码来源:iblock_section_edit.php
示例16: 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
示例17: CIBlockElementRights
if($arShowTabs['edit_rights']):
$tabControl->BeginNextFormTab();
if($ID > 0)
{
$obRights = new CIBlockElementRights($IBLOCK_ID, $ID);
$htmlHidden = '';
foreach($obRights->GetRights() as $RIGHT_ID => $arRight)
$htmlHidden .= '
<input type="hidden" name="SUB_RIGHTS[][RIGHT_ID]" value="'.htmlspecialcharsbx($RIGHT_ID).'">
<input type="hidden" name="SUB_RIGHTS[][GROUP_CODE]" value="'.htmlspecialcharsbx($arRight["GROUP_CODE"]).'">
<input type="hidden" name="SUB_RIGHTS[][TASK_ID]" value="'.htmlspecialcharsbx($arRight["TASK_ID"]).'">
';
}
else
{
$obRights = new CIBlockSectionRights($IBLOCK_ID, 0);
$htmlHidden = '';
}
$tabControl->BeginCustomField("RIGHTS", GetMessage("IBEL_E_RIGHTS_FIELD"));
IBlockShowRights(
'element',
$IBLOCK_ID,
$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);
开发者ID:akniyev,项目名称:arteva.ru,代码行数:31,代码来源:iblock_subelement_edit.php
示例18: OnSearchReindex
//.........这里部分代码省略.........
}
$
|
请发表评论