ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilCalendarAppointmentPresentationGUI Class Reference

Class ilCalendarAppointmentPresentationGUI. More...

+ Collaboration diagram for ilCalendarAppointmentPresentationGUI:

Public Member Functions

 setListItemMode (\ILIAS\UI\Component\Item\Standard $a_val)
 Set list item mode. More...
 
 getListItem ()
 Get list item mode. More...
 
 executeCommand ()
 
 getSeed ()
 Get seed date. More...
 
 getHTML ()
 Get modal html. More...
 
 getModalHTML ()
 Get modal html. More...
 
 modifyListItem ()
 Modify List item. More...
 

Static Public Member Functions

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

Data Fields

const MODE_MODAL = "modal"
 
const MODE_LIST_ITEM = "list_item"
 

Protected Member Functions

 __construct (ilDate $seed=null, $a_app)
 Singleton. More...
 
 getActivePlugins ()
 
 getContentByPlugins ($a_content, $a_toolbar)
 

Protected Attributes

 $seed = null
 
 $settings = null
 
 $appointment
 
 $mode = self::MODE_MODAL
 
 $toolbar
 
 $info_screen
 
 $list_item = null
 

Static Protected Attributes

static $instance = null
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilCalendarAppointmentPresentationGUI::__construct ( ilDate  $seed = null,
  $a_app 
)
protected

Singleton.

@access public

Parameters

param

Returns

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

41 {
42 global $DIC;
43 $this->lng = $DIC->language();
44 $this->ctrl = $DIC->ctrl();
45
47
48 $this->seed = $seed;
49 $this->appointment = $a_app;
50
51 $this->tpl = $DIC["tpl"];
52
53 $this->info_screen = new ilInfoScreenGUI($this);
54 $this->toolbar = new ilToolbarGUI();
55 }
static _getInstance()
get singleton instance
Class ilInfoScreenGUI.
settings()
Definition: settings.php:2
$DIC
Definition: xapitoken.php:46

References $DIC, $seed, ilCalendarSettings\_getInstance(), and settings().

+ Here is the call graph for this function:

Member Function Documentation

◆ _getInstance()

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

◆ executeCommand()

ilCalendarAppointmentPresentationGUI::executeCommand ( )

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

93 {
94 global $DIC;
95
96 $ilCtrl = $DIC['ilCtrl'];
97
98 $next_class = $ilCtrl->getNextClass($this);
99 $cmd = $ilCtrl->getCmd("getHTML");
100
101 switch ($next_class) {
102 case 'ilcalendarappointmentgui':
103 include_once('./Services/Calendar/classes/class.ilCalendarAppointmentGUI.php');
104 $app = new ilCalendarAppointmentGUI($this->seed, $this->seed, (int) $_GET['app_id']);
105 $this->ctrl->forwardCommand($app);
106 break;
107
108 default:
109 if ($next_class != '') {
110 // get the path and include
111 $class_path = $this->ctrl->lookupClassPath($next_class);
112 include_once($class_path);
113
114 // check if the class implements our interface
115 $class_name = $this->ctrl->getClassForClasspath($class_path);
116 if (in_array("ilCalendarAppointmentPresentation", class_implements($class_name))) {
117 // forward command to class
118 $gui_class = new $class_name($this->appointment, $this->info_screen, $this->toolbar, null);
119 $this->ctrl->forwardCommand($gui_class);
120 }
121 }
122 break;
123 }
124 }
$_GET["client_id"]
Administrate calendar appointments.
$app
Definition: cli.php:38
global $ilCtrl
Definition: ilias.php:18

References $_GET, $app, $DIC, and $ilCtrl.

◆ getActivePlugins()

ilCalendarAppointmentPresentationGUI::getActivePlugins ( )
protected

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

202 {
203 global $DIC;
204
205 $ilPluginAdmin = $DIC['ilPluginAdmin'];
206
207 $res = array();
208
209 foreach ($ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "Calendar", "capm") as $plugin_name) {
210 $res[] = $ilPluginAdmin->getPluginObject(
212 "Calendar",
213 "capm",
214 $plugin_name
215 );
216 }
217
218 return $res;
219 }
const IL_COMP_SERVICE
foreach($_POST as $key=> $value) $res

References $DIC, $res, and IL_COMP_SERVICE.

Referenced by getContentByPlugins().

+ Here is the caller graph for this function:

◆ getContentByPlugins()

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

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

222 {
223 $content = $a_content;
224 $toolbar = $a_toolbar;
225 foreach ($this->getActivePlugins() as $plugin) {
226 //pass only the appointment stuff
227 $plugin->setAppointment($this->appointment['event'], new ilDateTime($this->appointment['dstart']));
228
229 if ($new_infoscreen = $plugin->infoscreenAddContent($this->info_screen)) {
230 $this->info_screen = $new_infoscreen;
231 }
232
233 $content = $this->info_screen->getHTML();
234 $extra_content = $plugin->addExtraContent();
235 if ($extra_content != '') {
236 $content .= $extra_content;
237 }
238
239 if ($new_content = $plugin->replaceContent()) {
240 $content = $new_content;
241 }
242
243 if ($new_toolbar = $plugin->toolbarAddItems($toolbar)) {
244 $toolbar = $new_toolbar;
245 }
246
247 if ($new_toolbar = $plugin->toolbarReplaceContent()) {
248 $new_toolbar->setId($a_toolbar->getId());
249 $toolbar = $new_toolbar;
250 }
251 }
252
253 return array(
254 'content' => $content,
255 'toolbar' => $toolbar
256 );
257 }
@classDescription Date and time handling
$a_content
Definition: workflow.php:93

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

Referenced by getModalHTML().

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

◆ getHTML()

ilCalendarAppointmentPresentationGUI::getHTML ( )

Get modal html.

Returns
string

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

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

References getModalHTML(), and modifyListItem().

+ Here is the call graph for this function:

◆ getListItem()

ilCalendarAppointmentPresentationGUI::getListItem ( )

Get list item mode.

Returns
\ILIAS\UI\Component\Item\Standard

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

References $list_item.

Referenced by modifyListItem().

+ Here is the caller graph for this function:

◆ getModalHTML()

ilCalendarAppointmentPresentationGUI::getModalHTML ( )

Get modal html.

Returns
string

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

154 {
155 include_once "./Services/Calendar/classes/AppointmentPresentation/class.ilAppointmentPresentationFactory.php";
156
157 $tpl = new ilTemplate('tpl.appointment_presentation.html', true, true, 'Services/Calendar');
158
160 $info_screen->setFormAction($this->ctrl->getFormAction($this));
161
162 #21529 create new toolbar with unique id using the entry id for this purpose
163 //$toolbar = $this->toolbar;
164 $toolbar = new ilToolbarGUI();
165 $toolbar->setId($this->appointment['event']->getEntryId());
166
168
169 $this->ctrl->getHTML($f);
170 $content = $info_screen->getHTML();
171
172 //because #21529
173 $plugin_results = $this->getContentByPlugins($content, $toolbar);
174 $content = $plugin_results['content'];
175 $toolbar = $plugin_results['toolbar'];
176
177 // show toolbar
178 $tpl->setCurrentBlock("toolbar");
179 $tpl->setVariable("TOOLBAR", $toolbar->getHTML());
180 $tpl->parseCurrentBlock();
181
182
183 // show infoscreen
184 $tpl->setVariable("CONTENT", $content);
185
186 return $tpl->get();
187 }
static getInstance($a_appointment, $a_info_screen, $a_toolbar, $a_list_item)
special template class to simplify handling of ITX/PEAR
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl

References Vendor\Package\$f, $info_screen, $toolbar, $tpl, getContentByPlugins(), and ilAppointmentPresentationFactory\getInstance().

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 129 of file class.ilCalendarAppointmentPresentationGUI.php.

130 {
131 return $this->seed;
132 }

References $seed.

◆ modifyListItem()

ilCalendarAppointmentPresentationGUI::modifyListItem ( )

Modify List item.

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

193 {
194 $li = $this->getListItem();
195 include_once "./Services/Calendar/classes/AppointmentPresentation/class.ilAppointmentPresentationFactory.php";
196 $f = ilAppointmentPresentationFactory::getInstance($this->appointment, null, null, $li);
197 $this->ctrl->getHTML($f);
198 $this->list_item = $f->getListItem();
199 }

References Vendor\Package\$f, 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 ( \ILIAS\UI\Component\Item\Standard  $a_val)

Set list item mode.

Parameters
\ILIAS\UI\Component\Item\Standard$a_val

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

63 {
64 $this->list_item = $a_val;
65 $this->mode = self::MODE_LIST_ITEM;
66 }

References MODE_LIST_ITEM.

Field Documentation

◆ $appointment

ilCalendarAppointmentPresentationGUI::$appointment
protected

◆ $info_screen

ilCalendarAppointmentPresentationGUI::$info_screen
protected

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

Referenced by getModalHTML().

◆ $instance

ilCalendarAppointmentPresentationGUI::$instance = null
staticprotected

◆ $list_item

ilCalendarAppointmentPresentationGUI::$list_item = null
protected

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

Referenced by getListItem().

◆ $mode

ilCalendarAppointmentPresentationGUI::$mode = self::MODE_MODAL
protected

◆ $seed

ilCalendarAppointmentPresentationGUI::$seed = null
protected

◆ $settings

ilCalendarAppointmentPresentationGUI::$settings = null
protected

◆ $toolbar

ilCalendarAppointmentPresentationGUI::$toolbar
protected

◆ MODE_LIST_ITEM

const ilCalendarAppointmentPresentationGUI::MODE_LIST_ITEM = "list_item"

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

Referenced by setListItemMode().

◆ MODE_MODAL

const ilCalendarAppointmentPresentationGUI::MODE_MODAL = "modal"

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