ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilDclDatetimeRecordRepresentation Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

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

Public Member Functions

 getHTML (bool $link=true, array $options=[])
 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 (ilPropertyFormGUI $form)
 Fills the form with the value of a record. More...
 
 getHTML (bool $link=true, array $options=[])
 Outputs html of a certain field. More...
 
 getSingleHTML (?array $options=null, bool $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 (string $value, string $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
ilDclBaseRecordFieldModel $record_field
 
ilLanguage $lng
 
ilAccess $access
 
ilCtrl $ctrl
 
ILIAS HTTP Services $http
 
ILIAS Refinery Factory $refinery
 
ILIAS UI Renderer $renderer
 
ilObjUser $user
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning

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

Member Function Documentation

◆ formatDate()

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

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

References $timestamp, ilCalendarSettings\DATE_FORMAT_DMY, ilCalendarSettings\DATE_FORMAT_MDY, ilCalendarSettings\DATE_FORMAT_YMD, and ILIAS\Repository\lng().

Referenced by getHTML().

38  {
39  $timestamp = strtotime($value);
40  switch ($format) {
42  return date("d.m.Y", $timestamp);
44  return date("Y-m-d", $timestamp);
46  return date("m/d/Y", $timestamp);
47  }
48 
49  return $this->lng->txt('no_date');
50  }
$format
Definition: metadata.php:235
foreach($mandatory_scripts as $file) $timestamp
Definition: buildRTE.php:70
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getHTML()

ilDclDatetimeRecordRepresentation::getHTML ( bool  $link = true,
array  $options = [] 
)

Outputs html of a certain field.

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

References formatDate(), ilDclBaseRecordRepresentation\getRecordField(), ILIAS\Repository\lng(), and ILIAS\Repository\user().

24  : string
25  {
26  $value = $this->getRecordField()->getValue();
27  if ($value == '0000-00-00 00:00:00' || !$value) {
28  return $this->lng->txt('no_date');
29  }
30 
31  return $this->formatDate($value, $this->user->getDateFormat());
32  }
+ 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
string | int$value

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

56  : ?string
57  {
58  if (!$value || $value == "-") {
59  return null;
60  }
61 
62  return substr($value, 0, -9);
63  }

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