ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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...
 
 addConsultationHourButtons (ilTemplate $panel_template)
 Add consultation hour buttons. 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
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 $ilCtrl
Definition: ilias.php:18
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
settings()
Definition: settings.php:2
$ilUser
Definition: imgupload.php:18
ui()
Definition: ui.php:5
$DIC
Definition: xapitoken.php:46

References $_GET, $_SESSION, $ctrl, $DIC, $ilCtrl, $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

◆ addConsultationHourButtons()

ilCalendarBlockGUI::addConsultationHourButtons ( ilTemplate  $panel_template)
protected

Add consultation hour buttons.

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

985 : void
986 {
987 global $DIC;
988
989 $user = $DIC->user();
990
991 if (!$this->getRepositoryMode()) {
992 return;
993 }
994
996 (int) $_GET['ref_id'],
997 (int) $user->getId(),
998 $this->getTargetGUIClassPath()
999 );
1000 $counter = 0;
1001 foreach ($links as $link) {
1002 $ui_factory = $DIC->ui()->factory();
1003 $ui_renderer = $DIC->ui()->renderer();
1004
1005 $link_button = $ui_factory->button()->shy(
1006 $link['txt'],
1007 $link['link']
1008 );
1009 if ($counter) {
1010 $panel_template->touchBlock('consultation_hour_buttons_multi');
1011 }
1012 $panel_template->setCurrentBlock('consultation_hour_buttons');
1013 $panel_template->setVariable('SHY_BUTTON', $ui_renderer->render([$link_button]));
1014 $panel_template->parseCurrentBlock();
1015 $counter++;
1016 }
1017 }
getRepositoryMode()
Get RepositoryMode.
static getConsultationHourLinksForRepositoryObject(int $ref_id, int $current_user_id, array $ctrl_class_structure)
touchBlock($block)
overwrites ITX::touchBlock.
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.
setVariable($variable, $value='')

References $_GET, $DIC, ilBlockGUI\$user, ilConsultationHourUtils\getConsultationHourLinksForRepositoryObject(), ilBlockGUI\getRepositoryMode(), ilTemplate\parseCurrentBlock(), ilTemplate\setCurrentBlock(), ilGlobalTemplateInterface\setVariable(), and ilTemplate\touchBlock().

Referenced by getLegacyContent().

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

◆ 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 {
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, $ilCtrl, $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 1022 of file class.ilCalendarBlockGUI.php.

1022 : void
1023 {
1024 global $DIC;
1025
1026 $lng = $DIC->language();
1027
1028 $ui_factory = $DIC->ui()->factory();
1029 $ui_renderer = $DIC->ui()->renderer();
1030
1031 $gui_path = $this->getTargetGUIClassPath();
1032 $gui_path[] = strtolower(\ilCalendarSubscriptionGUI::class);
1033 $url = $this->ctrl->getLinkTargetByClass($gui_path, 'getModalForSubscription', "", true, false);
1034
1035 $roundtrip_modal = $ui_factory->modal()->roundtrip('', [])->withAsyncRenderUrl($url);
1036
1037 $standard_button = $ui_factory->button()->standard($lng->txt('btn_ical'), '')->withOnClick(
1038 $roundtrip_modal->getShowSignal()
1039 );
1040 $components = [
1041 $roundtrip_modal,
1042 $standard_button
1043 ];
1044
1045 $presentation = $ui_renderer->render($components);
1046
1047 $panel_template->setCurrentBlock('subscription_buttons');
1048 $panel_template->setVariable('SUBSCRIPTION_BUTTON', $presentation);
1049 $panel_template->parseCurrentBlock();
1050 }
$url

References $DIC, ilBlockGUI\$lng, ilBlockGUI\$presentation, $url, getTargetGUIClassPath(), ilTemplate\parseCurrentBlock(), ilTemplate\setCurrentBlock(), and ilGlobalTemplateInterface\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 {
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, $ilCtrl, 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 );
720 $this->tpl->parseCurrentBlock();
721 }
722 // end-patch ch
723
724 if ($this->tpl->blockExists("block_footer")) {
725 $this->tpl->setCurrentBlock("block_footer");
726 $this->tpl->parseCurrentBlock();
727 }
728 }

◆ 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 818 of file class.ilCalendarBlockGUI.php.

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

871 {
872 $start = $item["dstart"];
873 $end = $item["dend"];
874 if ($item["fullday"]) {
875 $start = new ilDate($start, IL_CAL_UNIX);
876 $end = new ilDate($end, IL_CAL_UNIX);
877 } else {
878 $start = new ilDateTime($start, IL_CAL_UNIX);
879 $end = new ilDateTime($end, IL_CAL_UNIX);
880 }
881 return array("start" => $start, "end" => $end);
882 }
@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 805 of file class.ilCalendarBlockGUI.php.

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

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();
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, $ilCtrl, 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 935 of file class.ilCalendarBlockGUI.php.

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

References ilBlockGUI\$tpl, addConsultationHourButtons(), 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 888 of file class.ilCalendarBlockGUI.php.

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

References $_GET, $ctrl, Vendor\Package\$f, $ilCtrl, $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 {
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, $ilCtrl, 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, $ilCtrl, 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 }
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;
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, $ilCtrl, 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 924 of file class.ilCalendarBlockGUI.php.

924 : array
925 {
926 if ($this->getPresentation() == self::PRES_SEC_LEG) {
927 return [$this->getViewControl()];
928 }
930 }
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 730 of file class.ilCalendarBlockGUI.php.

731 {
734
735 if (!$this->getForceMonthView()) {
736 // @todo: set checked on ($this->display_mode != 'mmon')
737 $this->addBlockCommand(
738 $ilCtrl->getLinkTarget($this, "setPdModeEvents"),
739 $lng->txt("cal_upcoming_events_header"),
740 $ilCtrl->getLinkTarget($this, "setPdModeEvents", "", true)
741 );
742
743 // @todo: set checked on ($this->display_mode == 'mmon')
744 $this->addBlockCommand(
745 $ilCtrl->getLinkTarget($this, "setPdModeMonth"),
746 $lng->txt("app_month"),
747 $ilCtrl->getLinkTarget($this, "setPdModeMonth", "", true)
748 );
749
750 if ($this->getRepositoryMode()) {
751 #23921
752 $ilCtrl->setParameterByClass('ilcalendarpresentationgui', 'seed', '');
753 $this->addBlockCommand(
754 $ilCtrl->getLinkTargetByClass($this->getTargetGUIClassPath(), ""),
755 $lng->txt("cal_open_calendar")
756 );
757
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 }

References $ctrl, $ilCtrl, 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 {
703
704 $ilCtrl->returnToParent($this);
705 }

References $ctrl, and $ilCtrl.

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

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

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

+ Here is the call graph for this function:

◆ setPdModeMonth()

ilCalendarBlockGUI::setPdModeMonth ( )

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

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

References $ctrl, $ilCtrl, $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 {
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, $ilCtrl, 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 919 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: