Ejemplo n.º 1
0
 /**
  * Get tail dependencies
  *
  * @param		string		entity
  * @param		string		target release
  * @param		array		ids
  * @return		array		array of array with keys "component", entity", "ids"
  */
 function getXmlExportTailDependencies($a_entity, $a_target_release, $a_ids)
 {
     include_once "./Modules/Wiki/classes/class.ilWikiPage.php";
     $pg_ids = array();
     foreach ($a_ids as $id) {
         $pages = ilWikiPage::getAllPages($id);
         foreach ($pages as $p) {
             if (ilWikiPage::_exists("wpg", $p["id"])) {
                 $pg_ids[] = "wpg:" . $p["id"];
             }
         }
     }
     $deps = array(array("component" => "Services/COPage", "entity" => "pg", "ids" => $pg_ids), array("component" => "Services/Rating", "entity" => "rating_category", "ids" => $a_ids));
     $advmd_ids = array();
     foreach ($a_ids as $id) {
         $rec_ids = $this->getActiveAdvMDRecords($id);
         if (sizeof($rec_ids)) {
             foreach ($rec_ids as $rec_id) {
                 $advmd_ids[] = $id . ":" . $rec_id;
             }
         }
     }
     if (sizeof($advmd_ids)) {
         $deps[] = array("component" => "Services/AdvancedMetaData", "entity" => "advmd", "ids" => $advmd_ids);
     }
     return $deps;
 }
Ejemplo n.º 2
0
 /**
  * Export all pages
  */
 function exportHTMLPages()
 {
     global $tpl, $ilBench, $ilLocator;
     $pages = ilWikiPage::getAllPages($this->wiki->getId());
     include_once "./Services/COPage/classes/class.ilPageContentUsage.php";
     include_once "./Services/MediaObjects/classes/class.ilObjMediaObject.php";
     foreach ($pages as $page) {
         if (ilWikiPage::_exists("wpg", $page["id"])) {
             $this->exportPageHTML($page["id"]);
             $this->co_page_html_export->collectPageElements("wpg:pg", $page["id"]);
         }
     }
     $this->co_page_html_export->exportPageElements();
 }
Ejemplo n.º 3
0
 /**
  * Get tail dependencies
  *
  * @param		string		entity
  * @param		string		target release
  * @param		array		ids
  * @return		array		array of array with keys "component", entity", "ids"
  */
 function getXmlExportTailDependencies($a_entity, $a_target_release, $a_ids)
 {
     include_once "./Modules/Wiki/classes/class.ilWikiPage.php";
     $pg_ids = array();
     foreach ($a_ids as $id) {
         $pages = ilWikiPage::getAllPages($id);
         foreach ($pages as $p) {
             if (ilWikiPage::_exists("wpg", $p["id"])) {
                 $pg_ids[] = "wpg:" . $p["id"];
             }
         }
     }
     return array(array("component" => "Services/COPage", "entity" => "pg", "ids" => $pg_ids), array("component" => "Services/Rating", "entity" => "rating_category", "ids" => $a_ids));
 }
Ejemplo n.º 4
0
 /**
  * Check if internal link refers to a valid target
  *
  * @param	string		$a_type			target type ("PageObject" | "StructureObject" |
  *										"GlossaryItem" | "MediaObject")
  * @param	string		$a_target		target id, e.g. "il__pg_244")
  *
  * @return	boolean		true/false
  */
 function _exists($a_type, $a_target)
 {
     global $tree;
     switch ($a_type) {
         case "PageObject":
         case "StructureObject":
             return ilLMObject::_exists($a_target);
             break;
         case "GlossaryItem":
             return ilGlossaryTerm::_exists($a_target);
             break;
         case "MediaObject":
             return ilObjMediaObject::_exists($a_target);
             break;
         case "WikiPage":
             include_once "./Modules/Wiki/classes/class.ilWikiPage.php";
             return ilWikiPage::_exists("wiki", (int) $a_target);
             break;
         case "RepositoryItem":
             if (is_int(strpos($a_target, "_"))) {
                 $ref_id = ilInternalLink::_extractObjIdOfTarget($a_target);
                 return $tree->isInTree($ref_id);
             }
             break;
     }
     return false;
 }