19 declare(strict_types=0);
    44         object $a_parent_class,
    51         $this->
http = $DIC->http();
    53         $this->ui_factory = $DIC->ui()->factory();
    54         $this->ui_renderer = $DIC->ui()->renderer();
    56         $this->container = $a_container_obj;
    57         $this->main_container = $a_main_container;
    74         $this->user_id = $a_usr_id;
    82     public function init(): void
    85         $this->
setRowTemplate(
'tpl.crs_personal_timings_row.html', 
'components/ILIAS/Course');
    86         $this->
setTitle($this->
lng->txt(
'crs_timings_edit_personal'));
    88         $this->
addColumn($this->
lng->txt(
'crs_timings_short_start_end'), 
'');
    89         $this->
addColumn($this->
lng->txt(
'crs_timings_short_end'), 
'');
    90         $this->
addColumn($this->
lng->txt(
'crs_timings_short_changeable'), 
'');
   105     protected function fillRow(array $a_set): void
   107         if ($a_set[
'error'] ?? 
false) {
   108             $this->tpl->setVariable(
'TD_CLASS', 
'warning');
   110             $this->tpl->setVariable(
'TD_CLASS', 
'std');
   114         if (strlen($a_set[
'title_link'] ?? 
'')) {
   115             $this->tpl->setCurrentBlock(
'title_link');
   116             $this->tpl->setVariable(
'TITLE_LINK', $a_set[
'title_link']);
   117             $this->tpl->setVariable(
'TITLE_LINK_NAME', $a_set[
'title']);
   118             $this->tpl->parseCurrentBlock();
   120             $this->tpl->setCurrentBlock(
'title_plain');
   121             $this->tpl->setVariable(
'TITLE', $a_set[
'title']);
   122             $this->tpl->parseCurrentBlock();
   124         if (strlen($a_set[
'desc'] ?? 
'')) {
   125             $this->tpl->setCurrentBlock(
'item_description');
   126             $this->tpl->setVariable(
'DESC', $a_set[
'desc']);
   127             $this->tpl->parseCurrentBlock();
   129         if ($a_set[
'failure'] ?? 
false) {
   130             $icon = $this->ui_factory->symbol()->icon()->custom(
   132                 $this->
lng->txt(
"alert"),
   135             $this->tpl->setCurrentBlock(
'alert');
   136             $this->tpl->setVariable(
'IMG_ALERT', $this->ui_renderer->render(
$icon));
   137             $this->tpl->setVariable(
"TXT_ALERT", $this->
lng->txt($a_set[
'failure']));
   138             $this->tpl->parseCurrentBlock();
   142         $this->tpl->setVariable(
'NAME_ACTIVE', 
'item[' . $a_set[
'ref_id'] . 
'][active]');
   143         $this->tpl->setVariable(
   148         $error_post_item = (array) ($this->
http->request()->getParsedBody()[
'item'] ?? []);
   154             $dt_input->setDate(
new ilDate($error_post_item[$a_set[
'ref_id']][
'sug_start'] ?? 
'', 
IL_CAL_DATE));
   157         if (!($a_set[
'item'][
'changeable'] ?? 
false)) {
   158             $dt_input->setDisabled(
true);
   161         $this->tpl->setVariable(
'start_abs');
   162         $this->tpl->setVariable(
'SUG_START', $dt_input->render());
   163         $this->tpl->parseCurrentBlock();
   169             $dt_end->setDate(
new ilDate($error_post_item[$a_set[
'ref_id']][
'sug_end'] ?? 
'', 
IL_CAL_DATE));
   172         if (!($a_set[
'item'][
'changeable'] ?? 
false)) {
   173             $dt_end->setDisabled(
true);
   175         $this->tpl->setVariable(
'end_abs');
   176         $this->tpl->setVariable(
'SUG_END', $dt_end->render());
   177         $this->tpl->parseCurrentBlock();
   180         $this->tpl->setVariable(
   182             $a_set[
'item'][
'changeable'] ? $this->
lng->txt(
'yes') : $this->
lng->txt(
'no')
   186     public function parse(array $a_item_data, array $failed = array()): void
   189         foreach ($a_item_data as $item) {
   195             $current_row = array();
   198             if ($item[
'type'] == 
'itgr') {
   201             $current_row[
'ref_id'] = $item[
'ref_id'];
   203             $current_row = $this->
parseTitle($current_row, $item);
   206             $current_row[
'start'] = $item[
'suggestion_start'];
   208             if (array_key_exists($item[
'ref_id'], $failed)) {
   209                 $current_row[
'failed'] = 
true;
   210                 $current_row[
'failure'] = $failed[$item[
'ref_id']];
   212             $current_row[
'item'] = $item;
   213             $rows[] = $current_row;
   227                 $a_item[
'suggestion_start'] = $tu->getStart()->get(
IL_CAL_UNIX);
   230                 $a_item[
'suggestion_end'] = $tu->getEnd()->get(
IL_CAL_UNIX);
   236     protected function parseTitle(array $current_row, array $item): array
   238         switch ($item[
'type']) {
   241                 $current_row[
'title'] = $item[
'title'];
   242                 $current_row[
'title_link'] = ilLink::_getLink($item[
'ref_id'], $item[
'type']);
   246                 if (strlen($item[
'title'])) {
   247                     $current_row[
'title'] = $item[
'title'];
   253                         (
bool) $app_info[
'fullday']
   256                 $current_row[
'title_link'] = ilLink::_getLink($item[
'ref_id'], $item[
'type']);
   260                 $current_row[
'title'] = $item[
'title'];
   261                 $current_row[
'title_link'] = 
'';
   264         $current_row[
'desc'] = $item[
'desc'];
 
ilObjCourse $main_container
 
setFormAction(string $a_form_action, bool $a_multipart=false)
 
parse(array $a_item_data, array $failed=array())
 
addCommandButton(string $a_cmd, string $a_text, string $a_onclick='', string $a_id="", string $a_class="")
 
__construct(object $a_parent_class, string $a_parent_cmd, ilObject $a_container_obj, ilObjCourse $a_main_container)
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
parseUserTimings(array $a_item)
 
parseTitle(array $current_row, array $item)
 
static _lookupObjId(int $ref_id)
 
failure()
 description: > Example for rendering a failure message box. 
 
setShowRowsSelector(bool $a_value)
Toggle rows-per-page selector. 
 
static _lookupAppointment(int $a_obj_id)
 
static http()
Fetches the global http state from ILIAS. 
 
setFailureStatus(bool $a_status)
 
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) 
 
setTitle(string $a_title, string $a_icon="", string $a_icon_alt="")
 
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)
 
TableGUI class for editing personal timings. 
 
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)