ILIAS  release_7 Revision v7.30-3-g800a261c036
ilCalendarBlockGUI Class Reference

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

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

Public Member Functions

 __construct ()
 Constructor. More...
 
 getShowWeeksColumn ()
 Show weeks column. More...
 
 getBlockType ()
 
Returns
string
More...
 
 setParentGUI ($a_val)
 Set parent gui. More...
 
 getParentGUI ()
 Get parent gui. More...
 
 setForceMonthView ($a_val)
 Set force month view. More...
 
 getForceMonthView ()
 Get force month view. More...
 
 executeCommand ()
 execute command More...
 
 setEnableEdit ($a_enable_edit=0)
 Set EnableEdit. More...
 
 getEnableEdit ()
 Get EnableEdit. More...
 
 fillDataSection ()
 Fill data section. More...
 
 getTargetGUIClassPath ()
 Get target gui class path (for presenting the calendar) More...
 
 addMiniMonth ($a_tpl, $a_include_view_ctrl=false)
 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...
 
 setSeed ()
 Set seed. More...
 
 returnToUpperContext ()
 Return to upper context. More...
 
 fillFooter ()
 
 initCommands ()
 Init commands. More...
 
 setPdModeEvents ()
 
 setPdModeMonth ()
 
 getEvents ()
 Get events. More...
 
 getData ()
 Get Data. More...
 
 getDatesForItem ($item)
 Get start/end date for item. More...
 
 getModalForApp ()
 Get modal for appointment (see similar code in ilCalendarAgendaListGUI) todo use all this methods from ilcalendarviewgui.php. 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

 $ctrl = null
 
- 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"
 
static $st_data
 

Protected Member Functions

 isRepositoryObject ()
 Returns whether block has a corresponding repository object.
Returns
bool
More...
 
 getViewControl ()
 Get view control. More...
 
 initCategories ()
 init categories @access protected More...
 
 setSubTabs ()
 
 getViewControls ()
 Get view controls.
Returns
array
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...
 
 getNoItemFoundContent ()
 No item entry. More...
 
 addSubscriptionButton (ilTemplate $panel_template)
 Add subscription button. 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

 $mode
 
 $display_mode
 
 $tabs
 
 $obj_data_cache
 
 $parent_gui = "ilcolumngui"
 
 $ui
 
 $force_month_view = false
 
 $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

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

groups and courses

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

@ilCtrl_IsCalledBy ilCalendarBlockGUI: ilColumnGUI @ilCtrl_Calls ilCalendarBlockGUI: ilCalendarAppointmentGUI, ilCalendarMonthGUI, ilCalendarWeekGUI, ilCalendarDayGUI @ilCtrl_Calls ilCalendarBlockGUI: ilConsultationHoursGUI, ilCalendarAppointmentPresentationGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilCalendarBlockGUI::__construct ( )

Constructor.

Parameters
booleanskip initialisation (is called by derived PDCalendarBlockGUI class)

Reimplemented from ilBlockGUI.

Reimplemented in ilPDCalendarBlockGUI.

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

56 {
57 global $DIC;
58
60
61 $this->tabs = $DIC->tabs();
62 $this->obj_data_cache = $DIC["ilObjDataCache"];
63 $this->ui = $DIC->ui();
64
66 $ilCtrl = $this->ctrl;
69 $ilHelp = $DIC["ilHelp"];
70
71 $lng->loadLanguageModule("dateplaner");
72 $ilHelp->addHelpSection("cal_block");
73
74 include_once("./Services/News/classes/class.ilNewsItem.php");
75
76 $ilCtrl->saveParameter($this, 'bkid');
77
78 $this->setBlockId($ilCtrl->getContextObjId());
79
80 $this->setLimit(5); // @todo: needed?
81
82 $this->setEnableNumInfo(false);
83
84 $title = $lng->txt("calendar");
85
86 $this->setTitle($title);
87 $this->allow_moving = false;
88
89 include_once('Services/Calendar/classes/class.ilDate.php');
90 include_once('Services/Calendar/classes/class.ilCalendarUserSettings.php');
91
92 $seed_str = "";
93 if ((!isset($_GET["seed"]) || $_GET["seed"] == "") &&
94 isset($_SESSION["il_cal_block_" . $this->getBlockType() . "_" . $this->getBlockId() . "_seed"])) {
95 $seed_str = $_SESSION["il_cal_block_" . $this->getBlockType() . "_" . $this->getBlockId() . "_seed"];
96 } elseif (isset($_GET["seed"])) {
97 $seed_str = $_GET["seed"];
98 }
99
100 if (isset($_GET["seed"]) && $_GET["seed"] != "") {
101 $_SESSION["il_cal_block_" . $this->getBlockType() . "_" . $this->getBlockId() . "_seed"]
102 = $_GET["seed"];
103 }
104
105 if ($seed_str == "") {
106 $now = new \ilDate(time(), IL_CAL_UNIX);
107 $this->seed = new \ilDate($now->get(IL_CAL_DATE), IL_CAL_DATE);
108 } else {
109 $this->seed = new ilDate($seed_str, IL_CAL_DATE); // @todo: check this
110 }
111
113 $this->user_settings = ilCalendarUserSettings::_getInstanceByUserId($ilUser->getId());
114
115 $mode = $ilUser->getPref("il_pd_cal_mode");
116 $this->display_mode = $mode ? $mode : "mmon";
117
118 if ($this->display_mode !== "mmon") {
119 $this->setPresentation(self::PRES_SEC_LIST);
120 }
121 }
$_GET["client_id"]
$_SESSION["AccountId"]
const IL_CAL_DATE
const IL_CAL_UNIX
setLimit($a_limit)
Set Limit.
getBlockId()
Get Block Id.
setPresentation(int $type)
Set presentation.
setTitle($a_title)
Set Title.
setBlockId($a_block_id=0)
Set Block Id.
setEnableNumInfo($a_enablenuminfo)
Set Enable Item Number Info.
static _getInstance()
get singleton instance
static _getInstanceByUserId($a_user_id)
get singleton instance
Class for single dates.
global $DIC
Definition: goto.php:24
$ilUser
Definition: imgupload.php:18
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
settings()
Definition: settings.php:2
ui()
Definition: ui.php:5

References $_GET, $_SESSION, $ctrl, $DIC, $ilUser, ilBlockGUI\$lng, ilBlockGUI\$main_tpl, $mode, ilBlockGUI\$title, ilBlockGUI\$tpl, ilBlockGUI\$user, ILIAS\GlobalScreen\Provider\__construct(), ilCalendarSettings\_getInstance(), ilCalendarUserSettings\_getInstanceByUserId(), ilBlockGUI\getBlockId(), getBlockType(), IL_CAL_DATE, IL_CAL_UNIX, ilBlockGUI\setBlockId(), ilBlockGUI\setEnableNumInfo(), ilBlockGUI\setLimit(), ilBlockGUI\setPresentation(), settings(), ilBlockGUI\setTitle(), and ui().

+ Here is the call graph for this function:

Member Function Documentation

◆ addMiniMonth()

ilCalendarBlockGUI::addMiniMonth (   $a_tpl,
  $a_include_view_ctrl = false 
)

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

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

330 {
332 $ilCtrl = $this->ctrl;
334 $ui = $this->ui;
335
336 // weekdays
337 include_once('Services/Calendar/classes/class.ilCalendarUtil.php');
338 if ($this->getShowWeeksColumn()) {
339 $a_tpl->setCurrentBlock('month_header_col');
340 $a_tpl->setVariable('TXT_WEEKDAY', $lng->txt("cal_week_abbrev"));
341 $a_tpl->parseCurrentBlock();
342 }
343 for ($i = (int) $this->user_settings->getWeekStart(); $i < (7 + (int) $this->user_settings->getWeekStart()); $i++) {
344 $a_tpl->setCurrentBlock('month_header_col');
345 $a_tpl->setVariable('TXT_WEEKDAY', ilCalendarUtil::_numericDayToString($i, false));
346 $a_tpl->parseCurrentBlock();
347 }
348
349 if (isset($_GET["bkid"])) {
350 $user_id = $_GET["bkid"];
351 $disable_empty = true;
352 } else {
353 $user_id = $ilUser->getId();
354 $disable_empty = false;
355 }
356 include_once('Services/Calendar/classes/class.ilCalendarSchedule.php');
357 $this->scheduler = new ilCalendarSchedule($this->seed, ilCalendarSchedule::TYPE_MONTH, $user_id);
358 $this->scheduler->addSubitemCalendars(true);
359 $this->scheduler->calculate();
360
361 $counter = 0;
363 $this->seed->get(IL_CAL_FKT_DATE, 'm'),
364 $this->seed->get(IL_CAL_FKT_DATE, 'Y'),
365 $this->user_settings->getWeekStart()
366 )->get() as $date) {
367 $counter++;
368
369 $events = $this->scheduler->getByDay($date, $ilUser->getTimeZone());
370 $has_events = (bool) count($events);
371 if ($has_events || !$disable_empty) {
372 $a_tpl->setCurrentBlock('month_col_link');
373 } else {
374 $a_tpl->setCurrentBlock('month_col_no_link');
375 }
376
377 if ($disable_empty) {
378 if (!$has_events) {
379 $a_tpl->setVariable('DAY_CLASS', 'calminiinactive');
380 } else {
381 $week_has_events = true;
382 include_once 'Services/Booking/classes/class.ilBookingEntry.php';
383 foreach ($events as $event) {
384 $booking = new ilBookingEntry($event['event']->getContextId());
385 if ($booking->hasBooked($event['event']->getEntryId())) {
386 $a_tpl->setVariable('DAY_CLASS', 'calminiapp');
387 break;
388 }
389 }
390 }
391 } elseif ($has_events) {
392 $week_has_events = true;
393 $a_tpl->setVariable('DAY_CLASS', 'calminiapp');
394 }
395
396 $day = $date->get(IL_CAL_FKT_DATE, 'j');
397 $month = $date->get(IL_CAL_FKT_DATE, 'n');
398
399 $month_day = $day;
400
401 $ilCtrl->setParameterByClass(end($this->getTargetGUIClassPath()), 'seed', $date->get(IL_CAL_DATE));
402 if ($agenda_view_type = (int) $_GET['cal_agenda_per']) {
403 $ilCtrl->setParameterByClass(end($this->getTargetGUIClassPath()), "cal_agenda_per", $agenda_view_type);
404 }
405 $a_tpl->setVariable('OPEN_DAY_VIEW', $ilCtrl->getLinkTargetByClass($this->getTargetGUIClassPath(), ''));
406
407 $a_tpl->setVariable('MONTH_DAY', $month_day);
408
409 $a_tpl->parseCurrentBlock();
410
411 $a_tpl->setCurrentBlock('month_col');
412
413 include_once('./Services/Calendar/classes/class.ilCalendarUtil.php');
414 if (ilCalendarUtil::_isToday($date)) {
415 $a_tpl->setVariable('TD_CLASS', 'calminitoday');
416 }
417 #elseif(ilDateTime::_equals($date,$this->seed,IL_CAL_DAY))
418 #{
419 # $a_tpl->setVariable('TD_CLASS','calmininow');
420 #}
421 elseif (ilDateTime::_equals($date, $this->seed, IL_CAL_MONTH)) {
422 $a_tpl->setVariable('TD_CLASS', 'calministd');
423 } elseif (ilDateTime::_before($date, $this->seed, IL_CAL_MONTH)) {
424 $a_tpl->setVariable('TD_CLASS', 'calminiprev');
425 } else {
426 $a_tpl->setVariable('TD_CLASS', 'calmininext');
427 }
428
429 $a_tpl->parseCurrentBlock();
430
431 if ($counter and !($counter % 7)) {
432 if ($this->getShowWeeksColumn()) {
433 $a_tpl->setCurrentBlock('week');
434 $a_tpl->setVariable(
435 'WEEK',
436 $date->get(IL_CAL_FKT_DATE, 'W')
437 );
438 $a_tpl->parseCurrentBlock();
439 }
440
441 $a_tpl->setCurrentBlock('month_row');
442 //$a_tpl->setVariable('TD_CLASS','calminiweek');
443 $a_tpl->parseCurrentBlock();
444
445 $week_has_events = false;
446 }
447 }
448 $a_tpl->setCurrentBlock('mini_month');
449 //$a_tpl->setVariable('TXT_MONTH_OVERVIEW', $lng->txt("cal_month_overview"));
450
451 if ($a_include_view_ctrl) {
452 $a_tpl->setVariable("VIEW_CTRL_SECTION", $ui->renderer()->render($this->getViewControl()));
453 }
454
455 $a_tpl->parseCurrentBlock();
456 }
const IL_CAL_MONTH
const IL_CAL_FKT_DATE
Booking definition.
getShowWeeksColumn()
Show weeks column.
getTargetGUIClassPath()
Get target gui class path (for presenting the calendar)
Represents a list of calendar appointments (including recurring events) for a specific user in a give...
static _isToday($date)
check if a date is today
static _numericDayToString($a_day, $a_long=true)
get
static _buildMonthDayList($a_month, $a_year, $weekstart)
Build a month day list.
static _equals(ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
Check if two date are equal.
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.
$i
Definition: metadata.php:24

References $_GET, $ctrl, $i, $ilUser, ilBlockGUI\$lng, $ui, ilBlockGUI\$user, ilDateTime\_before(), ilCalendarUtil\_buildMonthDayList(), ilDateTime\_equals(), ilCalendarUtil\_isToday(), ilCalendarUtil\_numericDayToString(), getShowWeeksColumn(), getTargetGUIClassPath(), IL_CAL_DATE, IL_CAL_FKT_DATE, IL_CAL_MONTH, and ilCalendarSchedule\TYPE_MONTH.

Referenced by fillDataSection(), and getLegacyContent().

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

◆ addSubscriptionButton()

ilCalendarBlockGUI::addSubscriptionButton ( ilTemplate  $panel_template)
protected

Add subscription button.

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

984 : void
985 {
986 global $DIC;
987
988 $lng = $DIC->language();
989
990 $ui_factory = $DIC->ui()->factory();
991 $ui_renderer = $DIC->ui()->renderer();
992
993 $gui_path = $this->getTargetGUIClassPath();
994 $gui_path[] = strtolower(\ilCalendarSubscriptionGUI::class);
995 $url = $this->ctrl->getLinkTargetByClass($gui_path, 'getModalForSubscription', "", true, false);
996
997 $roundtrip_modal = $ui_factory->modal()->roundtrip('', [])->withAsyncRenderUrl($url);
998
999 $standard_button = $ui_factory->button()->standard($lng->txt('btn_ical'), '')->withOnClick(
1000 $roundtrip_modal->getShowSignal()
1001 );
1002 $components = [
1003 $roundtrip_modal,
1004 $standard_button
1005 ];
1006
1007 $presentation = $ui_renderer->render($components);
1008
1009 $panel_template->setCurrentBlock('subscription_buttons');
1010 $panel_template->setVariable('SUBSCRIPTION_BUTTON', $presentation);
1011 $panel_template->parseCurrentBlock();
1012 }
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:615
parseCurrentBlock($part="DEFAULT")
Überladene Funktion, die auf den aktuelle Block vorher noch ein replace ausführt @access public.
setCurrentBlock($part="DEFAULT")
Überladene Funktion, die sich hier lokal noch den aktuellen Block merkt.
$url

References $DIC, ilBlockGUI\$lng, ilBlockGUI\$presentation, $url, getTargetGUIClassPath(), ilTemplate\parseCurrentBlock(), ilTemplate\setCurrentBlock(), and HTML_Template_IT\setVariable().

Referenced by getLegacyContent().

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

◆ executeCommand()

ilCalendarBlockGUI::executeCommand ( )

execute command

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

221 {
222 $ilCtrl = $this->ctrl;
223 $ilTabs = $this->tabs;
224
225 $next_class = $ilCtrl->getNextClass();
226 $cmd = $ilCtrl->getCmd("getHTML");
227
228 $this->setSubTabs();
229
230 switch ($next_class) {
231 case "ilcalendarappointmentgui":
232 include_once('./Services/Calendar/classes/class.ilCalendarAppointmentGUI.php');
233 $app_gui = new ilCalendarAppointmentGUI($this->seed, $this->seed);
234 $ilCtrl->forwardCommand($app_gui);
235 break;
236
237 case "ilconsultationhoursgui":
238 include_once('./Services/Calendar/classes/ConsultationHours/class.ilConsultationHoursGUI.php');
239 $hours = new ilConsultationHoursGUI($this->seed);
240 $ilCtrl->forwardCommand($hours);
241 break;
242
243 case "ilcalendarappointmentpresentationgui":
244 $this->initCategories();
245 $presentation = ilCalendarAppointmentPresentationGUI::_getInstance($this->seed, $this->appointment);
246 $ilCtrl->forwardCommand($presentation);
247 break;
248
249 case "ilcalendarmonthgui":
250 $ilTabs->setSubTabActive('app_month');
251 include_once('./Services/Calendar/classes/class.ilCalendarMonthGUI.php');
252 $month_gui = new ilCalendarMonthGUI($this->seed);
253 $ilCtrl->forwardCommand($month_gui);
254 break;
255
256 default:
257 return $this->$cmd();
258 }
259 }
Administrate calendar appointments.
static _getInstance(ilDate $seed, $a_app)
get singleton instance
initCategories()
init categories @access protected
Consultation hours editor.

References $ctrl, ilBlockGUI\$presentation, $tabs, ilCalendarAppointmentPresentationGUI\_getInstance(), initCategories(), and setSubTabs().

+ Here is the call graph for this function:

◆ fillDataSection()

ilCalendarBlockGUI::fillDataSection ( )

Fill data section.

Reimplemented from ilBlockGUI.

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

283 {
284 if ($this->display_mode != "mmon") {
285 $this->setRowTemplate("tpl.pd_event_list.html", "Services/Calendar");
286
288 } else {
289 $tpl = new ilTemplate(
290 "tpl.calendar_block.html",
291 true,
292 true,
293 "Services/Calendar"
294 );
295
296 $this->addMiniMonth($tpl, true);
297 $this->setDataSection($tpl->get());
298 }
299 }
setRowTemplate($a_rowtemplatename, $a_rowtemplatedir="")
Set Row Template Name.
setDataSection($a_content)
Call this from overwritten fillDataSection(), if standard row based data is not used.
fillDataSection()
Standard implementation for row based data.
addMiniMonth($a_tpl, $a_include_view_ctrl=false)
Add mini version of monthly overview (Maybe extracted to another class, if used in pd calendar tab.
special template class to simplify handling of ITX/PEAR

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

+ Here is the call graph for this function:

◆ fillFooter()

ilCalendarBlockGUI::fillFooter ( )

Reimplemented from ilBlockGUI.

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

708 {
709 // @todo: check this
710 return;
711
712 // begin-patch ch
713 foreach ((array) $this->cal_footer as $link_info) {
714 $this->tpl->setCurrentBlock('data_section');
715 $this->tpl->setVariable(
716 'DATA',
717 sprintf('<a href="%s">%s</a>', $link_info['link'], $link_info['txt'])
718 );
719 $this->tpl->parseCurrentBlock();
720 }
721 // end-patch ch
722
723 if ($this->tpl->blockExists("block_footer")) {
724 $this->tpl->setCurrentBlock("block_footer");
725 $this->tpl->parseCurrentBlock();
726 }
727 }

◆ getBlockType()

ilCalendarBlockGUI::getBlockType ( )

Returns
string

Reimplemented from ilBlockGUI.

Reimplemented in ilPDCalendarBlockGUI.

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

136 : string
137 {
138 return self::$block_type;
139 }

References $block_type.

Referenced by __construct(), and setSeed().

+ Here is the caller graph for this function:

◆ getData()

ilCalendarBlockGUI::getData ( )

Get Data.

Returns
array Data

Reimplemented from ilBlockGUI.

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

820 {
822 $ui = $this->ui;
823
824 $f = $ui->factory();
825
826 $events = $this->getEvents();
827
828 $data = array();
829 if (sizeof($events)) {
830 foreach ($events as $item) {
831 $this->ctrl->setParameter($this, "app_id", $item["event"]->getEntryId());
832 $this->ctrl->setParameter($this, 'dt', $item['dstart']);
833 $url = $this->ctrl->getLinkTarget($this, "getModalForApp", "", true, false);
834 $this->ctrl->setParameter($this, "app_id", $_GET["app_id"]);
835 $this->ctrl->setParameter($this, "dt", $_GET["dt"]);
836 $modal = $f->modal()->roundtrip('', [])->withAsyncRenderUrl($url);
837
838 $dates = $this->getDatesForItem($item);
839
840 $comps = [$f->button()->shy($item["event"]->getPresentationTitle(), "")->withOnClick($modal->getShowSignal()), $modal];
841 $renderer = $ui->renderer();
842 $shy = $renderer->render($comps);
843
844 $data[] = array(
845 "date" => ilDatePresentation::formatPeriod($dates["start"], $dates["end"]),
846 "title" => $item["event"]->getPresentationTitle(),
847 "url" => "#",
848 "shy_button" => $shy
849 );
850 }
851 $this->setEnableNumInfo(true);
852 } else {
853 $data = [];
854 /*$data[] = array(
855 "date" => $lng->txt("msg_no_search_result"),
856 "title" => "",
857 "url" => ""
858 ); */
859
860 $this->setEnableNumInfo(false);
861 }
862
863 return $data;
864 }
getDatesForItem($item)
Get start/end date for item.
static formatPeriod(ilDateTime $start, ilDateTime $end, $a_skip_starting_day=false)
Format a period of two date Shows: 14.

References $_GET, ilBlockGUI\$data, Vendor\Package\$f, ilBlockGUI\$lng, $ui, $url, ilDatePresentation\formatPeriod(), getDatesForItem(), getEvents(), and ilBlockGUI\setEnableNumInfo().

+ Here is the call graph for this function:

◆ getDatesForItem()

ilCalendarBlockGUI::getDatesForItem (   $item)

Get start/end date for item.

Parameters
array$itemitem
Returns
array

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

872 {
873 $start = $item["dstart"];
874 $end = $item["dend"];
875 if ($item["fullday"]) {
876 $start = new ilDate($start, IL_CAL_UNIX);
877 $end = new ilDate($end, IL_CAL_UNIX);
878 } else {
879 $start = new ilDateTime($start, IL_CAL_UNIX);
880 $end = new ilDateTime($end, IL_CAL_UNIX);
881 }
882 return array("start" => $start, "end" => $end);
883 }
@classDescription Date and time handling

References IL_CAL_UNIX.

Referenced by getData(), and getModalForApp().

+ Here is the caller graph for this function:

◆ getEnableEdit()

ilCalendarBlockGUI::getEnableEdit ( )

Get EnableEdit.

Returns
boolean Edit mode on/off

Reimplemented from ilBlockGUI.

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

275 {
276 return $this->enable_edit;
277 }

◆ getEvents()

ilCalendarBlockGUI::getEvents ( )

Get events.

Parameters

return

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

807 {
808 $seed = new ilDate(date('Y-m-d', time()), IL_CAL_DATE);
809
810 include_once('./Services/Calendar/classes/class.ilCalendarSchedule.php');
812 $schedule->addSubitemCalendars(true); // #12007
813 $schedule->setEventsLimit(20);
814 $schedule->calculate();
815 $ev = $schedule->getScheduledEvents(); // #13809
816 return ($ev);
817 }

References IL_CAL_DATE, and ilCalendarSchedule\TYPE_PD_UPCOMING.

Referenced by getData(), and getModalForApp().

+ Here is the caller graph for this function:

◆ getForceMonthView()

ilCalendarBlockGUI::getForceMonthView ( )

Get force month view.

Returns
bool force month view

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

References $force_month_view.

Referenced by getHTML(), initCategories(), ilPDCalendarBlockGUI\initCategories(), and initCommands().

+ Here is the caller graph for this function:

◆ getHTML()

ilCalendarBlockGUI::getHTML ( )

Get bloch HTML code.

Reimplemented from ilBlockGUI.

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

514 {
515 $this->initCategories();
517 $ilCtrl = $this->ctrl;
518 $ilObjDataCache = $this->obj_data_cache;
520
521 if ($this->mode == ilCalendarCategories::MODE_REPOSITORY) {
522 if (!isset($_GET["bkid"])) {
523 include_once "Modules/Course/classes/class.ilCourseParticipants.php";
524 $obj_id = $ilObjDataCache->lookupObjId((int) $_GET['ref_id']);
525 $participants = ilCourseParticipants::_getInstanceByObjId($obj_id);
526 $users = array_unique(array_merge($participants->getTutors(), $participants->getAdmins()));
527 //$users = $participants->getParticipants();
528 include_once 'Services/Booking/classes/class.ilBookingEntry.php';
529 $users = ilBookingEntry::lookupBookableUsersForObject($obj_id, $users);
530 foreach ($users as $user_id) {
531 if (!isset($_GET["bkid"])) {
532 include_once './Services/Calendar/classes/ConsultationHours/class.ilConsultationHourAppointments.php';
533 $now = new ilDateTime(time(), IL_CAL_UNIX);
534
535 // default to last booking entry
536 $appointments = ilConsultationHourAppointments::getAppointments($user_id);
537 $next_app = end($appointments);
538 reset($appointments);
539
540 foreach ($appointments as $entry) {
541 // find next entry
542 if (ilDateTime::_before($entry->getStart(), $now, IL_CAL_DAY)) {
543 continue;
544 }
545 include_once 'Services/Booking/classes/class.ilBookingEntry.php';
546 $booking_entry = new ilBookingEntry($entry->getContextId());
547 if (!in_array($obj_id, $booking_entry->getTargetObjIds())) {
548 continue;
549 }
550
551 if (!$booking_entry->isAppointmentBookableForUser($entry->getEntryId(), $user->getId())) {
552 continue;
553 }
554 $next_app = $entry;
555 break;
556 }
557
558 /*
559 $ilCtrl->setParameter($this, "bkid", $user_id);
560 if($next_app)
561 {
562 $ilCtrl->setParameter(
563 $this,
564 'seed',
565 (string) $next_app->getStart()->get(IL_CAL_DATE)
566 );
567 }*/
568
569 //$ilCtrl->setParameterByClass(end($this->getTargetGUIClassPath()), "bkid", $user_id);
570
571 $ilCtrl->setParameterByClass(end($this->getTargetGUIClassPath()), "ch_user_id", $user_id);
572
573 if ($next_app) {
574 // this does not work correctly
575 /*$ilCtrl->setParameterByClass(
576 end($this->getTargetGUIClassPath()),
577 'seed',
578 (string) $next_app->getStart()->get(IL_CAL_DATE)
579 );*/
580 }
581
582 if (!$this->getForceMonthView()) {
583 $this->cal_footer[] = array(
584 'link' => $ilCtrl->getLinkTargetByClass($this->getTargetGUIClassPath(), 'selectCHCalendarOfUser'),
585 'txt' => str_replace("%1", ilObjUser::_lookupFullname($user_id), $lng->txt("cal_consultation_hours_for_user"))
586 );
587 }
588 $ilCtrl->setParameterByClass(end($this->getTargetGUIClassPath()), "ch_user_id", "");
589 $ilCtrl->setParameterByClass(end($this->getTargetGUIClassPath()), "bkid", $_GET["bkid"]);
590 $ilCtrl->setParameterByClass(end($this->getTargetGUIClassPath()), "seed", $_GET["seed"]);
591 }
592 }
593 $ilCtrl->setParameter($this, "bkid", "");
594 $ilCtrl->setParameter($this, 'seed', '');
595 } else {
596 $ilCtrl->setParameter($this, "bkid", "");
597 $this->addBlockCommand(
598 $ilCtrl->getLinkTarget($this),
599 $lng->txt("back")
600 );
601 $ilCtrl->setParameter($this, "bkid", (int) $_GET["bkid"]);
602 }
603 }
604
605 if ($this->getProperty("settings") == true) {
606 $this->addBlockCommand(
607 $ilCtrl->getLinkTarget($this, "editSettings"),
608 $lng->txt("settings")
609 );
610 }
611
612 $ilCtrl->setParameterByClass($this->getParentGUI(), "seed", isset($_GET["seed"]) ? $_GET["seed"] : "");
613 $ret = parent::getHTML();
614 $ilCtrl->setParameterByClass($this->getParentGUI(), "seed", "");
615
616 // workaround to include asynch code from ui only one time, see #20853
617 if ($ilCtrl->isAsynch()) {
618 global $DIC;
619 $f = $DIC->ui()->factory()->legacy("");
620 $ret .= $DIC->ui()->renderer()->renderAsync($f);
621 }
622
623 return $ret;
624 }
const IL_CAL_DAY
addBlockCommand(string $a_href, string $a_text, string $a_onclick="")
Add Block Command.
getProperty($a_property)
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...
getForceMonthView()
Get force month view.
static getAppointments($a_user_id)
Get all appointments.
static _getInstanceByObjId($a_obj_id)
Get singleton instance.
static _lookupFullname($a_user_id)
Lookup Full Name.
$ret
Definition: parser.php:6

References $_GET, $ctrl, $DIC, Vendor\Package\$f, ilBlockGUI\$lng, $obj_data_cache, $ret, ilBlockGUI\$user, ilDateTime\_before(), ilCourseParticipants\_getInstanceByObjId(), ilObjUser\_lookupFullname(), ilBlockGUI\addBlockCommand(), ilConsultationHourAppointments\getAppointments(), getForceMonthView(), getParentGUI(), ilBlockGUI\getProperty(), getTargetGUIClassPath(), IL_CAL_DAY, IL_CAL_UNIX, initCategories(), ilBookingEntry\lookupBookableUsersForObject(), and ilCalendarCategories\MODE_REPOSITORY.

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

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

◆ getLegacyContent()

ilCalendarBlockGUI::getLegacyContent ( )
protected

Get legacy content.

Returns
string

Reimplemented from ilBlockGUI.

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

936 : string
937 {
938 $tpl = new ilTemplate(
939 "tpl.calendar_block.html",
940 true,
941 true,
942 "Services/Calendar"
943 );
944
945 $this->addMiniMonth($tpl);
946
947 $panel_tpl = new \ilTemplate(
948 'tpl.cal_block_panel.html',
949 true,
950 true,
951 'Services/Calendar'
952 );
953
954 $this->addSubscriptionButton($panel_tpl);
955
956 return $tpl->get() . $panel_tpl->get();
957 }
addSubscriptionButton(ilTemplate $panel_template)
Add subscription button.

References ilBlockGUI\$tpl, addMiniMonth(), and addSubscriptionButton().

+ Here is the call graph for this function:

◆ getListItemForData()

ilCalendarBlockGUI::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 962 of file class.ilCalendarBlockGUI.php.

963 {
964 $factory = $this->ui->factory();
965 if (isset($data["shy_button"])) {
966 return $factory->item()->standard($data["shy_button"])->withDescription($data["date"]);
967 } else {
968 return $factory->item()->standard($data["date"]);
969 }
970 }
Common interface to all items.
Definition: Item.php:11
$factory
Definition: metadata.php:58

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

+ Here is the call graph for this function:

◆ getModalForApp()

ilCalendarBlockGUI::getModalForApp ( )

Get modal for appointment (see similar code in ilCalendarAgendaListGUI) todo use all this methods from ilcalendarviewgui.php.

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

890 {
891 $this->initCategories();
892 $ui = $this->ui;
893 $ilCtrl = $this->ctrl;
894
895 $f = $ui->factory();
896 $r = $ui->renderer();
897
898 // @todo: this needs optimization
899 $events = $this->getEvents();
900 foreach ($events as $item) {
901 if ($item["event"]->getEntryId() == (int) $_GET["app_id"] && $item['dstart'] == (int) $_GET['dt']) {
902 $dates = $this->getDatesForItem($item);
903
904 // content of modal
905 include_once("./Services/Calendar/classes/class.ilCalendarAppointmentPresentationGUI.php");
906 $next_gui = ilCalendarAppointmentPresentationGUI::_getInstance($this->seed, $item);
907 $content = $ilCtrl->getHTML($next_gui);
908
909 $modal = $f->modal()->roundtrip(ilDatePresentation::formatPeriod($dates["start"], $dates["end"]), $f->legacy($content));
910 echo $r->renderAsync($modal);
911 }
912 }
913 exit();
914 }
exit
Definition: login.php:29

References $_GET, $ctrl, Vendor\Package\$f, $ui, ilCalendarAppointmentPresentationGUI\_getInstance(), exit, ilDatePresentation\formatPeriod(), getDatesForItem(), getEvents(), and initCategories().

+ Here is the call graph for this function:

◆ getNoItemFoundContent()

ilCalendarBlockGUI::getNoItemFoundContent ( )
protected

No item entry.

Returns
string

Reimplemented from ilBlockGUI.

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

976 : string
977 {
978 return $this->lng->txt("cal_no_events_block");
979 }

◆ getOverview()

ilCalendarBlockGUI::getOverview ( )

Get overview.

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

630 {
632 $ilCtrl = $this->ctrl;
633
634 include_once('./Services/Calendar/classes/class.ilCalendarSchedule.php');
635 $schedule = new ilCalendarSchedule($this->seed, ilCalendarSchedule::TYPE_INBOX);
636 $events = $schedule->getChangedEvents(true);
637
638 $ilCtrl->setParameterByClass('ilcalendarinboxgui', 'changed', 1);
639 $link = '<a href=' . $ilCtrl->getLinkTargetByClass('ilcalendarinboxgui', '') . '>';
640 $ilCtrl->setParameterByClass('ilcalendarinboxgui', 'changed', '');
641 $text = '<div class="small">' . ((int) count($events)) . " " . $lng->txt("cal_changed_events_header") . "</div>";
642 $end_link = '</a>';
643
644 return $link . $text . $end_link;
645 }

References $ctrl, ilBlockGUI\$lng, and ilCalendarSchedule\TYPE_INBOX.

◆ getParentGUI()

ilCalendarBlockGUI::getParentGUI ( )

Get parent gui.

Returns

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

References $parent_gui.

Referenced by getHTML().

+ Here is the caller graph for this function:

◆ getScreenMode()

static ilCalendarBlockGUI::getScreenMode ( )
static

Get Screen Mode for current command.

Reimplemented from ilBlockGUI.

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

193 {
194 global $DIC;
195
196 $ilCtrl = $DIC->ctrl();
197
198 $cmd_class = $ilCtrl->getCmdClass();
199
200 if ($cmd_class == "ilcalendarappointmentgui" ||
201 $cmd_class == "ilconsultationhoursgui" ||
202 $_GET['cmd'] == 'showCalendarSubscription') {
203 return IL_SCREEN_CENTER;
204 }
205
206 switch ($ilCtrl->getCmd()) {
207 case "kkk":
208 // return IL_SCREEN_CENTER;
209 // return IL_SCREEN_FULL;
210
211 default:
212 //return IL_SCREEN_SIDE;
213 break;
214 }
215 }
const IL_SCREEN_CENTER

References $_GET, $DIC, and IL_SCREEN_CENTER.

◆ getShowWeeksColumn()

ilCalendarBlockGUI::getShowWeeksColumn ( )

Show weeks column.

Parameters

return

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

129 {
130 return ($this->settings->getShowWeeks() && $this->user_settings->getShowWeeks());
131 }

References settings().

Referenced by addMiniMonth().

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

◆ getTargetGUIClassPath()

ilCalendarBlockGUI::getTargetGUIClassPath ( )

Get target gui class path (for presenting the calendar)

Parameters

return

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

307 {
308 $target_class = array();
309 if (!$this->getRepositoryMode()) {
310 $target_class = array("ildashboardgui", "ilcalendarpresentationgui");
311 } else {
312 switch (ilObject::_lookupType((int) $_GET["ref_id"], true)) {
313 case "crs":
314 $target_class = array("ilobjcoursegui", "ilcalendarpresentationgui");
315 break;
316
317 case "grp":
318 $target_class = array("ilobjgroupgui", "ilcalendarpresentationgui");
319 break;
320 }
321 }
322 return $target_class;
323 }
getRepositoryMode()
Get RepositoryMode.
static _lookupType($a_id, $a_reference=false)
lookup object type

References $_GET, ilObject\_lookupType(), and ilBlockGUI\getRepositoryMode().

Referenced by addMiniMonth(), addSubscriptionButton(), and getHTML().

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

◆ getViewControl()

ilCalendarBlockGUI::getViewControl ( )
protected

Get view control.

Returns
\ILIAS\UI\Component\ViewControl\Section

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

463 {
464 $ui = $this->ui;
466 $ilCtrl = $this->ctrl;
467
468 $first_of_month = substr($this->seed->get(IL_CAL_DATE), 0, 7) . "-01";
469 $myseed = new ilDate($first_of_month, IL_CAL_DATE);
470
471 $myseed->increment(ilDateTime::MONTH, -1);
472 $ilCtrl->setParameter($this, 'seed', $myseed->get(IL_CAL_DATE));
473
474 $prev_link = $ilCtrl->getLinkTarget($this, "setSeed", "", true);
475
476 $myseed->increment(ilDateTime::MONTH, 2);
477 $ilCtrl->setParameter($this, 'seed', $myseed->get(IL_CAL_DATE));
478 $next_link = $ilCtrl->getLinkTarget($this, "setSeed", "", true);
479
480 $ilCtrl->setParameter($this, 'seed', "");
481
482 $blockgui = $this;
483
484 // view control
485 // ... previous button
486 $b1 = $ui->factory()->button()->standard($lng->txt("previous"), "#")->withOnLoadCode(function ($id) use ($prev_link, $blockgui) {
487 return
488 "$('#" . $id . "').click(function() { ilBlockJSHandler('block_" . $blockgui->getBlockType() .
489 "_" . $blockgui->getBlockId() . "','" . $prev_link . "'); return false;});";
490 });
491
492 // ... month button
493 $ilCtrl->clearParameterByClass("ilcalendarblockgui", 'seed');
494 $month_link = $ilCtrl->getLinkTarget($this, "setSeed", "", true, false);
495 $seed_parts = explode("-", $this->seed->get(IL_CAL_DATE));
496 $b2 = $ui->factory()->button()->month($seed_parts[1] . "-" . $seed_parts[0])->withOnLoadCode(function ($id) use ($month_link, $blockgui) {
497 return "$('#" . $id . "').on('il.ui.button.month.changed', function(el, id, month) { var m = month.split('-'); ilBlockJSHandler('block_" . $blockgui->getBlockType() .
498 "_" . $blockgui->getBlockId() . "','" . $month_link . "' + '&seed=' + m[1] + '-' + m[0] + '-01'); return false;});";
499 });
500 // ... next button
501 $b3 = $ui->factory()->button()->standard($lng->txt("next"), "#")->withOnLoadCode(function ($id) use ($next_link, $blockgui) {
502 return
503 "$('#" . $id . "').click(function() { ilBlockJSHandler('block_" . $blockgui->getBlockType() .
504 "_" . $blockgui->getBlockId() . "','" . $next_link . "'); return false;});";
505 });
506
507 return $ui->factory()->viewControl()->section($b1, $b2, $b3);
508 }
This describes a Section Control.
Definition: Section.php:13

References $ctrl, ilBlockGUI\$lng, $ui, IL_CAL_DATE, and ilDateTime\MONTH.

Referenced by getViewControls().

+ Here is the caller graph for this function:

◆ getViewControls()

ilCalendarBlockGUI::getViewControls ( )
protected

Get view controls.

Returns
array

Reimplemented from ilBlockGUI.

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

925 : array
926 {
927 if ($this->getPresentation() == self::PRES_SEC_LEG) {
928 return [$this->getViewControl()];
929 }
931 }
getPresentation()
Get presentation type.
getViewControl()
Get view control.

References ilBlockGUI\getPresentation(), getViewControl(), and ILIAS\UI\Implementation\Component\ViewControl\getViewControls().

+ Here is the call graph for this function:

◆ initCategories()

ilCalendarBlockGUI::initCategories ( )
protected

init categories @access protected

Parameters

return

Reimplemented in ilPDCalendarBlockGUI.

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

654 {
657 if ($this->getForceMonthView()) {
658 // old comment: in full container calendar presentation (allows selection of other calendars)
659 } elseif (!$cats->getMode()) {
660 $cats->initialize(
662 (int) $_GET['ref_id'],
663 true
664 );
665 }
666 }
static _getInstance($a_usr_id=0)
get singleton instance

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

Referenced by executeCommand(), getHTML(), and getModalForApp().

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

◆ initCommands()

ilCalendarBlockGUI::initCommands ( )

Init commands.

Reimplemented from ilBlockGUI.

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

730 {
731 $ilCtrl = $this->ctrl;
733
734 if (!$this->getForceMonthView()) {
735 // @todo: set checked on ($this->display_mode != 'mmon')
736 $this->addBlockCommand(
737 $ilCtrl->getLinkTarget($this, "setPdModeEvents"),
738 $lng->txt("cal_upcoming_events_header"),
739 $ilCtrl->getLinkTarget($this, "setPdModeEvents", "", true)
740 );
741
742 // @todo: set checked on ($this->display_mode == 'mmon')
743 $this->addBlockCommand(
744 $ilCtrl->getLinkTarget($this, "setPdModeMonth"),
745 $lng->txt("app_month"),
746 $ilCtrl->getLinkTarget($this, "setPdModeMonth", "", true)
747 );
748
749 if ($this->getRepositoryMode()) {
750 #23921
751 $ilCtrl->setParameterByClass('ilcalendarpresentationgui', 'seed', '');
752 $this->addBlockCommand(
753 $ilCtrl->getLinkTargetByClass($this->getTargetGUIClassPath(), ""),
754 $lng->txt("cal_open_calendar")
755 );
756
757 if ($this->access->checkAccess('edit_event', '', (int) $_GET['ref_id'])) {
758 $ilCtrl->setParameter($this, "add_mode", "");
759 $this->addBlockCommand(
760 $ilCtrl->getLinkTargetByClass("ilCalendarAppointmentGUI", "add"),
761 $lng->txt("add_appointment")
762 );
763 $ilCtrl->setParameter($this, "add_mode", "");
764 }
765 }
766 }
767 }

References $_GET, $ctrl, ilBlockGUI\$lng, ilBlockGUI\addBlockCommand(), getForceMonthView(), and ilBlockGUI\getRepositoryMode().

+ Here is the call graph for this function:

◆ isRepositoryObject()

ilCalendarBlockGUI::isRepositoryObject ( )
protected

Returns whether block has a corresponding repository object.

Returns
bool

Reimplemented from ilBlockGUI.

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

144 : bool
145 {
146 return false;
147 }

◆ returnToUpperContext()

ilCalendarBlockGUI::returnToUpperContext ( )

Return to upper context.

Reimplemented in ilPDCalendarBlockGUI.

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

701 {
702 $ilCtrl = $this->ctrl;
703
704 $ilCtrl->returnToParent($this);
705 }

References $ctrl.

Referenced by setSeed().

+ 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

Reimplemented from ilBlockGUI.

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

266 {
267 $this->enable_edit = $a_enable_edit;
268 }

◆ setForceMonthView()

ilCalendarBlockGUI::setForceMonthView (   $a_val)

Set force month view.

Parameters
bool$a_valforce month view

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

172 {
173 $this->force_month_view = $a_val;
174 if ($a_val) {
175 $this->display_mode = "mmon";
176 $this->setPresentation(self::PRES_SEC_LEG);
177 }
178 }

References ilBlockGUI\setPresentation().

+ Here is the call graph for this function:

◆ setParentGUI()

ilCalendarBlockGUI::setParentGUI (   $a_val)

Set parent gui.

Parameters
$a_val

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

154 {
155 $this->parent_gui = $a_val;
156 }

◆ setPdModeEvents()

ilCalendarBlockGUI::setPdModeEvents ( )

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

770 {
771 $ilCtrl = $this->ctrl;
773
774 $ilUser->writePref("il_pd_cal_mode", "evt");
775 $this->display_mode = "evt";
776 $this->setPresentation(self::PRES_SEC_LIST);
777 if ($ilCtrl->isAsynch()) {
778 echo $this->getHTML();
779 exit;
780 } else {
781 $ilCtrl->redirectByClass("ildashboardgui", "show");
782 }
783 }
getHTML()
Get bloch HTML code.

References $ctrl, $ilUser, ilBlockGUI\$user, exit, getHTML(), and ilBlockGUI\setPresentation().

+ Here is the call graph for this function:

◆ setPdModeMonth()

ilCalendarBlockGUI::setPdModeMonth ( )

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

786 {
787 $ilCtrl = $this->ctrl;
789
790 $ilUser->writePref("il_pd_cal_mode", "mmon");
791 $this->display_mode = "mmon";
792 $this->setPresentation(self::PRES_SEC_LEG);
793 if ($ilCtrl->isAsynch()) {
794 echo $this->getHTML();
795 exit;
796 } else {
797 $ilCtrl->redirectByClass("ildashboardgui", "show");
798 }
799 }

References $ctrl, $ilUser, ilBlockGUI\$user, exit, getHTML(), and ilBlockGUI\setPresentation().

+ Here is the call graph for this function:

◆ setSeed()

ilCalendarBlockGUI::setSeed ( )

Set seed.

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

683 {
684 $ilCtrl = $this->ctrl;
685
686 //$ilUser->writePref("il_pd_bkm_mode", 'flat');
687 $_SESSION["il_cal_block_" . $this->getBlockType() . "_" . $this->getBlockId() . "_seed"] =
688 $_GET["seed"];
689 if ($ilCtrl->isAsynch()) {
690 echo $this->getHTML();
691 exit;
692 } else {
693 $this->returnToUpperContext();
694 }
695 }
returnToUpperContext()
Return to upper context.

References $_GET, $_SESSION, $ctrl, exit, ilBlockGUI\getBlockId(), getBlockType(), getHTML(), and returnToUpperContext().

+ Here is the call graph for this function:

◆ setSubTabs()

ilCalendarBlockGUI::setSubTabs ( )
protected
Parameters

return

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

673 {
674 $ilTabs = $this->tabs;
675
676 $ilTabs->clearSubTabs();
677 }

References $tabs.

Referenced by executeCommand().

+ Here is the caller graph for this function:

Field Documentation

◆ $block_type

ilCalendarBlockGUI::$block_type = "cal"
static

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

Referenced by getBlockType().

◆ $ctrl

◆ $display_mode

ilCalendarBlockGUI::$display_mode
protected

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

◆ $force_month_view

ilCalendarBlockGUI::$force_month_view = false
protected

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

Referenced by getForceMonthView().

◆ $mode

ilCalendarBlockGUI::$mode
protected

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

Referenced by __construct().

◆ $new_rendering

ilCalendarBlockGUI::$new_rendering = true
protected

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

◆ $obj_data_cache

ilCalendarBlockGUI::$obj_data_cache
protected

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

Referenced by getHTML().

◆ $parent_gui

ilCalendarBlockGUI::$parent_gui = "ilcolumngui"
protected

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

Referenced by getParentGUI().

◆ $st_data

ilCalendarBlockGUI::$st_data
static

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

◆ $tabs

ilCalendarBlockGUI::$tabs
protected

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

Referenced by executeCommand(), and setSubTabs().

◆ $ui

ilCalendarBlockGUI::$ui
protected

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

Referenced by addMiniMonth(), getData(), getModalForApp(), and getViewControl().


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