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


PHP CIBlockElement::_check_rights_sql方法代码示例

本文整理汇总了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) {
//.........这里部分代码省略.........
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:101,代码来源:iblockelement.php


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