本文整理汇总了PHP中CPageOption::GetOptionString方法的典型用法代码示例。如果您正苦于以下问题:PHP CPageOption::GetOptionString方法的具体用法?PHP CPageOption::GetOptionString怎么用?PHP CPageOption::GetOptionString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPageOption
的用法示例。
在下文中一共展示了CPageOption::GetOptionString方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetNavSize
function GetNavSize($table_id=false, $nPageSize=20)
{
/** @global CMain $APPLICATION */
global $APPLICATION;
$bSess = (CPageOption::GetOptionString("main", "nav_page_in_session", "Y")=="Y");
if(is_array($nPageSize))
$sNavID = $nPageSize["sNavID"];
$unique = md5((isset($sNavID)? $sNavID : $APPLICATION->GetCurPage()));
if(isset($_REQUEST["SIZEN_".($GLOBALS["NavNum"]+1)]))
{
$nSize = intval($_REQUEST["SIZEN_".($GLOBALS["NavNum"]+1)]);
if($bSess)
$_SESSION["NAV_PAGE_SIZE"][$unique] = $nSize;
}
elseif($bSess && isset($_SESSION["NAV_PAGE_SIZE"][$unique]))
{
$nSize = $_SESSION["NAV_PAGE_SIZE"][$unique];
}
else
{
$aOptions = array();
if($table_id)
$aOptions = CUserOptions::GetOption("list", $table_id);
if(intval($aOptions["page_size"]) > 0)
$nSize = intval($aOptions["page_size"]);
else
$nSize = (is_array($nPageSize)? $nPageSize["nPageSize"]:$nPageSize);
}
return $nSize;
}
示例2: elseif
<?php
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die;
}
/**
* Bitrix vars
*
* @var array $arParams
* @var array $arResult
* @var string $templateFolder
* @global CMain $APPLICATION
*/
CUtil::InitJSCore(array('window', 'ajax'));
$APPLICATION->AddHeadScript('/bitrix/js/main/utils.js');
$APPLICATION->AddHeadScript('/bitrix/js/main/popup_menu.js');
$APPLICATION->AddHeadScript('/bitrix/js/main/dd.js');
$APPLICATION->SetAdditionalCSS('/bitrix/themes/.default/pubstyles.css');
$theme = '';
if (isset($arResult["OPTIONS"])) {
$theme = $arResult["OPTIONS"]["theme"];
} elseif (CPageOption::GetOptionString("main.interface", "use_themes", "Y") !== "N") {
$theme = CGridOptions::GetTheme($arParams["GRID_ID"]);
}
if ($theme != '') {
$APPLICATION->SetAdditionalCSS($templateFolder . '/themes/' . $theme . '/style.css');
}
$currentBodyClass = $APPLICATION->GetPageProperty("BodyClass", false);
$APPLICATION->SetPageProperty("BodyClass", ($currentBodyClass ? $currentBodyClass . " " : "") . "flexible-layout");
示例3: NavStart
/**
* <p>Метод разбивает результат выборки на страницы.</p> <p> Для встраивания системы автоматической постраничной навигации необходимо сначала вызвать данный метод <a href="http://dev.1c-bitrix.ru/api_help/main/reference/cdbresult/navstart.php">CDBResult::NavStart</a>. После ее вызова, методы </p> <ul> <li> <a href="http://dev.1c-bitrix.ru/api_help/main/reference/cdbresult/fetch.php">CDBResult::Fetch</a> </li> <li> <a href="http://dev.1c-bitrix.ru/api_help/main/reference/cdbresult/getnext.php">CDBResult::GetNext</a> </li> <li> <a href="http://dev.1c-bitrix.ru/api_help/main/reference/cdbresult/extractfields.php">CDBResult::ExtractFields</a> </li> <li> <a href="http://dev.1c-bitrix.ru/api_help/main/reference/cdbresult/navnext.php">CDBResult::NavNext</a> </li> </ul> будут ограничены только текущей страницей (а не всей выборкой). Для вывода ссылок постраничной навигации необходимо воспользоваться методом <a href="http://dev.1c-bitrix.ru/api_help/main/reference/cdbresult/navprint.php">CDBResult::NavPrint</a>. <p> Динамичный метод.</p>
*
*
* @param int $page_size = 10 Размер страницы (от 1 и более). Необязательный. По умолчанию 10.
*
* @param bool $show_all = true Разрешить показывать все записи (и выводить ссылку "Все" в
* навигации).<br>Необязательный. По умолчанию - "true".
*
* @return mixed
*
* <h4>Example</h4>
* <pre>
* <?
* $rsBanners = CAdvBanner::GetList($by, $order, $arFilter, $is_filtered);
* <b>$rsBanners->NavStart(20)</b>;
* echo $rsBanners->NavPrint("Баннеры");
* while($rsBanners->NavNext(true, "f_")):
* echo "[".$f_ID."] ".$f_NAME."<br>";
* endwhile;
* echo $rsBanners->NavPrint("Баннеры");
* ?>
* </pre>
*
*
* <h4>See Also</h4>
* <ul> <li> <a href="http://dev.1c-bitrix.ru/api_help/main/reference/cdbresult/navnext.php">CDBResult::NavNext</a> </li>
* <li> <a href="http://dev.1c-bitrix.ru/api_help/main/reference/cdbresult/navprint.php">CDBResult::NavPrint</a> </li> <li>
* <a href="http://dev.1c-bitrix.ru/api_help/main/reference/cdbresult/isnavprint.php">CDBResult::IsNavPrint</a> </li> <li>
* <a href="http://dev.1c-bitrix.ru/api_help/main/reference/cdbresult/fetch.php">CDBResult::Fetch</a> </li> <li> <a
* href="http://dev.1c-bitrix.ru/api_help/main/reference/cdbresult/getnext.php">CDBResult::GetNext</a> </li> <li> <a
* href="http://dev.1c-bitrix.ru/api_help/main/reference/cdbresult/extractfields.php">CDBResult::ExtractFields</a> </li>
* </ul><a name="examples"></a>
*
*
* @static
* @link http://dev.1c-bitrix.ru/api_help/main/reference/cdbresult/navstart.php
* @author Bitrix
*/
public function NavStart($nPageSize = 0, $bShowAll = true, $iNumPage = false)
{
if ($this->bFromLimited) {
return;
}
if (is_array($nPageSize)) {
$this->InitNavStartVars($nPageSize);
} else {
$this->InitNavStartVars(intval($nPageSize), $bShowAll, $iNumPage);
}
if ($this->bFromArray) {
$this->NavRecordCount = count($this->arResult);
if ($this->NavRecordCount < 1) {
return;
}
if ($this->NavShowAll) {
$this->NavPageSize = $this->NavRecordCount;
}
$this->NavPageCount = floor($this->NavRecordCount / $this->NavPageSize);
if ($this->NavRecordCount % $this->NavPageSize > 0) {
$this->NavPageCount++;
}
$this->NavPageNomer = $this->PAGEN < 1 || $this->PAGEN > $this->NavPageCount ? CPageOption::GetOptionString("main", "nav_page_in_session", "Y") != "Y" || $_SESSION[$this->SESS_PAGEN] < 1 || $_SESSION[$this->SESS_PAGEN] > $this->NavPageCount ? 1 : $_SESSION[$this->SESS_PAGEN] : $this->PAGEN;
$NavFirstRecordShow = $this->NavPageSize * ($this->NavPageNomer - 1);
$NavLastRecordShow = $this->NavPageSize * $this->NavPageNomer;
$this->arResult = array_slice($this->arResult, $NavFirstRecordShow, $NavLastRecordShow - $NavFirstRecordShow);
} else {
$this->DBNavStart();
}
}
示例4: GetList
function GetList($arOrder = array("SORT" => "ASC"), $arFilter = array(), $arGroupBy = false, $arNavStartParams = false, $arSelectFields = array())
{
/*
Filter combinations:
CHECK_PERMISSIONS="N" - check permissions of the current user to the infoblock
MIN_PERMISSION="R" - when permissions check, then minimal access level
SHOW_HISTORY="N" - add history items to list
SHOW_NEW="N" - if not add history items, then add new, but not published elements
*/
global $DB, $USER, $APPLICATION;
$MAX_LOCK = intval(COption::GetOptionString("workflow", "MAX_LOCK_TIME", "60"));
$uid = is_object($USER) ? intval($USER->GetID()) : 0;
$arIblockElementFields = array("ID" => "BE.ID", "TIMESTAMP_X" => $DB->DateToCharFunction("BE.TIMESTAMP_X"), "TIMESTAMP_X_UNIX" => 'UNIX_TIMESTAMP(BE.TIMESTAMP_X)', "MODIFIED_BY" => "BE.MODIFIED_BY", "DATE_CREATE" => $DB->DateToCharFunction("BE.DATE_CREATE"), "DATE_CREATE_UNIX" => 'UNIX_TIMESTAMP(BE.DATE_CREATE)', "CREATED_BY" => "BE.CREATED_BY", "IBLOCK_ID" => "BE.IBLOCK_ID", "IBLOCK_SECTION_ID" => "BE.IBLOCK_SECTION_ID", "ACTIVE" => "BE.ACTIVE", "ACTIVE_FROM" => CPageOption::GetOptionString("iblock", "FORMAT_ACTIVE_DATES", "-") != "-" ? $DB->DateToCharFunction("BE.ACTIVE_FROM", CPageOption::GetOptionString("iblock", "FORMAT_ACTIVE_DATES", "SHORT")) : "IF(EXTRACT(HOUR_SECOND FROM BE.ACTIVE_FROM)>0, " . $DB->DateToCharFunction("BE.ACTIVE_FROM", "FULL") . ", " . $DB->DateToCharFunction("BE.ACTIVE_FROM", "SHORT") . ")", "ACTIVE_TO" => CPageOption::GetOptionString("iblock", "FORMAT_ACTIVE_DATES", "-") != "-" ? $DB->DateToCharFunction("BE.ACTIVE_TO", CPageOption::GetOptionString("iblock", "FORMAT_ACTIVE_DATES", "SHORT")) : "IF(EXTRACT(HOUR_SECOND FROM BE.ACTIVE_TO)>0, " . $DB->DateToCharFunction("BE.ACTIVE_TO", "FULL") . ", " . $DB->DateToCharFunction("BE.ACTIVE_TO", "SHORT") . ")", "DATE_ACTIVE_FROM" => CPageOption::GetOptionString("iblock", "FORMAT_ACTIVE_DATES", "-") != "-" ? $DB->DateToCharFunction("BE.ACTIVE_FROM", CPageOption::GetOptionString("iblock", "FORMAT_ACTIVE_DATES", "SHORT")) : "IF(EXTRACT(HOUR_SECOND FROM BE.ACTIVE_FROM)>0, " . $DB->DateToCharFunction("BE.ACTIVE_FROM", "FULL") . ", " . $DB->DateToCharFunction("BE.ACTIVE_FROM", "SHORT") . ")", "DATE_ACTIVE_TO" => CPageOption::GetOptionString("iblock", "FORMAT_ACTIVE_DATES", "-") != "-" ? $DB->DateToCharFunction("BE.ACTIVE_TO", CPageOption::GetOptionString("iblock", "FORMAT_ACTIVE_DATES", "SHORT")) : "IF(EXTRACT(HOUR_SECOND FROM BE.ACTIVE_TO)>0, " . $DB->DateToCharFunction("BE.ACTIVE_TO", "FULL") . ", " . $DB->DateToCharFunction("BE.ACTIVE_TO", "SHORT") . ")", "SORT" => "BE.SORT", "NAME" => "BE.NAME", "PREVIEW_PICTURE" => "BE.PREVIEW_PICTURE", "PREVIEW_TEXT" => "BE.PREVIEW_TEXT", "PREVIEW_TEXT_TYPE" => "BE.PREVIEW_TEXT_TYPE", "DETAIL_PICTURE" => "BE.DETAIL_PICTURE", "DETAIL_TEXT" => "BE.DETAIL_TEXT", "DETAIL_TEXT_TYPE" => "BE.DETAIL_TEXT_TYPE", "SEARCHABLE_CONTENT" => "BE.SEARCHABLE_CONTENT", "WF_STATUS_ID" => "BE.WF_STATUS_ID", "WF_PARENT_ELEMENT_ID" => "BE.WF_PARENT_ELEMENT_ID", "WF_LAST_HISTORY_ID" => "BE.WF_LAST_HISTORY_ID", "WF_NEW" => "BE.WF_NEW", "LOCK_STATUS" => "if (BE.WF_DATE_LOCK is null, 'green', if(DATE_ADD(BE.WF_DATE_LOCK, interval " . $MAX_LOCK . " MINUTE)<now(), 'green', if(BE.WF_LOCKED_BY=" . $uid . ", 'yellow', 'red')))", "WF_LOCKED_BY" => "BE.WF_LOCKED_BY", "WF_DATE_LOCK" => $DB->DateToCharFunction("BE.WF_DATE_LOCK"), "WF_COMMENTS" => "BE.WF_COMMENTS", "IN_SECTIONS" => "BE.IN_SECTIONS", "SHOW_COUNTER" => "BE.SHOW_COUNTER", "SHOW_COUNTER_START" => "BE.SHOW_COUNTER_START", "CODE" => "BE.CODE", "TAGS" => "BE.TAGS", "XML_ID" => "BE.XML_ID", "EXTERNAL_ID" => "BE.XML_ID", "TMP_ID" => "BE.TMP_ID", "USER_NAME" => "concat('(',U.LOGIN,') ',ifnull(U.NAME,''),' ',ifnull(U.LAST_NAME,''))", "LOCKED_USER_NAME" => "concat('(',UL.LOGIN,') ',ifnull(UL.NAME,''),' ',ifnull(UL.LAST_NAME,''))", "CREATED_USER_NAME" => "concat('(',UC.LOGIN,') ',ifnull(UC.NAME,''),' ',ifnull(UC.LAST_NAME,''))", "LANG_DIR" => "L.DIR", "LID" => "B.LID", "IBLOCK_TYPE_ID" => "B.IBLOCK_TYPE_ID", "IBLOCK_CODE" => "B.CODE", "IBLOCK_NAME" => "B.NAME", "IBLOCK_EXTERNAL_ID" => "B.XML_ID", "DETAIL_PAGE_URL" => "B.DETAIL_PAGE_URL", "LIST_PAGE_URL" => "B.LIST_PAGE_URL", "CREATED_DATE" => $DB->DateFormatToDB("YYYY.MM.DD", "BE.DATE_CREATE"), "BP_PUBLISHED" => "if(BE.WF_STATUS_ID = 1, 'Y', 'N')");
$bDistinct = false;
CIBlockElement::PrepareGetList($arIblockElementFields, $arJoinProps, $bOnlyCount, $bDistinct, $arSelectFields, $sSelect, $arAddSelectFields, $arFilter, $sWhere, $sSectionWhere, $arAddWhereFields, $arGroupBy, $sGroupBy, $arOrder, $arSqlOrder, $arAddOrderByFields, $arIBlockFilter, $arIBlockMultProps, $arIBlockConvProps, $arIBlockAllProps, $arIBlockNumProps, $arIBlockLongProps);
$arFilterIBlocks = isset($arFilter["IBLOCK_ID"]) ? array($arFilter["IBLOCK_ID"]) : array();
//******************FROM PART********************************************
$sFrom = "";
foreach ($arJoinProps["FPS"] as $iblock_id => $iPropCnt) {
$sFrom .= "\t\t\tINNER JOIN b_iblock_element_prop_s" . $iblock_id . " FPS" . $iPropCnt . " ON FPS" . $iPropCnt . ".IBLOCK_ELEMENT_ID = BE.ID\n";
$arFilterIBlocks[$iblock_id] = $iblock_id;
}
foreach ($arJoinProps["FP"] as $propID => $db_prop) {
$i = $db_prop["CNT"];
if ($db_prop["bFullJoin"]) {
$sFrom .= "\t\t\tINNER JOIN b_iblock_property FP" . $i . " ON FP" . $i . ".IBLOCK_ID = B.ID AND " . (IntVal($propID) > 0 ? " FP" . $i . ".ID=" . IntVal($propID) . "\n" : " FP" . $i . ".CODE='" . $DB->ForSQL($propID, 200) . "'\n");
} else {
$sFrom .= "\t\t\tLEFT JOIN b_iblock_property FP" . $i . " ON FP" . $i . ".IBLOCK_ID = B.ID AND " . (IntVal($propID) > 0 ? " FP" . $i . ".ID=" . IntVal($propID) . "\n" : " FP" . $i . ".CODE='" . $DB->ForSQL($propID, 200) . "'\n");
}
if ($db_prop["IBLOCK_ID"]) {
$arFilterIBlocks[$db_prop["IBLOCK_ID"]] = $db_prop["IBLOCK_ID"];
}
}
foreach ($arJoinProps["FPV"] as $propID => $db_prop) {
$i = $db_prop["CNT"];
if ($db_prop["MULTIPLE"] == "Y") {
$bDistinct = true;
}
if ($db_prop["VERSION"] == 2) {
$strTable = "b_iblock_element_prop_m" . $db_prop["IBLOCK_ID"];
} else {
$strTable = "b_iblock_element_property";
}
if ($db_prop["bFullJoin"]) {
$sFrom .= "\t\t\tINNER JOIN " . $strTable . " FPV" . $i . " ON FPV" . $i . ".IBLOCK_PROPERTY_ID = FP" . $db_prop["JOIN"] . ".ID AND FPV" . $i . ".IBLOCK_ELEMENT_ID = BE.ID\n";
} else {
$sFrom .= "\t\t\tLEFT JOIN " . $strTable . " FPV" . $i . " ON FPV" . $i . ".IBLOCK_PROPERTY_ID = FP" . $db_prop["JOIN"] . ".ID AND FPV" . $i . ".IBLOCK_ELEMENT_ID = BE.ID\n";
}
if ($db_prop["IBLOCK_ID"]) {
$arFilterIBlocks[$db_prop["IBLOCK_ID"]] = $db_prop["IBLOCK_ID"];
}
}
foreach ($arJoinProps["FPEN"] as $propID => $db_prop) {
$i = $db_prop["CNT"];
if ($db_prop["VERSION"] == 2 && $db_prop["MULTIPLE"] == "N") {
if ($db_prop["bFullJoin"]) {
$sFrom .= "\t\t\tINNER JOIN b_iblock_property_enum FPEN" . $i . " ON FPEN" . $i . ".PROPERTY_ID = " . $db_prop["ORIG_ID"] . " AND FPS" . $db_prop["JOIN"] . ".PROPERTY_" . $db_prop["ORIG_ID"] . " = FPEN" . $i . ".ID\n";
} else {
$sFrom .= "\t\t\tLEFT JOIN b_iblock_property_enum FPEN" . $i . " ON FPEN" . $i . ".PROPERTY_ID = " . $db_prop["ORIG_ID"] . " AND FPS" . $db_prop["JOIN"] . ".PROPERTY_" . $db_prop["ORIG_ID"] . " = FPEN" . $i . ".ID\n";
}
} else {
if ($db_prop["bFullJoin"]) {
$sFrom .= "\t\t\tINNER JOIN b_iblock_property_enum FPEN" . $i . " ON FPEN" . $i . ".PROPERTY_ID = FPV" . $db_prop["JOIN"] . ".IBLOCK_PROPERTY_ID AND FPV" . $db_prop["JOIN"] . ".VALUE_ENUM = FPEN" . $i . ".ID\n";
} else {
$sFrom .= "\t\t\tLEFT JOIN b_iblock_property_enum FPEN" . $i . " ON FPEN" . $i . ".PROPERTY_ID = FPV" . $db_prop["JOIN"] . ".IBLOCK_PROPERTY_ID AND FPV" . $db_prop["JOIN"] . ".VALUE_ENUM = FPEN" . $i . ".ID\n";
}
}
if ($db_prop["IBLOCK_ID"]) {
$arFilterIBlocks[$db_prop["IBLOCK_ID"]] = $db_prop["IBLOCK_ID"];
}
}
foreach ($arJoinProps["BE"] as $propID => $db_prop) {
$i = $db_prop["CNT"];
$sFrom .= "\t\t\tLEFT JOIN b_iblock_element BE" . $i . " ON BE" . $i . ".ID = " . ($db_prop["VERSION"] == 2 && $db_prop["MULTIPLE"] == "N" ? "FPS" . $db_prop["JOIN"] . ".PROPERTY_" . $db_prop["ORIG_ID"] : "FPV" . $db_prop["JOIN"] . ".VALUE_NUM") . ($arFilter["SHOW_HISTORY"] != "Y" ? " AND ((BE.WF_STATUS_ID=1 AND BE.WF_PARENT_ELEMENT_ID IS NULL)" . ($arFilter["SHOW_NEW"] == "Y" ? " OR BE.WF_NEW='Y'" : "") . ")" : "") . "\n";
if ($db_prop["bJoinIBlock"]) {
$sFrom .= "\t\t\tLEFT JOIN b_iblock B" . $i . " ON B" . $i . ".ID = BE" . $i . ".IBLOCK_ID\n";
}
if ($db_prop["bJoinSection"]) {
$sFrom .= "\t\t\tLEFT JOIN b_iblock_section BS" . $i . " ON BS" . $i . ".ID = BE" . $i . ".IBLOCK_SECTION_ID\n";
}
if ($db_prop["IBLOCK_ID"]) {
$arFilterIBlocks[$db_prop["IBLOCK_ID"]] = $db_prop["IBLOCK_ID"];
}
}
foreach ($arJoinProps["BE_FPS"] as $iblock_id => $db_prop) {
$sFrom .= "\t\t\tLEFT JOIN b_iblock_element_prop_s" . $iblock_id . " JFPS" . $db_prop["CNT"] . " ON JFPS" . $db_prop["CNT"] . ".IBLOCK_ELEMENT_ID = BE" . $db_prop["JOIN"] . ".ID\n";
if ($db_prop["IBLOCK_ID"]) {
$arFilterIBlocks[$db_prop["IBLOCK_ID"]] = $db_prop["IBLOCK_ID"];
}
}
foreach ($arJoinProps["BE_FP"] as $propID => $db_prop) {
$i = $db_prop["CNT"];
list($propID, $link) = explode("~", $propID, 2);
if ($db_prop["bFullJoin"]) {
$sFrom .= "\t\t\tINNER JOIN b_iblock_property JFP" . $i . " ON JFP" . $i . ".IBLOCK_ID = BE" . $db_prop["JOIN"] . ".IBLOCK_ID AND " . (IntVal($propID) > 0 ? " JFP" . $i . ".ID=" . IntVal($propID) . "\n" : " JFP" . $i . ".CODE='" . $DB->ForSQL($propID, 200) . "'\n");
} else {
$sFrom .= "\t\t\tLEFT JOIN b_iblock_property JFP" . $i . " ON JFP" . $i . ".IBLOCK_ID = BE" . $db_prop["JOIN"] . ".IBLOCK_ID AND " . (IntVal($propID) > 0 ? " JFP" . $i . ".ID=" . IntVal($propID) . "\n" : " JFP" . $i . ".CODE='" . $DB->ForSQL($propID, 200) . "'\n");
}
if ($db_prop["IBLOCK_ID"]) {
$arFilterIBlocks[$db_prop["IBLOCK_ID"]] = $db_prop["IBLOCK_ID"];
//.........这里部分代码省略.........
示例5: GetComponentProps
/**
* @param string $componentName
* @param array $arCurrentValues Don't change the name! It's used in the .parameters.php file.
* @param array $templateProperties
* @return array|bool
*/
public static function GetComponentProps($componentName, $arCurrentValues = array(), $templateProperties = array())
{
$arComponentParameters = array();
$componentName = trim($componentName);
if (strlen($componentName) <= 0) {
return false;
}
$path2Comp = CComponentEngine::MakeComponentPath($componentName);
if (strlen($path2Comp) <= 0) {
return false;
}
$componentPath = getLocalPath("components" . $path2Comp);
if (!CComponentUtil::isComponent($componentPath)) {
return false;
}
if (file_exists($_SERVER["DOCUMENT_ROOT"] . $componentPath . "/.parameters.php")) {
CComponentUtil::__IncludeLang($componentPath, ".parameters.php");
include $_SERVER["DOCUMENT_ROOT"] . $componentPath . "/.parameters.php";
}
if ($templateProperties && is_array($templateProperties)) {
if (is_array($arComponentParameters["PARAMETERS"])) {
$arComponentParameters["PARAMETERS"] = array_merge($arComponentParameters["PARAMETERS"], $templateProperties);
} else {
$arComponentParameters["PARAMETERS"] = $templateProperties;
}
}
if (!array_key_exists("PARAMETERS", $arComponentParameters) || !is_array($arComponentParameters["PARAMETERS"])) {
return false;
}
if (!array_key_exists("GROUPS", $arComponentParameters) || !is_array($arComponentParameters["GROUPS"])) {
$arComponentParameters["GROUPS"] = array();
}
$arParamKeys = array_keys($arComponentParameters["GROUPS"]);
for ($i = 0, $cnt = count($arParamKeys); $i < $cnt; $i++) {
if (!isset($arComponentParameters["GROUPS"][$arParamKeys[$i]]["SORT"])) {
$arComponentParameters["GROUPS"][$arParamKeys[$i]]["SORT"] = 1000 + $i;
}
$arComponentParameters["GROUPS"][$arParamKeys[$i]]["SORT"] = IntVal($arComponentParameters["GROUPS"][$arParamKeys[$i]]["SORT"]);
if ($arComponentParameters["GROUPS"][$arParamKeys[$i]]["SORT"] <= 0) {
$arComponentParameters["GROUPS"][$arParamKeys[$i]]["SORT"] = 1000 + $i;
}
}
$arParamKeys = array_keys($arComponentParameters["PARAMETERS"]);
for ($i = 0, $cnt = count($arParamKeys); $i < $cnt; $i++) {
if ($arParamKeys[$i] == "SET_TITLE") {
$arComponentParameters["GROUPS"]["ADDITIONAL_SETTINGS"] = array("NAME" => GetMessage("COMP_GROUP_ADDITIONAL_SETTINGS"), "SORT" => 700);
$arComponentParameters["PARAMETERS"]["SET_TITLE"] = array("PARENT" => "ADDITIONAL_SETTINGS", "NAME" => GetMessage("COMP_PROP_SET_TITLE"), "TYPE" => "CHECKBOX", "DEFAULT" => "Y", "ADDITIONAL_VALUES" => "N");
} elseif ($arParamKeys[$i] == "CACHE_TIME") {
$arComponentParameters["GROUPS"]["CACHE_SETTINGS"] = array("NAME" => GetMessage("COMP_GROUP_CACHE_SETTINGS"), "SORT" => 600);
$arSavedParams = $arComponentParameters["PARAMETERS"];
$arComponentParameters["PARAMETERS"] = array();
foreach ($arSavedParams as $keyTmp => $valueTmp) {
if ($keyTmp == "CACHE_TIME") {
$arComponentParameters["PARAMETERS"]["CACHE_TYPE"] = array("PARENT" => "CACHE_SETTINGS", "NAME" => GetMessage("COMP_PROP_CACHE_TYPE"), "TYPE" => "LIST", "VALUES" => array("A" => GetMessage("COMP_PROP_CACHE_TYPE_AUTO") . " " . GetMessage("COMP_PARAM_CACHE_MAN"), "Y" => GetMessage("COMP_PROP_CACHE_TYPE_YES"), "N" => GetMessage("COMP_PROP_CACHE_TYPE_NO")), "DEFAULT" => "A", "ADDITIONAL_VALUES" => "N");
$arComponentParameters["PARAMETERS"]["CACHE_TIME"] = array("PARENT" => "CACHE_SETTINGS", "NAME" => GetMessage("COMP_PROP_CACHE_TIME"), "TYPE" => "STRING", "MULTIPLE" => "N", "DEFAULT" => IntVal($arSavedParams["CACHE_TIME"]["DEFAULT"]), "COLS" => 5);
$arComponentParameters["PARAMETERS"]["CACHE_NOTES"] = array("PARENT" => "CACHE_SETTINGS", "TYPE" => "CUSTOM", "JS_FILE" => "/bitrix/js/main/comp_props.js", "JS_EVENT" => "BxShowComponentNotes", "JS_DATA" => GetMessage("COMP_PROP_CACHE_NOTE", array("#LANG#" => LANGUAGE_ID, "#AUTO_MODE#" => COption::GetOptionString("main", "component_cache_on", "Y") == "Y" ? GetMessage("COMP_PARAM_CACHE_AUTO_ON") : GetMessage("COMP_PARAM_CACHE_AUTO_OFF"), "#MANAGED_MODE#" => defined("BX_COMP_MANAGED_CACHE") ? GetMessage("COMP_PARAM_CACHE_MANAGED_ON") : GetMessage("COMP_PARAM_CACHE_MANAGED_OFF"))));
} else {
$arComponentParameters["PARAMETERS"][$keyTmp] = $valueTmp;
}
}
} elseif ($arParamKeys[$i] == "SEF_MODE") {
$arComponentParameters["GROUPS"]["SEF_MODE"] = array("NAME" => GetMessage("COMP_GROUP_SEF_MODE"), "SORT" => 500);
$arSEFModeSettings = $arComponentParameters["PARAMETERS"]["SEF_MODE"];
$arComponentParameters["PARAMETERS"]["SEF_MODE"] = array("PARENT" => "SEF_MODE", "NAME" => GetMessage("COMP_PROP_SEF_MODE"), "TYPE" => "CHECKBOX", "DEFAULT" => "N", "ADDITIONAL_VALUES" => "N");
$arComponentParameters["PARAMETERS"]["SEF_FOLDER"] = array("PARENT" => "SEF_MODE", "NAME" => GetMessage("COMP_PROP_SEF_FOLDER"), "TYPE" => "STRING", "MULTIPLE" => "N", "DEFAULT" => "", "COLS" => 30);
if (is_array($arSEFModeSettings) && count($arSEFModeSettings) > 0) {
foreach ($arSEFModeSettings as $templateKey => $arTemplateValue) {
$arComponentParameters["PARAMETERS"]["SEF_URL_TEMPLATES_" . $templateKey] = array("PARENT" => "SEF_MODE", "NAME" => $arTemplateValue["NAME"], "TYPE" => "STRING", "MULTIPLE" => "N", "DEFAULT" => $arTemplateValue["DEFAULT"], "HIDDEN" => $arTemplateValue["HIDDEN"], "COLS" => 50, "VARIABLES" => array());
$arVariableAliasesSettings = $arComponentParameters["PARAMETERS"]["VARIABLE_ALIASES"];
if (is_array($arVariableAliasesSettings) && count($arVariableAliasesSettings) > 0) {
foreach ($arTemplateValue["VARIABLES"] as $variable) {
$arComponentParameters["PARAMETERS"]["SEF_URL_TEMPLATES_" . $templateKey]["VARIABLES"]["#" . $variable . "#"] = $arVariableAliasesSettings[$variable]["NAME"];
}
}
}
}
} elseif ($arParamKeys[$i] == "VARIABLE_ALIASES") {
$arComponentParameters["GROUPS"]["SEF_MODE"] = array("NAME" => GetMessage("COMP_GROUP_SEF_MODE"), "SORT" => 500);
$arVariableAliasesSettings = $arComponentParameters["PARAMETERS"]["VARIABLE_ALIASES"];
unset($arComponentParameters["PARAMETERS"]["VARIABLE_ALIASES"]);
foreach ($arVariableAliasesSettings as $aliaseKey => $arAliaseValue) {
$arComponentParameters["PARAMETERS"]["VARIABLE_ALIASES_" . $aliaseKey] = array("PARENT" => "SEF_MODE", "NAME" => $arAliaseValue["NAME"], "TYPE" => "STRING", "MULTIPLE" => "N", "DEFAULT" => $aliaseKey, "COLS" => 20);
}
} elseif (isset($arComponentParameters["PARAMETERS"][$arParamKeys[$i]]["PARENT"]) && strlen($arComponentParameters["PARAMETERS"][$arParamKeys[$i]]["PARENT"]) > 0) {
if ($arComponentParameters["PARAMETERS"][$arParamKeys[$i]]["PARENT"] == "URL_TEMPLATES") {
$arComponentParameters["GROUPS"]["URL_TEMPLATES"] = array("NAME" => GetMessage("COMP_GROUP_URL_TEMPLATES"), "SORT" => 400);
} elseif ($arComponentParameters["PARAMETERS"][$arParamKeys[$i]]["PARENT"] == "VISUAL") {
$arComponentParameters["GROUPS"]["VISUAL"] = array("NAME" => GetMessage("COMP_GROUP_VISUAL"), "SORT" => 300);
} elseif ($arComponentParameters["PARAMETERS"][$arParamKeys[$i]]["PARENT"] == "DATA_SOURCE") {
$arComponentParameters["GROUPS"]["DATA_SOURCE"] = array("NAME" => GetMessage("COMP_GROUP_DATA_SOURCE"), "SORT" => 200);
} elseif ($arComponentParameters["PARAMETERS"][$arParamKeys[$i]]["PARENT"] == "BASE") {
$arComponentParameters["GROUPS"]["BASE"] = array("NAME" => GetMessage("COMP_GROUP_BASE"), "SORT" => 100);
} elseif ($arComponentParameters["PARAMETERS"][$arParamKeys[$i]]["PARENT"] == "ADDITIONAL_SETTINGS") {
$arComponentParameters["GROUPS"]["ADDITIONAL_SETTINGS"] = array("NAME" => GetMessage("COMP_GROUP_ADDITIONAL_SETTINGS"), "SORT" => 700);
//.........这里部分代码省略.........
示例6: array
if ($arParams["CAN_EXPAND_TABS"] !== 'N' && $arParams["CAN_EXPAND_TABS"] !== false) {
$arParams["CAN_EXPAND_TABS"] = true;
} else {
$arParams["CAN_EXPAND_TABS"] = false;
}
if ($arParams["SHOW_FORM_TAG"] !== 'N' && $arParams["SHOW_FORM_TAG"] !== false) {
$arParams["SHOW_FORM_TAG"] = true;
} else {
$arParams["SHOW_FORM_TAG"] = false;
}
if ($arParams["SHOW_SETTINGS"] !== 'N' && $arParams["SHOW_SETTINGS"] !== false) {
$arParams["SHOW_SETTINGS"] = true;
} else {
$arParams["SHOW_SETTINGS"] = false;
}
if ($arParams["USE_THEMES"] !== 'N' && $arParams["USE_THEMES"] !== false && CPageOption::GetOptionString("main.interface", "use_themes", "Y") !== "N") {
$arParams["USE_THEMES"] = true;
} else {
$arParams["USE_THEMES"] = false;
}
if ($arParams["MAX_FILE_SIZE"] == '') {
$arParams["MAX_FILE_SIZE"] = 102400;
}
$arParams["FORM_ID"] = preg_replace("/[^a-z0-9_]/i", "", $arParams["FORM_ID"]);
//*********************
//get saved options
//*********************
$aOptions = CUserOptions::GetOption("main.interface.form", $arParams["FORM_ID"], array());
if (!is_array($aOptions["tabs"])) {
$aOptions["tabs"] = array();
}
示例7: array
$dbresult->NavPageSize = 10;
}
$arResult = array();
$arResult["NavShowAlways"] = $arParams["SHOW_ALWAYS"];
$arResult["NavTitle"] = $arParams["NAV_TITLE"];
$arResult["NavRecordCount"] = $dbresult->NavRecordCount;
$arResult["NavPageCount"] = $dbresult->NavPageCount;
$arResult["NavPageNomer"] = $dbresult->NavPageNomer;
$arResult["NavPageSize"] = $dbresult->NavPageSize;
$arResult["bShowAll"] = $dbresult->bShowAll;
$arResult["NavShowAll"] = $dbresult->NavShowAll;
$arResult["NavNum"] = $dbresult->NavNum;
$arResult["bDescPageNumbering"] = $dbresult->bDescPageNumbering;
$arResult["add_anchor"] = $dbresult->add_anchor;
$arResult["nPageWindow"] = $nPageWindow = $dbresult->nPageWindow;
$arResult["bSavePage"] = CPageOption::GetOptionString("main", "nav_page_in_session", "Y") == "Y";
$arResult["sUrlPath"] = GetPagePath(false, false);
$arResult["NavQueryString"] = htmlspecialcharsbx(DeleteParam(array("PAGEN_" . $dbresult->NavNum, "SIZEN_" . $dbresult->NavNum, "SHOWALL_" . $dbresult->NavNum, "PHPSESSID", "clear_cache")));
$arResult['sUrlPathParams'] = $arResult['sUrlPath'] . '?' . ('' != $arResult['NavQueryString'] ? $arResult['NavQueryString'] . '&' : '');
if ($dbresult->bDescPageNumbering === true) {
if ($dbresult->NavPageNomer + floor($nPageWindow / 2) >= $dbresult->NavPageCount) {
$nStartPage = $dbresult->NavPageCount;
} else {
if ($dbresult->NavPageNomer + floor($nPageWindow / 2) >= $nPageWindow) {
$nStartPage = $dbresult->NavPageNomer + floor($nPageWindow / 2);
} else {
if ($dbresult->NavPageCount >= $nPageWindow) {
$nStartPage = $nPageWindow;
} else {
$nStartPage = $dbresult->NavPageCount;
}
示例8: GetOptionInt
/**
* <p>Возвращает числовое значение параметра <i>page_option_id</i>, принадлежащего модулю <i>module_id</i>. Статичный метод.</p>
*
*
* @param string $module_id <a href="http://dev.1c-bitrix.ru/api_help/main/general/identifiers.php">Идентификатор модуля</a>.
*
* @param string $name Произвольный идентификатор параметра страницы.
*
* @param mixed $def = false Значение по умолчанию. </ht
*
* @param string $site = false Идентификатор сайта. Значение по умолчанию - "false".
*
* @return int
*
* <h4>Example</h4>
* <pre>
* <?
* $my_parameter = <b>CPageOption::GetOptionInt</b>("main", "MY_PARAMETER", 21);
* ?>
* </pre>
*
*
* <h4>See Also</h4>
* <ul> <li> <a href="https://dev.1c-bitrix.ru/learning/course/index.php?COURSE_ID=43&LESSON_ID=2814#params"
* >Параметры страницы</a> </li> <li> <a
* href="http://dev.1c-bitrix.ru/api_help/main/reference/cpageoption/getoptionstring.php">CPageOption::GetOptionString</a>
* </li> </ul> </ht<a name="examples"></a>
*
*
* @static
* @link http://dev.1c-bitrix.ru/api_help/main/reference/cpageoption/getoptionint.php
* @author Bitrix
*/
public static function GetOptionInt($module_id, $name, $def = "", $site = false)
{
return CPageOption::GetOptionString($module_id, $name, $def, $site);
}
示例9: GetNavSize
function GetNavSize($table_id = false, $nPageSize = 20, $list_url)
{
$bSess = CPageOption::GetOptionString("main", "nav_page_in_session", "Y") == "Y";
if ($bSess) {
if (is_array($nPageSize)) {
$sNavID = $nPageSize["sNavID"];
}
$unique = md5(isset($sNavID) ? $sNavID : $list_url);
}
if (isset($_REQUEST["SIZEN_" . ($GLOBALS["NavNum"] + 1)])) {
$nSize = intval($_REQUEST["SIZEN_" . ($GLOBALS["NavNum"] + 1)]);
if ($bSess) {
$_SESSION["NAV_PAGE_SIZE"][$unique] = $nSize;
}
} elseif ($bSess && isset($_SESSION["NAV_PAGE_SIZE"][$unique])) {
$nSize = $_SESSION["NAV_PAGE_SIZE"][$unique];
} else {
$aOptions = array();
if ($table_id) {
$aOptions = CUserOptions::GetOption("list", $table_id);
}
if (intval($aOptions["page_size"]) > 0) {
$nSize = intval($aOptions["page_size"]);
} else {
$nSize = is_array($nPageSize) ? $nPageSize["nPageSize"] : $nPageSize;
}
}
return $nSize;
}
示例10: setPagerParamsFromOptions
private function setPagerParamsFromOptions($tableId)
{
$unique = md5($tableId);
$bSess = \CPageOption::GetOptionString("main", "nav_page_in_session", "Y") == "Y";
if (isset($_REQUEST["SIZEN_"])) {
$this->_elementsInPage = (int) $_REQUEST["SIZEN_"];
if ($bSess) {
$_SESSION["NAV_PAGE_SIZE"][$unique] = $this->_elementsInPage;
}
} elseif ($bSess && isset($_SESSION["NAV_PAGE_SIZE"][$unique])) {
$this->_elementsInPage = $_SESSION["NAV_PAGE_SIZE"][$unique];
} else {
$aOptions = array();
if ($tableId) {
$aOptions = \CUserOptions::GetOption("list", $tableId);
}
if (intval($aOptions["page_size"]) > 0) {
$this->_elementsInPage = intval($aOptions["page_size"]);
}
}
}
示例11: customNavStart
/**
* Выполняет CDBResult::NavNext с той разницей, что общее количество элементов берется не из count($arResult),
* а из нашего параметра, полученного из SQL-запроса.
* array_slice также не делается.
*
* @param \CAdminResult $res
*/
protected function customNavStart(&$res)
{
$res->NavStart($this->navParams['nPageSize'], $this->navParams['navParams']['SHOW_ALL'], (int) $this->navParams['navParams']['PAGEN']);
$res->NavRecordCount = $this->totalRowsCount;
if ($res->NavRecordCount < 1) {
return;
}
if ($res->NavShowAll) {
$res->NavPageSize = $res->NavRecordCount;
}
$res->NavPageCount = floor($res->NavRecordCount / $res->NavPageSize);
if ($res->NavRecordCount % $res->NavPageSize > 0) {
$res->NavPageCount++;
}
$res->NavPageNomer = $res->PAGEN < 1 || $res->PAGEN > $res->NavPageCount ? \CPageOption::GetOptionString("main", "nav_page_in_session", "Y") != "Y" || $_SESSION[$res->SESS_PAGEN] < 1 || $_SESSION[$res->SESS_PAGEN] > $res->NavPageCount ? 1 : $_SESSION[$res->SESS_PAGEN] : $res->PAGEN;
}
示例12: require_once
<?
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_admin_before.php");
\Bitrix\Main\Localization\Loc::loadMessages(__FILE__);
CPageOption::GetOptionString("main", "nav_page_in_session", "N");
/**
* Entity edit page
* @var string
*/
$strEditPath = BX_ROOT."/admin/simple_module_settings_edit.php?lang=" . LANGUAGE_ID;
/**
* Endity datamanager classname
* @var string
*/
$sDataClassName = "simple\module\Entity\SettingsTable";
/**
* Module id
* @var string
*/
$module_id = "simple.module";
$MODULE_RIGHT = $APPLICATION->GetGroupRight($module_id);
if($MODULE_RIGHT == "D") $APPLICATION->AuthForm(GetMessage("ACCESS_DENIED"));
$can_edit = ($MODULE_RIGHT >= "W");
CModule::IncludeModuleEx($module_id);
$sTableID = preg_replace("/\\\+/", "_", $sDataClassName) . "_list";