當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ilLMObject::_getIdForImportId方法代碼示例

本文整理匯總了PHP中ilLMObject::_getIdForImportId方法的典型用法代碼示例。如果您正苦於以下問題:PHP ilLMObject::_getIdForImportId方法的具體用法?PHP ilLMObject::_getIdForImportId怎麽用?PHP ilLMObject::_getIdForImportId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ilLMObject的用法示例。


在下文中一共展示了ilLMObject::_getIdForImportId方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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 "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;
 }
開發者ID:khanhnnvn,項目名稱:ilias_E-learning,代碼行數:52,代碼來源:class.ilInternalLink.php

示例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 "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;
 }
開發者ID:arlendotcn,項目名稱:ilias,代碼行數:73,代碼來源:class.ilInternalLink.php

示例3: _resolveInternalLink

 function _resolveInternalLink($internal_link)
 {
     if (preg_match("/il_(\\d+)_(\\w+)_(\\d+)/", $internal_link, $matches)) {
         include_once "./Services/Link/classes/class.ilInternalLink.php";
         include_once "./Modules/LearningModule/classes/class.ilLMObject.php";
         include_once "./Modules/Glossary/classes/class.ilGlossaryTerm.php";
         switch ($matches[2]) {
             case "lm":
                 $resolved_link = ilLMObject::_getIdForImportId($internal_link);
                 break;
             case "pg":
                 $resolved_link = ilInternalLink::_getIdForImportId("PageObject", $internal_link);
                 break;
             case "st":
                 $resolved_link = ilInternalLink::_getIdForImportId("StructureObject", $internal_link);
                 break;
             case "git":
                 $resolved_link = ilInternalLink::_getIdForImportId("GlossaryItem", $internal_link);
                 break;
             case "mob":
                 $resolved_link = ilInternalLink::_getIdForImportId("MediaObject", $internal_link);
                 break;
         }
         if (strcmp($resolved_link, "") == 0) {
             $resolved_link = $internal_link;
         }
     } else {
         $resolved_link = $internal_link;
     }
     return $resolved_link;
 }
開發者ID:arlendotcn,項目名稱:ilias,代碼行數:31,代碼來源:class.SurveyQuestion.php


注:本文中的ilLMObject::_getIdForImportId方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。