ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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.

373 {
374 $this->getFields()->addField($field);
375 }

References getFields().

+ Here is the call graph for this function:

◆ customizeFields()

arDisplayGUI::customizeFields ( )
protected

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

106 {
107 }

Referenced by initFields().

+ Here is the caller graph for this function:

◆ getBackButtonName()

arDisplayGUI::getBackButtonName ( )
Returns
string

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

308 {
310 }

References $back_button_name.

Referenced by getHtml().

+ Here is the caller graph for this function:

◆ getBackButtonTarget()

arDisplayGUI::getBackButtonTarget ( )
Returns
string

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

326 {
328 }

References $back_button_target.

Referenced by getHtml().

+ 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.

364 {
365 return $this->getFields()->getField($field_name);
366 }

References getFields().

+ Here is the call graph for this function:

◆ getFields()

arDisplayGUI::getFields ( )
Returns
arDisplayFields

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

344 {
345 return $this->fields;
346 }

References $fields.

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

+ Here is the caller graph for this function:

◆ getFieldsAsArray()

arDisplayGUI::getFieldsAsArray ( )
Returns
arDisplayField []

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

353 {
354 return $this->getFields()->getFields();
355 }

References getFields().

+ Here is the call graph for this function:

◆ getHtml()

arDisplayGUI::getHtml ( )
Returns
string

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

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 }

References getBackButtonName(), getBackButtonTarget(), and getTemplate().

+ Here is the call graph for this function:

◆ getTemplate()

arDisplayGUI::getTemplate ( )
Returns
\ilTemplate

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

409 {
410 return $this->template;
411 }

References $template.

Referenced by getHtml().

+ Here is the caller graph for this function:

◆ getTitle()

arDisplayGUI::getTitle ( )
Returns
string

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

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

References $title.

◆ init()

arDisplayGUI::init ( )
protected

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

83 {
84 $this->initTitle();
85 $this->initFields();
86 $this->initBackButton();
87 $this->initTemplate();
88 }

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

+ Here is the call graph for this function:

◆ initBackButton()

arDisplayGUI::initBackButton ( )
protected

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

111 {
112 $this->setBackButtonName($this->txt("back", false));
113 $this->setBackButtonTarget($this->ctrl->getLinkTarget($this->parent_gui, "index"));
114 }
setBackButtonTarget($back_button_target)
setBackButtonName($back_button_name)
txt($txt, $plugin_txt=true)

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

Referenced by init().

+ 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.

98 {
99 $this->fields = new arDisplayFields($this->ar);
100 $this->customizeFields();
101 $this->fields->sortFields();
102 }
GUI-Class arDisplayFields.
$errors fields
Definition: imgupload.php:51

References customizeFields(), and fields.

Referenced by init().

+ 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.

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

References setTemplate().

Referenced by init().

+ 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.

92 {
93 $this->setTitle(strtolower(str_replace("Record", "", get_class($this->ar))));
94 }

References setTitle().

Referenced by init().

+ 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.

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 }
setNumericData(arDisplayField $field, $value)
setEmptyFieldData(arDisplayField $field)
setTextData(arDisplayField $field, $value)
setCreatedByData(arDisplayField $field, $value)
setClobData(arDisplayField $field, $value)
setModifiedByData(arDisplayField $field, $value)
setCustomFieldData(arDisplayField $field)
setDateTimeData(arDisplayField $field, $value)

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

+ Here is the call graph for this function:

◆ setBackButtonName()

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

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

299 {
300 $this->back_button_name = $back_button_name;
301 }

References $back_button_name.

Referenced by initBackButton().

+ 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.

317 {
318 $this->back_button_target = $back_button_target;
319 }

References $back_button_target.

Referenced by initBackButton().

+ 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.

290 {
291 return $value;
292 }

Referenced by setArFieldData().

+ 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.

238 {
239 $user = new ilObjUser($value);
240
241 return $user->getPublicName();
242 }

Referenced by setArFieldData().

+ 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.

212 {
213 return "CUSTOM-OVERRIDE: setCustomFieldData";
214 }

Referenced by setArFieldData().

+ 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.

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, $include_seconds=false)
Format a date @access public.
@classDescription Date and time handling

References ilDatePresentation\formatDate(), and IL_CAL_DATETIME.

Referenced by setArFieldData().

+ 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.

201 {
202 return $this->txt("", false);
203 }

References txt().

Referenced by setArFieldData().

+ 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.

335 {
336 $this->fields = $fields;
337 }

References $fields, and fields.

◆ setModifiedByData()

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

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

224 {
225 $user = new ilObjUser($value);
226
227 return $user->getPublicName();
228 }

Referenced by setArFieldData().

+ 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.

252 {
253 return $value;
254 }

Referenced by setArFieldData().

+ Here is the caller graph for this function:

◆ setTemplate()

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

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

400 {
401 $this->template = $template;
402 }

References $template.

Referenced by initTemplate().

+ 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.

264 {
265 return $value;
266 }

Referenced by setArFieldData().

+ Here is the caller graph for this function:

◆ setTitle()

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

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

382 {
383 $this->title = $title;
384 }

References $title.

Referenced by initTitle().

+ 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.

421 {
422 return $this->parent_gui->txt($txt, $plugin_txt);
423 }
$txt
Definition: error.php:13

References $txt.

Referenced by initBackButton(), and setEmptyFieldData().

+ 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: