24 include_once(
'./Services/Table/classes/class.ilTable2GUI.php');
51 die(
"ilCalendarCategoryTableGUI::_construct");
55 $this->lng->loadLanguageModule(
'dateplaner');
60 $this->
setId(
'calmng');
62 parent::__construct($a_parent_obj,
'showCategories');
65 $this->
addColumn($this->lng->txt(
'type'),
'type_sortable',
"1");
66 $this->
addColumn($this->lng->txt(
'title'),
'title',
"100%");
70 $this->
setFormAction($this->ctrl->getFormAction($a_parent_obj));
71 $this->
setRowTemplate(
"tpl.show_category_row.html",
"Services/Calendar");
73 if (!$ilUser->prefs[
"screen_reader_optimization"]) {
79 $this->
enable(
'select_all');
99 $this->tpl->setVariable(
'VAL_ID', $a_set[
'id']);
100 if (!$a_set[
'hidden']) {
101 $this->tpl->setVariable(
'VAL_CHECKED',
'checked="checked"');
103 $this->tpl->setVariable(
'VAL_TITLE', $a_set[
'title']);
104 $this->tpl->setVariable(
'BGCOLOR', $a_set[
'color']);
106 $this->ctrl->setParameter($this->
getParentObject(),
'category_id', $a_set[
'id']);
107 $this->tpl->setVariable(
'EDIT_LINK', $this->ctrl->getLinkTarget($this->getParentObject(),
'details'));
108 $this->tpl->setVariable(
'TXT_EDIT', $this->lng->txt(
'edit'));
110 switch ($a_set[
'type']) {
113 $this->tpl->setVariable(
'IMG_ALT', $this->lng->txt(
'cal_type_system'));
118 $this->tpl->setVariable(
'IMG_ALT', $this->lng->txt(
'cal_type_personal'));
124 $this->tpl->setVariable(
'IMG_ALT', $this->lng->txt(
'cal_type_' .
$type));
127 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',
'category_id', $a_set[
'id']);
137 $this->tpl->setVariable(
'SUB_LINK', $this->ctrl->getLinkTargetByClass(
array(
'ilcalendarpresentationgui',
'ilcalendarsubscriptiongui')));
138 $this->ctrl->setParameterByClass(
'ilcalendarsubscriptiongui',
'category_id',
"");
139 $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.ilCalendarVisibility.php');
156 $hidden = $hidden_obj->getHidden();
159 $all = $cats->getCategoriesInfo();
160 $tmp_title_counter =
array();
161 $categories =
array();
162 foreach ($all as $category) {
163 $tmp_arr[
'obj_id'] = $category[
'obj_id'];
164 $tmp_arr[
'id'] = $category[
'cat_id'];
165 $tmp_arr[
'hidden'] = (bool) in_array($category[
'cat_id'], $hidden);
166 $tmp_arr[
'title'] = $category[
'title'];
167 $tmp_arr[
'type'] = $category[
'type'];
175 $tmp_arr[
'color'] = $category[
'color'];
176 $tmp_arr[
'editable'] = $category[
'editable'];
178 $categories[] = $tmp_arr;
181 $tmp_title_counter[$category[
'type'] .
'_' . $category[
'title']]++;
184 $path_categories =
array();
185 foreach ($categories as $cat) {
187 if ($tmp_title_counter[$cat[
'type'] .
'_' . $cat[
'title']] > 1) {
189 $cat[
'path'] = $this->
buildPath($ref_id);
194 $path_categories[] = $cat;
196 $this->
setData($path_categories);
203 $path_arr = $tree->getPathFull($a_ref_id, ROOT_FOLDER_ID);
205 unset($path_arr[count($path_arr) - 1]);
207 foreach ($path_arr as
$data) {
211 $path .= $data[
'title'];
213 if (strlen(
$path) > 30) {
214 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
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.
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.
setSelectAllCheckbox($a_select_all_checkbox)
Set the name of the checkbox that should be toggled with a select all button.