ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilDclDatetimeRecordRepresentation Class Reference

Class ilDclDateTimeRecordRepresentation. More...

+ Inheritance diagram for ilDclDatetimeRecordRepresentation:
+ Collaboration diagram for ilDclDatetimeRecordRepresentation:

Public Member Functions

 getHTML ($link=true)
 Outputs html of a certain field. More...
 
 parseFormInput ($value)
 function parses stored value to the variable needed to fill into the form for editing. More...
 
- Public Member Functions inherited from ilDclBaseRecordRepresentation
 __construct (ilDclBaseRecordFieldModel $record_field)
 
 getFormGUI (ilPropertyFormGUI $formGUI)
 
 parseFormInput ($value)
 function parses stored value to the variable needed to fill into the form for editing. More...
 
 fillFormInput ($form)
 Fills the form with the value of a record. More...
 
 getHTML ($link=true)
 Outputs html of a certain field. More...
 
 getSingleHTML (array $options=null, $link=true)
 Returns data for single record view. More...
 
 getConfirmationHTML ()
 Returns data for confirmation list When returning false, attribute is ignored in list. More...
 
 fillRow (ilTemplate $tpl)
 Fills row with record data. More...
 
 getRecordField ()
 Get Record Field. More...
 
 getField ()
 Getter shortcut for field. More...
 
 getRecord ()
 Getter shortcut for record. More...
 

Protected Member Functions

 formatDate ($value, $format)
 
- Protected Member Functions inherited from ilDclBaseRecordRepresentation
 getFormInput ()
 Gets the value from from the record field. More...
 

Additional Inherited Members

- Protected Attributes inherited from ilDclBaseRecordRepresentation
 $record_field
 
 $lng
 
 $access
 
 $ctrl
 

Detailed Description

Class ilDclDateTimeRecordRepresentation.

Author
Michael Herren mh@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch
Version
1.0.0

Definition at line 9 of file class.ilDclDatetimeRecordRepresentation.php.

Member Function Documentation

◆ formatDate()

ilDclDatetimeRecordRepresentation::formatDate (   $value,
  $format 
)
protected
Parameters
$value
$format
Returns
false|string

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

References $format, $timestamp, ilCalendarSettings\DATE_FORMAT_DMY, ilCalendarSettings\DATE_FORMAT_MDY, and ilCalendarSettings\DATE_FORMAT_YMD.

Referenced by getHTML().

41  {
42  $timestamp = strtotime($value);
43  switch ($format) {
45  return date("d.m.Y", $timestamp);
47  return date("Y-m-d", $timestamp);
49  return date("m/d/Y", $timestamp);
50  }
51 
52  return $this->lng->txt('no_date');
53  }
$format
Definition: metadata.php:141
foreach($mandatory_scripts as $file) $timestamp
Definition: buildRTE.php:81
+ Here is the caller graph for this function:

◆ getHTML()

ilDclDatetimeRecordRepresentation::getHTML (   $link = true)

Outputs html of a certain field.

Parameters
mixed$value
bool | true$link
Returns
string

Definition at line 20 of file class.ilDclDatetimeRecordRepresentation.php.

References $DIC, $ilUser, formatDate(), and ilDclBaseRecordRepresentation\getRecordField().

21  {
22  global $DIC;
23  $ilUser = $DIC['ilUser'];
24 
25  $value = $this->getRecordField()->getValue();
26  if ($value == '0000-00-00 00:00:00' or !$value) {
27  return $this->lng->txt('no_date');
28  }
29 
30  return $this->formatDate($value, $ilUser->getDateFormat());
31  }
global $DIC
Definition: saml.php:7
$ilUser
Definition: imgupload.php:18
+ Here is the call graph for this function:

◆ parseFormInput()

ilDclDatetimeRecordRepresentation::parseFormInput (   $value)

function parses stored value to the variable needed to fill into the form for editing.

Parameters
$value
Returns
mixed

Definition at line 63 of file class.ilDclDatetimeRecordRepresentation.php.

64  {
65  if (!$value || $value == "-") {
66  return null;
67  }
68 
69  return substr($value, 0, -9);
70  }

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