ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilMDUtils Class Reference
+ Collaboration diagram for ilMDUtils:

Public Member Functions

 _LOMDurationToArray ($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.

Static Public Member Functions

static _fillHTMLMetaTags ($a_rbac_id, $a_obj_id, $a_type)
 Fill html meta tags.
static _parseCopyright ($a_copyright)
 Parse copyright.

Detailed Description

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

Member Function Documentation

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

Fill html meta tags.

public

Parameters
intrbac_id
intobj_id
stringobj type

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

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

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

{
global $tpl,$ilObjDataCache;
include_once('Services/MetaData/classes/class.ilMDKeyword.php');
foreach(ilMDKeyword::_getKeywordsByLanguageAsString($a_rbac_id,$a_obj_id,$a_type) as $lng_code => $key_string)
{
$tpl->setCurrentBlock('mh_meta_item');
$tpl->setVariable('MH_META_NAME','keywords');
$tpl->setVariable('MH_META_LANG',$lng_code);
$tpl->setVariable('MH_META_CONTENT',$key_string);
$tpl->parseCurrentBlock();
}
include_once('Services/MetaData/classes/class.ilMDContribute.php');
foreach(ilMDContribute::_lookupAuthors($a_rbac_id,$a_obj_id,$a_type) as $author)
{
$tpl->setCurrentBlock('mh_meta_item');
$tpl->setVariable('MH_META_NAME','author');
$tpl->setVariable('MH_META_CONTENT',$author);
$tpl->parseCurrentBlock();
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMDUtils::_LOMDurationToArray (   $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.

Parameters
stringstring to parse
Returns
array e.g array(1,2,0,1,2) => 1 month,2 days, 0 hours, 1 minute, 2 seconds or false if not parsable

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

Referenced by ilMDEducational\_getTypicalLearningTimeSeconds(), ilMDEducational\getTypicalLearningTimeSeconds(), ilMDEditorGUI\listEducational(), ilMDEditorGUI\listQuickEdit_scorm(), and ilTypicalLearningTimeInputGUI\setValueByLOMDuration().

{
$a_string = trim($a_string);
#$pattern = '/^(PT)?(\d{1,2}H)?(\d{1,2}M)?(\d{1,2}S)?$/i';
$pattern = '/^P(\d{1,2}M)?(\d{1,2}D)?(T(\d{1,2}H)?(\d{1,2}M)?(\d{1,2}S)?)?$/i';
if(!preg_match($pattern,$a_string,$matches))
{
return false;
}
// Month
if(preg_match('/^P(\d+)M/i',$a_string,$matches))
{
$months = $matches[1];
}
// Days
if(preg_match('/(\d+)+D/i',$a_string,$matches))
{
#var_dump("<pre>",$matches,"<pre>");
$days = $matches[1];
}
if(preg_match('/(\d+)+H/i',$a_string,$matches))
{
#var_dump("<pre>",$matches,"<pre>");
$hours = $matches[1];
}
if(preg_match('/T(\d{1,2}H)?(\d+)M/i',$a_string,$matches))
{
#var_dump("<pre>",$matches,"<pre>");
$min = $matches[2];
}
if(preg_match('/(\d+)S/i',$a_string,$matches))
{
#var_dump("<pre>",$matches,"<pre>");
$sec = $matches[1];
}
// Hack for zero values
if(!$months and !$days and !$hours and !$min and !$sec)
{
return false;
}
return array($months,$days,$hours,$min,$sec);
}

+ Here is the caller graph for this function:

static ilMDUtils::_parseCopyright (   $a_copyright)
static

Parse copyright.

public

Parameters
stringcopyright

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

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

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

{
include_once('Services/MetaData/classes/class.ilMDSettings.php');
if(!$settings->isCopyrightSelectionActive())
{
return $a_copyright;
}
include_once('Services/MetaData/classes/class.ilMDCopyrightSelectionEntry.php');
}

+ 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: