本文整理汇总了PHP中CUserOptions类的典型用法代码示例。如果您正苦于以下问题:PHP CUserOptions类的具体用法?PHP CUserOptions怎么用?PHP CUserOptions使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CUserOptions类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:ASDAFF,项目名称:bxApiDocs,代码行数:28,代码来源:log_destination.php
示例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;
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:33,代码来源:action.php
示例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();
}
}
}
}
}
开发者ID:akniyev,项目名称:itprom_dobrohost,代码行数:60,代码来源:licence.php
示例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;
}
开发者ID:rasuldev,项目名称:torino,代码行数:30,代码来源:user.php
示例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());
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:13,代码来源:banner.php
示例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").'">';
}
开发者ID:ASDAFF,项目名称:open_bx,代码行数:8,代码来源:tags.php
示例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);
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:12,代码来源:crm_report_helper.php
示例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;
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:16,代码来源:class.php
示例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;
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:13,代码来源:user.php
示例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;
}
开发者ID:akniyev,项目名称:new_itprom,代码行数:14,代码来源:JivoSiteClass.php
示例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);
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:14,代码来源:functions.php
示例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'];
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:14,代码来源:configuration.php
示例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();
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:48,代码来源:class.php
示例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);
}
}
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:16,代码来源:result_modifier.php
示例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();
}
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:16,代码来源:ajax.php
示例16: EnsureAllResponsibilityImported
public static function EnsureAllResponsibilityImported($userID, $reset = false)
{
$userID = intval($userID);
if ($userID <= 0) {
$userID = CCrmSecurityHelper::GetCurrentUser();
}
$reset = (bool) $reset;
$optionName = 'sl_subscr_import';
if ($reset || CUserOptions::GetOption('crm', $optionName, 'N', $userID) !== 'Y') {
self::EnsureResponsibilityImported(CCrmOwnerType::Lead, $userID);
self::EnsureResponsibilityImported(CCrmOwnerType::Contact, $userID);
self::EnsureResponsibilityImported(CCrmOwnerType::Company, $userID);
self::EnsureResponsibilityImported(CCrmOwnerType::Deal, $userID);
self::EnsureResponsibilityImported(CCrmOwnerType::Activity, $userID);
CUserOptions::SetOption('crm', $optionName, 'Y', false, $userID);
}
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:17,代码来源:sonet_subscription.php
示例17: 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);
}
开发者ID:Satariall,项目名称:izurit,代码行数:17,代码来源:include.php
示例18: saveOptions
public function saveOptions($path = "", $arOpts)
{
$result = true;
$opts = self::getOptions();
$arTmp =& $opts;
$arPath = explode("/", $path);
if (is_array($arPath)) {
foreach ($arPath as $pathItem) {
if (!isset($arTmp[$pathItem]) || !is_array($arTmp[$pathItem])) {
$arTmp[$pathItem] = array();
}
$arTmp =& $arTmp[$pathItem];
}
$arTmp = $arOpts;
}
return CUserOptions::SetOption('mobileapp', 'push_options', $opts);
}
开发者ID:Satariall,项目名称:izurit,代码行数:17,代码来源:push.php
示例19: buildElementList
public function buildElementList($iblockId, $columns = array(), $params = array())
{
$this->initializeVars($iblockId);
/** @example */
/*
$columns = array(
'NAME',
'SORT',
'ID',
'PROPERTY_LINK',
); */
$opts = array();
foreach ($columns as $columnCode) {
$opts[] = $this->prepareCode($columnCode);
}
$opts = implode(',', $opts);
$params = array_merge(array('name_prefix' => 'tbl_iblock_element_', 'category' => 'list', 'page_size' => 20, 'order' => 'desc', 'by' => 'id'), $params);
$name = $params['name_prefix'] . md5($this->iblock['IBLOCK_TYPE_ID'] . "." . $iblockId);
$value = array('columns' => $opts, 'order' => $params['order'], 'by' => $params['by'], 'page_size' => $params['page_size']);
\CUserOptions::DeleteOptionsByName($params['category'], $name);
\CUserOptions::SetOption($params['category'], $name, $value, true);
}
开发者ID:andreyryabin,项目名称:sprint.migration,代码行数:22,代码来源:AdminIblockHelper.php
示例20: ShowBlockInfo
public static function ShowBlockInfo($top, $bottom, $id)
{
$aOpt = CUserOptions::GetOption("sysupdate", "hidden_blocks", array());
$s = CUpdateOutput::ShowScript();
$s .= '
<div class="update-block-info">
<table cellspacing="0" cellpadding="0" border="0" class="update-block-info">
<tr class="top">
<td class="left"><div class="empty"></div></td>
<td><div class="empty"></div></td>
<td class="right"><div class="empty"></div></td>
</tr>
<tr>
<td class="left"><div class="empty"></div></td>
<td class="content">
<div class="top">
<table cellspacing="0" width="100%">
<tr>
<td class="caption">' . $top . '</td>
<td align="right"><a class="button ' . ($aOpt[$id] == "off" ? "button-down" : "button-up") . '" title="' . ($aOpt[$id] == "off" ? GetMessage("SUP_EXPAND") : GetMessage("SUP_COLLAPSE")) . '" href="javascript:void(0);" onclick="ToggleInfo(\'' . $id . '\', this)"></a></td>
</tr>
</table>
</div>
<div class="bottom" id="' . $id . '" style="display:' . ($aOpt[$id] == "off" ? "none" : "block") . '">' . $bottom . '</div>
</td>
<td class="right"><div class="empty"></div></td>
</tr>
<tr class="bottom">
<td class="left"><div class="empty"></div></td>
<td><div class="empty"></div></td>
<td class="right"><div class="empty"></div></td>
</tr>
</table>
</div>
';
return $s;
}
开发者ID:rasuldev,项目名称:torino,代码行数:38,代码来源:update_update5.php
注:本文中的CUserOptions类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论