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


PHP CPageOption::SetOptionString方法代码示例

本文整理汇总了PHP中CPageOption::SetOptionString方法的典型用法代码示例。如果您正苦于以下问题:PHP CPageOption::SetOptionString方法的具体用法?PHP CPageOption::SetOptionString怎么用?PHP CPageOption::SetOptionString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CPageOption的用法示例。


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

示例1: setNavStartParams

 protected function setNavStartParams()
 {
     if ($this->arParams['PAGER_SAVE_SESSION'] !== 'Y') {
         \CPageOption::SetOptionString('main', 'nav_page_in_session', 'N');
     }
     $this->arParams['PAGER_DESC_NUMBERING'] = $this->arParams['PAGER_DESC_NUMBERING'] === 'Y';
     if ($this->arParams['DISPLAY_BOTTOM_PAGER'] === 'Y' || $this->arParams['DISPLAY_TOP_PAGER'] === 'Y') {
         $this->navStartParams = ['nPageSize' => $this->arParams['ELEMENTS_COUNT'], 'bDescPageNumbering' => $this->arParams['PAGER_DESC_NUMBERING'], 'bShowAll' => $this->arParams['PAGER_SHOW_ALL']];
         $this->addCacheAdditionalId(\CDBResult::GetNavParams($this->navStartParams));
     } elseif ($this->arParams['ELEMENTS_COUNT'] > 0) {
         $this->navStartParams = ['nTopCount' => $this->arParams['ELEMENTS_COUNT'], 'bDescPageNumbering' => $this->arParams['PAGER_DESC_NUMBERING']];
     } else {
         $this->navStartParams = false;
     }
 }
开发者ID:lithium-li,项目名称:bbc-module,代码行数:15,代码来源:elements.php

示例2: SetOptionInt

 /**
  * <p>Устанавливает числовое значение параметра <i>page_option_id</i> для модуля <i>module_id</i>. Возвращает "true", если операция прошла успешна, в противном случае - "false". Статичный метод.</p>
  *
  *
  * @param string $module_id  <a href="http://dev.1c-bitrix.ru/api_help/main/general/identifiers.php">Идентификатор модуля</a>.
  *
  * @param string $name  Произвольный идентификатор параметра страницы.
  *
  * @param mixed $value = "" Значение параметра.<br>Необязательный. По умолчанию - "".
  *
  * @param des $c = "" 
  *
  * @param string $site = false Идентификатор сайта. Значение по умолчанию - "false".
  *
  * @return bool 
  *
  * <h4>Example</h4> 
  * <pre>
  * &lt;?
  * <b>CPageOption::SetOptionInt</b>("main", "MY_PARAMETER", 2);
  * ?&gt;
  * </pre>
  *
  *
  * <h4>See Also</h4> 
  * <ul> <li> <a href="https://dev.1c-bitrix.ru/learning/course/index.php?COURSE_ID=43&amp;LESSON_ID=2814#params"
  * >Параметры страницы</a> </li> <li> <a
  * href="http://dev.1c-bitrix.ru/api_help/main/reference/cpageoption/setoptionstring.php">CPageOption::SetOptionString</a>
  * </li> </ul> </ht<a name="examples"></a>
  *
  *
  * @static
  * @link http://dev.1c-bitrix.ru/api_help/main/reference/cpageoption/setoptionint.php
  * @author Bitrix
  */
 public static function SetOptionInt($module_id, $name, $value = "", $desc = "", $site = "")
 {
     return CPageOption::SetOptionString($module_id, $name, IntVal($value), $desc, $site);
 }
开发者ID:andy-profi,项目名称:bxApiDocs,代码行数:39,代码来源:option.php

示例3: __construct

 public function __construct($component = null)
 {
     parent::__construct($component);
     CPageOption::SetOptionString("main", "nav_page_in_session", "N");
     $this->dateFormat = CSite::GetDateFormat("FULL", SITE_ID);
     Localization\Loc::loadMessages(__FILE__);
 }
开发者ID:ASDAFF,项目名称:entask.ru,代码行数:7,代码来源:class.php

示例4:

</span></h1>
										<div class="pagetitle-content-topEnd">
											<div class="pagetitle-content-topEnd-corn"></div>
										</div>
									</div>
									<div id="workarea">
										<?php 
if (!$isIndexPage && $APPLICATION->GetProperty("HIDE_SIDEBAR", "N") != "Y") {
    ?>
<div id="sidebar"><?php 
    if (IsModuleInstalled("bitrix24")) {
        $GLOBALS['INTRANET_TOOLBAR']->Disable();
    } else {
        $GLOBALS['INTRANET_TOOLBAR']->Enable();
        $GLOBALS['INTRANET_TOOLBAR']->Show();
    }
    $APPLICATION->ShowViewContent("sidebar");
    $APPLICATION->ShowViewContent("sidebar_tools_1");
    $APPLICATION->ShowViewContent("sidebar_tools_2");
    ?>
</div>
										<?php 
}
?>
										<div id="workarea-content">
										<?php 
$APPLICATION->ShowViewContent("topblock");
?>
										<?php 
CPageOption::SetOptionString("main.interface", "use_themes", "N");
//For grids
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:header.php

示例5: array

	
	elseif ($arParams["GID"] <= 0):
		ForumSetReadForum(false);
	else:
		$db_res = CForumNew::GetListEx(array("FORUM_GROUP_SORT"=>"ASC", "FORUM_GROUP_ID"=>"ASC", "SORT"=>"ASC", "NAME"=>"ASC"), $arFilter);
		while ($res = $db_res->Fetch()){
			ForumSetReadForum($res["ID"]);
		}
	endif;
endif;
/********************************************************************
				/Action
********************************************************************/
/************** Forums data ****************************************/
				
	CPageOption::SetOptionString("main", "nav_page_in_session", "N"); // reduce cache size
	$arFilterForum = $arFilter;
	if ($arParams["MINIMIZE_SQL"] == "Y" && $GLOBALS["USER"]->IsAuthorized()):
		$arFilterForum["RENEW"] = $GLOBALS["USER"]->GetID();
	endif;

	$arForumOrder = array(
		"FORUM_GROUP_SORT"=>"ASC",
		"FORUM_GROUP_ID"=>"ASC",
		"SORT"=>"ASC",
		"NAME"=>"ASC"
	);
	$arForumAddParams = array(
		'bDescPageNumbering' => ($arParams["USE_DESC_PAGE"] == "Y"),
		'nPageSize' => $arParams["FORUMS_PER_PAGE"],
		'bShowAll' => false,
开发者ID:ASDAFF,项目名称:bitrix-5,代码行数:30,代码来源:component.php

示例6: onPrepareComponentParams

 /**
  * @inheritdoc
  */
 public function onPrepareComponentParams($arParams)
 {
     $arParams = parent::onPrepareComponentParams($arParams);
     $arParams['IBLOCK_CODE'] = htmlspecialchars(trim($arParams['IBLOCK_CODE']));
     $arParams['SECTION_CODE'] = htmlspecialchars(trim($arParams['SECTION_CODE']));
     $arParams['SECTION_ID'] = intval($arParams['SECTION_ID']);
     if (strlen($arParams['ELEMENT_SORT_BY1']) <= 0) {
         $arParams['ELEMENT_SORT_BY1'] = 'SORT';
     }
     if ($arParams['ELEMENT_SORT_ORDER1'] != 'DESC') {
         $arParams['ELEMENT_SORT_ORDER1'] = 'ASC';
     }
     if (strlen($arParams['ELEMENT_SORT_BY2']) <= 0) {
         $arParams['ELEMENT_SORT_BY2'] = 'ID';
     }
     if ($arParams['ELEMENT_SORT_ORDER2'] != 'DESC') {
         $arParams['ELEMENT_SORT_ORDER2'] = 'ASC';
     }
     if (strlen($arParams['ELEMENT_SORT_BY3']) <= 0) {
         $arParams['ELEMENT_SORT_BY3'] = 'ID';
     }
     if ($arParams['ELEMENT_SORT_ORDER3'] != 'DESC') {
         $arParams['ELEMENT_SORT_ORDER3'] = 'ASC';
     }
     if (strlen($arParams['SECTION_SORT_BY1']) <= 0) {
         $arParams['SECTION_SORT_BY1'] = 'SORT';
     }
     if ($arParams['SECTION_SORT_ORDER1'] != 'DESC') {
         $arParams['SECTION_SORT_ORDER1'] = 'ASC';
     }
     if (strlen($arParams['SECTION_SORT_BY2']) <= 0) {
         $arParams['SECTION_SORT_BY2'] = 'ID';
     }
     if ($arParams['SECTION_SORT_ORDER2'] != 'DESC') {
         $arParams['SECTION_SORT_ORDER2'] = 'ASC';
     }
     if ($arParams['PAGE']) {
         $arParams['PAGE'] = intval($_GET['page']);
     }
     if ($arParams['PAGING'] == 'Y') {
         \CPageOption::SetOptionString('main', 'nav_page_in_session', 'N');
         //не сохраняем в сессии параметры пагинации потому что это сбивает с толку пользователей
         $nav = \CDBResult::GetNavParams();
         if ($nav) {
             $arParams['PAGE'] = intval($nav['PAGEN']);
         } else {
             if ($arParams['PAGE']) {
                 $arParams['PAGE'] = intval($_GET['page']);
             }
         }
     }
     $arParams['PREPROD_SERVER'] = defined('PREPROD_SERVER') && PREPROD_SERVER;
     if (strlen($arParams['FILTER_NAME']) > 0 && preg_match('/^[A-Za-z_][A-Za-z01-9_]*$/', $arParams['FILTER_NAME'])) {
         $this->elementsFilter = array_merge($this->elementsFilter, $GLOBALS[$arParams['FILTER_NAME']]);
         $this->addCacheAdditionalId($GLOBALS[$arParams['FILTER_NAME']]);
     }
     //удаляем пустые элементы массива
     if (!empty($arParams['ELEMENT_PROPERTIES'])) {
         $arParams['ELEMENT_PROPERTIES'] = array_filter($arParams['ELEMENT_PROPERTIES']);
     }
     if (!empty($arParams['ELEMENT_FIELDS'])) {
         $arParams['ELEMENT_FIELDS'] = array_filter($arParams['ELEMENT_FIELDS']);
     }
     return $arParams;
 }
开发者ID:notagency,项目名称:notagency.base,代码行数:68,代码来源:class.php

示例7: executeProlog

 /**
  * выполяет действия перед кешированием 
  */
 protected function executeProlog()
 {
     if ($this->arParams['COUNT'] > 0) {
         if ($this->arParams['SHOW_NAV'] == 'Y') {
             \CPageOption::SetOptionString('main', 'nav_page_in_session', 'N');
             $this->navParams = array('nPageSize' => $this->arParams['COUNT']);
             $arNavigation = \CDBResult::GetNavParams($this->navParams);
             $this->cacheAddon = array($arNavigation);
         } else {
             $this->navParams = array('nTopCount' => $this->arParams['COUNT']);
         }
     }
 }
开发者ID:belukov,项目名称:bx-components,代码行数:16,代码来源:class.php

示例8: executeComponent

 public function executeComponent()
 {
     if (!CModule::IncludeModule('intranet')) {
         ShowError(GetMessage('INTR_ISL_INTRANET_MODULE_NOT_INSTALLED'));
         return;
     }
     if (!CModule::IncludeModule('socialnetwork')) {
         return;
     }
     $showDepHeadAdditional = $this->arParams['SHOW_DEP_HEAD_ADDITIONAL'] == 'Y';
     $bNav = $this->arParams['SHOW_NAV_TOP'] == 'Y' || $this->arParams['SHOW_NAV_BOTTOM'] == 'Y';
     $isEnoughFiltered = $this->fillFilter();
     list($cntStartCacheId, $cntStart) = $this->getCacheIdWithDepartment();
     if ($this->arParams['SHOW_UNFILTERED_LIST'] == 'N' && !$this->bExcel && !$isEnoughFiltered) {
         $this->arResult['EMPTY_UNFILTERED_LIST'] = 'Y';
         $this->includeComponentTemplate();
         return;
     }
     $this->arParams['bCache'] = $cntStart == count($this->arFilter) && !$this->bExcel && $this->arParams['CACHE_TYPE'] == 'Y' && $this->arParams['CACHE_TIME'] > 0;
     $this->arResult['FILTER_VALUES'] = $this->arFilter;
     if (!$this->bExcel && $bNav) {
         CPageOption::SetOptionString("main", "nav_page_in_session", "N");
     }
     $bFromCache = false;
     if ($this->arParams['bCache']) {
         if ($bFromCache = $this->initCache($cntStartCacheId)) {
             $vars = $this->obCache->getVars();
             $this->arResult['USERS'] = $vars['USERS'];
             $this->arResult['DEPARTMENTS'] = $vars['DEPARTMENTS'];
             $this->arResult['DEPARTMENT_HEAD'] = $vars['DEPARTMENT_HEAD'];
             $this->arResult['USERS_NAV'] = $vars['USERS_NAV'];
             $strUserIDs = $vars['STR_USER_ID'];
         } else {
             $this->obCache->startDataCache();
             $this->getCacheManager()->startTagCache($this->cacheDir);
             $this->getCacheManager()->registerTag('intranet_users');
         }
     }
     if (!$bFromCache) {
         // get users list
         $obUser = new CUser();
         $arSelect = array('ID', 'ACTIVE', 'CONFIRM_CODE', 'DEP_HEAD', 'GROUP_ID', 'NAME', 'LAST_NAME', 'SECOND_NAME', 'LOGIN', 'EMAIL', 'LID', 'DATE_REGISTER', 'PERSONAL_PROFESSION', 'PERSONAL_WWW', 'PERSONAL_ICQ', 'PERSONAL_GENDER', 'PERSONAL_BIRTHDATE', 'PERSONAL_PHOTO', 'PERSONAL_PHONE', 'PERSONAL_FAX', 'PERSONAL_MOBILE', 'PERSONAL_PAGER', 'PERSONAL_STREET', 'PERSONAL_MAILBOX', 'PERSONAL_CITY', 'PERSONAL_STATE', 'PERSONAL_ZIP', 'PERSONAL_COUNTRY', 'PERSONAL_NOTES', 'WORK_COMPANY', 'WORK_DEPARTMENT', 'WORK_POSITION', 'WORK_WWW', 'WORK_PHONE', 'WORK_FAX', 'WORK_PAGER', 'WORK_STREET', 'WORK_MAILBOX', 'WORK_CITY', 'WORK_STATE', 'WORK_ZIP', 'WORK_COUNTRY', 'WORK_PROFILE', 'WORK_LOGO', 'WORK_NOTES', 'PERSONAL_BIRTHDAY', 'LAST_ACTIVITY_DATE', 'LAST_LOGIN', 'IS_ONLINE');
         $this->arResult['USERS'] = array();
         $this->arResult['DEPARTMENTS'] = array();
         $this->arResult['DEPARTMENT_HEAD'] = 0;
         // disable/enable appearing of department head on page
         if ($showDepHeadAdditional && !empty($this->arFilter['UF_DEPARTMENT']) && is_array($this->arFilter['UF_DEPARTMENT'])) {
             if ($this->arParams['bCache']) {
                 $this->getCacheManager()->registerTag('intranet_department_' . $this->arFilter['UF_DEPARTMENT'][0]);
             }
             $managerId = CIntranetUtils::GetDepartmentManagerID($this->arFilter['UF_DEPARTMENT'][0]);
             $appendManager = CUser::GetByID($managerId)->Fetch();
             if ($appendManager) {
                 $this->arResult['DEPARTMENT_HEAD'] = $appendManager['ID'];
                 $this->arFilter['!ID'] = $appendManager['ID'];
                 $this->arResult['USERS'][$appendManager['ID']] = $appendManager;
             }
         }
         $bDisable = false;
         if (CModule::IncludeModule('extranet')) {
             if (CExtranet::IsExtranetSite() && !CExtranet::IsExtranetAdmin()) {
                 $arIDs = array_merge(CExtranet::GetMyGroupsUsers(SITE_ID), CExtranet::GetPublicUsers());
                 if ($this->arParams['bCache']) {
                     $this->getCacheManager()->registerTag('extranet_public');
                     $this->getCacheManager()->registerTag('extranet_user_' . $this->getUser()->getID());
                 }
                 if (false !== ($key = array_search($this->getUser()->getID(), $arIDs))) {
                     unset($arIDs[$key]);
                 }
                 if (count($arIDs) > 0) {
                     $this->arFilter['ID'] = implode('|', array_unique($arIDs));
                 } else {
                     $bDisable = true;
                 }
             }
         }
         if ($bDisable) {
             $dbUsers = new CDBResult();
             $dbUsers->initFromArray(array());
         } else {
             $arListParams = array('SELECT' => array('UF_*'), 'ONLINE_INTERVAL' => static::LAST_ACTIVITY);
             if (!$this->bExcel && $this->arParams['USERS_PER_PAGE'] > 0) {
                 $arListParams['NAV_PARAMS'] = array('nPageSize' => $this->arParams['USERS_PER_PAGE'], 'bShowAll' => false);
             }
             $dbUsers = $obUser->GetList($sortBy = 'last_name', $sortDir = 'asc', $this->arFilter, $arListParams);
         }
         $strUserIDs = '';
         while ($arUser = $dbUsers->Fetch()) {
             $this->arResult['USERS'][$arUser['ID']] = $arUser;
             $strUserIDs .= ($strUserIDs === '' ? '' : '|') . $arUser['ID'];
         }
         $structure = CIntranetUtils::getStructure();
         $this->arResult['DEPARTMENTS'] = $structure['DATA'];
         $this->setDepWhereUserIsHead();
         $arAdmins = array();
         /** @noinspection PhpUndefinedVariableInspection */
         $rsUsers = CUser::GetList($o, $b, array("GROUPS_ID" => array(static::ADMIN_GROUP_ID)), array("SELECT" => array("ID")));
         while ($ar = $rsUsers->Fetch()) {
             $arAdmins[$ar["ID"]] = $ar["ID"];
         }
//.........这里部分代码省略.........
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:101,代码来源:class.php


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