コード例 #1
0
 function __sort_array_folder($res1, $res2)
 {
     global $by, $order;
     InitSorting();
     if (empty($by)) {
         $by = "NAME";
         $order = "ASC";
     }
     $by = strtoupper($by);
     $order = strtoupper($order);
     $by = is_set($res1, $by) ? $by : "NAME";
     if ($order == "ASC") {
         return $res1[$by] < $res2[$by] ? -1 : 1;
     }
     return $res1[$by] < $res2[$by] ? 1 : -1;
 }
コード例 #2
0
ファイル: dump.php プロジェクト: nProfessor/Mytb
								$lAdmin->AddGroupError(GetMessage("MAIN_DUMP_ERR_FILE_RENAME").htmlspecialcharsbx($ID), $ID);
								break;
							}

							$ID = CTar::getNextName($ID);
							$new_name = CTar::getNextName($new_name);
						}
					}
				}
				else
					$lAdmin->AddGroupError(GetMessage("MAIN_DUMP_ERR_NAME"), $ID);
			break;
		}
	}
}
InitSorting();

$arDirs = array();
$arFiles = array();
$arTmpFiles = array();
$arFilter = array();

GetDirList(Array($site, $path), $arDir, $arTmpFiles, $arFilter, Array($by=>$order), "F");

// Clouds
if (($arAllBucket = CBackup::GetBucketList()) && $_REQUEST['mode'])
{
	foreach($arAllBucket as $arBucket)
	{
		if ($arCloudFiles = CBackup::GetBucketFileList($arBucket['ID'], BX_ROOT.'/backup/'))
		{
コード例 #3
0
ファイル: component.php プロジェクト: Satariall/izurit
				Input params
********************************************************************/
/***************** BASE ********************************************/
$arParams["MID"] = intVal($arParams["MID"] > 0 ? $arParams["MID"] : $_REQUEST["MID"]);
$mode = !empty($arParams["mode"]) ? $arParams["mode"] : $_REQUEST["mode"];
if ($arParams["MID"] <= 0) {
    $mode = "new";
} elseif (empty($mode)) {
    $mode = "edit";
} else {
    $mode = htmlspecialcharsbx($mode);
}
$arParams["UID"] = intVal(empty($arParams["UID"]) ? $_REQUEST["UID"] : $arParams["UID"]);
$arParams["FID"] = intVal(empty($arParams["FID"]) ? $_REQUEST["FID"] : $arParams["FID"]);
/***************** Sorting *****************************************/
InitSorting($GLOBALS["APPLICATION"]->GetCurPage() . "?PAGE_NAME=pm_list&FID=" . $arParams["FID"]);
global $by, $order;
/***************** URL *********************************************/
$URL_NAME_DEFAULT = array("pm_list" => "PAGE_NAME=pm_list&FID=#FID#", "pm_read" => "PAGE_NAME=pm_read&FID=#FID#&MID=#MID#", "pm_edit" => "PAGE_NAME=pm_edit&FID=#FID#&MID=#MID#&mode=#mode#", "pm_search" => "PAGE_NAME=pm_search", "pm_folder" => "PAGE_NAME=pm_folder", "profile_view" => "PAGE_NAME=profile_view&UID=#UID#");
foreach ($URL_NAME_DEFAULT as $URL => $URL_VALUE) {
    if (strLen(trim($arParams["URL_TEMPLATES_" . strToUpper($URL)])) <= 0) {
        $arParams["URL_TEMPLATES_" . strToUpper($URL)] = $APPLICATION->GetCurPageParam($URL_VALUE, array("PAGE_NAME", "FID", "TID", "UID", "MID", "mode", BX_AJAX_PARAM_ID));
    }
    $arParams["~URL_TEMPLATES_" . strToUpper($URL)] = $arParams["URL_TEMPLATES_" . strToUpper($URL)];
    if (!empty($by) && !in_array($URL, array("profile_view", "pm_read", "pm_edit"))) {
        $arParams["~URL_TEMPLATES_" . strToUpper($URL)] = ForumAddPageParams($arParams["URL_TEMPLATES_" . strToUpper($URL)], array("by" => $by, "order" => $order), false, false);
    }
    $arParams["URL_TEMPLATES_" . strToUpper($URL)] = htmlspecialcharsbx($arParams["~URL_TEMPLATES_" . strToUpper($URL)]);
}
/***************** ADDITIONAL **************************************/
$arParams["NAME_TEMPLATE"] = str_replace(array("#NOBR#", "#/NOBR#"), "", !empty($arParams["NAME_TEMPLATE"]) ? $arParams["NAME_TEMPLATE"] : CSite::GetDefaultNameFormat());
コード例 #4
0
ファイル: component.php プロジェクト: rasuldev/torino
//*******************************************************************
$arResult["ERROR_MESSAGE"] .= trim($strErrorMessage);
if (!empty($strErrorMessage)) {
    $arResult["OK_MESSAGE"] = trim($strOkMessage);
} else {
    $arResult["OK_MESSAGE"] .= trim($strOkMessage);
}
/********************************************************************
				/Actions
********************************************************************/
/********************************************************************
				Data
********************************************************************/
$arResult["SortingEx"] = array("TITLE", "POSTS", "VIEWS", "USER_START_NAME", "LAST_POST_DATE");
global $by, $order;
InitSorting($APPLICATION->GetCurPage() . "?PAGE_NAME=list&FID=" . $arParams["FID"]);
if (!in_array($by, $arResult["SortingEx"])) {
    ForumGetTopicSort($by, $order, $arResult["FORUM"]);
}
$by = $by == "ABS_LAST_POST_DATE" ? "LAST_POST_DATE" : $by;
if ($by == "LAST_POST_DATE" && $arResult["PERMISSION"] >= "Q") {
    $by = "ABS_LAST_POST_DATE";
}
$arResult["SortingEx"] = array_flip($arResult["SortingEx"]);
foreach ($arResult["SortingEx"] as $key => $val) {
    $arResult["SortingEx"][$key] = SortingEx($key);
}
$arFilter = array("FORUM_ID" => $arParams["FID"]);
if ($USER->IsAuthorized()) {
    $arFilter["USER_ID"] = $USER->GetID();
}
コード例 #5
0
# Bitrix: SiteManager                        #
# Copyright (c) 2004 Bitrix                  #
# http://www.bitrix.ru                       #
# mailto:admin@bitrix.ru                     #
##############################################
*/
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_before.php";
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/form/prolog.php";
CModule::IncludeModule("form");
ClearVars();
$FORM_RIGHT = $APPLICATION->GetGroupRight("form");
if ($FORM_RIGHT <= "D") {
    $APPLICATION->AuthForm(GetMessage("ACCESS_DENIED"));
}
//require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/form/include.php");
$WEB_FORM_ID = intval($WEB_FORM_ID);
$z = CForm::GetByID($WEB_FORM_ID);
if ($form = $z->Fetch()) {
    $SHOW_ADDITIONAL = "Y";
    $SHOW_ANSWER_VALUE = "Y";
    $SHOW_STATUS = "Y";
    $WEB_FORM_NAME = $form["SID"];
    IncludeModuleLangFile(__FILE__);
    $s = dirname($APPLICATION->GetCurPage()) . "/" . basename($APPLICATION->GetCurPage(), "_xls.php") . ".php";
    InitSorting($s);
    require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/form/admin/body/form_result_list_handler.php";
    header("Content-Type: application/vnd.ms-excel");
    require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_excel_after.php";
    require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/form/admin/body/form_result_list_table_excel.php";
    require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_excel.php";
}
コード例 #6
0
ファイル: file.php プロジェクト: DarneoStudio/bitrix
 function __sort_array_folder_and_file($res1, $res2)
 {
     global $by, $order;
     InitSorting();
     if (empty($by)) {
         $by = "NAME";
         $order = "ASC";
     }
     $by = strtoupper($by);
     $order = strtoupper($order);
     if ($res1["~TYPE"] == "FOLDER" && $res2["~TYPE"] == "FILE") {
         return -1;
     } elseif ($res1["~TYPE"] == "FILE" && $res2["~TYPE"] == "FOLDER") {
         return 1;
     } else {
         $by = is_set($res1, $by) ? $by : "NAME";
         $ord = $order;
         if ($by == "TIMESTAMP_X") {
             $ord = $order == "ASC" ? "DESC" : "ASC";
         }
         if ($ord == "ASC") {
             return $res1[$by] < $res2[$by] ? -1 : 1;
         } else {
             return $res1[$by] < $res2[$by] ? 1 : -1;
         }
     }
 }
コード例 #7
0
ファイル: component.php プロジェクト: Satariall/izurit
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
if (!CModule::IncludeModule("forum")) {
    ShowError(GetMessage("F_NO_MODULE"));
    return 0;
}
/********************************************************************
				Input params
********************************************************************/
/***************** BASE ********************************************/
$arParams["SEND_MAIL"] = in_array($arParams["SEND_MAIL"], array("A", "E", "U", "Y")) ? $arParams["SEND_MAIL"] : "E";
$arParams["SEND_ICQ"] = in_array($arParams["SEND_ICQ"], array("A", "E", "U", "Y")) ? $arParams["SEND_ICQ"] : "A";
$arParams["SHOW_USER_STATUS"] = $arParams["SHOW_USER_STATUS"] == "Y" ? "Y" : "N";
/***************** Sorting *****************************************/
InitSorting($GLOBALS["APPLICATION"]->GetCurPage() . "?PAGE_NAME=user_list");
global $by, $order;
/***************** URL *********************************************/
$URL_NAME_DEFAULT = array("message_send" => "PAGE_NAME=message_send&TYPE=#TYPE#&UID=#UID#", "pm_edit" => "PAGE_NAME=pm_edit&FID=#FID#&MID=#MID#&UID=#UID#&mode=#mode#", "profile_view" => "PAGE_NAME=profile_view&UID=#UID#", "user_post" => "PAGE_NAME=user_post&UID=#UID#&mode=#mode#");
foreach ($URL_NAME_DEFAULT as $URL => $URL_VALUE) {
    if (strLen(trim($arParams["URL_TEMPLATES_" . strToUpper($URL)])) <= 0) {
        $arParams["URL_TEMPLATES_" . strToUpper($URL)] = $APPLICATION->GetCurPage() . "?" . $URL_VALUE;
    }
    $arParams["~URL_TEMPLATES_" . strToUpper($URL)] = $arParams["URL_TEMPLATES_" . strToUpper($URL)];
    $arParams["URL_TEMPLATES_" . strToUpper($URL)] = htmlspecialcharsbx($arParams["~URL_TEMPLATES_" . strToUpper($URL)]);
}
/***************** ADDITIONAL **************************************/
// Page elements
$arParams["USERS_PER_PAGE"] = intVal($arParams["USERS_PER_PAGE"]) > 0 ? intVal($arParams["USERS_PER_PAGE"]) : 20;
// Data and data-time format
$arParams["DATE_FORMAT"] = trim(empty($arParams["DATE_FORMAT"]) ? $DB->DateFormatToPHP(CSite::GetDateFormat("SHORT")) : $arParams["DATE_FORMAT"]);
コード例 #8
0
ファイル: iblock.php プロジェクト: mrdeadmouse/u136006
 function _get_mixed_list($section_id, $arParams = array(), $element_id = 0)
 {
     list($contextType, $contextEntityId) = $this->getContextData();
     if ($section_id) {
         $sectionData = $this->getSectionDataForLinkAnalyze($section_id);
         if (CWebDavSymlinkHelper::isLink($contextType, $contextEntityId, $sectionData)) {
             $parentSectionData = CWebDavSymlinkHelper::getLinkData($contextType, $contextEntityId, $sectionData);
             if ($parentSectionData) {
                 $linkWebdav = new self($parentSectionData[self::UF_LINK_IBLOCK_ID], $this->base_url . $this->_path, array('ROOT_SECTION_ID' => $parentSectionData[self::UF_LINK_SECTION_ID], 'symlinkMode' => true, 'symlinkSectionData' => $parentSectionData, 'symlinkRealRootSectionData' => $this->arRootSection));
                 return $linkWebdav->_get_mixed_list($section_id, $arParams, $element_id);
             }
         }
     } else {
         if (CWebDavSymlinkHelper::isLinkElement($contextType, $contextEntityId, $element_id)) {
             $parentSectionData = CWebDavSymlinkHelper::getLinkDataOfElement($contextType, $contextEntityId, $element_id);
             if ($parentSectionData) {
                 $linkWebdav = new self($parentSectionData[self::UF_LINK_IBLOCK_ID], $this->base_url . $this->_path, array('ROOT_SECTION_ID' => $parentSectionData[self::UF_LINK_SECTION_ID], 'symlinkMode' => true, 'symlinkSectionData' => $parentSectionData, 'symlinkRealRootSectionData' => $this->arRootSection));
                 return $linkWebdav->_get_mixed_list($section_id, $arParams, $element_id);
             }
         }
     }
     global $by, $order;
     InitSorting();
     if (empty($by)) {
         $by = "NAME";
         $order = "ASC";
     }
     $by = strtoupper($by);
     $order = strtoupper($order);
     $section_id = $section_id === null ? null : intVal($section_id);
     $element_id = intVal($element_id);
     $arParams = is_array($arParams) ? $arParams : array();
     $arParams["COLUMNS"] = is_array($arParams["COLUMNS"]) ? $arParams["COLUMNS"] : array();
     $arFilter = array("IBLOCK_ID" => $this->IBLOCK_ID, "IBLOCK_ACTIVE" => "Y", "CHECK_PERMISSIONS" => "Y", "MIN_PERMISSION" => "R", "SHOW_NEW" => "Y");
     if ($section_id !== null) {
         $arFilter["SECTION_ID"] = $section_id;
     }
     $perms = $this->permission;
     if ($this->e_rights && !$GLOBALS['USER']->CanDoOperation('webdav_change_settings')) {
         if ($element_id > 0) {
             $arParentPerms = $this->GetPermissions('ELEMENT', (int) $element_id);
         } else {
             $arParentPerms = $this->GetPermissions('SECTION', $section_id !== null ? $section_id : ($this->arRootSection ? $this->arRootSection : 0));
         }
         if (is_array($arParentPerms)) {
             if (isset($arParentPerms['element_rights_edit'])) {
                 $perms = 'X';
             } elseif (isset($arParentPerms['element_edit_any_wf_status'])) {
                 $perms = 'W';
             } elseif (isset($arParentPerms['element_edit'])) {
                 $perms = 'U';
             } elseif (isset($arParentPerms['element_read'])) {
                 $perms = 'R';
             } else {
                 $perms = 'A';
             }
         }
     }
     if ($perms < "U") {
         $arFilter["ACTIVE"] = "Y";
         $arFilter["GLOBAL_ACTIVE"] = "Y";
         $arFilter["SHOW_HISTORY"] = "N";
         $arFilter["SHOW_NEW"] = "N";
         $arParams["COLUMNS"] = array_diff($arParams["COLUMNS"], array("ACTIVE", "GLOBAL_ACTIVE", "SORT", "CODE", "EXTERNAL_ID", "DATE_ACTIVE_FROM", "DATE_ACTIVE_TO"));
     }
     if ($perms < "W" && $this->workflow == "bizproc") {
         $arFilter["SHOW_BP_NEW"] = array("GROUPS" => $this->USER["GROUPS"], "MODULE_ID" => $this->wfParams["DOCUMENT_TYPE"][0], "ENTITY" => $this->wfParams["DOCUMENT_TYPE"][1], "PERMISSION" => "read", "USER_ID" => $GLOBALS["USER"]->GetID());
     }
     if ($element_id > 0 && $arParams["SHOW_VERSIONS"] == "Y") {
         $arFilter["SHOW_HISTORY"] = "Y";
         $arFilter["WF_PARENT_ELEMENT_ID"] = $element_id;
         if ($perms >= "U" && $perms < "W") {
             $arFilter["CHECK_BP_PERMISSIONS"] = $arFilter["SHOW_BP_NEW"];
         }
     } elseif ($element_id > 0) {
         $arFilter["ID"] = $element_id;
     }
     if ($this->arRootSection && $element_id <= 0) {
         if ($arFilter["SECTION_ID"] === null) {
             $arFilter["SECTION_ID"] = $this->arRootSection["ID"];
         }
         if (sizeof($arParams['FILTER']) > 0) {
             $arFilter["INCLUDE_SUBSECTIONS"] = "Y";
         }
         $arFilter["RIGHT_MARGIN"] = $this->arRootSection["RIGHT_MARGIN"];
         $arFilter["LEFT_MARGIN"] = $this->arRootSection["LEFT_MARGIN"];
     }
     if ($arFilter["SECTION_ID"] === null) {
         unset($arFilter["SECTION_ID"]);
     }
     if (isset($arParams["FILTER"]) && sizeof($arParams["FILTER"]) > 0) {
         if (isset($arParams["FILTER"]["timestamp_2"]) && strlen($arParams["FILTER"]["timestamp_2"]) > 0 && $arParams["FILTER"]["timestamp_datesel"] != "before") {
             $arParams["FILTER"]["timestamp_2"] .= " 23:59:59";
         }
         $arFilter = array_merge($arFilter, $arParams["FILTER"]);
     }
     if (isset($arFilter["NAME"]) && isset($arFilter["DESCRIPTION"])) {
         $arFilter[] = array("LOGIC" => "OR", "NAME" => $arFilter["NAME"], "DESCRIPTION" => $arFilter["DESCRIPTION"]);
         unset($arFilter["NAME"]);
         unset($arFilter["DESCRIPTION"]);
     }
     $arSelectedFields = $arParams["COLUMNS"];
     if (in_array("LOCKED_USER_NAME", $arSelectedFields)) {
         $arSelectedFields[] = "WF_LOCKED_BY";
     }
     if (in_array("USER_NAME", $arSelectedFields)) {
         $arSelectedFields[] = "MODIFIED_BY";
     }
     if (in_array("CREATED_USER_NAME", $arSelectedFields)) {
         $arSelectedFields[] = "CREATED_BY";
     }
     if (in_array("DETAIL_TEXT", $arSelectedFields)) {
         $arSelectedFields[] = "DETAIL_TEXT_TYPE";
     }
     $arSelectedFields = array_merge($arSelectedFields, array("ACTIVE", "CODE", "CREATED_BY", "DATE_CREATE", "DATE_CREATE_UNIX", "DESCRIPTION", "DETAIL_PAGE_URL", "EXTERNAL_ID", "IBLOCK_ID", "IBLOCK_CODE", "IBLOCK_SECTION_ID", "ID", "LANG_DIR", "XML_ID", "LID", "LOCKED_USER_NAME", "LOCK_STATUS", "MODIFIED_BY", "NAME", "PREVIEW_TEXT", "PREVIEW_TEXT_TYPE", "PROPERTY_FORUM_TOPIC_ID", "PROPERTY_" . $this->file_prop, "PROPERTY_WEBDAV_INFO", "PROPERTY_WEBDAV_SIZE", "SITE_ID", "TAGS", "TIMESTAMP_X", "TIMESTAMP_X_UNIX", "WF_DATE_LOCK", "WF_NEW", "WF_PARENT_ELEMENT_ID", "WF_STATUS_ID", "WF_LOCKED_BY"));
     if ($this->workflow == "bizproc") {
         $arSelectedFields[] = "BP_PUBLISHED";
         $arSelectedFields[] = "BIZPROC";
     } elseif ($this->workflow == 'workflow') {
         $arSelectedFields[] = "WF_COMMENTS";
     }
     $arSelectedFields = array_unique($arSelectedFields);
     $arSelectedFields = array_filter($arSelectedFields);
     $this->wfParams["selected_fields"] = $arSelectedFields;
     if ($element_id > 0) {
         $arElementResult = array();
         $arFilter["SHOW_HISTORY"] = "Y";
         $db_res = CIBlockElement::GetList(array(), $arFilter, false, false, $arSelectedFields);
         if ($db_res) {
             while ($arElement = $db_res->Fetch()) {
                 $arElement["TYPE"] = "E";
                 $arElement["FILE"] = CFile::GetFileArray($arElement["PROPERTY_" . $this->file_prop . "_VALUE"]);
                 $arElement["FILE"] = is_array($arElement["FILE"]) ? $arElement["FILE"] : array("FILE_SIZE" => 0, "CONTENT_TYPE" => "text/plain", "MTIME" => 0);
                 if ($this->e_rights) {
                     $arElement['E_RIGHTS'] = $this->GetPermission('ELEMENT', $arElement['ID']);
                 }
                 $arElementResult[] = $arElement;
             }
         }
         $db_res = new CDBResult();
         $db_res->InitFromArray($arElementResult);
     } else {
         $arOrder = array($by => $order);
         $arResult = array();
         if (!isset($arFilter["ID"])) {
             $arSectionFilter = array("IBLOCK_ID" => $arFilter["IBLOCK_ID"], "?NAME" => $arFilter["NAME"], "SECTION_ID" => $arFilter["SECTION_ID"], ">=ID" => $arFilter["ID_1"], "<=ID" => $arFilter["ID_2"], ">=TIMESTAMP_X" => $arFilter["TIMESTAMP_X_1"], "<=TIMESTAMP_X" => $arFilter["TIMESTAMP_X_2"], "MODIFIED_BY" => $arFilter["MODIFIED_USER_ID"] ? $arFilter["MODIFIED_USER_ID"] : $arFilter["MODIFIED_BY"], ">=DATE_CREATE" => $arFilter["DATE_CREATE_1"], "<=DATE_CREATE" => $arFilter["DATE_CREATE_2"], "CREATED_BY" => $arFilter["CREATED_USER_ID"] ? $arFilter["CREATED_USER_ID"] : $arFilter["CREATED_BY"], "ACTIVE" => $arFilter["ACTIVE"], "CHECK_PERMISSIONS" => "Y");
             if (isset($arFilter["content"])) {
                 $arSectionFilter["?NAME"] = $arFilter["content"];
             }
             $arSectionIDs = array();
             $excludeDropped = $excludeOldDropped = $excludeTrash = $excludeSectionMargin = array();
             if (!empty($arParams['NON_OLD_DROPPED_SECTION'])) {
                 if ($excludeId = $this->GetMetaID(self::OLD_DROPPED)) {
                     $excludeOldDropped = self::$_metaSectionData[$excludeId];
                     $excludeSectionMargin[] = array($excludeOldDropped['LEFT_MARGIN'], $excludeOldDropped['RIGHT_MARGIN']);
                 }
             }
             if (!empty($arParams['NON_DROPPED_SECTION'])) {
                 if ($excludeId = $this->GetMetaID(self::DROPPED, false)) {
                     $excludeDropped = self::$_metaSectionData[$excludeId];
                     $excludeSectionMargin[] = array($excludeDropped['LEFT_MARGIN'], $excludeDropped['RIGHT_MARGIN']);
                 }
             }
             if (!empty($arParams['NON_TRASH_SECTION'])) {
                 if ($excludeId = $this->GetMetaID(self::TRASH)) {
                     $excludeTrash = self::$_metaSectionData[$excludeId];
                     $excludeSectionMargin[] = array($excludeTrash['LEFT_MARGIN'], $excludeTrash['RIGHT_MARGIN']);
                 }
             }
             $obSection = new CIBlockSection();
             $rsSection = $obSection->GetList($arOrder, $arSectionFilter, false, array_merge($arSelectedFields, self::getUFNamesForSectionLink(), array('LEFT_MARGIN', 'RIGHT_MARGIN')));
             while ($arSection = $rsSection->Fetch()) {
                 if ($excludeOldDropped && $arSection['LEFT_MARGIN'] >= $excludeOldDropped['LEFT_MARGIN'] && $arSection['RIGHT_MARGIN'] <= $excludeOldDropped['RIGHT_MARGIN']) {
                     continue;
                 }
                 if ($excludeTrash && $arSection['LEFT_MARGIN'] >= $excludeTrash['LEFT_MARGIN'] && $arSection['RIGHT_MARGIN'] <= $excludeTrash['RIGHT_MARGIN']) {
                     continue;
                 }
                 if ($excludeDropped && $arSection['LEFT_MARGIN'] >= $excludeDropped['LEFT_MARGIN'] && $arSection['RIGHT_MARGIN'] <= $excludeDropped['RIGHT_MARGIN']) {
                     continue;
                 }
                 $arSection["TYPE"] = "S";
                 $arResult[] = $arSection;
                 if ($this->e_rights) {
                     $arSectionIDs[] = $arSection['ID'];
                 }
             }
             if ($this->e_rights) {
                 $arSectionRights = $this->GetPermissions('SECTION', $arSectionIDs);
                 $arSectionRules = $this->GetPermissionRules('SECTION', $arSectionIDs);
                 foreach ($arResult as $id => &$arSection) {
                     if ($arSection['XML_ID'] == 'SHARED_FOLDER' && !isset($arSectionRights[$arSection['ID']]['element_read'])) {
                         unset($arResult[$id]);
                         continue;
                     }
                     if (isset($arSectionRights[$arSection['ID']])) {
                         $arSection['E_RIGHTS'] = $arSectionRights[$arSection['ID']];
                     }
                     if (isset($arSectionRules[$arSection['ID']]) && $this->IsShared($arSectionRules[$arSection['ID']])) {
                         $arSection['SHARED'] = true;
                     }
                 }
                 unset($arSection);
             }
         }
         $arElementFilter = array("IBLOCK_ID" => $arFilter["IBLOCK_ID"], "?NAME" => $arFilter["NAME"], "SECTION_ID" => $arFilter["SECTION_ID"], "ID" => $arFilter["ID"], ">=ID" => $arFilter["ID_1"], "<=ID" => $arFilter["ID_2"], ">=TIMESTAMP_X" => $arFilter["TIMESTAMP_X_1"], "<=TIMESTAMP_X" => $arFilter["TIMESTAMP_X_2"], "EXTERNAL_ID" => $arFilter["EXTERNAL_ID"], "MODIFIED_USER_ID" => $arFilter["MODIFIED_USER_ID"], "MODIFIED_BY" => $arFilter["MODIFIED_BY"], ">=DATE_CREATE" => $arFilter["DATE_CREATE_1"], "<=DATE_CREATE" => $arFilter["DATE_CREATE_2"], "CREATED_BY" => $arFilter["CREATED_BY"], "CREATED_USER_ID" => $arFilter["CREATED_USER_ID"], ">=DATE_ACTIVE_FROM" => $arFilter["DATE_ACTIVE_FROM_1"], "<=DATE_ACTIVE_FROM" => $arFilter["DATE_ACTIVE_FROM_2"], ">=DATE_ACTIVE_TO" => $arFilter["DATE_ACTIVE_TO_1"], "<=DATE_ACTIVE_TO" => $arFilter["DATE_ACTIVE_TO_2"], "ACTIVE" => $arFilter["ACTIVE"], "?SEARCHABLE_CONTENT" => $arFilter["DESCRIPTION"], "?TAGS" => $arFilter["?TAGS"], "WF_STATUS" => $arFilter["WF_STATUS"], "WF_LOCK_STATUS" => $arFilter["WF_LOCK_STATUS"], "CHECK_PERMISSIONS" => "Y", "MIN_PERMISSION" => "R", "SHOW_NEW" => $arFilter["SHOW_NEW"] !== "N" ? "Y" : "N", "SHOW_HISTORY" => $arFilter["SHOW_HISTORY"] !== "Y" ? "N" : "Y", "SHOW_BP_NEW" => $arFilter["SHOW_BP_NEW"]);
         if ($arElementFilter["SHOW_HISTORY"] == "Y") {
             $arElementFilter["SHOW_NEW"] = "N";
         }
         $fltSizeFrom = isset($arParams["FILTER"]["FILE_SIZE_1"]) ? $arParams["FILTER"]["FILE_SIZE_1"] : null;
         $fltSizeTo = isset($arParams["FILTER"]["FILE_SIZE_2"]) ? $arParams["FILTER"]["FILE_SIZE_2"] : null;
         if (($fltSizeFrom !== null || $fltSizeTo !== null) && isset($arParams["FILTER"]["FILE_SIZE_multiply"]) && in_array($arParams["FILTER"]["FILE_SIZE_multiply"], array("b", "kb", "mb", "gb"))) {
             $multiply = 1;
             if ($arParams["FILTER"]["FILE_SIZE_multiply"] === "kb") {
                 $multiply = 1024;
             } elseif ($arParams["FILTER"]["FILE_SIZE_multiply"] === "mb") {
                 $multiply = 1024 * 1024;
             } elseif ($arParams["FILTER"]["FILE_SIZE_multiply"] === "gb") {
                 $multiply = 1024 * 1024 * 1024;
             }
             if ($fltSizeFrom !== null) {
                 $fltSizeFrom = $fltSizeFrom * $multiply;
                 $arElementFilter[">=PROPERTY_WEBDAV_SIZE"] = $fltSizeFrom;
             }
             if ($fltSizeTo !== null) {
                 $fltSizeTo = $fltSizeTo * $multiply;
                 $arElementFilter["<=PROPERTY_WEBDAV_SIZE"] = $fltSizeTo;
             }
         }
         if (isset($arFilter["timestamp_1"]) && isset($arFilter["timestamp_2"])) {
             $arElementFilter[] = array("LOGIC" => "OR", array("LOGIC" => "AND", ">=DATE_CREATE" => $arFilter["timestamp_1"], "<=DATE_CREATE" => $arFilter["timestamp_2"]), array("LOGIC" => "AND", ">=TIMESTAMP_X" => $arFilter["timestamp_1"], "<=TIMESTAMP_X" => $arFilter["timestamp_2"]));
             unset($arFilter["timestamp_1"]);
             unset($arFilter["timestamp_2"]);
         } elseif (isset($arFilter["timestamp_1"])) {
             $arElementFilter[] = array("LOGIC" => "OR", ">=DATE_CREATE" => $arFilter["timestamp_1"], ">=TIMESTAMP_X" => $arFilter["timestamp_1"]);
             unset($arFilter["timestamp_2"]);
         } elseif (isset($arFilter["timestamp_2"])) {
             $arElementFilter[] = array("LOGIC" => "OR", "<=DATE_CREATE" => $arFilter["timestamp_2"], "<=TIMESTAMP_X" => $arFilter["timestamp_2"]);
             unset($arFilter["timestamp_2"]);
         }
         if (isset($arFilter["user"])) {
             $arElementFilter[] = array("LOGIC" => "OR", "MODIFIED_BY" => $arFilter["user"], "CREATED_BY" => $arFilter["user"]);
             unset($arFilter["user"]);
         }
         if (strlen($arFilter["SECTION_ID"]) <= 0) {
             unset($arElementFilter["SECTION_ID"]);
         }
         if (!is_array($arSelectedFields)) {
             $arSelectedFields = array("*");
         } elseif (!in_array("PROPERTY_WEBDAV_SIZE", $arSelectedFields)) {
             $arSelectedFields[] = "PROPERTY_WEBDAV_SIZE";
         }
         if (isset($arFilter["INCLUDE_SUBSECTIONS"])) {
             $arElementFilter["INCLUDE_SUBSECTIONS"] = $arFilter["INCLUDE_SUBSECTIONS"];
         }
         if (isset($arFilter["CHECK_BP_PERMISSIONS"])) {
             $arElementFilter["CHECK_BP_PERMISSIONS"] = $arFilter["CHECK_BP_PERMISSIONS"];
         }
         if (!empty($excludeSectionMargin)) {
             $arElementFilter['!SUBSECTION'] = $excludeSectionMargin;
         }
         $arNavParams = isset($arParams["NAV_PARAMS"]) ? $arParams["NAV_PARAMS"] : false;
         $arElementIDs = array();
         $arElementResult = array();
         $obElement = new CIBlockElement();
         $rsElement = $obElement->GetList($arOrder, $arElementFilter, false, $arNavParams, $arSelectedFields);
         while ($arElement = $rsElement->Fetch()) {
             $arElement["TYPE"] = "E";
             $arElement["FILE"]["FILE_SIZE"] = $this->GetFileSize($arElement);
             //$arElement['ID']
             $arElementResult[] = $arElement;
             if ($this->e_rights) {
                 $arElementIDs[] = $arElement['ID'];
             }
         }
         if ($this->e_rights) {
             $arElementRights = $this->GetPermissions('ELEMENT', $arElementIDs);
             $arElementRules = $this->GetPermissionRules('ELEMENT', $arElementIDs);
             foreach ($arElementResult as $id => &$arElement) {
                 if (isset($arElementRights[$arElement['ID']])) {
                     $arElement['E_RIGHTS'] = $arElementRights[$arElement['ID']];
                 }
                 if (isset($arElementRules[$arElement['ID']]) && $this->IsShared($arElementRules[$arElement['ID']])) {
                     $arElement['SHARED'] = true;
                 }
             }
             unset($arElement);
         }
         $arResult = array_merge($arResult, $arElementResult);
         $db_res = new CDBResult();
         $db_res->InitFromArray($arResult);
     }
     return $db_res;
 }
コード例 #9
0
<?if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true)die();
/**
 * @var AqwCatalog $this
 */
InitSorting(SITE_DIR);

$this->init($_REQUEST['SECTION_ID']);
if(is_array($_SESSION["SESS_SORT_BY"]) && is_array($_SESSION["SESS_SORT_ORDER"])){
    $this->setOrder(array(reset($_SESSION["SESS_SORT_BY"]) => reset($_SESSION["SESS_SORT_ORDER"])));
}
$arResult['ITEMS'] = $this->getItems();
$arResult['COMPONENT'] = $this;
$this->IncludeComponentTemplate();
?>