ILIAS  trunk Revision v13.0_alpha-52-g21c366bbdd4
ScheduleTableEditAction.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
29use ILIAS\UI\Factory as UIFactory;
32use ilLanguage;
33
39{
40 public const string ACTION_ID = 'edit';
41
42 public const string ACTION_LABEL = 'edit';
43
44 public function __construct(
45 private readonly UIFactory $ui_factory,
46 private readonly ilLanguage $lng,
47 private readonly AccessManager $access,
48 private readonly ilCtrlInterface $ctrl,
49 private readonly HttpService $http,
50 private readonly int $ref_id
51 ) {
52 }
53
54 public function getActionId(): string
55 {
56 return self::ACTION_ID;
57 }
58
59 public function getActionLabel(): string
60 {
61 return self::ACTION_LABEL;
62 }
63
64 public function isAvailable(): bool
65 {
66 return $this->access->canManageSettings($this->ref_id);
67 }
68
69 public function getTableAction(
70 URLBuilder $url_builder,
71 URLBuilderToken $row_id_token,
72 URLBuilderToken $action_token,
73 URLBuilderToken $action_type_token
74 ): Action {
75 return $this->ui_factory->table()->action()->single(
76 $this->lng->txt(self::ACTION_LABEL),
77 $url_builder
78 ->withParameter($action_token, self::ACTION_ID)
79 ->withParameter($action_type_token, 'edit'), // TODO: Check for constant.
80 $row_id_token
81 );
82 }
83
84 public function onExecute(
85 URLBuilder $url_builder,
86 URLBuilderToken $row_id_token,
87 URLBuilderToken $action_token,
88 URLBuilderToken $action_type_token
89 ): mixed {
90 $this->ctrl->setParameterByClass(
92 'schedule_id',
93 $this->http->resolveRowParameter($row_id_token->getName())
94 );
95 $this->ctrl->redirectByClass(ilBookingScheduleGUI::class, 'edit');
96
97 return null;
98 }
99
103 public function allowActionForRecord(mixed $record): bool
104 {
105 return $this->access->canManageSettings($this->ref_id);
106 }
107}
@phpstan-type ScheduleRecord array{booking_schedule_id: int, title: string, object_has_schedule: ?...
onExecute(URLBuilder $url_builder, URLBuilderToken $row_id_token, URLBuilderToken $action_token, URLBuilderToken $action_type_token)
__construct(private readonly UIFactory $ui_factory, private readonly ilLanguage $lng, private readonly AccessManager $access, private readonly ilCtrlInterface $ctrl, private readonly HttpService $http, private readonly int $ref_id)
getTableAction(URLBuilder $url_builder, URLBuilderToken $row_id_token, URLBuilderToken $action_token, URLBuilderToken $action_type_token)
Builds a Color from either hex- or rgb values.
Definition: Factory.php:31
@ilCtrl_Calls ilBookingScheduleGUI:
language handling
return['3gp', '7z', 'ai', 'aif', 'aifc', 'aiff', 'au', 'arw', 'avi', 'backup', 'bak', 'bas', 'bpmn', 'bpmn2', 'bmp', 'bib', 'bibtex', 'bz', 'bz2', 'c', 'c++', 'cc', 'cct', 'cdf', 'cer', 'class', 'cls', 'conf', 'cpp', 'crt', 'crs', 'crw', 'cr2', 'css', 'cst', 'csv', 'cur', 'db', 'dcr', 'des', 'dng', 'doc', 'docx', 'dot', 'dotx', 'dtd', 'dvi', 'el', 'eps', 'epub', 'f', 'f77', 'f90', 'flv', 'for', 'g3', 'gif', 'gl', 'gan', 'ggb', 'gsd', 'gsm', 'gtar', 'gz', 'gzip', 'h', 'hpp', 'htm', 'html', 'htmls', 'ibooks', 'ico', 'ics', 'ini', 'ipynb', 'java', 'jbf', 'jpeg', 'jpg', 'js', 'jsf', 'jso', 'json', 'latex', 'lang', 'less', 'log', 'lsp', 'ltx', 'm1v', 'm2a', 'm2v', 'm3u', 'm4a', 'm4v', 'markdown', 'm', 'mat', 'md', 'mdl', 'mdown', 'mid', 'min', 'midi', 'mobi', 'mod', 'mov', 'movie', 'mp2', 'mp3', 'mp4', 'mpa', 'mpeg', 'mpg', 'mph', 'mpga', 'mpp', 'mpt', 'mpv', 'mpx', 'mv', 'mw', 'mv4', 'nb', 'nbp', 'nef', 'nif', 'niff', 'obj', 'obm', 'odt', 'ods', 'odp', 'odg', 'odf', 'oga', 'ogg', 'ogv', 'old', 'p', 'pas', 'pbm', 'pcl', 'pct', 'pcx', 'pdf', 'pgm', 'pic', 'pict', 'png', 'por', 'pov', 'project', 'properties', 'ppa', 'ppm', 'pps', 'ppsx', 'ppt', 'pptx', 'ppz', 'ps', 'psd', 'pwz', 'qt', 'qtc', 'qti', 'qtif', 'r', 'ra', 'ram', 'rar', 'rast', 'rda', 'rev', 'rexx', 'ris', 'rf', 'rgb', 'rm', 'rmd', 'rmi', 'rmm', 'rmp', 'rt', 'rtf', 'rtx', 'rv', 's', 's3m', 'sav', 'sbs', 'sec', 'sdml', 'sgm', 'sgml', 'smi', 'smil', 'srt', 'sps', 'spv', 'stl', 'svg', 'swa', 'swf', 'swz', 'tar', 'tex', 'texi', 'texinfo', 'text', 'tgz', 'tif', 'tiff', 'ttf', 'txt', 'tmp', 'uvproj', 'vdf', 'vimeo', 'viv', 'vivo', 'vrml', 'vsdx', 'vtt', 'wav', 'webm', 'wmv', 'wmx', 'wmz', 'woff', 'wwd', 'xhtml', 'xif', 'xls', 'xlsx', 'xmind', 'xml', 'xsl', 'xsd', 'zip']
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static http()
Fetches the global http state from ILIAS.
global $lng
Definition: privfeed.php:26