Exemplo n.º 1
0
 /**
  * Insert content includes
  */
 function insertContentIncludes($a_html)
 {
     global $ilCtrl, $lng;
     $c_pos = 0;
     $start = strpos($a_html, "{{{{{ContentInclude;");
     if (is_int($start)) {
         $end = strpos($a_html, "}}}}}", $start);
     }
     $i = 1;
     while ($end > 0) {
         $param = substr($a_html, $start + 20, $end - $start - 20);
         $param = explode(";", $param);
         if ($param[0] == "mep" && is_numeric($param[1]) && $param[2] <= 0) {
             include_once "./Modules/MediaPool/classes/class.ilMediaPoolPageGUI.php";
             if (ilMediaPoolPage::_exists($param[1])) {
                 $page_gui = new ilMediaPoolPageGUI($param[1], 0, true, "-");
                 if ($this->getOutputMode() != "offline") {
                     $page_gui->setFileDownloadLink($this->determineFileDownloadLink());
                     $page_gui->setFullscreenLink($this->determineFullscreenLink());
                     $page_gui->setSourceCodeDownloadScript($this->determineSourcecodeDownloadScript());
                 } else {
                     $page_gui->setOutputMode(IL_PAGE_OFFLINE);
                 }
                 $html = $page_gui->getRawContent();
             } else {
                 if ($this->getOutputMode() == "edit") {
                     $html = "// " . $lng->txt("cont_missing_snippet") . " //";
                 }
             }
             $h2 = substr($a_html, 0, $start) . $html . substr($a_html, $end + 5);
             $a_html = $h2;
             $i++;
         }
         $start = strpos($a_html, "{{{{{ContentInclude;", $start + 5);
         $end = 0;
         if (is_int($start)) {
             $end = strpos($a_html, "}}}}}", $start);
         }
     }
     return $a_html;
 }