ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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.

public

Parameters

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

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

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.
global $DIC
Definition: saml.php:7
settings()
Definition: settings.php:2
+ 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.

References $_GET, and $ilCtrl.

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

◆ getActivePlugins()

ilCalendarAppointmentPresentationGUI::getActivePlugins ( )
protected

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

References $res, array, and IL_COMP_SERVICE.

Referenced by getContentByPlugins().

200  {
201  global $ilPluginAdmin;
202 
203  $res = array();
204 
205  foreach ($ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "Calendar", "capm") as $plugin_name) {
206  $res[] = $ilPluginAdmin->getPluginObject(
208  "Calendar",
209  "capm",
210  $plugin_name
211  );
212  }
213 
214  return $res;
215  }
foreach($_POST as $key=> $value) $res
Create styles array
The data for the language used.
const IL_COMP_SERVICE
+ Here is the caller graph for this function:

◆ getContentByPlugins()

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

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

References $a_content, $toolbar, array, and getActivePlugins().

Referenced by getModalHTML().

218  {
219  $content = $a_content;
220  $toolbar = $a_toolbar;
221  foreach ($this->getActivePlugins() as $plugin) {
222  //pass only the appointment stuff
223  $plugin->setAppointment($this->appointment['event'], new ilDateTime($this->appointment['dstart']));
224 
225  if ($new_infoscreen = $plugin->infoscreenAddContent($this->info_screen)) {
226  $this->info_screen = $new_infoscreen;
227  }
228 
229  $content = $this->info_screen->getHTML();
230  $extra_content = $plugin->addExtraContent();
231  if ($extra_content != '') {
232  $content .= $extra_content;
233  }
234 
235  if ($new_content = $plugin->replaceContent()) {
236  $content = $new_content;
237  }
238 
239  if ($new_toolbar = $plugin->toolbarAddItems($toolbar)) {
240  $toolbar = $new_toolbar;
241  }
242 
243  if ($new_toolbar = $plugin->toolbarReplaceContent()) {
244  $new_toolbar->setId($a_toolbar->getId());
245  $toolbar = $new_toolbar;
246  }
247  }
248 
249  return array(
250  'content' => $content,
251  'toolbar' => $toolbar
252  );
253  }
$a_content
Definition: workflow.php:93
Date and time handling
Create styles array
The data for the language used.
+ 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 136 of file class.ilCalendarAppointmentPresentationGUI.php.

References getModalHTML(), and modifyListItem().

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  }
+ Here is the call graph for this function:

◆ getListItem()

ilCalendarAppointmentPresentationGUI::getListItem ( )

Get list item mode.

Returns

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

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

Referenced by getHTML().

152  {
153  include_once "./Services/Calendar/classes/AppointmentPresentation/class.ilAppointmentPresentationFactory.php";
154 
155  $tpl = new ilTemplate('tpl.appointment_presentation.html', true, true, 'Services/Calendar');
156 
158  $info_screen->setFormAction($this->ctrl->getFormAction($this));
159 
160  #21529 create new toolbar with unique id using the entry id for this purpose
161  //$toolbar = $this->toolbar;
162  $toolbar = new ilToolbarGUI();
163  $toolbar->setId($this->appointment['event']->getEntryId());
164 
166 
167  $this->ctrl->getHTML($f);
168  $content = $info_screen->getHTML();
169 
170  //because #21529
171  $plugin_results = $this->getContentByPlugins($content, $toolbar);
172  $content = $plugin_results['content'];
173  $toolbar = $plugin_results['toolbar'];
174 
175  // show toolbar
176  $tpl->setCurrentBlock("toolbar");
177  $tpl->setVariable("TOOLBAR", $toolbar->getHTML());
178  $tpl->parseCurrentBlock();
179 
180 
181  // show infoscreen
182  $tpl->setVariable("CONTENT", $content);
183 
184  return $tpl->get();
185  }
$tpl
Definition: ilias.php:10
special template class to simplify handling of ITX/PEAR
static getInstance($a_appointment, $a_info_screen, $a_toolbar, $a_list_item)
+ 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 127 of file class.ilCalendarAppointmentPresentationGUI.php.

References $seed.

◆ modifyListItem()

ilCalendarAppointmentPresentationGUI::modifyListItem ( )

Modify List item.

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

References ilAppointmentPresentationFactory\getInstance(), and getListItem().

Referenced by getHTML().

191  {
192  $li = $this->getListItem();
193  include_once "./Services/Calendar/classes/AppointmentPresentation/class.ilAppointmentPresentationFactory.php";
194  $f = ilAppointmentPresentationFactory::getInstance($this->appointment, null, null, $li);
195  $this->ctrl->getHTML($f);
196  $this->list_item = $f->getListItem();
197  }
static getInstance($a_appointment, $a_info_screen, $a_toolbar, $a_list_item)
+ 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  }

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"

◆ MODE_MODAL

const ilCalendarAppointmentPresentationGUI::MODE_MODAL = "modal"

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