ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilMDUtils Class Reference
+ Collaboration diagram for ilMDUtils:

Static Public Member Functions

static _LOMDurationToArray (string $a_string)
 LOM datatype duration is a string like P2M4DT7H18M2S (2 months 4 days 7 hours 18 minutes 2 seconds) This function tries to parse a given string in an array of months, days, hours, minutes and seconds. More...
 
static _fillHTMLMetaTags (int $a_rbac_id, int $a_obj_id, string $a_type)
 
static _parseCopyright (string $a_copyright)
 Returns an empty string if copyright selection is not active, regardless of input. More...
 
static _getDefaultCopyright ()
 Returns an empty string if copyright selection is not active. More...
 

Detailed Description

Definition at line 28 of file class.ilMDUtils.php.

Member Function Documentation

◆ _fillHTMLMetaTags()

static ilMDUtils::_fillHTMLMetaTags ( int  $a_rbac_id,
int  $a_obj_id,
string  $a_type 
)
static

Definition at line 48 of file class.ilMDUtils.php.

References $DIC, ilMDKeyword\_getKeywordsByLanguageAsString(), and ilMDContribute\_lookupAuthors().

48  : bool
49  {
50  global $DIC;
51 
52  // currently disabled due to mantis 0026864
53  return true;
54 
55  $tpl = $DIC['tpl'];
56  $ilObjDataCache = $DIC['ilObjDataCache'];
57 
59  $a_rbac_id,
60  $a_obj_id,
61  $a_type
62  ) as $lng_code => $key_string) {
63  $tpl->setCurrentBlock('mh_meta_item');
64  $tpl->setVariable('MH_META_NAME', 'keywords');
65  $tpl->setVariable('MH_META_LANG', $lng_code);
66  $tpl->setVariable('MH_META_CONTENT', $key_string);
67  $tpl->parseCurrentBlock();
68  }
69 
70  foreach (ilMDContribute::_lookupAuthors($a_rbac_id, $a_obj_id, $a_type) as $author) {
71  $tpl->setCurrentBlock('mh_meta_item');
72  $tpl->setVariable('MH_META_NAME', 'author');
73  $tpl->setVariable('MH_META_CONTENT', $author);
74  $tpl->parseCurrentBlock();
75  }
76  return true;
77  }
static _getKeywordsByLanguageAsString(int $a_rbac_id, int $a_obj_id, string $a_type)
static _lookupAuthors(int $a_rbac_id, int $a_obj_id, string $a_obj_type)
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

◆ _getDefaultCopyright()

static ilMDUtils::_getDefaultCopyright ( )
static

Returns an empty string if copyright selection is not active.

Definition at line 96 of file class.ilMDUtils.php.

References ilMDCopyrightSelectionEntry\createIdentifier(), and ilMDCopyrightSelectionEntry\getDefault().

96  : string
97  {
99  return self::_parseCopyright(
101  );
102  }
+ Here is the call graph for this function:

◆ _LOMDurationToArray()

static ilMDUtils::_LOMDurationToArray ( string  $a_string)
static

LOM datatype duration is a string like P2M4DT7H18M2S (2 months 4 days 7 hours 18 minutes 2 seconds) This function tries to parse a given string in an array of months, days, hours, minutes and seconds.

Returns
int[] e.g array(1,2,0,1,2) => 1 month,2 days, 0 hours, 1 minute, 2 seconds or empty array if not parsable
Deprecated:
use DataHelper::durationToArray

Definition at line 36 of file class.ilMDUtils.php.

References $DIC.

Referenced by ilMDEducational\_getTypicalLearningTimeSeconds(), and ilMDEducational\getTypicalLearningTimeSeconds().

36  : array
37  {
38  global $DIC;
39 
40  $data_helper = $DIC->learningObjectMetadata()->dataHelper();
41 
42  $array = $data_helper->durationToArray($a_string);
43  // this function never returned the year, so we throw it away for backwards compatibility
44  array_shift($array);
45  return $array ?? [];
46  }
global $DIC
Definition: shib_login.php:22
+ Here is the caller graph for this function:

◆ _parseCopyright()

static ilMDUtils::_parseCopyright ( string  $a_copyright)
static

Returns an empty string if copyright selection is not active, regardless of input.

Definition at line 83 of file class.ilMDUtils.php.

References ilMDSettings\_getInstance(), ilMDCopyrightSelectionEntry\_lookupCopyright(), and ilMDCopyrightSelectionEntry\isEntry().

83  : string
84  {
85  $settings = ilMDSettings::_getInstance();
86  if (!$settings->isCopyrightSelectionActive()) {
87  return ilMDCopyrightSelectionEntry::isEntry($a_copyright) ? '' : $a_copyright;
88  }
89 
91  }
+ Here is the call graph for this function:

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