1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
Notify.php
См. документацию.
1<?php
2
3namespace Bitrix\Im\V2\Controller\Settings;
4
5use Bitrix\Im\V2\Controller\BaseController;
6use Bitrix\Im\V2\Controller\Filter\SettingsCheckAccess;
7use Bitrix\Im\V2\Settings\SettingsError;
8use Bitrix\Im\V2\Settings\UserConfiguration;
9use Bitrix\Main\Engine\CurrentUser;
10
12{
13 public const ALLOWED_SCHEME = ['simple', 'expert'];
14
15 protected function getDefaultPreFilters()
16 {
17 return array_merge(
18 parent::getDefaultPreFilters(),
19 [
21 ]
22 );
23 }
24
25 public function listAction(int $userId)
26 {
27 $userConfiguration = new UserConfiguration($userId);
28
29 return $userConfiguration->getNotifySettings();
30 }
31
32 public function updateAction(int $userId, string $moduleId, string $name, string $type, string $value)
33 {
34 $userConfiguration = new UserConfiguration($userId);
35 $userConfiguration->updateNotifySetting([
36 'name' => $name,
37 'value' => $this->convertCharToBool($value),
38 'moduleId' => $moduleId,
39 'type' => $type
40 ]);
41
42 return true;
43 }
44
48 public function switchSchemeAction(string $scheme, CurrentUser $currentUser, ?int $userId = null): ?array
49 {
50 if (!in_array($scheme, self::ALLOWED_SCHEME, true))
51 {
52 $this->addError(new SettingsError(SettingsError::WRONG_SCHEME));
53
54 return null;
55 }
56
57 $userId ??= (int)$currentUser->getId();
58 $userConfiguration = new UserConfiguration($userId);
59 $userConfiguration->updateGeneralSetting([
60 'name' => \Bitrix\Im\V2\Settings\Entity\General::SCHEME,
61 'value' => $scheme,
62 ]);
63
64 return $userConfiguration->getNotifySettings();
65 }
66}
$type
Определения options.php:106
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
Определения check_mail.php:18
convertCharToBool(string $char, bool $default=false)
Определения BaseController.php:220
switchSchemeAction(string $scheme, CurrentUser $currentUser, ?int $userId=null)
Определения Notify.php:48
updateAction(int $userId, string $moduleId, string $name, string $type, string $value)
Определения Notify.php:32
listAction(int $userId)
Определения Notify.php:25
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$moduleId
$name
Определения menu_edit.php:35
Определения ActionUuid.php:3
Определения ufield.php:9