ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilCalendarBlockGUI Class Reference

Calendar blocks, displayed in different contexts, e.g. More...

+ Inheritance diagram for ilCalendarBlockGUI:
+ Collaboration diagram for ilCalendarBlockGUI:

Public Member Functions

 __construct ($a_skip_init=false)
 Constructor. More...
 
 executeCommand ()
 execute command More...
 
 setEnableEdit ($a_enable_edit=0)
 Set EnableEdit. More...
 
 getEnableEdit ()
 Get EnableEdit. More...
 
 fillDataSection ()
 Fill data section. More...
 
 addMiniMonth ($a_tpl)
 Add mini version of monthly overview (Maybe extracted to another class, if used in pd calendar tab. More...
 
 getHTML ()
 Get bloch HTML code. More...
 
 getOverview ()
 Get overview. More...
 
 addCloseCommand ($a_content_block)
 
 setSeed ()
 Set seed. More...
 
 returnToUpperContext ()
 Return to upper context. More...
 
 showCalendarSubscription ()
 
 fillFooter ()
 
 setFooterLinks ()
 
 setPdModeEvents ()
 
 setPdModeMonth ()
 
 getData ()
 
- Public Member Functions inherited from ilBlockGUI
 __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 getBlockType ()
 Get block type. More...
 
static isRepositoryObject ()
 Is this a repository object. More...
 
static getScreenMode ()
 Get Screen Mode for current command. More...
 
- Static Public Member Functions inherited from ilBlockGUI
static getBlockType ()
 
static isRepositoryObject ()
 
static getScreenMode ()
 Get Screen Mode for current command. More...
 

Data Fields

 $ctrl = null
 

Static Public Attributes

static $block_type = "cal"
 
static $st_data
 

Protected Member Functions

 initCategories ()
 init categories More...
 
 setSubTabs ()
 
- Protected Member Functions inherited from ilBlockGUI
 fillRowColor ($a_placeholder="CSS_ROW")
 
 preloadData (array $data)
 Can be overwritten in subclasses. More...
 

Protected Attributes

 $mode
 
 $display_mode
 
- 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
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilCalendarBlockGUI::__construct (   $a_skip_init = false)

Constructor.

Parameters
booleanskip initialisation (is called by derived PDCalendarBlockGUI class)

Definition at line 54 of file class.ilCalendarBlockGUI.php.

References $_GET, $_SESSION, $ilCtrl, $ilUser, $lng, $mode, $title, $tpl, ilCalendarUserSettings\_getInstanceByUserId(), ilObjUser\_lookupFullname(), ilBlockGUI\getBlockId(), getBlockType(), IL_CAL_DATE, IL_CAL_UNIX, initCategories(), ilBlockGUI\setAvailableDetailLevels(), ilBlockGUI\setBlockId(), ilBlockGUI\setEnableNumInfo(), ilBlockGUI\setLimit(), ilBlockGUI\setTitle(), and time.

55  {
56  global $ilCtrl, $lng, $ilUser, $tpl, $ilHelp;
57 
58  parent::__construct();
59 
60  $this->ctrl = $ilCtrl;
61 
62  $lng->loadLanguageModule("dateplaner");
63  $ilHelp->addHelpSection("cal_block");
64 
65  include_once("./Services/News/classes/class.ilNewsItem.php");
66 
67  $ilCtrl->saveParameter($this, 'bkid');
68 
69  if (!$a_skip_init)
70  {
71  $this->initCategories();
72  $this->setBlockId($ilCtrl->getContextObjId());
73  }
74 
75  $this->setLimit(5); // @todo: needed?
76 
77  // alex: original detail level 1 did not work anymore
78  $this->setAvailableDetailLevels(1);
79  $this->setEnableNumInfo(false);
80 
81  if(!isset($_GET["bkid"]))
82  {
83  $title = $lng->txt("calendar");
84  }
85  else
86  {
87  $title = $lng->txt("cal_consultation_hours_for")." ".ilObjUser::_lookupFullname($_GET["bkid"]);
88  }
89 
90  $this->setTitle($title);
91  //$this->setData($data);
92  $this->allow_moving = false;
93  //$this->handleView();
94 
95  include_once('Services/Calendar/classes/class.ilDate.php');
96  include_once('Services/Calendar/classes/class.ilCalendarUserSettings.php');
97 
98  $seed_str = "";
99  if ((!isset($_GET["seed"]) || $_GET["seed"] == "") &&
100  isset($_SESSION["il_cal_block_".$this->getBlockType()."_".$this->getBlockId()."_seed"]))
101  {
102  $seed_str = $_SESSION["il_cal_block_".$this->getBlockType()."_".$this->getBlockId()."_seed"];
103  }
104  else if (isset($_GET["seed"]))
105  {
106  $seed_str = $_GET["seed"];
107  }
108 
109  if (isset($_GET["seed"]) && $_GET["seed"] != "")
110  {
111  $_SESSION["il_cal_block_".$this->getBlockType()."_".$this->getBlockId()."_seed"]
112  = $_GET["seed"];
113  }
114 
115  if ($seed_str == "")
116  {
117  $this->seed = new ilDate(time(),IL_CAL_UNIX); // @todo: check this
118  }
119  else
120  {
121  $this->seed = new ilDate($seed_str,IL_CAL_DATE); // @todo: check this
122  }
123  $this->user_settings = ilCalendarUserSettings::_getInstanceByUserId($ilUser->getId());
124 
125  $tpl->addCSS("./Services/Calendar/css/calendar.css");
126  // @todo: this must work differently...
127  $tpl->addCSS("./Services/Calendar/templates/default/delos.css");
128 
129  $mode = $ilUser->getPref("il_pd_cal_mode");
130  $this->display_mode = $mode ? $mode : "mmon";
131  }
$_SESSION["AccountId"]
$_GET["client_id"]
static _lookupFullname($a_user_id)
Lookup Full Name.
static _getInstanceByUserId($a_user_id)
get singleton instance
static getBlockType()
Get block type.
setEnableNumInfo($a_enablenuminfo)
Set Enable Item Number Info.
const IL_CAL_UNIX
global $tpl
Definition: ilias.php:8
global $ilCtrl
Definition: ilias.php:18
initCategories()
init categories
Class for single dates.
setTitle($a_title)
Set Title.
setBlockId($a_block_id=0)
Set Block Id.
setAvailableDetailLevels($a_max, $a_min=0)
Set Available Detail Levels.
$ilUser
Definition: imgupload.php:18
getBlockId()
Get Block Id.
setLimit($a_limit)
Set Limit.
const IL_CAL_DATE
global $lng
Definition: privfeed.php:17
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
+ Here is the call graph for this function:

Member Function Documentation

◆ addCloseCommand()

ilCalendarBlockGUI::addCloseCommand (   $a_content_block)

Definition at line 629 of file class.ilCalendarBlockGUI.php.

References $ilCtrl, and $lng.

630  {
631  global $lng, $ilCtrl;
632 
633  $a_content_block->addHeaderCommand($ilCtrl->getParentReturn($this),
634  $lng->txt("close"), true);
635  }
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:17

◆ addMiniMonth()

ilCalendarBlockGUI::addMiniMonth (   $a_tpl)

Add mini version of monthly overview (Maybe extracted to another class, if used in pd calendar tab.

Definition at line 298 of file class.ilCalendarBlockGUI.php.

References $_GET, $counter, $ilCtrl, $ilUser, $lng, ilDateTime\_before(), ilCalendarUtil\_buildMonthDayList(), ilDateTime\_equals(), ilCalendarUtil\_isToday(), ilCalendarUtil\_numericDayToString(), ilBlockGUI\getBlockId(), getBlockType(), IL_CAL_DATE, IL_CAL_FKT_DATE, IL_CAL_MONTH, ilDateTime\MONTH, and ilCalendarSchedule\TYPE_MONTH.

Referenced by fillDataSection().

299  {
300  global $ilCtrl, $lng,$ilUser;
301 
302  // weekdays
303  include_once('Services/Calendar/classes/class.ilCalendarUtil.php');
304  $a_tpl->setCurrentBlock('month_header_col');
305  $a_tpl->setVariable('TXT_WEEKDAY', $lng->txt("cal_week_abbrev"));
306  $a_tpl->parseCurrentBlock();
307  for($i = (int) $this->user_settings->getWeekStart();$i < (7 + (int) $this->user_settings->getWeekStart());$i++)
308  {
309  $a_tpl->setCurrentBlock('month_header_col');
310  $a_tpl->setVariable('TXT_WEEKDAY',ilCalendarUtil::_numericDayToString($i,false));
311  $a_tpl->parseCurrentBlock();
312  }
313 
314  if(isset($_GET["bkid"]))
315  {
316  $user_id = $_GET["bkid"];
317  $disable_empty = true;
318  }
319  else
320  {
321  $user_id = $ilUser->getId();
322  $disable_empty = false;
323  }
324  include_once('Services/Calendar/classes/class.ilCalendarSchedule.php');
325  $this->scheduler = new ilCalendarSchedule($this->seed,ilCalendarSchedule::TYPE_MONTH,$user_id);
326  $this->scheduler->addSubitemCalendars(true);
327  $this->scheduler->calculate();
328 
329  $counter = 0;
330  foreach(ilCalendarUtil::_buildMonthDayList($this->seed->get(IL_CAL_FKT_DATE,'m'),
331  $this->seed->get(IL_CAL_FKT_DATE,'Y'),
332  $this->user_settings->getWeekStart())->get() as $date)
333  {
334  $counter++;
335 
336  $events = $this->scheduler->getByDay($date,$ilUser->getTimeZone());
337  $has_events = (bool)count($events);
338  if($has_events || !$disable_empty)
339  {
340  $a_tpl->setCurrentBlock('month_col_link');
341  }
342  else
343  {
344  $a_tpl->setCurrentBlock('month_col_no_link');
345  }
346 
347  if($disable_empty)
348  {
349  if(!$has_events)
350  {
351  $a_tpl->setVariable('DAY_CLASS','calminiinactive');
352  }
353  else
354  {
355  $week_has_events = true;
356  include_once 'Services/Booking/classes/class.ilBookingEntry.php';
357  foreach($events as $event)
358  {
359  $booking = new ilBookingEntry($event['event']->getContextId());
360  if($booking->hasBooked($event['event']->getEntryId()))
361  {
362  $a_tpl->setVariable('DAY_CLASS','calminiapp');
363  break;
364  }
365  }
366  }
367  }
368  elseif($has_events)
369  {
370  $week_has_events = true;
371  $a_tpl->setVariable('DAY_CLASS','calminiapp');
372  }
373 
374 
375  $day = $date->get(IL_CAL_FKT_DATE,'j');
376  $month = $date->get(IL_CAL_FKT_DATE,'n');
377 
378  $month_day = $day;
379 
380  $ilCtrl->clearParametersByClass('ilcalendardaygui');
381  $ilCtrl->setParameterByClass('ilcalendardaygui','seed',$date->get(IL_CAL_DATE));
382  $a_tpl->setVariable('OPEN_DAY_VIEW', $ilCtrl->getLinkTargetByClass('ilcalendardaygui',''));
383  $ilCtrl->clearParametersByClass('ilcalendardaygui');
384 
385  $a_tpl->setVariable('MONTH_DAY',$month_day);
386 
387  $a_tpl->parseCurrentBlock();
388 
389 
390  $a_tpl->setCurrentBlock('month_col');
391 
392  include_once('./Services/Calendar/classes/class.ilCalendarUtil.php');
393  if(ilCalendarUtil::_isToday($date))
394  {
395  $a_tpl->setVariable('TD_CLASS','calminitoday');
396  }
397  #elseif(ilDateTime::_equals($date,$this->seed,IL_CAL_DAY))
398  #{
399  # $a_tpl->setVariable('TD_CLASS','calmininow');
400  #}
401  elseif(ilDateTime::_equals($date,$this->seed,IL_CAL_MONTH))
402  {
403  $a_tpl->setVariable('TD_CLASS','calministd');
404  }
405  elseif(ilDateTime::_before($date,$this->seed,IL_CAL_MONTH))
406  {
407  $a_tpl->setVariable('TD_CLASS','calminiprev');
408  }
409  else
410  {
411  $a_tpl->setVariable('TD_CLASS','calmininext');
412  }
413 
414  $a_tpl->parseCurrentBlock();
415 
416 
417  if($counter and !($counter % 7))
418  {
419  if(!$disable_empty || $week_has_events)
420  {
421  $a_tpl->setCurrentBlock('month_row_link');
422  $ilCtrl->clearParametersByClass('ilcalendarweekgui');
423  $ilCtrl->setParameterByClass('ilcalendarweekgui','seed',$date->get(IL_CAL_DATE));
424  $a_tpl->setVariable('OPEN_WEEK_VIEW', $ilCtrl->getLinkTargetByClass('ilcalendarweekgui',''));
425  $ilCtrl->clearParametersByClass('ilcalendarweekgui');
426  }
427  else
428  {
429  $a_tpl->setCurrentBlock('month_row_no_link');
430  $a_tpl->setVariable('WEEK_CLASS', 'calminiinactive');
431  }
432  $a_tpl->setVariable('WEEK',
433  $date->get(IL_CAL_FKT_DATE,'W'));
434  $a_tpl->parseCurrentBlock();
435 
436  $a_tpl->setCurrentBlock('month_row');
437  $a_tpl->setVariable('TD_CLASS','calminiweek');
438  $a_tpl->parseCurrentBlock();
439 
440  $week_has_events = false;
441  }
442  }
443  $a_tpl->setCurrentBlock('mini_month');
444  $a_tpl->setVariable('TXT_MONTH_OVERVIEW', $lng->txt("cal_month_overview"));
445  $a_tpl->setVariable('TXT_MONTH',
446  $lng->txt('month_'.$this->seed->get(IL_CAL_FKT_DATE,'m').'_long').
447  ' '.$this->seed->get(IL_CAL_FKT_DATE,'Y'));
448  $myseed = clone($this->seed);
449  $ilCtrl->setParameterByClass('ilcalendarmonthgui','seed',$myseed->get(IL_CAL_DATE));
450  $a_tpl->setVariable('OPEN_MONTH_VIEW',$ilCtrl->getLinkTargetByClass('ilcalendarmonthgui',''));
451 
452  $myseed->increment(ilDateTime::MONTH, -1);
453  $ilCtrl->setParameter($this,'seed',$myseed->get(IL_CAL_DATE));
454 
455  $a_tpl->setVariable('BL_TYPE', $this->getBlockType());
456  $a_tpl->setVariable('BL_ID', $this->getBlockId());
457 
458  $a_tpl->setVariable('PREV_MONTH',
459  $ilCtrl->getLinkTarget($this, "setSeed"));
460  $a_tpl->setVariable('PREV_MONTH_ASYNC',
461  $ilCtrl->getLinkTarget($this, "setSeed", "", true));
462 
463  $myseed->increment(ilDateTime::MONTH, 2);
464  $ilCtrl->setParameter($this,'seed',$myseed->get(IL_CAL_DATE));
465  $a_tpl->setVariable('NEXT_MONTH',
466  $ilCtrl->getLinkTarget($this, "setSeed"));
467  $a_tpl->setVariable('NEXT_MONTH_ASYNC',
468  $ilCtrl->getLinkTarget($this, "setSeed", "", true));
469 
470  $ilCtrl->setParameter($this, 'seed', "");
471  $a_tpl->parseCurrentBlock();
472  }
static _buildMonthDayList($a_month, $a_year, $weekstart)
Build a month day list.
static _numericDayToString($a_day, $a_long=true)
get
$_GET["client_id"]
static _before(ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
compare two dates and check start is before end This method does not consider tz offsets.
Booking definition.
static getBlockType()
Get block type.
const IL_CAL_MONTH
global $ilCtrl
Definition: ilias.php:18
$counter
static _equals(ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
Check if two date are equal.
const IL_CAL_FKT_DATE
$ilUser
Definition: imgupload.php:18
getBlockId()
Get Block Id.
const IL_CAL_DATE
global $lng
Definition: privfeed.php:17
static _isToday($date)
check if a date is today
Represents a list of calendar appointments (including recurring events) for a specific user in a give...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilCalendarBlockGUI::executeCommand ( )

execute command

Definition at line 188 of file class.ilCalendarBlockGUI.php.

References $cmd, $ilCtrl, $ilUser, and setSubTabs().

189  {
190  global $ilCtrl,$ilTabs,$ilUser;
191 
192  $next_class = $ilCtrl->getNextClass();
193  $cmd = $ilCtrl->getCmd("getHTML");
194 
195  $this->setSubTabs();
196 
197  switch ($next_class)
198  {
199  case "ilcalendarappointmentgui":
200  include_once('./Services/Calendar/classes/class.ilCalendarAppointmentGUI.php');
201  $app_gui = new ilCalendarAppointmentGUI($this->seed,$this->seed);
202  $ilCtrl->forwardCommand($app_gui);
203  break;
204 
205  case "ilcalendardaygui":
206  $ilTabs->setSubTabActive('app_day');
207  include_once('./Services/Calendar/classes/class.ilCalendarDayGUI.php');
208  $day_gui = new ilCalendarDayGUI($this->seed);
209  $ilCtrl->forwardCommand($day_gui);
210  break;
211 
212  case "ilcalendarweekgui":
213  $ilTabs->setSubTabActive('app_week');
214  include_once('./Services/Calendar/classes/class.ilCalendarWeekGUI.php');
215  $week_gui = new ilCalendarWeekGUI($this->seed);
216  $ilCtrl->forwardCommand($week_gui);
217  break;
218 
219  case "ilcalendarmonthgui":
220  $ilTabs->setSubTabActive('app_month');
221  include_once('./Services/Calendar/classes/class.ilCalendarMonthGUI.php');
222  $month_gui = new ilCalendarMonthGUI($this->seed);
223  $ilCtrl->forwardCommand($month_gui);
224  break;
225 
226  case "ilcalendarinboxgui":
227  include_once('./Services/Calendar/classes/class.ilCalendarInboxGUI.php');
228  $inbox = new ilCalendarInboxGUI($this->seed);
229  $ilCtrl->forwardCommand($inbox);
230  break;
231 
232  case "ilconsultationhoursgui":
233  include_once('./Services/Calendar/classes/ConsultationHours/class.ilConsultationHoursGUI.php');
234  $hours = new ilConsultationHoursGUI($this->seed);
235  $ilCtrl->forwardCommand($hours);
236  break;
237 
238  default:
239  return $this->$cmd();
240  }
241  }
Consultation hours editor.
$cmd
Definition: sahs_server.php:35
global $ilCtrl
Definition: ilias.php:18
$ilUser
Definition: imgupload.php:18
Administrate calendar appointments.
Presentation day view.
+ Here is the call graph for this function:

◆ fillDataSection()

ilCalendarBlockGUI::fillDataSection ( )

Fill data section.

Definition at line 266 of file class.ilCalendarBlockGUI.php.

References $tpl, addMiniMonth(), ilBlockGUI\fillDataSection(), ilBlockGUI\getCurrentDetailLevel(), getOverview(), ilBlockGUI\setColSpan(), ilBlockGUI\setDataSection(), and ilBlockGUI\setRowTemplate().

267  {
268  // alex: changed from > 1 to > 0 - original detail level 1 did not work anymore
269  if ($this->getCurrentDetailLevel() > 0 && $this->display_mode != "mmon")
270  {
271  $this->setColSpan(1);
272  $this->setRowTemplate("tpl.pd_event_list.html", "Services/Calendar");
273 
275  }
276  else
277  {
278  // alex: changed from > 1 to > 0 - original detail level 1 did not work anymore
279  if ($this->getCurrentDetailLevel() > 0)
280  {
281  $tpl = new ilTemplate("tpl.calendar_block.html", true, true,
282  "Services/Calendar");
283 
284  $this->addMiniMonth($tpl);
285  $this->setDataSection($tpl->get());
286  }
287  else
288  {
289  $this->setDataSection($this->getOverview());
290  }
291  }
292  }
setDataSection($a_content)
Call this from overwritten fillDataSection(), if standard row based data is not used.
global $tpl
Definition: ilias.php:8
setColSpan($a_colspan)
Set Columns Span.
special template class to simplify handling of ITX/PEAR
addMiniMonth($a_tpl)
Add mini version of monthly overview (Maybe extracted to another class, if used in pd calendar tab...
fillDataSection()
Standard implementation for row based data.
setRowTemplate($a_rowtemplatename, $a_rowtemplatedir="")
Set Row Template Name.
getCurrentDetailLevel()
Get Current Detail Level.
+ Here is the call graph for this function:

◆ fillFooter()

ilCalendarBlockGUI::fillFooter ( )

Definition at line 770 of file class.ilCalendarBlockGUI.php.

References $ilCtrl, $ilUser, $lng, array, ilBlockGUI\fillFooterLinks(), ilBlockGUI\getColSpan(), and setFooterLinks().

771  {
772  global $ilCtrl, $lng, $ilUser;
773 
774  // begin-patch ch
775  foreach((array) $this->cal_footer as $link_info)
776  {
777  $this->tpl->setCurrentBlock('data_section');
778  $this->tpl->setVariable('DATA',
779  sprintf('<a href="%s">%s</a>',$link_info['link'],$link_info['txt'])
780 
781  );
782  $this->tpl->parseCurrentBlock();
783  }
784  // end-patch ch
785 
786  $this->setFooterLinks();
787  $this->fillFooterLinks();
788  $this->tpl->setVariable("FCOLSPAN", $this->getColSpan());
789  if ($this->tpl->blockExists("block_footer"))
790  {
791  $this->tpl->setCurrentBlock("block_footer");
792  $this->tpl->parseCurrentBlock();
793  }
794 
795  }
fillFooterLinks($a_top=false, $a_numinfo="")
Fill footer links.
global $ilCtrl
Definition: ilias.php:18
$ilUser
Definition: imgupload.php:18
Create styles array
The data for the language used.
global $lng
Definition: privfeed.php:17
getColSpan()
Get Columns Span.
+ Here is the call graph for this function:

◆ getBlockType()

static ilCalendarBlockGUI::getBlockType ( )
static

Get block type.

Returns
string Block type.

Definition at line 138 of file class.ilCalendarBlockGUI.php.

Referenced by __construct(), and addMiniMonth().

139  {
140  return self::$block_type;
141  }
+ Here is the caller graph for this function:

◆ getData()

ilCalendarBlockGUI::getData ( )

Definition at line 864 of file class.ilCalendarBlockGUI.php.

References ilBlockGUI\$data, $ilCtrl, $lng, $start, array, date, ilDatePresentation\formatPeriod(), IL_CAL_DATE, IL_CAL_UNIX, ilBlockGUI\setEnableNumInfo(), time, and ilCalendarSchedule\TYPE_PD_UPCOMING.

865  {
866  global $ilCtrl, $lng;
867 
868  $seed = new ilDate(date('Y-m-d',time()),IL_CAL_DATE);
869 
870  include_once('./Services/Calendar/classes/class.ilCalendarSchedule.php');
872  $schedule->addSubitemCalendars(true); // #12007
873  $schedule->setEventsLimit(20);
874  $schedule->calculate();
875  $events = $schedule->getScheduledEvents(); // #13809
876 
877  $data = array();
878  if(sizeof($events))
879  {
880  foreach($events as $item)
881  {
882  $start = $item["dstart"];
883  $end = $item["dend"];
884  if($item["fullday"])
885  {
887  $end = new ilDate($end, IL_CAL_UNIX);
888  }
889  else
890  {
892  $end = new ilDateTime($end, IL_CAL_UNIX);
893  }
894 
895  $ilCtrl->clearParametersByClass('ilcalendardaygui');
896  $ilCtrl->setParameterByClass('ilcalendardaygui','seed',$start->get(IL_CAL_DATE));
897  $link = $ilCtrl->getLinkTargetByClass('ilcalendardaygui','');
898  $ilCtrl->clearParametersByClass('ilcalendardaygui');
899 
900  $data[] = array(
901  "date" => ilDatePresentation::formatPeriod($start, $end),
902  "title" => $item["event"]->getPresentationTitle(),
903  "url" => $link
904  );
905  }
906 
907  $this->setEnableNumInfo(true);
908  }
909  else
910  {
911  $data[] = array(
912  "date" => $lng->txt("msg_no_search_result"),
913  "title" => "",
914  "url" => ""
915  );
916 
917  $this->setEnableNumInfo(false);
918  }
919 
920  return $data;
921  }
static formatPeriod(ilDateTime $start, ilDateTime $end)
Format a period of two date Shows: 14.
setEnableNumInfo($a_enablenuminfo)
Set Enable Item Number Info.
const IL_CAL_UNIX
global $ilCtrl
Definition: ilias.php:18
Class for single dates.
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
Date and time handling
Create styles array
The data for the language used.
const IL_CAL_DATE
global $lng
Definition: privfeed.php:17
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
Represents a list of calendar appointments (including recurring events) for a specific user in a give...
+ Here is the call graph for this function:

◆ getEnableEdit()

ilCalendarBlockGUI::getEnableEdit ( )

Get EnableEdit.

Returns
boolean Edit mode on/off

Definition at line 258 of file class.ilCalendarBlockGUI.php.

259  {
260  return $this->enable_edit;
261  }

◆ getHTML()

ilCalendarBlockGUI::getHTML ( )

Get bloch HTML code.

Definition at line 477 of file class.ilCalendarBlockGUI.php.

References $_GET, $GLOBALS, $ilCtrl, $ilUser, $lng, $ret, ilDateTime\_before(), ilCourseParticipants\_getInstanceByObjId(), ilObjUser\_lookupFullname(), ilBlockGUI\addBlockCommand(), array, ilRSSButtonGUI\get(), ilConsultationHourAppointments\getAppointments(), ilBlockGUI\getCurrentDetailLevel(), ilBlockGUI\getProperty(), ilRSSButtonGUI\ICON_ICAL, IL_CAL_DATE, IL_CAL_DAY, IL_CAL_UNIX, ilBookingEntry\lookupBookableUsersForObject(), ilCalendarCategories\MODE_PERSONAL_DESKTOP_ITEMS, ilCalendarCategories\MODE_PERSONAL_DESKTOP_MEMBERSHIP, ilCalendarCategories\MODE_REPOSITORY, and time.

Referenced by setPdModeEvents(), setPdModeMonth(), and setSeed().

478  {
479  global $ilCtrl, $lng, $ilUser,$ilAccess;
480 
481  if ($this->getCurrentDetailLevel() == 0)
482  {
483  return "";
484  }
485 
486  // add edit commands
487  #if ($this->getEnableEdit())
488 
491  {
492  include_once("./Services/News/classes/class.ilRSSButtonGUI.php");
493  $this->addBlockCommand(
494  $this->ctrl->getLinkTarget($this,'showCalendarSubscription'),
495  $lng->txt('ical_export'),
496  "", "", true, false, ilRSSButtonGUI::get(ilRSSButtonGUI::ICON_ICAL)
497  );
498  }
499 
500 
501  if($this->mode == ilCalendarCategories::MODE_REPOSITORY)
502  {
503  if(!isset($_GET["bkid"]))
504  {
505  if($ilAccess->checkAccess('edit_event','',(int) $_GET['ref_id']))
506  {
507  $ilCtrl->setParameter($this, "add_mode", "block");
508  $this->addBlockCommand(
509  $ilCtrl->getLinkTargetByClass("ilCalendarAppointmentGUI",
510  "add"),
511  $lng->txt("add_appointment"));
512  $ilCtrl->setParameter($this, "add_mode", "");
513  }
514 
515  global $ilObjDataCache;
516 
517  include_once "Modules/Course/classes/class.ilCourseParticipants.php";
518  $obj_id = $ilObjDataCache->lookupObjId((int) $_GET['ref_id']);
519  $participants = ilCourseParticipants::_getInstanceByObjId($obj_id);
520  $users = array_unique(array_merge($participants->getTutors(), $participants->getAdmins()));
521  //$users = $participants->getParticipants();
522  include_once 'Services/Booking/classes/class.ilBookingEntry.php';
523  $users = ilBookingEntry::lookupBookableUsersForObject($obj_id,$users);
524  foreach($users as $user_id)
525  {
526  if(!isset($_GET["bkid"]))
527  {
528  include_once './Services/Calendar/classes/ConsultationHours/class.ilConsultationHourAppointments.php';
529  $now = new ilDateTime(time(), IL_CAL_UNIX);
530 
531  // default to last booking entry
532  $appointments = ilConsultationHourAppointments::getAppointments($user_id);
533  $next_app = end($appointments);
534  reset($appointments);
535 
536  foreach($appointments as $entry)
537  {
538  // find next entry
539  if(ilDateTime::_before($entry->getStart(), $now, IL_CAL_DAY))
540  {
541  continue;
542  }
543  include_once 'Services/Booking/classes/class.ilBookingEntry.php';
544  $booking_entry = new ilBookingEntry($entry->getContextId());
545  if(!in_array($obj_id, $booking_entry->getTargetObjIds()))
546  {
547  continue;
548  }
549 
550  if(!$booking_entry->isAppointmentBookableForUser($entry->getEntryId(), $GLOBALS['ilUser']->getId()))
551  {
552  continue;
553  }
554  $next_app = $entry;
555  break;
556  }
557 
558  $ilCtrl->setParameter($this, "bkid", $user_id);
559  if($next_app)
560  {
561  $ilCtrl->setParameter(
562  $this,
563  'seed',
564  (string) $next_app->getStart()->get(IL_CAL_DATE)
565  );
566  }
567 
568  $this->addBlockCommand(
569  $ilCtrl->getLinkTargetByClass(
570  "ilCalendarMonthGUI",
571  ""),
572  $lng->txt("cal_consultation_hours_for").' '. ilObjUser::_lookupFullname($user_id)
573  );
574 
575  $this->cal_footer[] = array(
576  'link' => $ilCtrl->getLinkTargetByClass('ilCalendarMonthGUI',''),
577  'txt' => $lng->txt("cal_consultation_hours_for").' '.ilObjUser::_lookupFullname($user_id)
578  );
579 
580  }
581  }
582  $ilCtrl->setParameter($this, "bkid", "");
583  $ilCtrl->setParameter($this, 'seed', '');
584  }
585  else
586  {
587  $ilCtrl->setParameter($this, "bkid", "");
588  $this->addBlockCommand(
589  $ilCtrl->getLinkTarget($this),
590  $lng->txt("back"));
591  $ilCtrl->setParameter($this, "bkid", (int)$_GET["bkid"]);
592  }
593  }
594 
595  if ($this->getProperty("settings") == true)
596  {
597  $this->addBlockCommand(
598  $ilCtrl->getLinkTarget($this, "editSettings"),
599  $lng->txt("settings"));
600  }
601 
602  $ilCtrl->setParameterByClass("ilcolumngui", "seed", isset($_GET["seed"]) ? $_GET["seed"] : "");
603  $ret = parent::getHTML();
604  $ilCtrl->setParameterByClass("ilcolumngui", "seed", "");
605 
606  return $ret;
607  }
static get($a_type, $a_href="")
Get icon html.
$_GET["client_id"]
static _lookupFullname($a_user_id)
Lookup Full Name.
static _before(ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
compare two dates and check start is before end This method does not consider tz offsets.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
Booking definition.
addBlockCommand($a_href, $a_text, $a_target="", $a_img="", $a_right_aligned=false, $a_checked=false, $a_html="")
Add Block Command.
const IL_CAL_UNIX
global $ilCtrl
Definition: ilias.php:18
const IL_CAL_DAY
static lookupBookableUsersForObject($a_obj_id, $a_user_ids)
Consultation hours are offered if 1) consultation hour owner is admin or tutor and no object assignme...
static getAppointments($a_user_id)
Get all appointments.
Date and time handling
$ilUser
Definition: imgupload.php:18
Create styles array
The data for the language used.
const IL_CAL_DATE
global $lng
Definition: privfeed.php:17
$ret
Definition: parser.php:6
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
getProperty($a_property)
getCurrentDetailLevel()
Get Current Detail Level.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getOverview()

ilCalendarBlockGUI::getOverview ( )

Get overview.

Definition at line 612 of file class.ilCalendarBlockGUI.php.

References $ilCtrl, $ilUser, $lng, $text, and ilCalendarSchedule\TYPE_INBOX.

Referenced by fillDataSection().

613  {
614  global $ilUser, $lng, $ilCtrl;
615 
616  include_once('./Services/Calendar/classes/class.ilCalendarSchedule.php');
617  $schedule = new ilCalendarSchedule($this->seed,ilCalendarSchedule::TYPE_INBOX);
618  $events = $schedule->getChangedEvents(true);
619 
620  $ilCtrl->setParameterByClass('ilcalendarinboxgui', 'changed', 1);
621  $link = '<a href='.$ilCtrl->getLinkTargetByClass('ilcalendarinboxgui','').'>';
622  $ilCtrl->setParameterByClass('ilcalendarinboxgui', 'changed', '');
623  $text = '<div class="small">'.((int) count($events))." ".$lng->txt("cal_changed_events_header")."</div>";
624  $end_link = '</a>';
625 
626  return $link.$text.$end_link;
627  }
global $ilCtrl
Definition: ilias.php:18
$ilUser
Definition: imgupload.php:18
global $lng
Definition: privfeed.php:17
$text
Represents a list of calendar appointments (including recurring events) for a specific user in a give...
+ Here is the caller graph for this function:

◆ getScreenMode()

static ilCalendarBlockGUI::getScreenMode ( )
static

Get Screen Mode for current command.

Definition at line 156 of file class.ilCalendarBlockGUI.php.

References $_GET, $ilCtrl, and IL_SCREEN_CENTER.

157  {
158  global $ilCtrl;
159 
160  $cmd_class = $ilCtrl->getCmdClass();
161 
162  if ($cmd_class == "ilcalendarappointmentgui" ||
163  $cmd_class == "ilcalendardaygui" ||
164  $cmd_class == "ilcalendarweekgui" ||
165  $cmd_class == "ilcalendarmonthgui" ||
166  $cmd_class == "ilcalendarinboxgui" ||
167  $cmd_class == "ilconsultationhoursgui" ||
168  $_GET['cmd'] == 'showCalendarSubscription')
169  {
170  return IL_SCREEN_CENTER;
171  }
172 
173  switch($ilCtrl->getCmd())
174  {
175  case "kkk":
176  // return IL_SCREEN_CENTER;
177  // return IL_SCREEN_FULL;
178 
179  default:
180  //return IL_SCREEN_SIDE;
181  break;
182  }
183  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
const IL_SCREEN_CENTER

◆ initCategories()

ilCalendarBlockGUI::initCategories ( )
protected

init categories

protected

Parameters

Definition at line 644 of file class.ilCalendarBlockGUI.php.

References $_GET, ilCalendarCategories\_getInstance(), ilCalendarCategories\MODE_CONSULTATION, and ilCalendarCategories\MODE_REPOSITORY.

Referenced by __construct().

645  {
647 
648  include_once('./Services/Calendar/classes/class.ilCalendarCategories.php');
649 
650  if(!isset($_GET['bkid']))
651  {
653  }
654  else
655  {
656  // display consultation hours only (in course/group)
657  ilCalendarCategories::_getInstance()->setCHUserId((int) $_GET['bkid']);
658  ilCalendarCategories::_getInstance()->initialize(ilCalendarCategories::MODE_CONSULTATION,(int) $_GET['ref_id'],true);
659  }
660  }
$_GET["client_id"]
static _getInstance($a_usr_id=0)
get singleton instance
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isRepositoryObject()

static ilCalendarBlockGUI::isRepositoryObject ( )
static

Is this a repository object.

Returns
string Block type.

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

149  {
150  return false;
151  }

◆ returnToUpperContext()

ilCalendarBlockGUI::returnToUpperContext ( )

Return to upper context.

Definition at line 709 of file class.ilCalendarBlockGUI.php.

References $ilCtrl.

Referenced by setSeed().

710  {
711  global $ilCtrl;
712 
713  $ilCtrl->returnToParent($this);
714  }
global $ilCtrl
Definition: ilias.php:18
+ Here is the caller graph for this function:

◆ setEnableEdit()

ilCalendarBlockGUI::setEnableEdit (   $a_enable_edit = 0)

Set EnableEdit.

Parameters
boolean$a_enable_editEdit mode on/off

Definition at line 248 of file class.ilCalendarBlockGUI.php.

249  {
250  $this->enable_edit = $a_enable_edit;
251  }

◆ setFooterLinks()

ilCalendarBlockGUI::setFooterLinks ( )

Definition at line 797 of file class.ilCalendarBlockGUI.php.

References ilBlockGUI\$block_id, $ilCtrl, $lng, ilBlockGUI\addFooterLink(), and ilBlockGUI\getCurrentDetailLevel().

Referenced by fillFooter().

798  {
799  global $ilCtrl, $lng;
800 
801  // alex: changed from < 2 to < 1 - original detail level 1 did not work anymore
802  if ($this->getCurrentDetailLevel() < 1)
803  {
804  return;
805  }
806 
807 // if ($this->display_mode == 'mmon')
808 // {
809 // $this->addFooterLink($lng->txt("month"));
810 
811  $this->addFooterLink($lng->txt("cal_upcoming_events_header"),
812  $ilCtrl->getLinkTarget($this, "setPdModeEvents"),
813  $ilCtrl->getLinkTarget($this, "setPdModeEvents", "", true),
814  "block_".$this->getBlockType()."_".$this->block_id,
815  false, false, ($this->display_mode != 'mmon'));
816 
817 // }
818 // else
819 // {
820  $this->addFooterLink( $lng->txt("app_month"),
821  $ilCtrl->getLinkTarget($this, "setPdModeMonth"),
822  $ilCtrl->getLinkTarget($this, "setPdModeMonth", "", true),
823  "block_".$this->getBlockType()."_".$this->block_id,
824  false, false, ($this->display_mode == 'mmon'));
825 
826 // $this->addFooterLink($lng->txt("cal_upcoming_events_header"));
827 // }
828  }
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.
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:17
getCurrentDetailLevel()
Get Current Detail Level.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setPdModeEvents()

ilCalendarBlockGUI::setPdModeEvents ( )

Definition at line 830 of file class.ilCalendarBlockGUI.php.

References $ilCtrl, $ilUser, exit, and getHTML().

831  {
832  global $ilUser, $ilCtrl;
833 
834  $ilUser->writePref("il_pd_cal_mode", "evt");
835  $this->display_mode = "evt";
836  if ($ilCtrl->isAsynch())
837  {
838  echo $this->getHTML();
839  exit;
840  }
841  else
842  {
843  $ilCtrl->redirectByClass("ilpersonaldesktopgui", "show");
844  }
845  }
getHTML()
Get bloch HTML code.
global $ilCtrl
Definition: ilias.php:18
$ilUser
Definition: imgupload.php:18
+ Here is the call graph for this function:

◆ setPdModeMonth()

ilCalendarBlockGUI::setPdModeMonth ( )

Definition at line 847 of file class.ilCalendarBlockGUI.php.

References $ilCtrl, $ilUser, exit, and getHTML().

848  {
849  global $ilUser, $ilCtrl;
850 
851  $ilUser->writePref("il_pd_cal_mode", "mmon");
852  $this->display_mode = "mmon";
853  if ($ilCtrl->isAsynch())
854  {
855  echo $this->getHTML();
856  exit;
857  }
858  else
859  {
860  $ilCtrl->redirectByClass("ilpersonaldesktopgui", "show");
861  }
862  }
getHTML()
Get bloch HTML code.
global $ilCtrl
Definition: ilias.php:18
$ilUser
Definition: imgupload.php:18
+ Here is the call graph for this function:

◆ setSeed()

ilCalendarBlockGUI::setSeed ( )

Set seed.

Definition at line 688 of file class.ilCalendarBlockGUI.php.

References $_GET, $_SESSION, $ilCtrl, $ilUser, exit, ilBlockGUI\getBlockId(), getHTML(), and returnToUpperContext().

689  {
690  global $ilCtrl, $ilUser;
691 
692  //$ilUser->writePref("il_pd_bkm_mode", 'flat');
693  $_SESSION["il_cal_block_".$this->getBlockType()."_".$this->getBlockId()."_seed"] =
694  $_GET["seed"];
695  if ($ilCtrl->isAsynch())
696  {
697  echo $this->getHTML();
698  exit;
699  }
700  else
701  {
702  $this->returnToUpperContext();
703  }
704  }
$_SESSION["AccountId"]
$_GET["client_id"]
getHTML()
Get bloch HTML code.
global $ilCtrl
Definition: ilias.php:18
returnToUpperContext()
Return to upper context.
$ilUser
Definition: imgupload.php:18
getBlockId()
Get Block Id.
+ Here is the call graph for this function:

◆ setSubTabs()

ilCalendarBlockGUI::setSubTabs ( )
protected
Parameters

Definition at line 667 of file class.ilCalendarBlockGUI.php.

References $_GET.

Referenced by executeCommand().

668  {
669  global $ilTabs;
670 
671  $ilTabs->clearSubTabs();
672  return true;
673 
674  // TODO: needs another switch
675  if($_GET['ref_id'])
676  {
677 
678  $ilTabs->addSubTabTarget('app_day',$this->ctrl->getLinkTargetByClass('ilCalendarDayGUI',''));
679  $ilTabs->addSubTabTarget('app_week',$this->ctrl->getLinkTargetByClass('ilCalendarWeekGUI',''));
680  $ilTabs->addSubTabTarget('app_month',$this->ctrl->getLinkTargetByClass('ilCalendarMonthGUI',''));
681  }
682  return true;
683  }
$_GET["client_id"]
+ Here is the caller graph for this function:

◆ showCalendarSubscription()

ilCalendarBlockGUI::showCalendarSubscription ( )

Definition at line 717 of file class.ilCalendarBlockGUI.php.

References $_GET, $ilUser, $lng, $tpl, $url, ilObject\_lookupObjId(), ilCalendarAuthenticationToken\lookupAuthToken(), ilCalendarCategories\MODE_PERSONAL_DESKTOP_ITEMS, ilCalendarCategories\MODE_PERSONAL_DESKTOP_MEMBERSHIP, ilCalendarAuthenticationToken\SELECTION_CATEGORY, ilCalendarAuthenticationToken\SELECTION_PD, and ilCalendarAuthenticationToken\setSelectionType().

718  {
719  global $lng, $ilUser;
720 
721  $tpl = new ilTemplate('tpl.show_calendar_subscription.html',true,true,'Services/Calendar');
722 
723  $tpl->setVariable('TXT_TITLE',$lng->txt('cal_subscription_header'));
724  $tpl->setVariable('TXT_INFO',$lng->txt('cal_subscription_info'));
725  $tpl->setVariable('TXT_CAL_URL',$lng->txt('cal_subscription_url'));
726 
727  include_once './Services/Calendar/classes/class.ilCalendarAuthenticationToken.php';
728 
729  switch($this->mode)
730  {
734  $calendar = 0;
735  break;
736 
737  default:
739  // TODO: calendar id
740  $calendar = ilObject::_lookupObjId((int) $_GET['ref_id']);
741  break;
742  }
743  if($hash = ilCalendarAuthenticationToken::lookupAuthToken($ilUser->getId(), $selection, $calendar))
744  {
745 
746  }
747  else
748  {
749  $token = new ilCalendarAuthenticationToken($ilUser->getId());
750  $token->setSelectionType($selection);
751  $token->setCalendar($calendar);
752  $hash = $token->add();
753  }
754  $url = ILIAS_HTTP_PATH.'/calendar.php?client_id='.CLIENT_ID.'&token='.$hash;
755 
756  $tpl->setVariable('VAL_CAL_URL',$url);
757  $tpl->setVariable('VAL_CAL_URL_TXT',$url);
758 
759  include_once("./Services/PersonalDesktop/classes/class.ilPDContentBlockGUI.php");
760  $content_block = new ilPDContentBlockGUI();
761  $content_block->setContent($tpl->get());
762  $content_block->setTitle($lng->txt("calendar"));
763  $content_block->addHeaderCommand($this->ctrl->getParentReturn($this),
764  $lng->txt("selected_items_back"));
765 
766  return $content_block->getHTML();
767 
768  }
$_GET["client_id"]
$url
Definition: shib_logout.php:72
global $tpl
Definition: ilias.php:8
static _lookupObjId($a_id)
special template class to simplify handling of ITX/PEAR
$ilUser
Definition: imgupload.php:18
global $lng
Definition: privfeed.php:17
static lookupAuthToken($a_user_id, $a_selection, $a_calendar=0)
Handles calendar authentication tokens for external calendar subscriptions.
BlockGUI class for (centered) Content on Personal Desktop.
+ Here is the call graph for this function:

Field Documentation

◆ $block_type

ilCalendarBlockGUI::$block_type = "cal"
static

Definition at line 46 of file class.ilCalendarBlockGUI.php.

◆ $ctrl

ilCalendarBlockGUI::$ctrl = null

Definition at line 42 of file class.ilCalendarBlockGUI.php.

◆ $display_mode

ilCalendarBlockGUI::$display_mode
protected

Definition at line 44 of file class.ilCalendarBlockGUI.php.

◆ $mode

ilCalendarBlockGUI::$mode
protected

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

Referenced by __construct().

◆ $st_data

ilCalendarBlockGUI::$st_data
static

Definition at line 47 of file class.ilCalendarBlockGUI.php.


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