ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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.

344 {
345 $this->getFields()->addField($field);
346 }

References getFields().

+ Here is the call graph for this function:

◆ customizeFields()

arDisplayGUI::customizeFields ( )
protected

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

98 {
99 }

Referenced by initFields().

+ Here is the caller graph for this function:

◆ getBackButtonName()

arDisplayGUI::getBackButtonName ( )
Returns
string

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

286 {
288 }

References $back_button_name.

Referenced by getHtml().

+ Here is the caller graph for this function:

◆ getBackButtonTarget()

arDisplayGUI::getBackButtonTarget ( )
Returns
string

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

302 {
304 }

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 336 of file class.arDisplayGUI.php.

336 {
337 return $this->getFields()->getField($field_name);
338 }

References getFields().

+ Here is the call graph for this function:

◆ getFields()

arDisplayGUI::getFields ( )
Returns
arDisplayFields

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

318 {
319 return $this->fields;
320 }

References $fields.

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

+ Here is the caller graph for this function:

◆ getFieldsAsArray()

arDisplayGUI::getFieldsAsArray ( )
Returns
arDisplayField []

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

326 {
327 return $this->getFields()->getFields();
328 }

References getFields().

+ Here is the call graph for this function:

◆ getHtml()

arDisplayGUI::getHtml ( )
Returns
string

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

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 }

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

+ Here is the call graph for this function:

◆ getTemplate()

arDisplayGUI::getTemplate ( )
Returns
\ilTemplate

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

376 {
377 return $this->template;
378 }

References $template.

Referenced by getHtml().

+ Here is the caller graph for this function:

◆ getTitle()

arDisplayGUI::getTitle ( )
Returns
string

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

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

References $title.

◆ init()

arDisplayGUI::init ( )
protected

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

78 {
79 $this->initTitle();
80 $this->initFields();
81 $this->initBackButton();
82 $this->initTemplate();
83 }

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

+ Here is the call graph for this function:

◆ initBackButton()

arDisplayGUI::initBackButton ( )
protected

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

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

91 {
92 $this->fields = new arDisplayFields($this->ar);
93 $this->customizeFields();
94 $this->fields->sortFields();
95 }
GUI-Class arDisplayFields.
$errors fields
Definition: imgupload.php:48

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 108 of file class.arDisplayGUI.php.

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

86 {
87 $this->setTitle(strtolower(str_replace("Record", "", get_class($this->ar))));
88 }

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 150 of file class.arDisplayGUI.php.

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 }
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 278 of file class.arDisplayGUI.php.

278 {
279 $this->back_button_name = $back_button_name;
280 }

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 294 of file class.arDisplayGUI.php.

294 {
295 $this->back_button_target = $back_button_target;
296 }

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 270 of file class.arDisplayGUI.php.

270 {
271 return $value;
272 }

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 222 of file class.arDisplayGUI.php.

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

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 198 of file class.arDisplayGUI.php.

198 {
199 return "CUSTOM-OVERRIDE: setCustomFieldData";
200 }

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 257 of file class.arDisplayGUI.php.

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

188 {
189 return $this->txt("", false);
190 }

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 310 of file class.arDisplayGUI.php.

310 {
311 $this->fields = $fields;
312 }

References $fields, and fields.

◆ setModifiedByData()

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

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

209 {
210 $user = new ilObjUser($value);
211
212 return $user->getPublicName();
213 }

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 235 of file class.arDisplayGUI.php.

235 {
236 return $value;
237 }

Referenced by setArFieldData().

+ Here is the caller graph for this function:

◆ setTemplate()

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

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

368 {
369 $this->template = $template;
370 }

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 246 of file class.arDisplayGUI.php.

246 {
247 return $value;
248 }

Referenced by setArFieldData().

+ Here is the caller graph for this function:

◆ setTitle()

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

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

352 {
353 $this->title = $title;
354 }

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 387 of file class.arDisplayGUI.php.

387 {
388 return $this->parent_gui->txt($txt, $plugin_txt);
389 }
$txt
Definition: error.php:12

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