ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 344 of file class.arDisplayGUI.php.

References getFields().

344  {
345  $this->getFields()->addField($field);
346  }
+ Here is the call graph for this function:

◆ customizeFields()

arDisplayGUI::customizeFields ( )
protected

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

Referenced by initFields().

98  {
99  }
+ Here is the caller graph for this function:

◆ getBackButtonName()

arDisplayGUI::getBackButtonName ( )
Returns
string

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

References $back_button_name.

Referenced by getHtml().

286  {
288  }
+ Here is the caller graph for this function:

◆ getBackButtonTarget()

arDisplayGUI::getBackButtonTarget ( )
Returns
string

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

References $back_button_target.

Referenced by getHtml().

302  {
304  }
+ Here is the caller graph for this function:

◆ getField()

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

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

References getFields().

336  {
337  return $this->getFields()->getField($field_name);
338  }
+ Here is the call graph for this function:

◆ getFields()

arDisplayGUI::getFields ( )
Returns
arDisplayFields

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

References $fields.

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

318  {
319  return $this->fields;
320  }
+ Here is the caller graph for this function:

◆ getFieldsAsArray()

arDisplayGUI::getFieldsAsArray ( )
Returns
arDisplayField []

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

References getFields().

326  {
327  return $this->getFields()->getFields();
328  }
+ Here is the call graph for this function:

◆ getHtml()

arDisplayGUI::getHtml ( )
Returns
string

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

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

116  {
117 
118  $this->getTemplate()->setVariable("TITLE", $this->title);
119  $this->setArFieldsData();
120  $this->getTemplate()->setVariable("BACK_BUTTON_NAME", $this->getBackButtonName());
121  $this->getTemplate()->setVariable("BACK_BUTTON_TARGET", $this->getBackButtonTarget());
122 
123  return $this->getTemplate()->get();
124  }
+ Here is the call graph for this function:

◆ getTemplate()

arDisplayGUI::getTemplate ( )
Returns

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

References $template.

Referenced by getHtml().

376  {
377  return $this->template;
378  }
+ Here is the caller graph for this function:

◆ getTitle()

arDisplayGUI::getTitle ( )
Returns
string

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

References $title.

360  {
361  return $this->title;
362  }

◆ init()

arDisplayGUI::init ( )
protected

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

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

78  {
79  $this->initTitle();
80  $this->initFields();
81  $this->initBackButton();
82  $this->initTemplate();
83  }
+ Here is the call graph for this function:

◆ initBackButton()

arDisplayGUI::initBackButton ( )
protected

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

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

Referenced by init().

102  {
103  $this->setBackButtonName($this->txt("back", false));
104  $this->setBackButtonTarget($this->ctrl->getLinkTarget($this->parent_gui, "index"));
105  }
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 91 of file class.arDisplayGUI.php.

References customizeFields(), and fields.

Referenced by init().

91  {
92  $this->fields = new arDisplayFields($this->ar);
93  $this->customizeFields();
94  $this->fields->sortFields();
95  }
$errors fields
Definition: imgupload.php:52
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 108 of file class.arDisplayGUI.php.

References setTemplate().

Referenced by init().

108  {
109  $this->setTemplate(new ilTemplate("tpl.display.html", true, true, "Customizing/global/plugins/Libraries/ActiveRecord"));
110  }
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 86 of file class.arDisplayGUI.php.

References setTitle().

Referenced by init().

86  {
87  $this->setTitle(strtolower(str_replace("Record", "", get_class($this->ar))));
88  }
+ 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 150 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().

150  {
151  if ($field->getCustomField()) {
152  return $this->setCustomFieldData($field);
153  } else {
154  if ($value == NULL) {
155  return $this->setEmptyFieldData($field);
156  } else {
157  if ($field->getIsCreatedByField()) {
158  return $this->setCreatedByData($field, $value);
159  } else {
160  if ($field->getIsModifiedByField()) {
161  return $this->setModifiedByData($field, $value);
162  } else {
163  switch ($field->getFieldType()) {
164  case 'integer':
165  case 'float':
166  return $this->setNumericData($field, $value);
167  case 'text':
168  return $this->setTextData($field, $value);
169  case 'date':
170  case 'time':
171  case 'timestamp':
172  return $this->setDateTimeData($field, $value);
173  case 'clob':
174  return $this->setClobData($field, $value);
175  }
176  }
177  }
178  }
179  }
180  }
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 278 of file class.arDisplayGUI.php.

References $back_button_name.

Referenced by initBackButton().

278  {
279  $this->back_button_name = $back_button_name;
280  }
+ Here is the caller graph for this function:

◆ setBackButtonTarget()

arDisplayGUI::setBackButtonTarget (   $back_button_target)
Parameters
$back_button_target

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

References $back_button_target.

Referenced by initBackButton().

294  {
295  $this->back_button_target = $back_button_target;
296  }
+ Here is the caller graph for this function:

◆ setClobData()

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

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

Referenced by setArFieldData().

270  {
271  return $value;
272  }
+ Here is the caller graph for this function:

◆ setCreatedByData()

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

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

Referenced by setArFieldData().

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

◆ setCustomFieldData()

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

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

Referenced by setArFieldData().

198  {
199  return "CUSTOM-OVERRIDE: setCustomFieldData";
200  }
+ Here is the caller graph for this function:

◆ setDateTimeData()

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

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

References ilDatePresentation\formatDate(), and IL_CAL_DATETIME.

Referenced by setArFieldData().

257  {
258  $datetime = new ilDateTime($value, IL_CAL_DATETIME);
259 
261  }
const IL_CAL_DATETIME
static formatDate(ilDateTime $date)
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 188 of file class.arDisplayGUI.php.

References txt().

Referenced by setArFieldData().

188  {
189  return $this->txt("", false);
190  }
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 310 of file class.arDisplayGUI.php.

References $fields, and fields.

310  {
311  $this->fields = $fields;
312  }
$errors fields
Definition: imgupload.php:52

◆ setModifiedByData()

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

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

Referenced by setArFieldData().

209  {
210  $user = new ilObjUser($value);
211 
212  return $user->getPublicName();
213  }
+ Here is the caller graph for this function:

◆ setNumericData()

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

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

Referenced by setArFieldData().

235  {
236  return $value;
237  }
+ Here is the caller graph for this function:

◆ setTemplate()

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

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

References $template.

Referenced by initTemplate().

368  {
369  $this->template = $template;
370  }
+ Here is the caller graph for this function:

◆ setTextData()

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

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

Referenced by setArFieldData().

246  {
247  return $value;
248  }
+ Here is the caller graph for this function:

◆ setTitle()

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

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

References $title.

Referenced by initTitle().

352  {
353  $this->title = $title;
354  }
+ 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 387 of file class.arDisplayGUI.php.

References $txt.

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

387  {
388  return $this->parent_gui->txt($txt, $plugin_txt);
389  }
$txt
Definition: error.php:12
+ Here is the caller graph for this function:

Field Documentation

◆ $back_button_name

arDisplayGUI::$back_button_name = ""
protected

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

Referenced by getBackButtonName(), and setBackButtonName().

◆ $back_button_target

arDisplayGUI::$back_button_target = ""
protected

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

Referenced by getBackButtonTarget(), and setBackButtonTarget().

◆ $ctrl

arDisplayGUI::$ctrl
protected

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

◆ $data

arDisplayGUI::$data = array()
protected

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

◆ $fields

arDisplayGUI::$fields = array()
protected

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

Referenced by getFields(), and setFields().

◆ $parent_gui

arDisplayGUI::$parent_gui
protected

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

◆ $record

arDisplayGUI::$record
protected

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

◆ $template

arDisplayGUI::$template
protected

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

Referenced by getTemplate(), and setTemplate().

◆ $title

arDisplayGUI::$title = ""
protected

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

Referenced by getTitle(), and setTitle().

◆ $tpl

arDisplayGUI::$tpl
protected

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


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