• Модуль: iblock
  • Путь к файлу: ~/bitrix/modules/iblock/classes/general/comp_parameters.php
  • Класс: CIBlockParameters
  • Вызов: CIBlockParameters::GetElementSortFields
static function GetElementSortFields($arFields = array(), $arOptions = array())
{
	$arResult = array();
	if (!is_array($arFields))
		$arFields = array($arFields);
	if (!is_array($arOptions))
		$arOptions = array();
	$boolLowerCase = (isset($arOptions['KEY_LOWERCASE']) && $arOptions['KEY_LOWERCASE'] == 'Y');
	$arSortFields = array(
		"SHOWS" => Loc::getMessage("IBLOCK_SORT_FIELD_SHOWS"),
		"SORT" => Loc::getMessage("IBLOCK_SORT_FIELD_SORT"),
		"TIMESTAMP_X" => Loc::getMessage("IBLOCK_SORT_FIELD_TIMESTAMP"),
		"NAME" => Loc::getMessage("IBLOCK_SORT_FIELD_NAME"),
		"ID" => Loc::getMessage("IBLOCK_SORT_FIELD_ID"),
		"ACTIVE_FROM" => Loc::getMessage("IBLOCK_SORT_FIELD_ACTIVE_FROM"),
		"ACTIVE_TO" => Loc::getMessage("IBLOCK_SORT_FIELD_ACTIVE_TO"),
	);
	if (!empty($arFields))
	{
		foreach ($arFields as $strFieldName)
		{
			if (isset($arSortFields[$strFieldName]))
				$arResult[$strFieldName] = $arSortFields[$strFieldName];
		}
		unset($strFieldName);
	}
	else
	{
		$arResult = $arSortFields;
	}
	if ($boolLowerCase)
		$arResult = array_change_key_case($arResult, CASE_LOWER);
	return $arResult;
}