19 declare(strict_types=0);
    47         object $a_parent_class,
    54         $this->
http = $DIC->http();
    56         $this->ui_factory = $DIC->ui()->factory();
    57         $this->ui_renderer = $DIC->ui()->renderer();
    59         $this->container = $a_container_obj;
    60         $this->main_container = $a_main_container;
    78     public function init(): void
    81         $this->
setRowTemplate(
'tpl.crs_manage_timings_row.html', 
'components/ILIAS/Course');
    83         $this->
setTitle($this->
lng->txt(
'edit_timings_list'));
    86         $this->
addColumn($this->
lng->txt(
'crs_timings_short_active'), 
'', 
'', 
false);
    89             $this->
addColumn($this->
lng->txt(
'crs_timings_short_start_end_rel'), 
'', 
'', 
false);
    90             $this->
addColumn($this->
lng->txt(
'crs_timings_time_frame'), 
'', 
'', 
false);
    92             $this->
addColumn($this->
lng->txt(
'crs_timings_short_start_end'), 
'', 
'', 
false);
    93             $this->
addColumn($this->
lng->txt(
'crs_timings_short_end'), 
'');
    95         $this->
addColumn($this->
lng->txt(
'crs_timings_short_changeable'), 
'', 
'', 
false);
   110     protected function fillRow(array $a_set): void
   112         if ($a_set[
'error'] ?? 
false) {
   113             $this->tpl->setVariable(
'TD_CLASS', 
'warning');
   115             $this->tpl->setVariable(
'TD_CLASS', 
'std');
   119         if (strlen($a_set[
'title_link'] ?? 
'')) {
   120             $this->tpl->setCurrentBlock(
'title_link');
   121             $this->tpl->setVariable(
'TITLE_LINK', $a_set[
'title_link'] ?? 
'');
   122             $this->tpl->setVariable(
   125                     $a_set[
'title'] ?? 
'',
   126                     ENT_QUOTES | ENT_SUBSTITUTE,
   130             $this->tpl->parseCurrentBlock();
   132             $this->tpl->setCurrentBlock(
'title_plain');
   133             $this->tpl->setVariable(
   136                     $a_set[
'title'] ?? 
'',
   137                     ENT_QUOTES | ENT_SUBSTITUTE,
   141             $this->tpl->parseCurrentBlock();
   143         if (strlen($a_set[
'desc'] ?? 
'')) {
   144             $this->tpl->setCurrentBlock(
'item_description');
   145             $this->tpl->setVariable(
'DESC', $a_set[
'desc'] ?? 
'');
   146             $this->tpl->parseCurrentBlock();
   149         if ($a_set[
'failure'] ?? 
false) {
   150             $icon = $this->ui_factory->symbol()->icon()->custom(
   152                 $this->
lng->txt(
"alert"),
   155             $this->tpl->setCurrentBlock(
'alert');
   156             $this->tpl->setVariable(
'IMG_ALERT', $this->ui_renderer->render(
$icon));
   157             $this->tpl->setVariable(
"TXT_ALERT", $this->
lng->txt($a_set[
'failure'] ?? 
''));
   158             $this->tpl->parseCurrentBlock();
   161         $error_post_item = (array) ($this->
http->request()->getParsedBody()[
'item'] ?? []);
   164         $this->tpl->setVariable(
'NAME_ACTIVE', 
'item[' . $a_set[
'ref_id'] . 
'][active]');
   166             $active = (bool) ($error_post_item[$a_set[
'ref_id']][
'active'] ?? 
false);
   167             $this->tpl->setVariable(
   169                 $active ? 
'checked="checked"' : 
''   172             $this->tpl->setVariable(
   183                 $start = (string) ($error_post_item[$a_set[
'ref_id']][
'sug_start'] ?? 
'');
   187             $this->tpl->setVariable(
'start_abs');
   188             $this->tpl->setVariable(
'SUG_START', $dt_input->render());
   189             $this->tpl->parseCurrentBlock();
   191             $this->tpl->setCurrentBlock(
'start_rel');
   192             $this->tpl->setVariable(
'START_REL_VAL', (
int) $a_set[
'item'][
'suggestion_start_rel']);
   194                 $start = (string) ($error_post_item[$a_set[
'ref_id']][
'sug_start_rel'] ?? 
'');
   195                 $this->tpl->setVariable(
'START_REL_VAL', $start);
   197                 $this->tpl->setVariable(
'START_REL_VAL', (
int) $a_set[
'item'][
'suggestion_start_rel']);
   199             $this->tpl->setVariable(
'START_REL_NAME', 
'item[' . $a_set[
'ref_id'] . 
'][sug_start_rel]');
   200             $this->tpl->parseCurrentBlock();
   205                 $duration = (string) ($error_post_item[$a_set[
'ref_id']][
'duration_a'] ?? 
'');
   206                 $this->tpl->setVariable(
'VAL_DURATION_A', 
$duration);
   208                 $duration = $a_set[
'item'][
'suggestion_end_rel'] - $a_set[
'item'][
'suggestion_start_rel'];
   209                 $this->tpl->setVariable(
'VAL_DURATION_A', (
int) 
$duration);
   211             $this->tpl->setVariable(
'NAME_DURATION_A', 
'item[' . $a_set[
'ref_id'] . 
'][duration_a]');
   216                 $end = (string) ($error_post_item[$a_set[
'ref_id']][
'sug_end'] ?? 
'');
   220             $this->tpl->setVariable(
'end_abs');
   221             $this->tpl->setVariable(
'SUG_END', $dt_end->render());
   222             $this->tpl->parseCurrentBlock();
   226         $this->tpl->setVariable(
'NAME_CHANGE', 
'item[' . $a_set[
'ref_id'] . 
'][change]');
   227         $this->tpl->setVariable(
'CHECKED_CHANGE', $a_set[
'item'][
'changeable'] ? 
'checked="checked"' : 
'');
   229             $change = (bool) ($error_post_item[$a_set[
'ref_id']][
'change'] ?? 
false);
   230             $this->tpl->setVariable(
   232                 $change ? 
'checked="checked"' : 
''   235             $this->tpl->setVariable(
'CHECKED_CHANGE', $a_set[
'item'][
'changeable'] ? 
'checked="checked"' : 
'');
   239     public function parse(array $a_item_data, array $a_failed_update = array()): void
   242         foreach ($a_item_data as $item) {
   243             $current_row = array();
   246             if ($item[
'type'] == 
'itgr') {
   249             $current_row[
'ref_id'] = $item[
'ref_id'];
   250             $current_row = $this->
parseTitle($current_row, $item);
   253             if (array_key_exists($item[
'ref_id'], $a_failed_update)) {
   254                 $current_row[
'failed'] = 
true;
   255                 $current_row[
'failure'] = $a_failed_update[$item[
'ref_id']];
   257             $current_row[
'item'] = $item;
   259             $rows[] = $current_row;
   264     protected function parseTitle(array $current_row, array $item): array
   266         switch ($item[
'type']) {
   269                 $current_row[
'title'] = $item[
'title'];
   270                 $current_row[
'title_link'] = ilLink::_getLink($item[
'ref_id'], $item[
'type']);
   274                 if (strlen($item[
'title'])) {
   275                     $current_row[
'title'] = $item[
'title'];
   281                         (
bool) $app_info[
'fullday']
   284                 $current_row[
'title_link'] = ilLink::_getLink($item[
'ref_id'], $item[
'type']);
   288                 $current_row[
'title'] = $item[
'title'];
   289                 $current_row[
'title_link'] = 
'';
   292         $current_row[
'desc'] = $item[
'desc'];
 parseTitle(array $current_row, array $item)
 
const IL_CRS_VIEW_TIMING_ABSOLUTE
 
setFormAction(string $a_form_action, bool $a_multipart=false)
 
addCommandButton(string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
 
ilObjCourse $main_container
 
static _lookupObjId(int $ref_id)
 
failure()
 description: > Example for rendering a failure message box. 
 
parse(array $a_item_data, array $a_failed_update=array())
 
setShowRowsSelector(bool $a_value)
Toggle rows-per-page selector. 
 
static _lookupAppointment(int $a_obj_id)
 
static http()
Fetches the global http state from ILIAS. 
 
setRowTemplate(string $a_template, string $a_template_dir="")
Set row template. 
 
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory) 
 
const IL_CRS_VIEW_TIMING_RELATIVE
 
setFailureStatus(bool $a_status)
 
__construct(object $a_parent_class, string $a_parent_cmd, ilObject $a_container_obj, ilObjCourse $a_main_container)
Constructor. 
 
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
 
TableGUI class for timings administration. 
 
static _appointmentToString(int $start, int $end, bool $fulltime)
 
__construct(Container $dic, ilPlugin $plugin)
 
addColumn(string $a_text, string $a_sort_field="", string $a_width="", bool $a_is_checkbox_action_column=false, string $a_class="", string $a_tooltip="", bool $a_tooltip_with_html=false)