ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilCalendarSelectionBlockGUI Class Reference

BlockGUI class calendar selection. More...

+ Inheritance diagram for ilCalendarSelectionBlockGUI:
+ Collaboration diagram for ilCalendarSelectionBlockGUI:

Public Member Functions

 __construct ($a_seed, $a_ref_id=0)
 Constructor. More...
 
 getBlockType ()
 
Returns
string
More...
 
 executeCommand ()
 execute command More...
 
 getCalendars ()
 Get calendars. More...
 
 fillDataSection ()
 Fill data section. More...
 
 getHTML ()
 Get block HTML code. More...
 
- Public Member Functions inherited from ilBlockGUI
 getBlockType ()
 
 __construct ()
 Constructor. More...
 
 addHeaderLink ($a_href, $a_text, $status=true)
 
 getHeaderLinks ()
 
 setData ($a_data)
 Set Data. More...
 
 getData ()
 Get Data. More...
 
 setBigMode ($a_bigmode)
 Set Big Mode. More...
 
 getBigMode ()
 Get Big Mode. More...
 
 setBlockId ($a_block_id=0)
 Set Block Id. More...
 
 getBlockId ()
 Get Block Id. More...
 
 setAvailableDetailLevels ($a_max, $a_min=0)
 Set Available Detail Levels. More...
 
 setCurrentDetailLevel ($a_currentdetaillevel)
 Set Current Detail Level. More...
 
 setGuiObject (&$a_gui_object)
 Set GuiObject. More...
 
 getGuiObject ()
 Get GuiObject. More...
 
 getCurrentDetailLevel ()
 Get Current Detail Level. More...
 
 setTitle ($a_title)
 Set Title. More...
 
 getTitle ()
 Get Title. More...
 
 setImage ($a_image)
 Set Image. More...
 
 getImage ()
 Get Image. More...
 
 setOffset ($a_offset)
 Set Offset. More...
 
 getOffset ()
 Get Offset. More...
 
 correctOffset ()
 
 setLimit ($a_limit)
 Set Limit. More...
 
 getLimit ()
 Get Limit. More...
 
 setEnableEdit ($a_enableedit)
 Set EnableEdit. More...
 
 getEnableEdit ()
 Get EnableEdit. More...
 
 setRepositoryMode ($a_repositorymode)
 Set RepositoryMode. More...
 
 getRepositoryMode ()
 Get RepositoryMode. More...
 
 setFooterInfo ($a_footerinfo, $a_hide_and_icon=false)
 Set Footer Info. More...
 
 getFooterInfo ($a_hide_and_icon=false)
 Get Footer Info. More...
 
 setSubtitle ($a_subtitle)
 Set Subtitle. More...
 
 getSubtitle ()
 Get Subtitle. More...
 
 setRefId ($a_refid)
 Set Ref Id (only used if isRepositoryObject() is true). More...
 
 getRefId ()
 Get Ref Id (only used if isRepositoryObject() is true). More...
 
 setAdminCommands ($a_admincommands)
 Set Administration Commmands. More...
 
 getAdminCommands ()
 Get Administration Commmands. More...
 
 setColSpan ($a_colspan)
 Set Columns Span. More...
 
 getColSpan ()
 Get Columns Span. More...
 
 setEnableDetailRow ($a_enabledetailrow)
 Set EnableDetailRow. More...
 
 getEnableDetailRow ()
 Get EnableDetailRow. More...
 
 setEnableNumInfo ($a_enablenuminfo)
 Set Enable Item Number Info. More...
 
 getEnableNumInfo ()
 Get Enable Item Number Info. More...
 
 setProperties ($a_properties)
 This function is supposed to be used for block type specific properties, that should be inherited through ilColumnGUI->setBlockProperties. More...
 
 getProperty ($a_property)
 
 setProperty ($a_property, $a_value)
 
 setRowTemplate ($a_rowtemplatename, $a_rowtemplatedir="")
 Set Row Template Name. More...
 
 getNavParameter ()
 
 getDetailParameter ()
 
 getConfigParameter ()
 
 getMoveParameter ()
 
 getRowTemplateName ()
 Get Row Template Name. More...
 
 getRowTemplateDir ()
 Get Row Template Directory. More...
 
 addBlockCommand ( $a_href, $a_text, $a_target="", $a_img="", $a_right_aligned=false, $a_checked=false, $a_html="")
 Add Block Command. More...
 
 getBlockCommands ()
 Get Block commands. More...
 
 addHeaderCommand ($a_href, $a_text, $a_as_close=false)
 Add Header Block Command. More...
 
 getHeaderCommands ()
 Get Header Block commands. More...
 
 addFooterLink ( $a_text, $a_href="", $a_onclick="", $a_block_id="", $a_top=false, $a_omit_separator=false, $a_checked=false)
 Add a footer text/link. More...
 
 getFooterLinks ()
 Get footer links. More...
 
 clearFooterLinks ()
 Clear footer links. More...
 
 handleDetailLevel ()
 Handle read/write current detail level. More...
 
 getHTML ()
 Handle config status. More...
 
 fillHeaderCommands ()
 Fill header commands block. More...
 
 fillHeaderTitleBlock ()
 Fill header title block (title and. More...
 
 setDataSection ($a_content)
 Call this from overwritten fillDataSection(), if standard row based data is not used. More...
 
 fillDataSection ()
 Standard implementation for row based data. More...
 
 fillRow ($a_set)
 
 fillFooter ()
 
 fillPreviousNext ()
 Fill previous/next row. More...
 
 setPreviousNextLinks ()
 Get previous/next linkbar. More...
 
 fillFooterLinks ($a_top=false, $a_numinfo="")
 Fill footer links. More...
 
 fillDetailRow ()
 Fill Detail Setting Row. More...
 

Static Public Member Functions

static getScreenMode ()
 Get Screen Mode for current command. More...
 
static getScreenMode ()
 Get Screen Mode for current command. More...
 

Data Fields

const CAL_GRP_CURRENT_CONT_CONS = "curr_cont_cons"
 
const CAL_GRP_CURRENT_CONT = "curr_cont"
 
const CAL_GRP_PERSONAL = "personal"
 
const CAL_GRP_OTHERS = "others"
 

Static Public Attributes

static $block_type = "cal_sel"
 

Protected Member Functions

 isRepositoryObject ()
 Returns whether block has a corresponding repository object.
Returns
bool
More...
 
 buildPath ($a_ref_id)
 Build path for ref id. More...
 
 renderItem ($a_set, $a_tpl)
 Render item. More...
 
- Protected Member Functions inherited from ilBlockGUI
 isRepositoryObject ()
 Returns whether block has a corresponding repository object. More...
 
 fillRowColor ($a_placeholder="CSS_ROW")
 
 preloadData (array $data)
 Can be overwritten in subclasses. More...
 

Protected Attributes

 $calendar_groups = array()
 
 $calendars = array()
 
 $ref_id = 0
 
 $obj_id = 0
 
 $category_id = 0
 
- Protected Attributes inherited from ilBlockGUI
 $data = array()
 
 $colspan = 1
 
 $enablenuminfo = true
 
 $detail_min = 0
 
 $detail_max = 0
 
 $bigmode = false
 
 $footer_links = array()
 
 $block_id = 0
 
 $header_commands = array()
 
 $allow_moving = true
 
 $move = array("left" => false, "right" => false, "up" => false, "down" => false)
 
 $enabledetailrow = true
 
 $header_links = array()
 
 $footerinfo = false
 
 $footerinfo_icon = false
 
 $block_commands = array()
 
 $max_count = false
 
 $close_command = false
 
 $image = false
 
 $property = false
 
 $nav_value = ""
 
 $css_row = ""
 
 $dropdown
 
 $tpl
 
 $main_tpl
 
 $user
 
 $ctrl
 
 $access
 
 $lng
 
 $obj_def
 

Detailed Description

BlockGUI class calendar selection.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 15 of file class.ilCalendarSelectionBlockGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilCalendarSelectionBlockGUI::__construct (   $a_seed,
  $a_ref_id = 0 
)

Constructor.

Definition at line 43 of file class.ilCalendarSelectionBlockGUI.php.

44 {
45 global $DIC;
46
47 $ilCtrl = $DIC['ilCtrl'];
48 $lng = $DIC['lng'];
49
50 $this->lng = $lng;
51 parent::__construct();
52 $lng->loadLanguageModule('pd');
53 $lng->loadLanguageModule('dateplaner');
54 $this->ref_id = $a_ref_id;
55 $this->obj_id = ilObject::_lookupObjId($this->ref_id);
56
57 $this->category_id = $_GET['category_id'];
58
59 $this->setLimit(5);
60 $this->allow_moving = false;
61 $this->seed = $a_seed;
62
63 $this->setTitle($lng->txt('cal_table_categories'));
64
65 include_once('./Services/Calendar/classes/class.ilCalendarUserSettings.php');
66 $sel_type = ilCalendarUserSettings::_getInstance()->getCalendarSelectionType();
67 $ilCtrl->setParameterByClass("ilcalendarcategorygui", 'calendar_mode', ilCalendarUserSettings::CAL_SELECTION_ITEMS);
68 $ilCtrl->setParameterByClass("ilcalendarcategorygui", 'seed', $this->seed->get(IL_CAL_DATE));
69 $this->addBlockCommand(
70 $ilCtrl->getLinkTargetByClass("ilcalendarcategorygui", 'switchCalendarMode'),
71 $lng->txt('pd_my_offers'),
72 "",
73 "",
74 false,
76 );
77 $ilCtrl->setParameterByClass("ilcalendarcategorygui", 'calendar_mode', ilCalendarUserSettings::CAL_SELECTION_MEMBERSHIP);
78 $ilCtrl->setParameterByClass("ilcalendarcategorygui", 'seed', $this->seed->get(IL_CAL_DATE));
79 $this->addBlockCommand(
80 $ilCtrl->getLinkTargetByClass("ilcalendarcategorygui", 'switchCalendarMode'),
81 $lng->txt('pd_my_memberships'),
82 "",
83 "",
84 false,
86 );
87
88 $ilCtrl->setParameterByClass("ilcalendarcategorygui", 'calendar_mode', "");
89 $this->addBlockCommand(
90 $ilCtrl->getLinkTargetByClass("ilcalendarcategorygui", 'add'),
91 $lng->txt('cal_add_calendar')
92 );
93
94 $this->calendar_groups = array(
95 self::CAL_GRP_CURRENT_CONT_CONS => $lng->txt("cal_grp_" . self::CAL_GRP_CURRENT_CONT_CONS),
96 self::CAL_GRP_CURRENT_CONT => $lng->txt("cal_grp_" . self::CAL_GRP_CURRENT_CONT),
97 self::CAL_GRP_PERSONAL => $lng->txt("cal_grp_" . self::CAL_GRP_PERSONAL),
98 self::CAL_GRP_OTHERS => $lng->txt("cal_grp_" . self::CAL_GRP_OTHERS)
99 );
100 }
$_GET["client_id"]
const IL_CAL_DATE
setLimit($a_limit)
Set Limit.
setTitle($a_title)
Set Title.
addBlockCommand( $a_href, $a_text, $a_target="", $a_img="", $a_right_aligned=false, $a_checked=false, $a_html="")
Add Block Command.
static _getInstance()
get instance for logged in user
static _lookupObjId($a_id)
global $ilCtrl
Definition: ilias.php:18
global $DIC
Definition: saml.php:7

References $_GET, $DIC, $ilCtrl, ilBlockGUI\$lng, ilCalendarUserSettings\_getInstance(), ilObject\_lookupObjId(), ilBlockGUI\addBlockCommand(), ilCalendarUserSettings\CAL_SELECTION_ITEMS, ilCalendarUserSettings\CAL_SELECTION_MEMBERSHIP, IL_CAL_DATE, ilBlockGUI\setLimit(), and ilBlockGUI\setTitle().

+ Here is the call graph for this function:

Member Function Documentation

◆ buildPath()

ilCalendarSelectionBlockGUI::buildPath (   $a_ref_id)
protected

Build path for ref id.

Parameters
int$a_ref_idref id

Definition at line 264 of file class.ilCalendarSelectionBlockGUI.php.

265 {
266 global $DIC;
267
268 $tree = $DIC['tree'];
269
270 $path_arr = $tree->getPathFull($a_ref_id, ROOT_FOLDER_ID);
271 $counter = 0;
272 unset($path_arr[count($path_arr) - 1]);
273
274 foreach ($path_arr as $data) {
275 if ($counter++) {
276 $path .= " -> ";
277 }
278 $path .= $data['title'];
279 }
280 if (strlen($path) > 30) {
281 return '...' . substr($path, -30);
282 }
283 return $path;
284 }
$path
Definition: aliased.php:25

References ilBlockGUI\$data, $DIC, $path, and $tree.

Referenced by getCalendars().

+ Here is the caller graph for this function:

◆ executeCommand()

ilCalendarSelectionBlockGUI::executeCommand ( )

execute command

Definition at line 133 of file class.ilCalendarSelectionBlockGUI.php.

134 {
135 global $DIC;
136
137 $ilCtrl = $DIC['ilCtrl'];
138
139 $next_class = $ilCtrl->getNextClass();
140 $cmd = $ilCtrl->getCmd("getHTML");
141
142 switch ($next_class) {
143 default:
144 return $this->$cmd();
145 }
146 }

References $DIC, and $ilCtrl.

◆ fillDataSection()

ilCalendarSelectionBlockGUI::fillDataSection ( )

Fill data section.

Reimplemented from ilBlockGUI.

Definition at line 290 of file class.ilCalendarSelectionBlockGUI.php.

291 {
292 global $DIC;
293
294 $lng = $DIC['lng'];
295 $ilCtrl = $DIC['ilCtrl'];
296
297 $tpl = new ilTemplate("tpl.cal_selection_block_content.html", true, true, "Services/Calendar");
298
299 foreach ($this->calendar_groups as $type => $txt) {
300 foreach ($this->calendars[$type] as $c) {
301 $this->renderItem($c, $tpl);
302 }
303 if (count($this->calendars[$type]) > 0) {
304 if ($type == self::CAL_GRP_CURRENT_CONT) {
305 $txt = $lng->txt("cal_grp_curr_" . ilObject::_lookupType($this->obj_id));
306 }
307 if ($type == self::CAL_GRP_CURRENT_CONT_CONS) {
308 $txt = $lng->txt("cal_grp_curr_crs_cons");
309 }
310 $tpl->setCurrentBlock("item_grp");
311 $tpl->setVariable("GRP_HEAD", $txt);
312 $tpl->parseCurrentBlock();
313 }
314 }
315
316 $tpl->setVariable("TXT_SHOW", $lng->txt("refresh"));
317 $tpl->setVariable("CMD_SHOW", "saveSelection");
318 $tpl->setVariable("TXT_ACTION", $lng->txt("select"));
319 $tpl->setVariable("SRC_ACTION", ilUtil::getImagePath("arrow_downright.svg"));
320 $tpl->setVariable("FORM_ACTION", $ilCtrl->getFormActionByClass("ilcalendarcategorygui"));
321 $tpl->setVariable("TXT_SELECT_ALL", $lng->txt("select_all"));
322
323 $this->setDataSection($tpl->get());
324 }
setDataSection($a_content)
Call this from overwritten fillDataSection(), if standard row based data is not used.
static _lookupType($a_id, $a_reference=false)
lookup object type
special template class to simplify handling of ITX/PEAR
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
$txt
Definition: error.php:11
$type

References $c, $DIC, $ilCtrl, ilBlockGUI\$lng, ilBlockGUI\$tpl, $txt, $type, ilObject\_lookupType(), ilUtil\getImagePath(), renderItem(), and ilBlockGUI\setDataSection().

+ Here is the call graph for this function:

◆ getBlockType()

ilCalendarSelectionBlockGUI::getBlockType ( )

Returns
string

Reimplemented from ilBlockGUI.

Definition at line 113 of file class.ilCalendarSelectionBlockGUI.php.

113 : string
114 {
115 return self::$block_type;
116 }

References $block_type.

◆ getCalendars()

ilCalendarSelectionBlockGUI::getCalendars ( )

Get calendars.

Definition at line 151 of file class.ilCalendarSelectionBlockGUI.php.

152 {
153 global $DIC;
154
155 $ilUser = $DIC['ilUser'];
156 $tree = $DIC['tree'];
157 $access = $DIC->access();
158
159 include_once('./Services/Calendar/classes/class.ilCalendarCategories.php');
160 include_once('./Services/Calendar/classes/class.ilCalendarVisibility.php');
161
162 $hidden_obj = ilCalendarVisibility::_getInstanceByUserId($ilUser->getId(), $this->ref_id);
163
164 $hidden = $hidden_obj->getHidden();
165 $visible = $hidden_obj->getVisible();
166
167 $cats = new ilCalendarCategories($ilUser->getId());
168 if ($this->ref_id > 0) {
169 $cats->initialize(ilCalendarCategories::MODE_REPOSITORY, (int) $this->ref_id, true);
170 } else {
173 } else {
175 }
176 }
177
178 $all = $cats->getCategoriesInfo();
179 $tmp_title_counter = array();
180 $categories = array();
181 foreach ($all as $category) {
182 //if ($category["obj_id"] == 255)
183 //{var_dump($category); exit;}
184 $tmp_arr['obj_id'] = $category['obj_id'];
185 $tmp_arr['id'] = $category['cat_id'];
186 $tmp_arr['hidden'] = (bool) in_array($category['cat_id'], $hidden);
187 $tmp_arr['visible'] = (bool) in_array($category['cat_id'], $visible);
188 $tmp_arr['title'] = $category['title'];
189 $tmp_arr['type'] = $category['type'];
190 $tmp_arr['source_ref_id'] = $category['source_ref_id'];
191
192 $tmp_arr['default_selected'] = true;
193 if ($this->category_id) {
194 if ($this->category_id == $category['cat_id']) {
195 $tmp_arr['default_selected'] = true;
196 } else {
197 $tmp_arr['default_selected'] = false;
198 }
199 }
200
201 // Append object type to make type sortable
202 $tmp_arr['type_sortable'] = ilCalendarCategory::lookupCategorySortIndex($category['type']);
203 if ($category['type'] == ilCalendarCategory::TYPE_OBJ) {
204 $tmp_arr['type_sortable'] .= ('_' . ilObject::_lookupType($category['obj_id']));
205 }
206 $tmp_arr['color'] = $category['color'];
207 $tmp_arr['editable'] = $category['editable'];
208
209 // reference
210 if ($category['type'] == ilCalendarCategory::TYPE_OBJ) {
211 foreach (ilObject::_getAllReferences($category['obj_id']) as $ref_id => $tmp_ref) {
212 if ($access->checkAccess('read', '', $ref_id)) {
213 $tmp_arr['ref_id'] = $ref_id;
214 }
215 }
216 }
217
218 $categories[] = $tmp_arr;
219
220 // count title for appending the parent container if there is more than one entry.
221 $tmp_title_counter[$category['type'] . '_' . $category['title']]++;
222 }
223
224 $path_categories = array();
225 foreach ($categories as $cat) {
226 if ($cat['type'] == ilCalendarCategory::TYPE_OBJ) {
227 if ($tmp_title_counter[$cat['type'] . '_' . $cat['title']] > 1) {
228 foreach (ilObject::_getAllReferences($cat['obj_id']) as $ref_id) {
229 $cat['path'] = $this->buildPath($ref_id);
230 break;
231 }
232 }
233 }
234 $path_categories[] = $cat;
235 }
236 $path_categories = ilUtil::sortArray($path_categories, 'title', "asc");
237
238
239 $this->calendars[self::CAL_GRP_CURRENT_CONT_CONS] = array();
240 $this->calendars[self::CAL_GRP_CURRENT_CONT] = array();
241 $this->calendars[self::CAL_GRP_PERSONAL] = array();
242 $this->calendars[self::CAL_GRP_OTHERS] = array();
243
244 foreach ($path_categories as $cal) {
245 if ($cal["type"] == ilCalendarCategory::TYPE_CH && $this->obj_id > 0) {
246 $this->calendars[self::CAL_GRP_CURRENT_CONT_CONS][] = $cal;
247 } elseif ($cal["type"] == ilCalendarCategory::TYPE_OBJ && ($this->obj_id > 0 && ($cal["obj_id"] == $this->obj_id
248 || $this->ref_id == $cal["source_ref_id"]))) {
249 $this->calendars[self::CAL_GRP_CURRENT_CONT][] = $cal;
250 } elseif ($cal["type"] == ilCalendarCategory::TYPE_USR || $cal["type"] == ilCalendarCategory::TYPE_BOOK ||
251 ($cal["type"] == ilCalendarCategory::TYPE_CH && $this->user->getId() == $cal["obj_id"])) {
252 $this->calendars[self::CAL_GRP_PERSONAL][] = $cal;
253 } else {
254 $this->calendars[self::CAL_GRP_OTHERS][] = $cal;
255 }
256 }
257 }
user()
Definition: user.php:4
class for calendar categories
static lookupCategorySortIndex($a_type_id)
Lookup sort index of calendar type.
buildPath($a_ref_id)
Build path for ref id.
static _getInstanceByUserId($a_user_id, $a_ref_id=0)
get instance by user id
static _getAllReferences($a_id)
get all reference ids of object
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
$ilUser
Definition: imgupload.php:18

References ilBlockGUI\$access, $DIC, $ilUser, $ref_id, $tree, ilObject\_getAllReferences(), ilCalendarUserSettings\_getInstance(), ilCalendarVisibility\_getInstanceByUserId(), ilObject\_lookupType(), buildPath(), CAL_GRP_CURRENT_CONT, CAL_GRP_CURRENT_CONT_CONS, CAL_GRP_OTHERS, CAL_GRP_PERSONAL, ilCalendarUserSettings\CAL_SELECTION_MEMBERSHIP, ilCalendarCategory\lookupCategorySortIndex(), ilCalendarCategories\MODE_PERSONAL_DESKTOP_ITEMS, ilCalendarCategories\MODE_PERSONAL_DESKTOP_MEMBERSHIP, ilCalendarCategories\MODE_REPOSITORY, ilUtil\sortArray(), ilCalendarCategory\TYPE_BOOK, ilCalendarCategory\TYPE_CH, ilCalendarCategory\TYPE_OBJ, ilCalendarCategory\TYPE_USR, and user().

Referenced by getHTML().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getHTML()

ilCalendarSelectionBlockGUI::getHTML ( )

Get block HTML code.

Reimplemented from ilBlockGUI.

Definition at line 450 of file class.ilCalendarSelectionBlockGUI.php.

451 {
452 global $DIC;
453
454 $ilCtrl = $DIC['ilCtrl'];
455 $lng = $DIC['lng'];
456 $ilUser = $DIC['ilUser'];
457 $ilAccess = $DIC['ilAccess'];
458 $ilSetting = $DIC['ilSetting'];
459
460 $this->getCalendars();
461
462 return parent::getHTML();
463 }
global $ilSetting
Definition: privfeed.php:17

References $DIC, $ilCtrl, $ilSetting, $ilUser, ilBlockGUI\$lng, and getCalendars().

+ Here is the call graph for this function:

◆ getScreenMode()

static ilCalendarSelectionBlockGUI::getScreenMode ( )
static

Get Screen Mode for current command.

Reimplemented from ilBlockGUI.

Definition at line 121 of file class.ilCalendarSelectionBlockGUI.php.

122 {
123 global $DIC;
124
125 $ilCtrl = $DIC['ilCtrl'];
126
127 return IL_SCREEN_SIDE;
128 }
const IL_SCREEN_SIDE

References $DIC, $ilCtrl, and IL_SCREEN_SIDE.

◆ isRepositoryObject()

ilCalendarSelectionBlockGUI::isRepositoryObject ( )
protected

Returns whether block has a corresponding repository object.

Returns
bool

Reimplemented from ilBlockGUI.

Definition at line 105 of file class.ilCalendarSelectionBlockGUI.php.

105 : bool
106 {
107 return false;
108 }

◆ renderItem()

ilCalendarSelectionBlockGUI::renderItem (   $a_set,
  $a_tpl 
)
protected

Render item.

Parameters
array$a_setitem datat

Definition at line 331 of file class.ilCalendarSelectionBlockGUI.php.

332 {
333 global $DIC;
334
335 $ilCtrl = $DIC->ctrl();
336 $ilUser = $DIC->user();
337
338 if (strlen($a_set['path'])) {
339 $a_tpl->setCurrentBlock('calendar_path');
340 $a_tpl->setVariable('ADD_PATH_INFO', $a_set['path']);
341 $a_tpl->parseCurrentBlock();
342 }
343
344 $a_tpl->setCurrentBlock("item");
345
346 $a_tpl->setVariable('VAL_ID', $a_set['id']);
347 if ($this->obj_id == 0) {
348 if (!$a_set['hidden'] && $a_set['default_selected']) {
349 $a_tpl->setVariable('VAL_CHECKED', 'checked="checked"');
350 }
351 } else { // if calendar is shown and repo object id (course group given)
352 if ($a_set["obj_id"] == $this->obj_id) {
353 $a_tpl->setVariable('VAL_CHECKED', 'checked="checked"');
354 $a_tpl->setVariable('VAL_DISABLED', 'disabled');
355 } elseif ($a_set['visible']) {
356 $a_tpl->setVariable('VAL_CHECKED', 'checked="checked"');
357 }
358 }
359 $a_tpl->setVariable('BGCOLOR', $a_set['color']);
360
361
362 if (
363 ($a_set['type'] == ilCalendarCategory::TYPE_OBJ) &&
364 $a_set['ref_id']
365 ) {
366 # if(
367 # ilCalendarCategories::_getInstance($ilUser->getId())->getMode() == ilCalendarCategories::MODE_PERSONAL_DESKTOP_MEMBERSHIP ||
368 # ilCalendarCategories::_getInstance($ilUser->getId())->getMode() == ilCalendarCategories::MODE_PERSONAL_DESKTOP_ITEMS
369 # )
370 if (!$this->ref_id) {
371 $ilCtrl->setParameterByClass('ilcalendarpresentationgui', 'backpd', 1);
372 }
373 $ilCtrl->setParameterByClass('ilcalendarpresentationgui', 'ref_id', $a_set['ref_id']);
374 switch (ilObject::_lookupType($a_set['obj_id'])) {
375 case 'crs':
376 $link = $ilCtrl->getLinkTargetByClass(
377 [
378 ilRepositoryGUI::class,
379 ilObjCourseGUI::class,
380 ilCalendarPresentationGUI::class
381 ],
382 ''
383 );
384 break;
385
386 case 'grp':
387 $link = $ilCtrl->getLinkTargetByClass(
388 [
389 ilRepositoryGUI::class,
390 ilObjGroupGUI::class,
391 ilCalendarPresentationGUI::class
392 ],
393 ''
394 );
395 break;
396
397 default:
398 $link = ilLink::_getLink($a_set['ref_id']);
399 break;
400 }
401
402 $ilCtrl->clearParameterByClass(ilCalendarPresentationGUI::class, 'ref_id');
403
404 $a_tpl->setVariable('EDIT_LINK', $link);
405 $a_tpl->setVariable('VAL_TITLE', $a_set['title']);
406 } elseif ($a_set['type'] == ilCalendarCategory::TYPE_OBJ) {
407 $a_tpl->setVariable('PLAIN_TITLE', $a_set['title']);
408 } else {
409 $a_tpl->setVariable('VAL_TITLE', $a_set['title']);
410 $ilCtrl->setParameterByClass("ilcalendarpresentationgui", 'category_id', $a_set['id']);
411 $a_tpl->setVariable('EDIT_LINK', $ilCtrl->getLinkTargetByClass("ilcalendarpresentationgui", ''));
412 $ilCtrl->setParameterByClass("ilcalendarpresentationgui", 'category_id', $_GET["category_id"]);
413 $a_tpl->setVariable('TXT_EDIT', $this->lng->txt('edit'));
414 }
415
416 switch ($a_set['type']) {
418 $a_tpl->setVariable('IMG_SRC', ilUtil::getImagePath('icon_calg.svg'));
419 $a_tpl->setVariable('IMG_ALT', $this->lng->txt('cal_type_system'));
420 break;
421
423 $a_tpl->setVariable('IMG_SRC', ilUtil::getImagePath('icon_usr.svg'));
424 $a_tpl->setVariable('IMG_ALT', $this->lng->txt('cal_type_personal'));
425 break;
426
428 $type = ilObject::_lookupType($a_set['obj_id']);
429 $a_tpl->setVariable('IMG_SRC', ilUtil::getImagePath('icon_' . $type . '.svg'));
430 $a_tpl->setVariable('IMG_ALT', $this->lng->txt('cal_type_' . $type));
431 break;
432
434 $a_tpl->setVariable('IMG_SRC', ilUtil::getImagePath('icon_book.svg'));
435 $a_tpl->setVariable('IMG_ALT', $this->lng->txt('cal_type_' . $type));
436 break;
437
439 $a_tpl->setVariable('IMG_SRC', ilUtil::getImagePath('icon_calch.svg'));
440 $a_tpl->setVariable('IMG_ALT', $this->lng->txt('cal_ch_ch'));
441 break;
442 }
443
444 $a_tpl->parseCurrentBlock();
445 }

References $_GET, $DIC, $ilCtrl, $ilUser, $type, ilLink\_getLink(), ilObject\_lookupType(), ilUtil\getImagePath(), ilCalendarCategory\TYPE_BOOK, ilCalendarCategory\TYPE_CH, ilCalendarCategory\TYPE_GLOBAL, ilCalendarCategory\TYPE_OBJ, and ilCalendarCategory\TYPE_USR.

Referenced by fillDataSection().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $block_type

ilCalendarSelectionBlockGUI::$block_type = "cal_sel"
static

Definition at line 17 of file class.ilCalendarSelectionBlockGUI.php.

Referenced by getBlockType().

◆ $calendar_groups

ilCalendarSelectionBlockGUI::$calendar_groups = array()
protected

Definition at line 25 of file class.ilCalendarSelectionBlockGUI.php.

◆ $calendars

ilCalendarSelectionBlockGUI::$calendars = array()
protected

Definition at line 26 of file class.ilCalendarSelectionBlockGUI.php.

◆ $category_id

ilCalendarSelectionBlockGUI::$category_id = 0
protected

Definition at line 38 of file class.ilCalendarSelectionBlockGUI.php.

◆ $obj_id

ilCalendarSelectionBlockGUI::$obj_id = 0
protected

Definition at line 36 of file class.ilCalendarSelectionBlockGUI.php.

◆ $ref_id

ilCalendarSelectionBlockGUI::$ref_id = 0
protected

Definition at line 31 of file class.ilCalendarSelectionBlockGUI.php.

Referenced by getCalendars().

◆ CAL_GRP_CURRENT_CONT

const ilCalendarSelectionBlockGUI::CAL_GRP_CURRENT_CONT = "curr_cont"

Definition at line 20 of file class.ilCalendarSelectionBlockGUI.php.

Referenced by getCalendars().

◆ CAL_GRP_CURRENT_CONT_CONS

const ilCalendarSelectionBlockGUI::CAL_GRP_CURRENT_CONT_CONS = "curr_cont_cons"

Definition at line 19 of file class.ilCalendarSelectionBlockGUI.php.

Referenced by getCalendars().

◆ CAL_GRP_OTHERS

const ilCalendarSelectionBlockGUI::CAL_GRP_OTHERS = "others"

Definition at line 22 of file class.ilCalendarSelectionBlockGUI.php.

Referenced by getCalendars().

◆ CAL_GRP_PERSONAL

const ilCalendarSelectionBlockGUI::CAL_GRP_PERSONAL = "personal"

Definition at line 21 of file class.ilCalendarSelectionBlockGUI.php.

Referenced by getCalendars().


The documentation for this class was generated from the following file: