1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
useroption.php
См. документацию.
1<?php
2
3declare(strict_types=1);
4
5namespace Bitrix\Main\Controller;
6
7use Bitrix\Main\Engine;
8use Bitrix\Main\Engine\ActionFilter;
9use Bitrix\Main\Error;
10
19{
20 public const ERROR_USER_NOT_AUTHORIZED = 'ERROR_USER_NOT_AUTHORIZED';
21
22 protected function getDefaultPreFilters(): array
23 {
24 return array_merge(
25 parent::getDefaultPreFilters(),
26 [
30 ),
31 ]
32 );
33 }
34
35 public function saveOptionsAction(array $newValues): void
36 {
37 \CUserOptions::SetOptionsFromArray($newValues);
38 }
39
40 public function deleteOptionAction(string $category, string $name, bool $common = false): void
41 {
42 if (!($GLOBALS["USER"] instanceof \CUser))
43 {
44 $this->addError(new Error('User is not authorized', self::ERROR_USER_NOT_AUTHORIZED));
45
46 return;
47 }
48
49 $currentUser = $GLOBALS["USER"];
50 if ($common && !$currentUser->CanDoOperation('edit_other_settings'))
51 {
52 $common = false;
53 }
54
55 \CUserOptions::DeleteOption(
56 $category,
57 $name,
58 $common,
59 $currentUser->getId()
60 );
61 }
62}
deleteOptionAction(string $category, string $name, bool $common=false)
Определения useroption.php:40
const ERROR_USER_NOT_AUTHORIZED
Определения useroption.php:20
saveOptionsAction(array $newValues)
Определения useroption.php:35
addError(Error $error)
Определения controller.php:1070
Определения error.php:15
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$name
Определения menu_edit.php:35
$GLOBALS['____1690880296']
Определения license.php:1