ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
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 27 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 47 of file class.ilMDUtils.php.

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

Referenced by ilObjLinkResourceGUI\executeCommand(), ilObjCourseGUI\infoScreen(), ilObjGroupGUI\infoScreen(), ilObjCourseGUI\renderObject(), and ilObjGroupGUI\viewObject().

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

◆ _getDefaultCopyright()

static ilMDUtils::_getDefaultCopyright ( )
static

Returns an empty string if copyright selection is not active.

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

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

Referenced by ilInfoScreenGUI\addMetaDataSections().

95  : string
96  {
98  return self::_parseCopyright(
100  );
101  }
+ Here is the call graph for this function:
+ Here is the caller 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 35 of file class.ilMDUtils.php.

References $DIC.

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

35  : array
36  {
37  global $DIC;
38 
39  $data_helper = $DIC->learningObjectMetadata()->dataHelper();
40 
41  $array = $data_helper->durationToArray($a_string);
42  // this function never returned the year, so we throw it away for backwards compatibility
43  array_shift($array);
44  return $array ?? [];
45  }
global $DIC
Definition: feed.php:28
+ 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 82 of file class.ilMDUtils.php.

References ILIAS\LTI\ToolProvider\$settings, ilMDSettings\_getInstance(), ilMDCopyrightSelectionEntry\_lookupCopyright(), and ilMDCopyrightSelectionEntry\isEntry().

Referenced by ilInfoScreenGUI\addMetaDataSections(), ilLMPresentationGUI\showDownloadList(), and ilLMPresentationGUI\showPrintView().

82  : string
83  {
85  if (!$settings->isCopyrightSelectionActive()) {
86  return ilMDCopyrightSelectionEntry::isEntry($a_copyright) ? '' : $a_copyright;
87  }
88 
90  }
array $settings
Setting values (LTI parameters, custom parameters and local parameters).
Definition: System.php:200
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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