Пример #1
0
 /**
  * show media object
  */
 protected function showMedia()
 {
     global $ilAccess;
     $this->checkPermission("read");
     $item = new ilMediaPoolItem((int) $_GET["mepitem_id"]);
     $mob_id = $item->getForeignId();
     $this->tpl = new ilTemplate("tpl.fullscreen.html", true, true, "Services/COPage");
     include_once "Services/Style/classes/class.ilObjStyleSheet.php";
     $this->tpl->setVariable("LOCATION_STYLESHEET", ilUtil::getStyleSheetLocation());
     $this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0));
     require_once "./Services/MediaObjects/classes/class.ilObjMediaObject.php";
     require_once "./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php";
     ilObjMediaObjectGUI::includePresentationJS($this->tpl);
     $media_obj = new ilObjMediaObject((int) $mob_id);
     $this->tpl->setVariable("TITLE", " - " . $media_obj->getTitle());
     $xml = "<dummy>";
     // todo: we get always the first alias now (problem if mob is used multiple
     // times in page)
     $xml .= $media_obj->getXML(IL_MODE_ALIAS);
     $xml .= $media_obj->getXML(IL_MODE_OUTPUT);
     $xml .= $link_xml;
     $xml .= "</dummy>";
     $xsl = file_get_contents("./Services/COPage/xsl/page.xsl");
     $args = array('/_xml' => $xml, '/_xsl' => $xsl);
     $xh = xslt_create();
     $wb_path = ilUtil::getWebspaceDir("output") . "/";
     $mode = $_GET["cmd"] != "showPreview" ? "fullscreen" : "media";
     $enlarge_path = ilUtil::getImagePath("enlarge.svg", false, "output");
     $fullscreen_link = $this->ctrl->getLinkTarget($this, "showFullscreen", "", false, false);
     $params = array('mode' => $mode, 'enlarge_path' => $enlarge_path, 'link_params' => "ref_id=" . $_GET["ref_id"], 'fullscreen_link' => $fullscreen_link, 'ref_id' => $_GET["ref_id"], 'pg_frame' => $pg_frame, 'webspace_path' => $wb_path);
     $output = xslt_process($xh, "arg:/_xml", "arg:/_xsl", NULL, $args, $params);
     echo xslt_error($xh);
     xslt_free($xh);
     // unmask user html
     $this->tpl->setVariable("MEDIA_CONTENT", $output);
 }