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


PHP CUserOptions::setOption方法代码示例

本文整理汇总了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());
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:13,代码来源:banner.php

示例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();
     }
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:16,代码来源:ajax.php

示例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);
         }
     }
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:16,代码来源:contact.php

示例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));
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:8,代码来源:class.php

示例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()));
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:13,代码来源:folderlistoptions.php

示例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'));
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:ajax.php

示例7: resetDocumentServiceCode

 public static function resetDocumentServiceCode()
 {
     \CUserOptions::setOption(Driver::INTERNAL_MODULE_ID, 'doc_service', array('default' => ''));
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:4,代码来源:configuration.php

示例8: saveFirstRun

 private function saveFirstRun($userId)
 {
     \CUserOptions::setOption(Driver::INTERNAL_MODULE_ID, 'recently_used', array('r' => '1'), false, $userId);
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:4,代码来源:recentlyusedmanager.php

示例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();
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:9,代码来源:desktop.php

示例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);
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:36,代码来源:class.php


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