本文整理汇总了PHP中CUserOptions::GetOption方法的典型用法代码示例。如果您正苦于以下问题:PHP CUserOptions::GetOption方法的具体用法?PHP CUserOptions::GetOption怎么用?PHP CUserOptions::GetOption使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CUserOptions
的用法示例。
在下文中一共展示了CUserOptions::GetOption方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __InTaskDeleteView
function __InTaskDeleteView($delViewId, $iblockId, $taskType, $ownerId)
{
$delViewId = IntVal($delViewId);
$iblockId = IntVal($iblockId);
$ownerId = IntVal($ownerId);
if ($delViewId <= 0 || $iblockId <= 0 || $ownerId <= 0) {
return "";
}
$errorMessage = "";
$userSettingsCategory = "IntranetTasks";
$userSettingsNamePart = "Settings_";
$arUserSettings = CUserOptions::GetOption($userSettingsCategory, $userSettingsNamePart . $delViewId, false, $GLOBALS["USER"]->GetID());
if (!$arUserSettings) {
$errorMessage .= GetMessage("INTL_VIEW_NOT_FOUND") . ".";
}
if (StrLen($errorMessage) <= 0) {
if ($arUserSettings["IBLOCK_ID"] != $iblockId || $arUserSettings["TASK_TYPE"] != $taskType || $arUserSettings["OWNER_ID"] != $ownerId) {
$errorMessage .= GetMessage("INTL_WRONG_VIEW") . ".";
}
}
if (StrLen($errorMessage) <= 0) {
if ($arUserSettings["COMMON"] != "N") {
$canModifyCommon = $taskType == 'user' && CSocNetFeaturesPerms::CanPerformOperation($GLOBALS["USER"]->GetID(), SONET_ENTITY_USER, $ownerId, "tasks", 'modify_common_views') || $taskType == 'group' && CSocNetFeaturesPerms::CanPerformOperation($GLOBALS["USER"]->GetID(), SONET_ENTITY_GROUP, $ownerId, "tasks", 'modify_common_views');
if (!$canModifyCommon) {
$errorMessage .= GetMessage("INTL_NO_VIEW_PERMS") . ".";
}
}
}
if (StrLen($errorMessage) <= 0) {
CUserOptions::DeleteOption($userSettingsCategory, $userSettingsNamePart . $delViewId, $arUserSettings["COMMON"] == "Y" ? true : false, $GLOBALS["USER"]->GetID());
}
return $errorMessage;
}
示例2: Show
public static function Show()
{
IncludeModuleLangFile($_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/interface/prolog_main_admin.php');
$supportFinishDate = COption::GetOptionString('main', '~support_finish_date', '');
if ($supportFinishDate != '' && is_array($aSupportFinishDate = ParseDate($supportFinishDate, 'ymd'))) {
$aGlobalOpt = CUserOptions::GetOption("global", "settings", array());
if ($aGlobalOpt['messages']['support'] != 'N') {
$supportFinishStamp = mktime(0, 0, 0, $aSupportFinishDate[1], $aSupportFinishDate[0], $aSupportFinishDate[2]);
$supportDateDiff = ceil(($supportFinishStamp - time()) / 86400);
$sSupportMess = '';
$sSupWIT = " (<span onclick=\"BX.toggle(BX('supdescr'))\" style='border-bottom: 1px dashed #1c91e7; color: #1c91e7; cursor: pointer;'>" . GetMessage("prolog_main_support_wit") . "</span>)";
if ($supportDateDiff >= 0 && $supportDateDiff <= 30) {
$sSupportMess = GetMessage("prolog_main_support11", array('#FINISH_DATE#' => GetTime($supportFinishStamp), '#DAYS_AGO#' => $supportDateDiff == 0 ? GetMessage("prolog_main_today") : GetMessage('prolog_main_support_days', array('#N_DAYS_AGO#' => $supportDateDiff)), '#LICENSE_KEY#' => md5(LICENSE_KEY), '#WHAT_IS_IT#' => $sSupWIT, '#SUP_FINISH_DATE#' => GetTime(mktime(0, 0, 0, $aSupportFinishDate[1] + 1, $aSupportFinishDate[0], $aSupportFinishDate[2]))));
} elseif ($supportDateDiff < 0 && $supportDateDiff >= -30) {
$sSupportMess = GetMessage("prolog_main_support21", array('#FINISH_DATE#' => GetTime($supportFinishStamp), '#DAYS_AGO#' => -$supportDateDiff, '#LICENSE_KEY#' => md5(LICENSE_KEY), '#WHAT_IS_IT#' => $sSupWIT, '#SUP_FINISH_DATE#' => GetTime(mktime(0, 0, 0, $aSupportFinishDate[1] + 1, $aSupportFinishDate[0], $aSupportFinishDate[2]))));
} elseif ($supportDateDiff < -30) {
$sSupportMess = GetMessage("prolog_main_support31", array('#FINISH_DATE#' => GetTime($supportFinishStamp), '#LICENSE_KEY#' => md5(LICENSE_KEY), '#WHAT_IS_IT#' => $sSupWIT));
}
if ($sSupportMess != '') {
$sSupportMess .= GetMessage('ACRIT_EXPORTPRO_BUY_LICENCE');
$userOption = CUserOptions::GetOption("main", "admSupInf");
if (mktime() > $userOption["showInformerDate"]) {
$prolongUrl = "/bitrix/admin/buy_support.php?lang=" . LANGUAGE_ID;
if (!in_array(LANGUAGE_ID, array("ru", "ua")) || IntVal(COption::GetOptionString("main", "~PARAM_PARTNER_ID")) <= 0) {
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/classes/general/update_client.php";
$prolongUrl = "http://www.acrit-studio.ru/shop/list/lupd/";
}
echo BeginNote('style="position: relative; top: -15px;"');
?>
<div style="float: right; padding-left: 50px; margin-top: -5px; text-align: center;">
<a href="<?php
echo $prolongUrl;
?>
" target="_blank" class="adm-btn adm-btn-save" style="margin-bottom: 4px;"><?php
echo GetMessage("prolog_main_support_button_prolong");
?>
</a><br />
<a href="http://www.acrit-studio.ru/market/" target="_blank"><?php
echo GetMessage("prolog_main_support_button_prolong_modules");
?>
</a>
</div>
<?php
echo $sSupportMess;
?>
<div id="supdescr" style="display: none;"><br /><br /><b><?php
echo GetMessage("prolog_main_support_wit_descr1");
?>
</b><hr><?php
echo GetMessage("prolog_main_support_wit_descr2");
?>
</div>
<?php
echo EndNote();
}
}
}
}
}
示例3: SetSetting
public static function SetSetting($type, $value, $userId = false)
{
if (!in_array($type, Array(self::SETTINGS, self::NOTIFY)))
return false;
global $USER;
$userId = intval($userId);
if ($userId == 0)
$userId = $USER->GetId();
$arSettings = CUserOptions::GetOption('IM', $type, Array(), $userId);
foreach ($value as $key => $val)
$arSettings[$key] = $val;
$arDefault = self::GetDefaultSettings($type);
foreach ($arSettings as $key => $val)
{
if ($arDefault[$key] == $val)
unset($arSettings[$key]);
}
CUserOptions::SetOption('IM', $type, $arSettings, false, $userId);
self::ClearCache($userId);
return true;
}
示例4: __construct
public function __construct($grid_id)
{
$this->grid_id = $grid_id;
$this->options = array();
$this->filter = array();
$aOptions = CUserOptions::GetOption("main.interface.grid", $this->grid_id, array());
if (!is_array($aOptions["views"])) {
$aOptions["views"] = array();
}
if (!is_array($aOptions["filters"])) {
$aOptions["filters"] = array();
}
if (!array_key_exists("default", $aOptions["views"])) {
$aOptions["views"]["default"] = array("columns" => "");
}
if ($aOptions["current_view"] == '' || !array_key_exists($aOptions["current_view"], $aOptions["views"])) {
$aOptions["current_view"] = "default";
}
$this->all_options = $aOptions;
if (array_key_exists($aOptions["current_view"], $aOptions["views"])) {
$this->options = $aOptions["views"][$aOptions["current_view"]];
}
if ($this->options["saved_filter"] != '' && array_key_exists($this->options["saved_filter"], $aOptions["filters"])) {
if (is_array($aOptions["filters"][$this->options["saved_filter"]]["fields"])) {
$this->filter = $aOptions["filters"][$this->options["saved_filter"]]["fields"];
}
}
}
示例5: GetLastDepartment
public static function GetLastDepartment()
{
$arLastSelected = CUserOptions::GetOption("socialnetwork", "log_destination", array());
if (
is_array($arLastSelected)
&& strlen($arLastSelected['department']) > 0
&& $arLastSelected['department'] != '"{}"'
)
{
$arLastSelected = array_reverse(CUtil::JsObjectToPhp($arLastSelected['department']));
}
else
$arLastSelected = array();
$count = 0;
$arDepartment = Array();
foreach ($arLastSelected as $depId)
{
if ($count < 4)
$count++;
else
break;
$arDepartment[$depId] = $depId;
}
return array_reverse($arDepartment);
}
示例6: SetSetting
public static function SetSetting($type, $value, $userId = false)
{
if (!in_array($type, array(self::SETTINGS, self::NOTIFY))) {
return false;
}
global $USER, $USER_FIELD_MANAGER;
$userId = intval($userId);
if ($userId == 0) {
$userId = $USER->GetId();
}
$arSettings = CUserOptions::GetOption('im', $type, array(), $userId);
foreach ($value as $key => $val) {
$arSettings[$key] = $val;
}
if (isset($value[self::STATUS])) {
CIMStatus::Set($userId, array('STATUS' => $value[self::STATUS]));
}
$arDefault = self::GetDefaultSettings($type);
foreach ($arSettings as $key => $val) {
if (isset($arDefault[$key]) && $arDefault[$key] == $val) {
if ($key == self::PRIVACY_SEARCH) {
$USER_FIELD_MANAGER->Update("USER", $userId, array('UF_IM_SEARCH' => ''));
}
unset($value[$key]);
}
}
CUserOptions::SetOption('im', $type, $arSettings, false, $userId);
if (isset($value[self::PRIVACY_SEARCH])) {
$USER_FIELD_MANAGER->Update("USER", $userId, array('UF_IM_SEARCH' => $value[self::PRIVACY_SEARCH]));
}
self::ClearCache($userId);
return true;
}
示例7: InputTags
function InputTags($sName="", $sValue="", $arSites=array(), $sHTML="", $sId="")
{
if(!$sId)
$sId = GenerateUniqId($sName);
TagsShowScript();
$order = class_exists("cuseroptions")? CUserOptions::GetOption("search_tags", "order", "CNT"): "CNT";
return '<input name="'.htmlspecialcharsbx($sName).'" id="'.htmlspecialcharsbx($sId).'" type="text" autocomplete="off" value="'.htmlspecialcharsex($sValue).'" onfocus="'.htmlspecialcharsbx('window.oObject[this.id] = new JsTc(this, '.CUtil::PhpToJSObject($arSites).');').'" '.$sHTML.'/><input type="checkbox" id="ck_'.$sId.'" name="ck_'.htmlspecialcharsbx($sName).'" '.($order=="NAME"? "checked": "").' title="'.GetMessage("SEARCH_TAGS_SORTING_TIP").'">';
}
示例8: GetReportCurrencyID
public static function GetReportCurrencyID()
{
if (!self::$REPORT_CURRENCY_ID) {
self::$REPORT_CURRENCY_ID = CUserOptions::GetOption('crm', 'report_currency_id', '');
if (!isset(self::$REPORT_CURRENCY_ID[0])) {
self::$REPORT_CURRENCY_ID = CCrmCurrency::GetBaseCurrencyID();
}
}
return self::$REPORT_CURRENCY_ID;
}
示例9: checkOnline
public static function checkOnline($userId = false)
{
$maxDate = 120;
$LastActivityDate = \CUserOptions::GetOption('mobile', 'lastActivityDate', 0, $userId);
if (intval($LastActivityDate) + $maxDate + 60 > time()) {
return true;
} else {
return false;
}
}
示例10: getCurrentView
/**
* @param $arParams
* @return string
*/
protected function getCurrentView($arParams)
{
$currentView = $arParams['DEFAULT_VIEW'] === 'list' ? 'list' : 'table';
$UserCurrentView = CUserOptions::GetOption('search_structure', 'current_view_' . $arParams['FILTER_NAME']);
if (isset($_REQUEST['current_view']) && $_REQUEST['current_view'] !== $UserCurrentView) {
$currentView = $_REQUEST['current_view'] === 'list' ? 'list' : 'table';
CUserOptions::SetOption('search_structure', 'current_view_' . $arParams['FILTER_NAME'], $currentView);
} elseif ($UserCurrentView) {
$currentView = $UserCurrentView === 'list' ? 'list' : 'table';
}
return $currentView;
}
示例11: isEditMode
private static function isEditMode()
{
if (isset($_SESSION["SESS_INCLUDE_AREAS"]) && $_SESSION["SESS_INCLUDE_AREAS"]) {
return true;
}
if (isset($_GET["bitrix_include_areas"]) && $_GET["bitrix_include_areas"] == "Y") {
return true;
}
$aUserOpt = CUserOptions::GetOption("global", "settings");
if (isset($aUserOpt["panel_dynamic_mode"]) && $aUserOpt["panel_dynamic_mode"] == "Y") {
return true;
}
return false;
}
示例12: ExportSettingsToXML
public static function ExportSettingsToXML($BID, $arWhat)
{
$xml = '';
if ($BID > 0 && is_array($arWhat) && !empty($arWhat)) {
if (in_array('forms', $arWhat)) {
$xml .= '<form_element>';
$xml .= '<![CDATA[' . array_pop(CUserOptions::GetOption('form', 'form_element_' . $BID, true)) . ']]>';
$xml .= '</form_element>' . "\n";
$xml .= '<form_section>';
$xml .= '<![CDATA[' . array_pop(CUserOptions::GetOption('form', 'form_section_' . $BID, true)) . ']]>';
$xml .= '</form_section>' . "\n";
}
}
return $xml;
}
示例13: executeComponent
public function executeComponent()
{
global $APPLICATION;
$this->arParams['LAST_MAIL_CHECK'] = null;
$this->arParams['IS_TIME_TO_MAIL_CHECK'] = null;
$settedUp = null;
if (defined('SKIP_MAIL_CHECK') && SKIP_MAIL_CHECK == true) {
$settedUp = false;
}
if (defined('ADMIN_SECTION') && ADMIN_SECTION == true) {
$settedUp = false;
}
if ($settedUp !== false) {
$isMobileInstalled = COption::GetOptionString('main', 'wizard_mobile_installed', 'N', SITE_ID) == 'Y';
$isMobileVersion = strpos($APPLICATION->GetCurPage(), SITE_DIR . 'm/') === 0;
if ($isMobileInstalled && $isMobileVersion) {
$settedUp = false;
}
}
if ($settedUp !== false) {
if (!is_callable(array('CIntranetUtils', 'IsExternalMailAvailable')) || !CIntranetUtils::IsExternalMailAvailable()) {
$settedUp = false;
}
}
if ($settedUp !== false) {
$lastMailCheck = CUserOptions::GetOption('global', 'last_mail_check_' . SITE_ID, null);
if (isset($lastMailCheck) && intval($lastMailCheck) < 0) {
$settedUp = false;
}
}
if ($settedUp !== false) {
$isTimeToMailCheck = true;
if (isset($lastMailCheck)) {
$settedUp = true;
$isTimeToMailCheck = false;
if (intval($lastMailCheck) >= 0) {
$checkInterval = COption::GetOptionString('intranet', 'mail_check_period', 10) * 60;
$isTimeToMailCheck = time() - intval($lastMailCheck) >= $checkInterval;
}
}
}
if ($settedUp !== false) {
$this->arParams['LAST_MAIL_CHECK'] = $lastMailCheck;
$this->arParams['IS_TIME_TO_MAIL_CHECK'] = $isTimeToMailCheck;
}
$this->arParams['SETTED_UP'] = $settedUp;
$this->includeComponentTemplate();
}
示例14: MenuSaveSettings
function MenuSaveSettings($arParams, $POS)
{
$arUserOptions = CUserOptions::GetOption("socialnetwork", "~menu_" . $arParams["ENTITY_TYPE"] . "_" . $arParams["ENTITY_ID"], false, 0);
if (!is_array($arUserOptions)) {
$arUserOptions = array("FEATURES" => array(), "MAX_ITEMS" => 6);
}
$arNewUserOptions = array("FEATURES" => array(), "MAX_ITEMS" => $arUserOptions["MAX_ITEMS"]);
foreach ($POS as $col => $itemId) {
if (is_array($arUserOptions["FEATURES"][$itemId])) {
$arNewUserOptions["FEATURES"][$itemId] = $arUserOptions["FEATURES"][$itemId];
} else {
$arNewUserOptions["FEATURES"][$itemId] = array();
}
$arNewUserOptions["FEATURES"][$itemId]["INDEX"] = $col;
}
CUserOptions::SetOption("socialnetwork", "~menu_" . $arParams["ENTITY_TYPE"] . "_" . $arParams["ENTITY_ID"], $arNewUserOptions, false, 0);
}
示例15: SetTabNames
public static function SetTabNames($form_id, $tabs)
{
$aOptions = CUserOptions::GetOption('main.interface.form', $form_id, array());
if (!is_array($aOptions['tabs'])) {
$aOptions['tabs'] = array();
}
foreach ($tabs as $tab) {
reset($aOptions['tabs']);
foreach ($aOptions['tabs'] as $k => $aOpTab) {
if ($tab['id'] == $aOpTab['id']) {
$aOptions['tabs'][$k]['name'] = $tab['name'];
break;
}
}
}
CUserOptions::SetOption('main.interface.form', $form_id, $aOptions);
}