24 include_once(
'./Services/Table/classes/class.ilTable2GUI.php');
55 die(
"ilCalendarCategoryTableGUI::_construct");
59 $this->lng->loadLanguageModule(
'dateplaner');
64 $this->
setId(
'calmng');
66 parent::__construct($a_parent_obj,
'showCategories');
69 $this->
addColumn($this->lng->txt(
'type'),
'type_sortable',
"1");
70 $this->
addColumn($this->lng->txt(
'title'),
'title',
"100%");
74 $this->
setFormAction($this->ctrl->getFormAction($a_parent_obj));
75 $this->
setRowTemplate(
"tpl.show_category_row.html",
"Services/Calendar");
77 if (!
$ilUser->prefs[
"screen_reader_optimization"]) {
83 $this->
enable(
'select_all');
103 $this->tpl->setVariable(
'VAL_ID', $a_set[
'id']);
104 if (!$a_set[
'hidden']) {
105 $this->tpl->setVariable(
'VAL_CHECKED',
'checked="checked"');
107 $this->tpl->setVariable(
'VAL_TITLE', $a_set[
'title']);
108 $this->tpl->setVariable(
'BGCOLOR', $a_set[
'color']);
110 $this->ctrl->setParameter($this->
getParentObject(),
'category_id', $a_set[
'id']);
111 $this->tpl->setVariable(
'EDIT_LINK', $this->ctrl->getLinkTarget($this->getParentObject(),
'details'));
112 $this->tpl->setVariable(
'TXT_EDIT', $this->lng->txt(
'edit'));
114 switch ($a_set[
'type']) {
117 $this->tpl->setVariable(
'IMG_ALT', $this->lng->txt(
'cal_type_system'));
122 $this->tpl->setVariable(
'IMG_ALT', $this->lng->txt(
'cal_type_personal'));
128 $this->tpl->setVariable(
'IMG_ALT', $this->lng->txt(
'cal_type_' .
$type));
131 if (strlen($a_set[
'path'])) {
132 $this->tpl->setCurrentBlock(
'calendar_path');
133 $this->tpl->setVariable(
'ADD_PATH_INFO', $a_set[
'path']);
134 $this->tpl->parseCurrentBlock();
139 $this->ctrl->setParameterByClass(
'ilcalendarsubscriptiongui',
'seed', $this->seed->get(
IL_CAL_DATE));
140 $this->ctrl->setParameterByClass(
'ilcalendarsubscriptiongui',
'category_id', $a_set[
'id']);
141 $this->tpl->setVariable(
'SUB_LINK', $this->ctrl->getLinkTargetByClass(array(
'ilcalendarpresentationgui',
'ilcalendarsubscriptiongui')));
142 $this->ctrl->setParameterByClass(
'ilcalendarsubscriptiongui',
'category_id',
"");
143 $this->tpl->setVariable(
'SUB_ALT', $this->lng->txt(
'ical_export'));
157 $tree = $DIC[
'tree'];
159 include_once(
'./Services/Calendar/classes/class.ilCalendarCategories.php');
160 include_once(
'./Services/Calendar/classes/class.ilCalendarVisibility.php');
163 $hidden = $hidden_obj->getHidden();
166 $all = $cats->getCategoriesInfo();
167 $tmp_title_counter = array();
168 $categories = array();
169 foreach ($all as $category) {
170 $tmp_arr[
'obj_id'] = $category[
'obj_id'];
171 $tmp_arr[
'id'] = $category[
'cat_id'];
172 $tmp_arr[
'hidden'] = (bool) in_array($category[
'cat_id'], $hidden);
173 $tmp_arr[
'title'] = $category[
'title'];
174 $tmp_arr[
'type'] = $category[
'type'];
182 $tmp_arr[
'color'] = $category[
'color'];
183 $tmp_arr[
'editable'] = $category[
'editable'];
185 $categories[] = $tmp_arr;
188 $tmp_title_counter[$category[
'type'] .
'_' . $category[
'title']]++;
191 $path_categories = array();
192 foreach ($categories as $cat) {
194 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 $tree = $DIC[
'tree'];
212 $path_arr =
$tree->getPathFull($a_ref_id, ROOT_FOLDER_ID);
214 unset($path_arr[count($path_arr) - 1]);
216 foreach ($path_arr as
$data) {
220 $path .= $data[
'title'];
222 if (strlen(
$path) > 30) {
223 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
setDefaultOrderDirection($a_defaultorderdirection)
Set Default order direction.
static _getInstanceByUserId($a_user_id, $a_ref_id=0)
get instance by user id
setSelectAllCheckbox($a_select_all_checkbox, $a_select_all_on_top=false)
Set the name of the checkbox that should be toggled with a select all button.
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.
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.
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.