本文整理汇总了PHP中CIBlockElement::_check_rights_sql方法的典型用法代码示例。如果您正苦于以下问题:PHP CIBlockElement::_check_rights_sql方法的具体用法?PHP CIBlockElement::_check_rights_sql怎么用?PHP CIBlockElement::_check_rights_sql使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CIBlockElement
的用法示例。
在下文中一共展示了CIBlockElement::_check_rights_sql方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: MkFilter
function MkFilter($arFilter, &$arJoinProps, &$arAddWhereFields, $level = 0, $bPropertyLeftJoin = false)
{
global $DB, $USER;
$arSqlSearch = array();
$permSQL = "";
$arSectionFilter = array("LOGIC" => "", "BE" => array(), "BS" => array());
$strSqlSearch = "";
if (!is_array($arFilter)) {
$arFilter = array();
}
foreach ($arFilter as $key => $val) {
$key = strtoupper($key);
$p = strpos($key, "PROPERTY_");
if ($p !== false && $p < 4) {
$arFilter[substr($key, 0, $p) . "PROPERTY"][substr($key, $p + 9)] = $val;
unset($arFilter[$key]);
}
}
if (array_key_exists("LOGIC", $arFilter) && $arFilter["LOGIC"] == "OR") {
$Logic = "OR";
unset($arFilter["LOGIC"]);
$bPropertyLeftJoin = true;
} else {
$Logic = "AND";
}
if ($Logic === "AND" && $level === 0) {
$f = new \Bitrix\Iblock\PropertyIndex\QueryBuilder($arFilter["IBLOCK_ID"]);
if ($f->isValid()) {
$arJoinProps["FC"] = $f->getFilterSql($arFilter, $arSqlSearch);
$arJoinProps["FC_DISTINCT"] = $f->getDistinct();
}
}
foreach ($arFilter as $orig_key => $val) {
$res = CIBlock::MkOperationFilter($orig_key);
$key = $res["FIELD"];
$cOperationType = $res["OPERATION"];
//it was done before $key = strtoupper($key);
switch ($key . "") {
case "ACTIVE":
case "DETAIL_TEXT_TYPE":
case "PREVIEW_TEXT_TYPE":
$arSqlSearch[] = CIBlock::FilterCreateEx("BE." . $key, $val, "string_equal", $bFullJoinTmp, $cOperationType);
break;
case "NAME":
case "XML_ID":
case "TMP_ID":
case "DETAIL_TEXT":
case "SEARCHABLE_CONTENT":
case "PREVIEW_TEXT":
case "CODE":
case "TAGS":
case "WF_COMMENTS":
$arSqlSearch[] = CIBlock::FilterCreateEx("BE." . $key, $val, "string", $bFullJoinTmp, $cOperationType);
break;
case "ID":
if (is_object($val)) {
$arSqlSearch[] = $val->_sql_in("BE." . $key, $cOperationType);
} else {
$arSqlSearch[] = CIBlock::FilterCreateEx("BE." . $key, $val, "number", $bFullJoinTmp, $cOperationType);
}
break;
case "SHOW_COUNTER":
case "WF_PARENT_ELEMENT_ID":
case "WF_STATUS_ID":
case "SORT":
case "CREATED_BY":
case "PREVIEW_PICTURE":
case "DETAIL_PICTURE":
$arSqlSearch[] = CIBlock::FilterCreateEx("BE." . $key, $val, "number", $bFullJoinTmp, $cOperationType);
break;
case "IBLOCK_ID":
$arSqlSearch[] = CIBlock::FilterCreateEx("BE." . $key, $val, "number", $bFullJoinTmp, $cOperationType);
break;
case "TIMESTAMP_X":
case "DATE_CREATE":
case "SHOW_COUNTER_START":
$arSqlSearch[] = CIBlock::FilterCreateEx("BE." . $key, $val, "date", $bFullJoinTmp, $cOperationType);
break;
case "EXTERNAL_ID":
$arSqlSearch[] = CIBlock::FilterCreateEx("BE.XML_ID", $val, "string", $bFullJoinTmp, $cOperationType);
break;
case "IBLOCK_TYPE":
$flt = CIBlock::FilterCreateEx("B.IBLOCK_TYPE_ID", $val, "string", $bFullJoinTmp, $cOperationType);
$arSqlSearch[] = $flt;
break;
case "CHECK_PERMISSIONS":
if ($val == "Y" && (!is_object($USER) || !$USER->IsAdmin())) {
$permSQL = CIBlockElement::_check_rights_sql($arFilter["MIN_PERMISSION"]);
}
break;
case "CHECK_BP_PERMISSIONS":
if (IsModuleInstalled('bizproc') && (!is_object($USER) || !$USER->IsAdmin())) {
if (is_array($val)) {
$MODULE_ID = $DB->ForSQL($val["MODULE_ID"]);
$ENTITY = $DB->ForSQL($val["ENTITY"]);
$PERMISSION = $DB->ForSQL($val["PERMISSION"]);
$arUserGroups = array();
if (is_array($val["GROUPS"])) {
$USER_ID = intval($val["USER_ID"]);
foreach ($val["GROUPS"] as $GROUP_ID) {
//.........这里部分代码省略.........