ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ILIAS\MetaData\Presentation\Utilities Class Reference
+ Inheritance diagram for ILIAS\MetaData\Presentation\Utilities:
+ Collaboration diagram for ILIAS\MetaData\Presentation\Utilities:

Public Member Functions

 __construct (\ilLanguage $lng, \ilObjUser $user,)
 
 getUserDateFormat ()
 
 txt (string $key)
 
 txtFill (string $key, string ... $values)
 
 sanitizeForHTML (string $string)
 

Protected Attributes

ilLanguage $lng
 
ilObjUser $user
 

Detailed Description

Definition at line 25 of file Utilities.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\MetaData\Presentation\Utilities::__construct ( \ilLanguage  $lng,
\ilObjUser  $user 
)

Definition at line 30 of file Utilities.php.

References ILIAS\MetaData\Presentation\Utilities\$lng, ILIAS\MetaData\Presentation\Utilities\$user, ILIAS\Repository\lng(), and ILIAS\Repository\user().

33  {
34  $this->lng = $lng;
35  $this->lng->loadLanguageModule('meta');
36  $this->user = $user;
37  }
+ Here is the call graph for this function:

Member Function Documentation

◆ getUserDateFormat()

ILIAS\MetaData\Presentation\Utilities::getUserDateFormat ( )

Implements ILIAS\MetaData\Presentation\UtilitiesInterface.

Definition at line 39 of file Utilities.php.

References ILIAS\Repository\user().

39  : DateFormat
40  {
41  return $this->user->getDateFormat();
42  }
+ Here is the call graph for this function:

◆ sanitizeForHTML()

ILIAS\MetaData\Presentation\Utilities::sanitizeForHTML ( string  $string)

Implements ILIAS\MetaData\Presentation\UtilitiesInterface.

Definition at line 57 of file Utilities.php.

57  : string
58  {
59  return htmlspecialchars(
60  $string,
61  ENT_QUOTES | ENT_SUBSTITUTE,
62  'utf-8'
63  );
64  }

◆ txt()

ILIAS\MetaData\Presentation\Utilities::txt ( string  $key)

Implements ILIAS\MetaData\Presentation\UtilitiesInterface.

Definition at line 44 of file Utilities.php.

References ILIAS\Repository\lng().

44  : string
45  {
46  return $this->lng->txt($key);
47  }
string $key
Consumer key/client ID value.
Definition: System.php:193
+ Here is the call graph for this function:

◆ txtFill()

ILIAS\MetaData\Presentation\Utilities::txtFill ( string  $key,
string ...  $values 
)

Implements ILIAS\MetaData\Presentation\UtilitiesInterface.

Definition at line 49 of file Utilities.php.

References ILIAS\Repository\lng().

49  : string
50  {
51  if ($this->lng->exists($key)) {
52  return sprintf($this->lng->txt($key), ...$values);
53  }
54  return $key . ' ' . implode(', ', $values);
55  }
string $key
Consumer key/client ID value.
Definition: System.php:193
+ Here is the call graph for this function:

Field Documentation

◆ $lng

ilLanguage ILIAS\MetaData\Presentation\Utilities::$lng
protected

Definition at line 27 of file Utilities.php.

Referenced by ILIAS\MetaData\Presentation\Utilities\__construct().

◆ $user

ilObjUser ILIAS\MetaData\Presentation\Utilities::$user
protected

Definition at line 28 of file Utilities.php.

Referenced by ILIAS\MetaData\Presentation\Utilities\__construct().


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