ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
arDisplayGUI Class Reference

GUI-Class arDisplayGUI. More...

+ Collaboration diagram for arDisplayGUI:

Public Member Functions

 getHtml ()
 
 setBackButtonName ($back_button_name)
 
 getBackButtonName ()
 
 setBackButtonTarget ($back_button_target)
 
 getBackButtonTarget ()
 
 setFields (arDisplayFields $fields)
 
 getFields ()
 
 getFieldsAsArray ()
 
 getField ($field_name)
 
 addField (arDisplayField $field)
 
 setTitle ($title)
 
 getTitle ()
 
 setTemplate ($template)
 
 getTemplate ()
 

Protected Member Functions

 init ()
 
 initTitle ()
 
 initFields ()
 
 customizeFields ()
 
 initBackButton ()
 
 initTemplate ()
 
 setArFieldData (arDisplayField $field, $value)
 
 setEmptyFieldData (arDisplayField $field)
 
 setCustomFieldData (arDisplayField $field)
 
 setModifiedByData (arDisplayField $field, $value)
 
 setCreatedByData (arDisplayField $field, $value)
 
 setNumericData (arDisplayField $field, $value)
 
 setTextData (arDisplayField $field, $value)
 
 setDateTimeData (arDisplayField $field, $value)
 
 setClobData (arDisplayField $field, $value)
 
 txt ($txt, $plugin_txt=true)
 

Protected Attributes

 $record
 
 $parent_gui
 
 $ctrl
 
 $tpl
 
 $title = ""
 
 $fields = array()
 
 $data = array()
 
 $back_button_name = ""
 
 $back_button_target = ""
 
 $template
 

Detailed Description

GUI-Class arDisplayGUI.

Author
Timon Amstutz timon.nosp@m..ams.nosp@m.tutz@.nosp@m.ilub.nosp@m..unib.nosp@m.e.ch
Version
2.0.7

Definition at line 13 of file class.arDisplayGUI.php.

Member Function Documentation

◆ addField()

arDisplayGUI::addField ( arDisplayField  $field)
Parameters
arDisplayField

Definition at line 372 of file class.arDisplayGUI.php.

References getFields().

373  {
374  $this->getFields()->addField($field);
375  }
+ Here is the call graph for this function:

◆ customizeFields()

arDisplayGUI::customizeFields ( )
protected

Definition at line 105 of file class.arDisplayGUI.php.

Referenced by initFields().

106  {
107  }
+ Here is the caller graph for this function:

◆ getBackButtonName()

arDisplayGUI::getBackButtonName ( )
Returns
string

Definition at line 307 of file class.arDisplayGUI.php.

References $back_button_name.

Referenced by getHtml().

308  {
310  }
+ Here is the caller graph for this function:

◆ getBackButtonTarget()

arDisplayGUI::getBackButtonTarget ( )
Returns
string

Definition at line 325 of file class.arDisplayGUI.php.

References $back_button_target.

Referenced by getHtml().

326  {
328  }
+ Here is the caller graph for this function:

◆ getField()

arDisplayGUI::getField (   $field_name)
Parameters
$field_name
Returns
arDisplayField

Definition at line 363 of file class.arDisplayGUI.php.

References getFields().

364  {
365  return $this->getFields()->getField($field_name);
366  }
+ Here is the call graph for this function:

◆ getFields()

arDisplayGUI::getFields ( )
Returns
arDisplayFields

Definition at line 343 of file class.arDisplayGUI.php.

References $fields.

Referenced by addField(), getField(), and getFieldsAsArray().

344  {
345  return $this->fields;
346  }
+ Here is the caller graph for this function:

◆ getFieldsAsArray()

arDisplayGUI::getFieldsAsArray ( )
Returns
arDisplayField []

Definition at line 352 of file class.arDisplayGUI.php.

References getFields().

353  {
354  return $this->getFields()->getFields();
355  }
+ Here is the call graph for this function:

◆ getHtml()

arDisplayGUI::getHtml ( )
Returns
string

Definition at line 126 of file class.arDisplayGUI.php.

References fields, getBackButtonName(), getBackButtonTarget(), getTemplate(), setArFieldData(), and txt().

127  {
128  $this->getTemplate()->setVariable("TITLE", $this->title);
129  $this->setArFieldsData();
130  $this->getTemplate()->setVariable("BACK_BUTTON_NAME", $this->getBackButtonName());
131  $this->getTemplate()->setVariable("BACK_BUTTON_TARGET", $this->getBackButtonTarget());
132 
133  return $this->getTemplate()->get();
134  }
+ Here is the call graph for this function:

◆ getTemplate()

arDisplayGUI::getTemplate ( )
Returns

Definition at line 408 of file class.arDisplayGUI.php.

References $template.

Referenced by getHtml().

409  {
410  return $this->template;
411  }
+ Here is the caller graph for this function:

◆ getTitle()

arDisplayGUI::getTitle ( )
Returns
string

Definition at line 390 of file class.arDisplayGUI.php.

References $title.

391  {
392  return $this->title;
393  }

◆ init()

arDisplayGUI::init ( )
protected

Definition at line 82 of file class.arDisplayGUI.php.

References initBackButton(), initFields(), initTemplate(), and initTitle().

83  {
84  $this->initTitle();
85  $this->initFields();
86  $this->initBackButton();
87  $this->initTemplate();
88  }
+ Here is the call graph for this function:

◆ initBackButton()

arDisplayGUI::initBackButton ( )
protected

Definition at line 110 of file class.arDisplayGUI.php.

References setBackButtonName(), setBackButtonTarget(), and txt().

Referenced by init().

111  {
112  $this->setBackButtonName($this->txt("back", false));
113  $this->setBackButtonTarget($this->ctrl->getLinkTarget($this->parent_gui, "index"));
114  }
setBackButtonTarget($back_button_target)
txt($txt, $plugin_txt=true)
setBackButtonName($back_button_name)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initFields()

arDisplayGUI::initFields ( )
protected

Definition at line 97 of file class.arDisplayGUI.php.

References customizeFields(), and fields.

Referenced by init().

98  {
99  $this->fields = new arDisplayFields($this->ar);
100  $this->customizeFields();
101  $this->fields->sortFields();
102  }
$errors fields
Definition: imgupload.php:51
GUI-Class arDisplayFields.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initTemplate()

arDisplayGUI::initTemplate ( )
protected

Definition at line 117 of file class.arDisplayGUI.php.

References setTemplate().

Referenced by init().

118  {
119  $this->setTemplate(new ilTemplate("tpl.display.html", true, true, "Services/ActiveRecord"));
120  }
setTemplate($template)
special template class to simplify handling of ITX/PEAR
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initTitle()

arDisplayGUI::initTitle ( )
protected

Definition at line 91 of file class.arDisplayGUI.php.

References setTitle().

Referenced by init().

92  {
93  $this->setTitle(strtolower(str_replace("Record", "", get_class($this->ar))));
94  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setArFieldData()

arDisplayGUI::setArFieldData ( arDisplayField  $field,
  $value 
)
protected
Parameters
arDisplayField$field
$value
Returns
null|string

Definition at line 161 of file class.arDisplayGUI.php.

References arViewField\getCustomField(), arField\getFieldType(), arViewField\getIsCreatedByField(), arViewField\getIsModifiedByField(), setClobData(), setCreatedByData(), setCustomFieldData(), setDateTimeData(), setEmptyFieldData(), setModifiedByData(), setNumericData(), and setTextData().

Referenced by getHtml().

162  {
163  if ($field->getCustomField()) {
164  return $this->setCustomFieldData($field);
165  } else {
166  if ($value == null) {
167  return $this->setEmptyFieldData($field);
168  } else {
169  if ($field->getIsCreatedByField()) {
170  return $this->setCreatedByData($field, $value);
171  } else {
172  if ($field->getIsModifiedByField()) {
173  return $this->setModifiedByData($field, $value);
174  } else {
175  switch ($field->getFieldType()) {
176  case 'integer':
177  case 'float':
178  return $this->setNumericData($field, $value);
179  case 'text':
180  return $this->setTextData($field, $value);
181  case 'date':
182  case 'time':
183  case 'timestamp':
184  return $this->setDateTimeData($field, $value);
185  case 'clob':
186  return $this->setClobData($field, $value);
187  }
188  }
189  }
190  }
191  }
192  }
setDateTimeData(arDisplayField $field, $value)
setEmptyFieldData(arDisplayField $field)
setNumericData(arDisplayField $field, $value)
setTextData(arDisplayField $field, $value)
setModifiedByData(arDisplayField $field, $value)
setCustomFieldData(arDisplayField $field)
setClobData(arDisplayField $field, $value)
setCreatedByData(arDisplayField $field, $value)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setBackButtonName()

arDisplayGUI::setBackButtonName (   $back_button_name)
Parameters
string$back_button_name

Definition at line 298 of file class.arDisplayGUI.php.

References $back_button_name.

Referenced by initBackButton().

299  {
300  $this->back_button_name = $back_button_name;
301  }
+ Here is the caller graph for this function:

◆ setBackButtonTarget()

arDisplayGUI::setBackButtonTarget (   $back_button_target)
Parameters
$back_button_target

Definition at line 316 of file class.arDisplayGUI.php.

References $back_button_target.

Referenced by initBackButton().

317  {
318  $this->back_button_target = $back_button_target;
319  }
+ Here is the caller graph for this function:

◆ setClobData()

arDisplayGUI::setClobData ( arDisplayField  $field,
  $value 
)
protected
Parameters
arDisplayField$field
$value
Returns
mixed

Definition at line 289 of file class.arDisplayGUI.php.

Referenced by setArFieldData().

290  {
291  return $value;
292  }
+ Here is the caller graph for this function:

◆ setCreatedByData()

arDisplayGUI::setCreatedByData ( arDisplayField  $field,
  $value 
)
protected
Parameters
arDisplayField$field
$value
Returns
string

Definition at line 237 of file class.arDisplayGUI.php.

Referenced by setArFieldData().

238  {
239  $user = new ilObjUser($value);
240 
241  return $user->getPublicName();
242  }
+ Here is the caller graph for this function:

◆ setCustomFieldData()

arDisplayGUI::setCustomFieldData ( arDisplayField  $field)
protected
Parameters
arDisplayField$field
Returns
string

Definition at line 211 of file class.arDisplayGUI.php.

Referenced by setArFieldData().

212  {
213  return "CUSTOM-OVERRIDE: setCustomFieldData";
214  }
+ Here is the caller graph for this function:

◆ setDateTimeData()

arDisplayGUI::setDateTimeData ( arDisplayField  $field,
  $value 
)
protected
Parameters
arDisplayField$field
$value
Returns
string

Definition at line 275 of file class.arDisplayGUI.php.

References ilDatePresentation\formatDate(), and IL_CAL_DATETIME.

Referenced by setArFieldData().

276  {
277  $datetime = new ilDateTime($value, IL_CAL_DATETIME);
278 
280  }
const IL_CAL_DATETIME
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date public.
Date and time handling
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setEmptyFieldData()

arDisplayGUI::setEmptyFieldData ( arDisplayField  $field)
protected
Parameters
arDisplayField$field
Returns
string

Definition at line 200 of file class.arDisplayGUI.php.

References txt().

Referenced by setArFieldData().

201  {
202  return $this->txt("", false);
203  }
txt($txt, $plugin_txt=true)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setFields()

arDisplayGUI::setFields ( arDisplayFields  $fields)
Parameters
arDisplayFields$fields

Definition at line 334 of file class.arDisplayGUI.php.

References $fields, and fields.

335  {
336  $this->fields = $fields;
337  }
$errors fields
Definition: imgupload.php:51

◆ setModifiedByData()

arDisplayGUI::setModifiedByData ( arDisplayField  $field,
  $value 
)
protected
Parameters
arDisplayField$field
$value
Returns
string

Definition at line 223 of file class.arDisplayGUI.php.

Referenced by setArFieldData().

224  {
225  $user = new ilObjUser($value);
226 
227  return $user->getPublicName();
228  }
+ Here is the caller graph for this function:

◆ setNumericData()

arDisplayGUI::setNumericData ( arDisplayField  $field,
  $value 
)
protected
Parameters
arDisplayField$field
$value
Returns
mixed

Definition at line 251 of file class.arDisplayGUI.php.

Referenced by setArFieldData().

252  {
253  return $value;
254  }
+ Here is the caller graph for this function:

◆ setTemplate()

arDisplayGUI::setTemplate (   $template)
Parameters
\ilTemplate$template

Definition at line 399 of file class.arDisplayGUI.php.

References $template.

Referenced by initTemplate().

400  {
401  $this->template = $template;
402  }
+ Here is the caller graph for this function:

◆ setTextData()

arDisplayGUI::setTextData ( arDisplayField  $field,
  $value 
)
protected
Parameters
arDisplayField$field
$value
Returns
mixed

Definition at line 263 of file class.arDisplayGUI.php.

Referenced by setArFieldData().

264  {
265  return $value;
266  }
+ Here is the caller graph for this function:

◆ setTitle()

arDisplayGUI::setTitle (   $title)
Parameters
string$title

Definition at line 381 of file class.arDisplayGUI.php.

References $title.

Referenced by initTitle().

382  {
383  $this->title = $title;
384  }
+ Here is the caller graph for this function:

◆ txt()

arDisplayGUI::txt (   $txt,
  $plugin_txt = true 
)
protected
Parameters
$txt
bool$plugin_txt
Returns
string

Definition at line 420 of file class.arDisplayGUI.php.

References $txt.

Referenced by getHtml(), initBackButton(), and setEmptyFieldData().

421  {
422  return $this->parent_gui->txt($txt, $plugin_txt);
423  }
$txt
Definition: error.php:11
+ Here is the caller graph for this function:

Field Documentation

◆ $back_button_name

arDisplayGUI::$back_button_name = ""
protected

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

Referenced by getBackButtonName(), and setBackButtonName().

◆ $back_button_target

arDisplayGUI::$back_button_target = ""
protected

Definition at line 51 of file class.arDisplayGUI.php.

Referenced by getBackButtonTarget(), and setBackButtonTarget().

◆ $ctrl

arDisplayGUI::$ctrl
protected

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

◆ $data

arDisplayGUI::$data = array()
protected

Definition at line 43 of file class.arDisplayGUI.php.

◆ $fields

arDisplayGUI::$fields = array()
protected

Definition at line 39 of file class.arDisplayGUI.php.

Referenced by getFields(), and setFields().

◆ $parent_gui

arDisplayGUI::$parent_gui
protected

Definition at line 23 of file class.arDisplayGUI.php.

◆ $record

arDisplayGUI::$record
protected

Definition at line 19 of file class.arDisplayGUI.php.

◆ $template

arDisplayGUI::$template
protected

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

Referenced by getTemplate(), and setTemplate().

◆ $title

arDisplayGUI::$title = ""
protected

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

Referenced by getTitle(), and setTitle().

◆ $tpl

arDisplayGUI::$tpl
protected

Definition at line 31 of file class.arDisplayGUI.php.


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