24 include_once(
'./Services/Table/classes/class.ilTable2GUI.php');
49 $this->lng->loadLanguageModule(
'dateplaner');
55 $this->
addColumn($this->lng->txt(
'type'),
'',
"1");
56 $this->
addColumn($this->lng->txt(
'title'),
'title',
"100%");
59 $this->
setFormAction($this->ctrl->getFormAction($a_parent_obj));
60 $this->
setRowTemplate(
"tpl.show_category_row.html",
"Services/Calendar");
62 if (!$ilUser->prefs[
"screen_reader_optimization"])
67 $this->
enable(
'select_all');
84 $this->tpl->setVariable(
'VAL_ID',$a_set[
'id']);
87 $this->tpl->setVariable(
'VAL_CHECKED',
'checked="checked"');
89 $this->tpl->setVariable(
'VAL_TITLE',$a_set[
'title']);
90 $this->tpl->setVariable(
'BGCOLOR',$a_set[
'color']);
92 if($a_set[
'editable'] or 1)
94 #$this->tpl->setCurrentBlock('title_link');
95 $this->ctrl->setParameter($this->
getParentObject(),
'category_id',$a_set[
'id']);
96 $this->tpl->setVariable(
'EDIT_LINK',$this->ctrl->getLinkTarget($this->getParentObject(),
'details'));
97 $this->tpl->setVariable(
'TXT_EDIT',$this->lng->txt(
'edit'));
98 #$this->tpl->parseCurrentBlock();
100 switch($a_set[
'type'])
104 $this->tpl->setVariable(
'IMG_ALT', $this->lng->txt(
'cal_type_system'));
109 $this->tpl->setVariable(
'IMG_ALT',$this->lng->txt(
'cal_type_personal'));
115 $this->tpl->setVariable(
'IMG_ALT',$this->lng->txt(
'cal_type_'.$type));
118 if(strlen($a_set[
'path']))
120 $this->tpl->setCurrentBlock(
'calendar_path');
121 $this->tpl->setVariable(
'ADD_PATH_INFO',$a_set[
'path']);
122 $this->tpl->parseCurrentBlock();
134 global $ilUser,$tree;
136 include_once(
'./Services/Calendar/classes/class.ilCalendarCategories.php');
137 include_once(
'./Services/Calendar/classes/class.ilCalendarHidden.php');
140 $hidden = $hidden_obj->getHidden();
143 $all = $cats->getCategoriesInfo();
144 $tmp_title_counter = array();
145 $categories = array();
146 foreach($all as $category)
148 $tmp_arr[
'obj_id'] = $category[
'obj_id'];
149 $tmp_arr[
'id'] = $category[
'cat_id'];
150 $tmp_arr[
'hidden'] = (bool) in_array($category[
'cat_id'],$hidden);
151 $tmp_arr[
'title'] = $category[
'title'];
152 $tmp_arr[
'type'] = $category[
'type'];
153 $tmp_arr[
'color'] = $category[
'color'];
154 $tmp_arr[
'editable'] = $category[
'editable'];
156 $categories[] = $tmp_arr;
159 $tmp_title_counter[$category[
'type'].
'_'.$category[
'title']]++;
163 $path_categories = array();
164 foreach($categories as $cat)
168 if($tmp_title_counter[$cat[
'type'].
'_'.$cat[
'title']] > 1)
172 $cat[
'path'] = $this->
buildPath($ref_id);
177 $path_categories[] = $cat;
179 $this->
setData($path_categories ? $path_categories : array());
186 $path_arr = $tree->getPathFull($a_ref_id,ROOT_FOLDER_ID);
188 unset($path_arr[count($path_arr) - 1]);
190 foreach($path_arr as
$data)
196 $path .= $data[
'title'];
198 if(strlen(
$path) > 30)
200 return '...'.substr(
$path,-30);