ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilCalendarAppointmentPresentationGUI Class Reference

Class ilCalendarAppointmentPresentationGUI. More...

+ Collaboration diagram for ilCalendarAppointmentPresentationGUI:

Public Member Functions

 setListItemMode (Item $a_val)
 Set list item mode. More...
 
 getListItem ()
 
 executeCommand ()
 
 getSeed ()
 Get seed date. More...
 
 getHTML ()
 
 getModalHTML ()
 
 modifyListItem ()
 Modify List item. More...
 

Static Public Member Functions

static _getInstance (ilDate $seed, array $a_app)
 get singleton instance More...
 

Protected Member Functions

 __construct (ilDate $seed, array $a_app)
 
 getActivePlugins ()
 
 getContentByPlugins ($a_content, $a_toolbar)
 

Protected Attributes

const MODE_MODAL = "modal"
 
const MODE_LIST_ITEM = "list_item"
 
ilDate $seed
 
ilCalendarSettings $settings
 
array $appointment = []
 
string $mode = self::MODE_MODAL
 
ilToolbarGUI $toolbar
 
ilInfoScreenGUI $info_screen
 
ilLanguage $lng
 
ilCtrlInterface $ctrl
 
ilGlobalTemplateInterface $tpl
 
HttpServices $http
 
RefineryFactory $refinery
 
Item $list_item = null
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilCalendarAppointmentPresentationGUI::__construct ( ilDate  $seed,
array  $a_app 
)
protected

Definition at line 52 of file class.ilCalendarAppointmentPresentationGUI.php.

53 {
54 global $DIC;
55
56 $this->http = $DIC->http();
57 $this->refinery = $DIC->refinery();
58 $this->lng = $DIC->language();
59 $this->ctrl = $DIC->ctrl();
60
62
63 $this->seed = $seed;
64 $this->appointment = $a_app;
65
66 $this->tpl = $DIC->ui()->mainTemplate();
67 $this->info_screen = new ilInfoScreenGUI($this);
68 $this->toolbar = new ilToolbarGUI();
69 }
Class ilInfoScreenGUI.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static http()
Fetches the global http state from ILIAS.
global $DIC
Definition: shib_login.php:26

References $DIC, $seed, ilCalendarSettings\_getInstance(), ILIAS\Repository\ctrl(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), ILIAS\Repository\settings(), and ILIAS\Repository\toolbar().

+ Here is the call graph for this function:

Member Function Documentation

◆ _getInstance()

static ilCalendarAppointmentPresentationGUI::_getInstance ( ilDate  $seed,
array  $a_app 
)
static

◆ executeCommand()

ilCalendarAppointmentPresentationGUI::executeCommand ( )

Definition at line 93 of file class.ilCalendarAppointmentPresentationGUI.php.

93 : void
94 {
95 $next_class = $this->ctrl->getNextClass($this);
96 $cmd = $this->ctrl->getCmd("getHTML");
97
98 switch ($next_class) {
99 case 'ilcalendarappointmentgui':
100 $app_id = 0;
101 if ($this->http->wrapper()->query()->has('app_id')) {
102 $app_id = $this->http->wrapper()->query()->retrieve(
103 'app_id',
104 $this->refinery->kindlyTo()->int()
105 );
106 }
107 $app = new ilCalendarAppointmentGUI($this->seed, $this->seed, $app_id);
108 $this->ctrl->forwardCommand($app);
109 break;
110
111 default:
112 if ($next_class != '') {
113 // get the path and include
114 $class_path = $this->ctrl->lookupClassPath($next_class);
115
116 // check if the class implements our interface
117 $class_name = $this->ctrl->getClassForClasspath($class_path);
118 if (in_array("ilCalendarAppointmentPresentation", class_implements($class_name))) {
119 // forward command to class
120 $gui_class = new $class_name($this->appointment, $this->info_screen, $this->toolbar, null);
121 $this->ctrl->forwardCommand($gui_class);
122 }
123 }
124 break;
125 }
126 }
Administrate calendar appointments.

References ILIAS\Repository\ctrl(), ILIAS\FileDelivery\http(), ILIAS\Repository\refinery(), and ILIAS\Repository\toolbar().

+ Here is the call graph for this function:

◆ getActivePlugins()

ilCalendarAppointmentPresentationGUI::getActivePlugins ( )
protected

Definition at line 191 of file class.ilCalendarAppointmentPresentationGUI.php.

191 : Iterator
192 {
193 global $DIC;
194
195 $component_factory = $DIC['component.factory'];
196 return $component_factory->getActivePluginsInSlot("capm");
197 }

References $DIC.

Referenced by getContentByPlugins().

+ Here is the caller graph for this function:

◆ getContentByPlugins()

ilCalendarAppointmentPresentationGUI::getContentByPlugins (   $a_content,
  $a_toolbar 
)
protected

Definition at line 199 of file class.ilCalendarAppointmentPresentationGUI.php.

199 : array
200 {
201 $content = $a_content;
202 $toolbar = $a_toolbar;
203 foreach ($this->getActivePlugins() as $plugin) {
204 //pass only the appointment stuff
205 $plugin->setAppointment($this->appointment['event'], new ilDateTime($this->appointment['dstart']));
206 if ($new_infoscreen = $plugin->infoscreenAddContent($this->info_screen)) {
207 $this->info_screen = $new_infoscreen;
208 }
209 $content = $this->info_screen->getHTML();
210 $extra_content = $plugin->addExtraContent();
211 if ($extra_content != '') {
212 $content .= $extra_content;
213 }
214
215 if ($new_content = $plugin->replaceContent()) {
216 $content = $new_content;
217 }
218
219 if ($new_toolbar = $plugin->toolbarAddItems($toolbar)) {
220 $toolbar = $new_toolbar;
221 }
222
223 if ($new_toolbar = $plugin->toolbarReplaceContent()) {
224 $new_toolbar->setId((string) $a_toolbar->getId());
225 $toolbar = $new_toolbar;
226 }
227 }
228 return array(
229 'content' => $content,
230 'toolbar' => $toolbar
231 );
232 }
@classDescription Date and time handling
setId(string $a_val)

References XapiProxy\$plugin, $toolbar, getActivePlugins(), and ilToolbarGUI\setId().

Referenced by getModalHTML().

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

◆ getHTML()

ilCalendarAppointmentPresentationGUI::getHTML ( )

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

136 : string
137 {
138 if ($this->mode == self::MODE_MODAL) {
139 return $this->getModalHTML();
140 }
141 if ($this->mode == self::MODE_LIST_ITEM) {
142 return $this->modifyListItem();
143 }
144 return "";
145 }

References getModalHTML(), and modifyListItem().

+ Here is the call graph for this function:

◆ getListItem()

ilCalendarAppointmentPresentationGUI::getListItem ( )

Definition at line 80 of file class.ilCalendarAppointmentPresentationGUI.php.

References $list_item.

Referenced by modifyListItem().

+ Here is the caller graph for this function:

◆ getModalHTML()

ilCalendarAppointmentPresentationGUI::getModalHTML ( )

Definition at line 147 of file class.ilCalendarAppointmentPresentationGUI.php.

147 : string
148 {
149 $tpl = new ilTemplate('tpl.appointment_presentation.html', true, true, 'components/ILIAS/Calendar');
150
152 $info_screen->setFormAction($this->ctrl->getFormAction($this));
153
154 #21529 create new toolbar with unique id using the entry id for this purpose
155 $toolbar = new ilToolbarGUI();
156 $toolbar->setId((string) $this->appointment['event']->getEntryId());
157
159
160 $this->ctrl->getHTML($f);
161 $content = $info_screen->getHTML();
162
163 //because #21529
164 $plugin_results = $this->getContentByPlugins($content, $toolbar);
165 $content = $plugin_results['content'];
166 $toolbar = $plugin_results['toolbar'];
167
168 // show toolbar
169 $tpl->setCurrentBlock("toolbar");
170 $tpl->setVariable("TOOLBAR", $toolbar->getHTML());
172
173 // show infoscreen
174 $tpl->setVariable("CONTENT", $content);
175
176 return $tpl->get();
177 }
static getInstance(array $a_appointment, ?ilInfoScreenGUI $a_info_screen, ?ilToolbarGUI $a_toolbar, ?Item $a_list_item)
setFormAction(string $a_form_action)
special template class to simplify handling of ITX/PEAR
setVariable(string $variable, $value='')
Sets the given variable to the given value.
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.

References Vendor\Package\$f, $info_screen, $toolbar, $tpl, ILIAS\Repository\ctrl(), ILIAS\UICore\GlobalTemplate\get(), getContentByPlugins(), ilInfoScreenGUI\getHTML(), ilAppointmentPresentationFactory\getInstance(), ILIAS\UICore\GlobalTemplate\parseCurrentBlock(), ILIAS\UICore\GlobalTemplate\setCurrentBlock(), ilInfoScreenGUI\setFormAction(), ilToolbarGUI\setId(), and ILIAS\UICore\GlobalTemplate\setVariable().

Referenced by getHTML().

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

◆ getSeed()

ilCalendarAppointmentPresentationGUI::getSeed ( )

Get seed date.

Definition at line 131 of file class.ilCalendarAppointmentPresentationGUI.php.

131 : ilDate
132 {
133 return $this->seed;
134 }
Class for single dates.

References $seed.

◆ modifyListItem()

ilCalendarAppointmentPresentationGUI::modifyListItem ( )

Modify List item.

Definition at line 182 of file class.ilCalendarAppointmentPresentationGUI.php.

182 : string
183 {
184 $li = $this->getListItem();
185 $f = ilAppointmentPresentationFactory::getInstance($this->appointment, null, null, $li);
186 $this->ctrl->getHTML($f);
187 $this->list_item = $f->getListItem();
188 return '';
189 }

References Vendor\Package\$f, ILIAS\Repository\ctrl(), ilAppointmentPresentationFactory\getInstance(), and getListItem().

Referenced by getHTML().

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

◆ setListItemMode()

ilCalendarAppointmentPresentationGUI::setListItemMode ( Item  $a_val)

Set list item mode.

Definition at line 74 of file class.ilCalendarAppointmentPresentationGUI.php.

75 {
76 $this->list_item = $a_val;
77 $this->mode = self::MODE_LIST_ITEM;
78 }

References MODE_LIST_ITEM.

Field Documentation

◆ $appointment

array ilCalendarAppointmentPresentationGUI::$appointment = []
protected

◆ $ctrl

ilCtrlInterface ilCalendarAppointmentPresentationGUI::$ctrl
protected

◆ $http

HttpServices ilCalendarAppointmentPresentationGUI::$http
protected

◆ $info_screen

ilInfoScreenGUI ilCalendarAppointmentPresentationGUI::$info_screen
protected

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

Referenced by getModalHTML().

◆ $list_item

Item ilCalendarAppointmentPresentationGUI::$list_item = null
protected

Definition at line 50 of file class.ilCalendarAppointmentPresentationGUI.php.

Referenced by getListItem().

◆ $lng

ilLanguage ilCalendarAppointmentPresentationGUI::$lng
protected

◆ $mode

string ilCalendarAppointmentPresentationGUI::$mode = self::MODE_MODAL
protected

◆ $refinery

RefineryFactory ilCalendarAppointmentPresentationGUI::$refinery
protected

◆ $seed

ilDate ilCalendarAppointmentPresentationGUI::$seed
protected

◆ $settings

ilCalendarSettings ilCalendarAppointmentPresentationGUI::$settings
protected

◆ $toolbar

ilToolbarGUI ilCalendarAppointmentPresentationGUI::$toolbar
protected

◆ $tpl

ilGlobalTemplateInterface ilCalendarAppointmentPresentationGUI::$tpl
protected

Definition at line 45 of file class.ilCalendarAppointmentPresentationGUI.php.

Referenced by getModalHTML().

◆ MODE_LIST_ITEM

const ilCalendarAppointmentPresentationGUI::MODE_LIST_ITEM = "list_item"
protected

Definition at line 33 of file class.ilCalendarAppointmentPresentationGUI.php.

Referenced by setListItemMode().

◆ MODE_MODAL

const ilCalendarAppointmentPresentationGUI::MODE_MODAL = "modal"
protected

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