本文整理汇总了PHP中CUserOptions类的典型用法代码示例。如果您正苦于以下问题:PHP CUserOptions类的具体用法?PHP CUserOptions怎么用?PHP CUserOptions使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CUserOptions类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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);
}
示例2: __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;
}
示例3: 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();
}
}
}
}
}
示例4: OnUserDelete
public static function OnUserDelete($ID)
{
global $DB;
if (!CSocNetGroup::__ValidateID($ID)) {
return false;
}
$ID = IntVal($ID);
$bSuccess = True;
if (!CSocNetGroup::DeleteNoDemand($ID)) {
if ($ex = $GLOBALS["APPLICATION"]->GetException()) {
$err = $ex->GetString();
}
$GLOBALS["APPLICATION"]->ThrowException($err);
$bSuccess = false;
}
if ($bSuccess) {
CSocNetUserRelations::DeleteNoDemand($ID);
CSocNetUserPerms::DeleteNoDemand($ID);
CSocNetUserEvents::DeleteNoDemand($ID);
CSocNetMessages::DeleteNoDemand($ID);
CSocNetUserToGroup::DeleteNoDemand($ID);
CSocNetLogEvents::DeleteNoDemand($ID);
CSocNetLog::DeleteNoDemand($ID);
CSocNetLogComments::DeleteNoDemand($ID);
CSocNetFeatures::DeleteNoDemand($ID);
CSocNetSubscription::DeleteEx($ID);
CUserOptions::DeleteOption("socialnetwork", "~menu_" . SONET_ENTITY_USER . "_" . $ID, false, 0);
}
return $bSuccess;
}
示例5: deactivate
/**
* Deactivates banner for current user by name.
* @param string $name Banner name.
* @return bool
*/
public static function deactivate($name)
{
global $USER;
if ($USER->getId() <= 0) {
return false;
}
return \CUserOptions::setOption(Driver::INTERNAL_MODULE_ID, '~banner-offer', array($name => true), false, $USER->getId());
}
示例6: 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").'">';
}
示例7: SetReportCurrencyID
public static function SetReportCurrencyID($currencyID)
{
$currencyID = strval($currencyID);
if (!isset($currencyID[0])) {
$currencyID = CCrmCurrency::GetBaseCurrencyID();
}
if ($currencyID === self::$REPORT_CURRENCY_ID) {
return;
}
self::$REPORT_CURRENCY_ID = $currencyID;
CUserOptions::SetOption('crm', 'report_currency_id', $currencyID);
}
示例8: 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;
}
示例9: setOffline
public static function setOffline($userId = false)
{
global $USER;
if (!$userId) {
$userId = $USER->GetId();
}
$userId = intval($userId);
if ($userId <= 0) {
return false;
}
\CUserOptions::DeleteOption('mobile', 'lastActivityDate', false, $userId);
return false;
}
示例10: 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;
}
示例11: SwitchGroupMode
private static function SwitchGroupMode($yn)
{
// Get User Id
$uid = static::GetUserId(false);
if ($uid === false) {
return;
}
if ($yn === 'Y') {
$value = 'Y';
} else {
$value = 'N';
}
CUserOptions::SetOption(static::listModeCategoryName, static::listModeParamName, $value, $bCommon = false, $uid);
}
示例12: getDocumentServiceCode
public static function getDocumentServiceCode()
{
static $service = null;
if ($service !== null) {
return $service;
}
/** @noinspection PhpParamsInspection */
$userSettings = \CUserOptions::getOption(Driver::INTERNAL_MODULE_ID, 'doc_service', array('default' => ''));
if (empty($userSettings['default'])) {
$userSettings['default'] = '';
}
$service = $userSettings['default'];
return $userSettings['default'];
}
示例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: CheckMenuUserSections
function CheckMenuUserSections(&$userMenuSectionsOption, $arTitles)
{
if (is_array($userMenuSectionsOption)) {
$isChanged = false;
foreach ($userMenuSectionsOption as $key => $section) {
if (!in_array($section, $arTitles)) {
unset($userMenuSectionsOption[$key]);
$isChanged = true;
}
}
$userMenuSectionsOption = array_unique(array_merge($userMenuSectionsOption, $arTitles));
if ($isChanged) {
CUserOptions::SetOption("bitrix24", "user_menu_sections_" . SITE_ID, $userMenuSectionsOption);
}
}
}
示例15: processActionDefault
protected function processActionDefault()
{
if ($this->request->getPost('installDisk')) {
\Bitrix\Disk\Desktop::setDesktopDiskInstalled();
$this->sendJsonSuccessResponse();
}
if ($this->request->getPost('uninstallDisk')) {
\Bitrix\Disk\Desktop::setDesktopDiskUninstalled();
$this->sendJsonSuccessResponse();
}
if ($this->request->getPost('reInstallDisk')) {
\CUserOptions::setOption('disk', 'DesktopDiskReInstall', true, false, $this->getUser()->getId());
\Bitrix\Disk\Desktop::setDesktopDiskInstalled();
$this->sendJsonSuccessResponse();
}
}