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


PHP InitSorting函数代码示例

本文整理汇总了PHP中InitSorting函数的典型用法代码示例。如果您正苦于以下问题:PHP InitSorting函数的具体用法?PHP InitSorting怎么用?PHP InitSorting使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: __sort_array_folder

 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;
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:16,代码来源:disk_sections_tree.php

示例2: InitSorting

								$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/'))
		{
开发者ID:nProfessor,项目名称:Mytb,代码行数:31,代码来源:dump.php

示例3: intVal

				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());
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:component.php

示例4: trim

//*******************************************************************
$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();
}
开发者ID:rasuldev,项目名称:torino,代码行数:31,代码来源:component.php

示例5: Copyright

# 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";
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:form_result_list_xls.php

示例6: __sort_array_folder_and_file

 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;
         }
     }
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:27,代码来源:file.php

示例7: ShowError

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"]);
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:component.php

示例8: _get_mixed_list

 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"]);
//.........这里部分代码省略.........
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:101,代码来源:iblock.php

示例9: InitSorting

<?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();
?>
开发者ID:ASDAFF,项目名称:bitrix_marketplace_module,代码行数:14,代码来源:component.php


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