本文整理汇总了PHP中CUserOptions::setOption方法的典型用法代码示例。如果您正苦于以下问题:PHP CUserOptions::setOption方法的具体用法?PHP CUserOptions::setOption怎么用?PHP CUserOptions::setOption使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CUserOptions
的用法示例。
在下文中一共展示了CUserOptions::setOption方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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());
}
示例2: 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();
}
}
示例3: onUserLoginSocserv
public static function onUserLoginSocserv($params)
{
global $USER;
if ($params['EXTERNAL_AUTH_ID'] === \CSocServBitrix24Net::ID && \Bitrix\Main\ModuleManager::isModuleInstalled('bitrix24')) {
$notificationOptions = \CUserOptions::getOption("socialservices", "notifications", array());
$lastDate = 0;
if (isset($notificationOptions["CONTACTS_NOTIFY_DATE"])) {
$lastDate = $notificationOptions["CONTACTS_NOTIFY_DATE"];
}
if ($lastDate < time() - 86400) {
static::notifyPossible($USER->getId());
$notificationOptions["CONTACTS_NOTIFY_DATE"] = time();
\CUserOptions::setOption("socialservices", "notifications", $notificationOptions);
}
}
}
示例4: storeViewMode
private function storeViewMode($mode)
{
$mode = strtolower($mode);
if ($mode != 'grid' && $mode != 'tile') {
$mode = 'grid';
}
\CUserOptions::setOption(Driver::INTERNAL_MODULE_ID, 'grid', array('viewMode' => $mode));
}
示例5: storeSortMode
/**
* Stores sort mode for folder list.
* @param string $mode
* @return void
*/
public function storeSortMode($mode)
{
$mode = strtolower($mode);
if ($mode !== self::SORT_MODE_ORDINARY && $mode !== self::SORT_MODE_MIX) {
$mode = self::SORT_MODE_ORDINARY;
}
\CUserOptions::setOption(Driver::INTERNAL_MODULE_ID, 'grid', array('sortMode' => $mode, 'viewMode' => $this->getViewMode()));
}
示例6:
require_once $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/prolog_before.php';
if (!CModule::IncludeModule('webdav')) {
return;
}
global $USER, $APPLICATION;
if (!$USER->IsAuthorized() || !check_bitrix_sessid() || $_SERVER['REQUEST_METHOD'] != 'POST') {
return;
}
CUtil::JSPostUnescape();
if ($_POST['installDisk']) {
CWebDavTools::setDesktopDiskInstalled();
if (\Bitrix\Main\Config\Option::get('disk', 'successfully_converted', false) && CModule::includeModule('disk')) {
\Bitrix\Disk\Desktop::setDesktopDiskInstalled();
}
CWebDavTools::sendJsonResponse(array('status' => 'success'));
}
if ($_POST['uninstallDisk']) {
CWebDavTools::setDesktopDiskUninstalled();
if (\Bitrix\Main\Config\Option::get('disk', 'successfully_converted', false) && CModule::includeModule('disk')) {
\Bitrix\Disk\Desktop::setDesktopDiskUninstalled();
}
CWebDavTools::sendJsonResponse(array('status' => 'success'));
}
if ($_POST['reInstallDisk']) {
CWebDavTools::setDesktopDiskUninstalled();
if (\Bitrix\Main\Config\Option::get('disk', 'successfully_converted', false) && CModule::includeModule('disk')) {
\CUserOptions::setOption('disk', 'DesktopDiskReInstall', true, false, $USER->getId());
\Bitrix\Disk\Desktop::setDesktopDiskInstalled();
}
CWebDavTools::sendJsonResponse(array('status' => 'success'));
}
示例7: resetDocumentServiceCode
public static function resetDocumentServiceCode()
{
\CUserOptions::setOption(Driver::INTERNAL_MODULE_ID, 'doc_service', array('default' => ''));
}
示例8: saveFirstRun
private function saveFirstRun($userId)
{
\CUserOptions::setOption(Driver::INTERNAL_MODULE_ID, 'recently_used', array('r' => '1'), false, $userId);
}
示例9: setDesktopDiskUninstalled
/**
* Sets option for current user for disk uninstall.
*/
public static function setDesktopDiskUninstalled()
{
global $USER;
\CUserOptions::setOption(Driver::INTERNAL_MODULE_ID, self::OPT_DESKTOP_DISK_INSTALL, false, false, $USER->getId());
UserConfiguration::resetDocumentServiceCode();
}
示例10: processActionSaveAjax
protected function processActionSaveAjax()
{
$this->request->addFilter(new PostDecodeFilter());
if ($this->request->getQuery('saveuserparams') == 'Y') {
$serializeValue = serialize($this->request->getPost('USER_PARAMS'));
if (strlen($serializeValue) > 64000) {
$response = "\n\t\t\t\t\t<script>\n\t\t\t\t\t\talert('" . Loc::getMessage('BIZPROC_USER_PARAMS_SAVE_ERROR') . "');\n\t\t\t\t\t</script>\n\t\t\t\t";
$this->sendResponse($response);
}
CUserOptions::setOption('~bizprocdesigner', 'activity_settings', $serializeValue);
$this->getApplication()->restartBuffer();
$this->end();
}
$fields = array('DOCUMENT_TYPE' => $this->arResult['DOCUMENT_COMPLEX_TYPE'], 'AUTO_EXECUTE' => $this->request->getPost('workflowTemplateAutostart'), 'NAME' => $this->request->getPost('workflowTemplateName'), 'DESCRIPTION' => $this->request->getPost('workflowTemplateDescription'), 'TEMPLATE' => $this->request->getPost('arWorkflowTemplate'), 'PARAMETERS' => $this->request->getPost('arWorkflowParameters'), 'VARIABLES' => $this->request->getPost('arWorkflowVariables'), 'CONSTANTS' => $this->request->getPost('arWorkflowConstants'), 'USER_ID' => intval($this->getUser()->getID()), 'MODIFIER_USER' => new CBPWorkflowTemplateUser(CBPWorkflowTemplateUser::CurrentUser));
if (!is_array($fields["VARIABLES"])) {
$fields['VARIABLES'] = array();
}
if (!is_array($fields["CONSTANTS"])) {
$fields['CONSTANTS'] = array();
}
if ($this->arResult['TEMPLATE'] != $fields['TEMPLATE']) {
$fields['SYSTEM_CODE'] = '';
}
try {
if ($this->arResult['ID'] > 0) {
CBPWorkflowTemplateLoader::update($this->arResult['ID'], $fields);
} else {
$this->arResult['ID'] = CBPWorkflowTemplateLoader::add($fields);
}
} catch (Exception $e) {
$response = "\n\t\t\t\t<script>\n\t\t\t\t\talert('" . Loc::getMessage('BIZPROC_WFEDIT_SAVE_ERROR') . "\\n " . preg_replace("#\\.\\W?#", ".\\n", AddSlashes(htmlspecialcharsbx($e->getMessage()))) . "');\n\t\t\t\t</script>\n\t\t\t";
$this->sendResponse($response);
}
$response = "\n\t\t\t<script>\n\t\t\t\twindow.location = '" . ($this->request->getQuery('apply') == 'Y' ? str_replace('#ID#', $this->arResult['ID'], $this->arResult['EDIT_PAGE_TEMPLATE']) : CUtil::JSEscape($this->arResult['LIST_PAGE_URL'])) . "';\n\t\t\t</script>\n\t\t";
$this->sendResponse($response);
}