ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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...
 
 setData ($a_data)
 Set Data. More...
 
 getData ()
 Get Data. More...
 
 setPresentation (int $type)
 Set presentation. More...
 
 getPresentation ()
 Get presentation type. More...
 
 setBlockId ($a_block_id=0)
 Set Block Id. More...
 
 getBlockId ()
 Get Block Id. More...
 
 setGuiObject (&$a_gui_object)
 Set GuiObject. More...
 
 getGuiObject ()
 Get GuiObject. More...
 
 setTitle ($a_title)
 Set Title. More...
 
 getTitle ()
 Get Title. 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...
 
 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 (bool $a_admincommands)
 Set Administration Commmands. More...
 
 getAdminCommands ()
 Get Administration Commmands. 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 ()
 
 getConfigParameter ()
 
 getMoveParameter ()
 
 getRowTemplateName ()
 Get Row Template Name. More...
 
 getRowTemplateDir ()
 Get Row Template Directory. More...
 
 addBlockCommand (string $a_href, string $a_text, string $a_onclick="")
 Add Block Command. More...
 
 getBlockCommands ()
 Get Block commands. More...
 
 getHTML ()
 Get HTML. 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...
 
 getAsynch ()
 Use this for final get before sending asynchronous output (ajax) per echo to output. More...
 
 getPaginationViewControl ()
 Fill previous/next row. More...
 
 getHTMLNew ()
 Get HTML. 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"
 
- Data Fields inherited from ilBlockGUI
const PRES_MAIN_LEG = 0
 
const PRES_SEC_LEG = 1
 
const PRES_SEC_LIST = 2
 
const PRES_MAIN_LIST = 3
 

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...
 
 getLegacyContent ()
 Get legacy content.
Returns
string
More...
 
 getListItemForData (array $data)
 Get list item for data array.
Parameters
array$data
Returns
null|\ILIAS\UI\Component\Item\Item
More...
 
- Protected Member Functions inherited from ilBlockGUI
 isRepositoryObject ()
 Returns whether block has a corresponding repository object. More...
 
 initCommands ()
 Init commands. More...
 
 fillRowColor ($a_placeholder="CSS_ROW")
 
 preloadData (array $data)
 Can be overwritten in subclasses. More...
 
 getLegacyContent ()
 Get legacy content. More...
 
 getViewControls ()
 Get view controls. More...
 
 getListItemForData (array $data)
 Get list item for data array. More...
 
 handleNavigation ()
 Handle navigation. More...
 
 loadData ()
 Load data for current page. More...
 
 getListItemGroups ()
 Get items. More...
 
 addRepoCommands ()
 Add repo commands. More...
 
 getNoItemFoundContent ()
 No item entry. More...
 

Protected Attributes

 $calendar_groups = array()
 
 $calendars = array()
 
 $ref_id = 0
 
 $obj_id = 0
 
 $category_id = 0
 
 $new_rendering = true
 
- Protected Attributes inherited from ilBlockGUI
 $ui
 
 $data = array()
 
 $enablenuminfo = true
 
 $footer_links = array()
 
 $block_id = 0
 
 $allow_moving = true
 
 $move = array("left" => false, "right" => false, "up" => false, "down" => false)
 
 $block_commands = array()
 
 $max_count = false
 
 $close_command = false
 
 $image = false
 
 $property = false
 
 $nav_value = ""
 
 $css_row = ""
 
 $title = ""
 
 $admincommands = false
 
 $dropdown
 
 $tpl
 
 $main_tpl
 
 $user
 
 $ctrl
 
 $access
 
 $lng
 
 $obj_def
 
 $presentation
 
 $new_rendering = false
 

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;
52 $lng->loadLanguageModule('dash');
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 // @todo: set checked if ($sel_type == ilCalendarUserSettings::CAL_SELECTION_ITEMS)
70 $this->addBlockCommand(
71 $ilCtrl->getLinkTargetByClass("ilcalendarcategorygui", 'switchCalendarMode'),
72 $lng->txt('dash_favourites')
73 );
74 $ilCtrl->setParameterByClass("ilcalendarcategorygui", 'calendar_mode', ilCalendarUserSettings::CAL_SELECTION_MEMBERSHIP);
75 $ilCtrl->setParameterByClass("ilcalendarcategorygui", 'seed', $this->seed->get(IL_CAL_DATE));
76
77 // @todo: set checked if ($sel_type == ilCalendarUserSettings::CAL_SELECTION_MEMBERSHIP)
78 $this->addBlockCommand(
79 $ilCtrl->getLinkTargetByClass("ilcalendarcategorygui", 'switchCalendarMode'),
80 $lng->txt('dash_memberships')
81 );
82
83 $ilCtrl->setParameterByClass("ilcalendarcategorygui", 'calendar_mode', "");
84 $this->addBlockCommand(
85 $ilCtrl->getLinkTargetByClass("ilcalendarcategorygui", 'add'),
86 $lng->txt('cal_add_calendar')
87 );
88
89 $this->calendar_groups = array(
90 self::CAL_GRP_CURRENT_CONT_CONS => $lng->txt("cal_grp_" . self::CAL_GRP_CURRENT_CONT_CONS),
91 self::CAL_GRP_CURRENT_CONT => $lng->txt("cal_grp_" . self::CAL_GRP_CURRENT_CONT),
92 self::CAL_GRP_PERSONAL => $lng->txt("cal_grp_" . self::CAL_GRP_PERSONAL),
93 self::CAL_GRP_OTHERS => $lng->txt("cal_grp_" . self::CAL_GRP_OTHERS)
94 );
95
96 $this->setPresentation(self::PRES_SEC_LEG);
97 }
$_GET["client_id"]
const IL_CAL_DATE
setLimit($a_limit)
Set Limit.
setPresentation(int $type)
Set presentation.
addBlockCommand(string $a_href, string $a_text, string $a_onclick="")
Add Block Command.
setTitle($a_title)
Set Title.
static _getInstance()
get instance for logged in user
static _lookupObjId($a_id)
global $ilCtrl
Definition: ilias.php:18
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$DIC
Definition: xapitoken.php:46

References $_GET, $DIC, $ilCtrl, ilBlockGUI\$lng, ILIAS\GlobalScreen\Provider\__construct(), ilCalendarUserSettings\_getInstance(), ilObject\_lookupObjId(), ilBlockGUI\addBlockCommand(), ilCalendarUserSettings\CAL_SELECTION_ITEMS, ilCalendarUserSettings\CAL_SELECTION_MEMBERSHIP, IL_CAL_DATE, ilBlockGUI\setLimit(), ilBlockGUI\setPresentation(), 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 261 of file class.ilCalendarSelectionBlockGUI.php.

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

References ilBlockGUI\$data, and $DIC.

Referenced by getCalendars().

+ Here is the caller graph for this function:

◆ executeCommand()

ilCalendarSelectionBlockGUI::executeCommand ( )

execute command

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

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

References $DIC, and $ilCtrl.

◆ fillDataSection()

ilCalendarSelectionBlockGUI::fillDataSection ( )

Fill data section.

Reimplemented from ilBlockGUI.

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

288 {
289 global $DIC;
290
291 $lng = $DIC['lng'];
292 $ilCtrl = $DIC['ilCtrl'];
293
294 $tpl = new ilTemplate("tpl.cal_selection_block_content.html", true, true, "Services/Calendar");
295
296 foreach ($this->calendar_groups as $type => $txt) {
297 foreach ($this->calendars[$type] as $c) {
298 $this->renderItem($c, $tpl);
299 }
300 if (count($this->calendars[$type]) > 0) {
301 if ($type == self::CAL_GRP_CURRENT_CONT) {
302 $txt = $lng->txt("cal_grp_curr_" . ilObject::_lookupType($this->obj_id));
303 }
304 if ($type == self::CAL_GRP_CURRENT_CONT_CONS) {
305 $txt = $lng->txt("cal_grp_curr_crs_cons");
306 }
307 $tpl->setCurrentBlock("item_grp");
308 $tpl->setVariable("GRP_HEAD", $txt);
309 $tpl->parseCurrentBlock();
310 }
311 }
312
313 $tpl->setVariable("TXT_SHOW", $lng->txt("refresh"));
314 $tpl->setVariable("CMD_SHOW", "saveSelection");
315 $tpl->setVariable("TXT_ACTION", $lng->txt("select"));
316 $tpl->setVariable("SRC_ACTION", ilUtil::getImagePath("arrow_downright.svg"));
317 $tpl->setVariable("FORM_ACTION", $ilCtrl->getFormActionByClass("ilcalendarcategorygui"));
318 $tpl->setVariable("TXT_SELECT_ALL", $lng->txt("select_all"));
319
320 return $tpl->get();
321 }
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:13
$type

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

Referenced by getLegacyContent().

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

◆ getBlockType()

ilCalendarSelectionBlockGUI::getBlockType ( )

Returns
string

Reimplemented from ilBlockGUI.

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

110 : string
111 {
112 return self::$block_type;
113 }

References $block_type.

◆ getCalendars()

ilCalendarSelectionBlockGUI::getCalendars ( )

Get calendars.

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

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

448 {
449 $this->getCalendars();
450 return parent::getHTML();
451 }

References getCalendars().

+ Here is the call graph for this function:

◆ getLegacyContent()

ilCalendarSelectionBlockGUI::getLegacyContent ( )
protected

Get legacy content.

Returns
string

Reimplemented from ilBlockGUI.

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

462 : string
463 {
464 return $this->fillDataSection();
465 }

References fillDataSection().

+ Here is the call graph for this function:

◆ getListItemForData()

ilCalendarSelectionBlockGUI::getListItemForData ( array  $data)
protected

Get list item for data array.

Parameters
array$data
Returns
null|\ILIAS\UI\Component\Item\Item

Reimplemented from ilBlockGUI.

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

471 {
472 $factory = $this->ui->factory();
473 if (isset($data["shy_button"])) {
474 return $factory->item()->standard($data["shy_button"])->withDescription($data["date"]);
475 } else {
476 return $factory->item()->standard($data["date"]);
477 }
478 }
Common interface to all items.
Definition: Item.php:11
$factory
Definition: metadata.php:58
ui()
Definition: ui.php:5

References ilBlockGUI\$data, $factory, and ui().

+ 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 118 of file class.ilCalendarSelectionBlockGUI.php.

119 {
120 global $DIC;
121
122 $ilCtrl = $DIC['ilCtrl'];
123
124 return IL_SCREEN_SIDE;
125 }
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 102 of file class.ilCalendarSelectionBlockGUI.php.

102 : bool
103 {
104 return false;
105 }

◆ renderItem()

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

Render item.

Parameters
array$a_setitem datat

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

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

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.

◆ $new_rendering

ilCalendarSelectionBlockGUI::$new_rendering = true
protected

Definition at line 457 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: