本文整理汇总了PHP中ilObjMediaObject::_getIdForImportId方法的典型用法代码示例。如果您正苦于以下问题:PHP ilObjMediaObject::_getIdForImportId方法的具体用法?PHP ilObjMediaObject::_getIdForImportId怎么用?PHP ilObjMediaObject::_getIdForImportId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilObjMediaObject
的用法示例。
在下文中一共展示了ilObjMediaObject::_getIdForImportId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _getIdForImportId
/**
* Get current id for an import id
*
* @param string $a_type target type ("PageObject" | "StructureObject" |
* "GlossaryItem" | "MediaObject")
* @param string $a_target import target id (e.g. "il_2_pg_22")
*
* @return string current target id (e.g. "il__pg_244")
*/
function _getIdForImportId($a_type, $a_target)
{
switch ($a_type) {
case "PageObject":
$id = ilLMObject::_getIdForImportId($a_target);
if ($id > 0) {
return "il__pg_" . $id;
}
break;
case "StructureObject":
$id = ilLMObject::_getIdForImportId($a_target);
if ($id > 0) {
return "il__st_" . $id;
}
break;
case "GlossaryItem":
$id = ilGlossaryTerm::_getIdForImportId($a_target);
if ($id > 0) {
return "il__git_" . $id;
}
break;
case "WikiPage":
// no import IDs for wiki pages (yet)
//$id = ilGlossaryTerm::_getIdForImportId($a_target);
$id = 0;
if ($id > 0) {
return "il__wpage_" . $id;
}
break;
case "MediaObject":
$id = ilObjMediaObject::_getIdForImportId($a_target);
if ($id > 0) {
return "il__mob_" . $id;
}
break;
case "RepositoryItem":
$tarr = explode("_", $a_target);
$import_id = $a_target;
// if a ref id part is given, strip this
// since this will not be part of an import id
if ($tarr[4] != "") {
$import_id = $tarr[0] . "_" . $tarr[1] . "_" . $tarr[2] . "_" . $tarr[3];
}
if (ilInternalLink::_extractInstOfTarget($a_target) == IL_INST_ID && IL_INST_ID > 0) {
// does it have a ref id part?
if ($tarr[4] != "") {
return "il__obj_" . $tarr[4];
}
}
$id = ilObject::_getIdForImportId($import_id);
//echo "-$a_target-$id-";
// get ref id for object id
// (see ilPageObject::insertInstIntoIDs for the export procedure)
if ($id > 0) {
$refs = ilObject::_getAllReferences($id);
//var_dump($refs);
foreach ($refs as $ref) {
return "il__obj_" . $ref;
}
}
break;
}
return false;
}
示例2: _getIdForImportId
/**
* get current id for an import id
*
* @param string $a_type target type ("PageObject" | "StructureObject" |
* "GlossaryItem" | "MediaObject")
* @param string $a_target import target id (e.g. "il_2_pg_22")
*
* @return string current target id (e.g. "il__pg_244")
*/
function _getIdForImportId($a_type, $a_target)
{
switch ($a_type) {
case "PageObject":
$id = ilLMObject::_getIdForImportId($a_target);
if ($id > 0) {
return "il__pg_" . $id;
}
break;
case "StructureObject":
$id = ilLMObject::_getIdForImportId($a_target);
if ($id > 0) {
return "il__st_" . $id;
}
break;
case "GlossaryItem":
$id = ilGlossaryTerm::_getIdForImportId($a_target);
if ($id > 0) {
return "il__git_" . $id;
}
break;
case "MediaObject":
$id = ilObjMediaObject::_getIdForImportId($a_target);
if ($id > 0) {
return "il__mob_" . $id;
}
break;
case "RepositoryItem":
$id = ilObject::_getIdForImportId($a_target);
//echo "-$a_target-$id-";
// get ref id for object id
// (see ilPageObject::insertInstIntoIDs for the export procedure)
if ($id > 0) {
$refs = ilObject::_getAllReferences($id);
//var_dump($refs);
foreach ($refs as $ref) {
return "il__obj_" . $ref;
}
}
break;
}
return false;
}