1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
note.php
См. документацию.
1<?php
2namespace Bitrix\Landing\Controller;
3
4use \Bitrix\Landing\Rights;
5use \Bitrix\Landing\Note\Target;
6use \Bitrix\Landing\Note\Source;
7use \Bitrix\Landing\Site\Type;
8use \Bitrix\Main\Engine\Controller;
9use \Bitrix\Main\Error;
10
11class Note extends Controller
12{
13 public function getDefaultPreFilters()
14 {
15 return [];
16 }
17
22 protected static function canCreateNew(): bool
23 {
24 Type::setScope(Type::SCOPE_CODE_KNOWLEDGE);
26 }
27
32 public static function getTargetsAction(): array
33 {
34 return [
35 'list' => Target::getShortList(),
36 'canCreateNew' => self::canCreateNew()
37 ];
38 }
39
48 public function createNoteAction(int $kbId, string $sourceType, int $sourceId, ?string $scope = null): ?array
49 {
50 $result = null;
51
52 if ($scope)
53 {
54 Type::setScope($scope);
55 }
57 {
58 $result = Source::createFromSource($kbId, $sourceType, $sourceId);
59 }
60 if (is_array($result))
61 {
62 return $result;
63 }
64
65 $this->addError(new Error('Error occurred during note creating.'));
66 return null;
67 }
68}
getDefaultPreFilters()
Определения note.php:13
static canCreateNew()
Определения note.php:22
createNoteAction(int $kbId, string $sourceType, int $sourceId, ?string $scope=null)
Определения note.php:48
static getTargetsAction()
Определения note.php:32
static getShortList()
Определения target.php:57
const ADDITIONAL_RIGHTS
Определения rights.php:33
static hasAdditionalRight($code, $type=null, bool $checkExtraRights=false, bool $strict=false)
Определения rights.php:1027
addError(Error $error)
Определения controller.php:1070
setScope($scope)
Определения controller.php:373
Определения 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
$result
Определения get_property_values.php:14
check_bitrix_sessid($varname='sessid')
Определения tools.php:4686
Определения source.php:2