24 include_once(
'./Services/Table/classes/class.ilTable2GUI.php');
51 $this->lng->loadLanguageModule(
'dateplaner');
56 $this->
setId(
'calmng');
58 parent::__construct($a_parent_obj,
'showCategories');
61 $this->
addColumn($this->lng->txt(
'type'),
'type_sortable',
"1");
62 $this->
addColumn($this->lng->txt(
'title'),
'title',
"100%");
66 $this->
setFormAction($this->ctrl->getFormAction($a_parent_obj));
67 $this->
setRowTemplate(
"tpl.show_category_row.html",
"Services/Calendar");
69 if (!$ilUser->prefs[
"screen_reader_optimization"])
76 $this->
enable(
'select_all');
96 $this->tpl->setVariable(
'VAL_ID',$a_set[
'id']);
99 $this->tpl->setVariable(
'VAL_CHECKED',
'checked="checked"');
101 $this->tpl->setVariable(
'VAL_TITLE',$a_set[
'title']);
102 $this->tpl->setVariable(
'BGCOLOR',$a_set[
'color']);
104 $this->ctrl->setParameter($this->
getParentObject(),
'category_id',$a_set[
'id']);
105 $this->tpl->setVariable(
'EDIT_LINK',$this->ctrl->getLinkTarget($this->getParentObject(),
'details'));
106 $this->tpl->setVariable(
'TXT_EDIT',$this->lng->txt(
'edit'));
108 switch($a_set[
'type'])
112 $this->tpl->setVariable(
'IMG_ALT', $this->lng->txt(
'cal_type_system'));
117 $this->tpl->setVariable(
'IMG_ALT',$this->lng->txt(
'cal_type_personal'));
123 $this->tpl->setVariable(
'IMG_ALT',$this->lng->txt(
'cal_type_'.$type));
126 if(strlen($a_set[
'path']))
128 $this->tpl->setCurrentBlock(
'calendar_path');
129 $this->tpl->setVariable(
'ADD_PATH_INFO',$a_set[
'path']);
130 $this->tpl->parseCurrentBlock();
135 $this->ctrl->setParameterByClass(
'ilcalendarsubscriptiongui',
'seed',$this->seed->get(
IL_CAL_DATE));
136 $this->ctrl->setParameterByClass(
'ilcalendarsubscriptiongui',
'cal_id',$a_set[
'id']);
137 $this->tpl->setVariable(
'SUB_LINK',$this->ctrl->getLinkTargetByClass(
array(
'ilcalendarpresentationgui',
'ilcalendarsubscriptiongui')));
138 $this->tpl->setVariable(
'SUB_ALT',$this->lng->txt(
'ical_export'));
152 include_once(
'./Services/Calendar/classes/class.ilCalendarCategories.php');
153 include_once(
'./Services/Calendar/classes/class.ilCalendarHidden.php');
156 $hidden = $hidden_obj->getHidden();
159 $all = $cats->getCategoriesInfo();
160 $tmp_title_counter =
array();
161 $categories =
array();
162 foreach($all as $category)
164 $tmp_arr[
'obj_id'] = $category[
'obj_id'];
165 $tmp_arr[
'id'] = $category[
'cat_id'];
166 $tmp_arr[
'hidden'] = (bool) in_array($category[
'cat_id'],$hidden);
167 $tmp_arr[
'title'] = $category[
'title'];
168 $tmp_arr[
'type'] = $category[
'type'];
174 $tmp_arr[
'type_sortable'] .= (
'_'.ilObject::_lookupType($category[
'obj_id']));
177 $tmp_arr[
'color'] = $category[
'color'];
178 $tmp_arr[
'editable'] = $category[
'editable'];
180 $categories[] = $tmp_arr;
183 $tmp_title_counter[$category[
'type'].
'_'.$category[
'title']]++;
187 $path_categories =
array();
188 foreach($categories as $cat)
192 if($tmp_title_counter[$cat[
'type'].
'_'.$cat[
'title']] > 1)
196 $cat[
'path'] = $this->
buildPath($ref_id);
201 $path_categories[] = $cat;
203 $this->
setData($path_categories);
210 $path_arr = $tree->getPathFull($a_ref_id,ROOT_FOLDER_ID);
212 unset($path_arr[count($path_arr) - 1]);
214 foreach($path_arr as
$data)
220 $path .= $data[
'title'];
222 if(strlen(
$path) > 30)
224 return '...'.substr(
$path,-30);
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
static lookupCategorySortIndex($a_type_id)
Lookup sort index of calendar type.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
show presentation of calendar category side block
setDisplayAsBlock($a_val)
Set display as block.
__construct($a_parent_obj, ilDateTime $seed=null)
Constructor.
getParentObject()
Get parent object.
static _getAllReferences($a_id)
get all reference ids of object
static _getInstanceByUserId($a_user_id)
get instance by user id
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
enable($a_module_name)
enables particular modules of table
static _getInstance($a_usr_id=0)
get singleton instance
setRowTemplate($a_template, $a_template_dir="")
Set row template.
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
disable($a_module_name)
diesables particular modules of table
setFormName($a_formname="")
Set Form name.
setSelectAllCheckbox($a_select_all_checkbox)
Set the name of the checkbox that should be toggled with a select all button.
addColumn($a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.