function __renderUserItem($item, $level) { include_once 'Modules/Course/classes/Timings/class.ilTimingPlaned.php'; include_once './Services/MetaData/classes/class.ilMDEducational.php'; $this->lng->loadLanguageModule('meta'); $usr_planed = new ilTimingPlaned($item['ref_id'], $_GET['member_id']); for ($i = 0; $i < $level; $i++) { $this->tpl->touchBlock('start_indent'); $this->tpl->touchBlock('end_indent'); } if (strlen($item['description'])) { $this->tpl->setCurrentBlock("item_description"); $this->tpl->setVariable("DESC", $item['description']); $this->tpl->parseCurrentBlock(); } if ($tlt = ilMDEducational::_getTypicalLearningTimeSeconds($item['obj_id'])) { $this->tpl->setCurrentBlock("tlt"); $this->tpl->setVariable("TXT_TLT", $this->lng->txt('meta_typical_learning_time')); $this->tpl->setVariable("TLT_VAL", ilFormat::_secondsToString($tlt)); $this->tpl->parseCurrentBlock(); } $this->tpl->setCurrentBlock("title_plain"); $this->tpl->setVariable("TITLE", $item['title']); $this->tpl->parseCurrentBlock(); $this->tpl->setCurrentBlock("container_standard_row"); $this->tpl->setVariable("ROWCLASS", ilUtil::switchColor($this->counter++, 'tblrow1', 'tblrow2')); #$this->tpl->setVariable("TYPE_IMG",ilUtil::getImagePath('icon_'.$item['type'].'.png')); $this->tpl->setVariable('TYPE_IMG', ilUtil::getTypeIconPath($item['type'], $item['obj_id'], 'tiny')); $this->tpl->setVariable("TYPE_ALT_IMG", $this->lng->txt('obj_' . $item['type'])); if ($item['timing_type'] == ilObjectActivation::TIMINGS_PRESETTING) { $this->tpl->setVariable('SUG_START', ilDatePresentation::formatDate(new ilDate($item['suggestion_start'], IL_CAL_UNIX))); $this->tpl->setVariable('SUG_END', ilDatePresentation::formatDate(new ilDate($item['suggestion_end'], IL_CAL_UNIX))); } if ($item['changeable'] and $item['timing_type'] == ilObjectActivation::TIMINGS_PRESETTING) { if ($usr_planed->getPlanedStartingTime()) { $start = $usr_planed->getPlanedStartingTime(); } else { $start = $item['suggestion_start']; } $this->tpl->setVariable('OWN_START', ilDatePresentation::formatDate(new ilDate($start, IL_CAL_UNIX))); if ($usr_planed->getPlanedEndingTime()) { $end = $usr_planed->getPlanedEndingTime(); } else { $end = $item['suggestion_end']; } if ($start != $item['suggestion_start'] or $end != $item['suggestion_end']) { $this->tpl->setVariable("OK_IMG", ilUtil::getImagePath('icon_ok.png')); $this->tpl->setVariable("OK_ALT", $this->lng->txt('crs_timings_changed')); } else { $this->tpl->setVariable("OK_IMG", ilUtil::getImagePath('icon_not_ok.png')); $this->tpl->setVariable("OK_ALT", $this->lng->txt('crs_timings_not_changed')); } $this->tpl->setVariable('OWN_END', ilDatePresentation::formatDate(new ilDate($end, IL_CAL_UNIX))); } $this->tpl->parseCurrentBlock(); foreach (ilObjectActivation::getTimingsAdministrationItems($item['ref_id']) as $item_data) { if ($item_data['timing_type'] == ilObjectActivation::TIMINGS_PRESETTING or ilObjectActivation::hasChangeableTimings($item_data['ref_id'])) { $this->__renderUserItem($item_data, $level + 1); } } }