public function printViewObject($a_pdf_export = false) { global $tpl; $page_ids = $this->getPrintPageIds(); if (!$page_ids) { $this->ctrl->redirect($this, ""); } $tpl = new ilTemplate("tpl.main.html", true, true); $tpl->setVariable("LOCATION_STYLESHEET", ilObjStyleSheet::getContentPrintStyle()); $this->setContentStyleSheet($tpl); // syntax style $tpl->setCurrentBlock("SyntaxStyle"); $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath()); $tpl->parseCurrentBlock(); // determine target frames for internal links include_once "./Modules/Wiki/classes/class.ilWikiPageGUI.php"; $page_content = ""; foreach ($page_ids as $p_id) { $page_gui = new ilWikiPageGUI($p_id); $page_gui->setOutputMode("print"); $page_content .= $page_gui->showPage(); if ($a_pdf_export) { $page_content .= '<p style="page-break-after:always;"></p>'; } } $page_content = '<div class="ilInvisibleBorder">' . $page_content . '</div>'; if (!$a_pdf_export) { $page_content .= '<script type="text/javascript" language="javascript1.2"> <!-- il.Util.addOnLoad(function () { il.Util.print(); }); //--> </script>'; } $tpl->setVariable("CONTENT", $page_content); if (!$a_pdf_export) { $tpl->show(false); exit; } else { return $tpl->get("DEFAULT", false, false, false, true, false, false); } }
/** * Export page html */ function exportPageHTML($a_page_id) { global $ilUser, $lng, $ilTabs; $ilTabs->clearTargets(); $this->tpl = $this->co_page_html_export->getPreparedMainTemplate(); $this->tpl->getStandardTemplate(); $file = $this->export_dir . "/wpg_" . $a_page_id . ".html"; // return if file is already existing if (@is_file($file)) { return; } // page include_once "./Modules/Wiki/classes/class.ilWikiPageGUI.php"; $wpg_gui = new ilWikiPageGUI($a_page_id); $wpg_gui->setOutputMode("offline"); $page_content = $wpg_gui->showPage(); // export template: page content $ep_tpl = new ilTemplate("tpl.export_page.html", true, true, "Modules/Wiki"); $ep_tpl->setVariable("PAGE_CONTENT", $page_content); // export template: right content include_once "./Modules/Wiki/classes/class.ilWikiImportantPagesBlockGUI.php"; $bl = new ilWikiImportantPagesBlockGUI(); $ep_tpl->setVariable("RIGHT_CONTENT", $bl->getHTML(true)); // workaround // $this->tpl->setVariable("MAINMENU", "<div style='min-height:40px;'></div>"); $this->tpl->setVariable("MAINMENU", ""); $this->tpl->setTitle($this->wiki->getTitle()); $this->tpl->setTitleIcon("./images/icon_wiki.svg", $lng->txt("obj_wiki")); $this->tpl->setContent($ep_tpl->get()); //$this->tpl->fillMainContent(); $content = $this->tpl->get("DEFAULT", false, false, false, true, true, true); //echo htmlentities($content); exit; // open file if (!($fp = @fopen($file, "w+"))) { die("<b>Error</b>: Could not open \"" . $file . "\" for writing" . " in <b>" . __FILE__ . "</b> on line <b>" . __LINE__ . "</b><br />"); } // set file permissions chmod($file, 0770); // write xml data into the file fwrite($fp, $content); // close file fclose($fp); if ($this->wiki->getStartPage() == $wpg_gui->getPageObject()->getTitle()) { copy($file, $this->export_dir . "/index.html"); } }
/** * Show printable view of a wiki page */ function printViewObject() { $this->checkPermission("read"); switch ($_POST["sel_type"]) { case "wiki": include_once "./Modules/Wiki/classes/class.ilWikiPage.php"; $pages = ilWikiPage::getAllPages($this->object->getId()); foreach ($pages as $p) { $pg_ids[] = $p["id"]; } break; case "selection": if (is_array($_POST["obj_id"])) { $pg_ids = $_POST["obj_id"]; } else { $pg_ids[] = $_GET["wpg_id"]; } break; default: $pg_ids[] = $_GET["wpg_id"]; break; } include_once "./Modules/Wiki/classes/class.ilWikiPageGUI.php"; global $tpl; $tpl = new ilTemplate("tpl.main.html", true, true); $tpl->setVariable("LOCATION_STYLESHEET", ilObjStyleSheet::getContentPrintStyle()); $this->setContentStyleSheet($tpl); // syntax style $tpl->setCurrentBlock("SyntaxStyle"); $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET", ilObjStyleSheet::getSyntaxStylePath()); $tpl->parseCurrentBlock(); // determine target frames for internal links foreach ($pg_ids as $p_id) { $page_gui = new ilWikiPageGUI($p_id); $page_gui->setOutputMode("print"); $page_content .= $page_gui->showPage(); } $tpl->setVariable("CONTENT", '<div class="ilInvisibleBorder">' . $page_content . '</div>' . '<script type="text/javascript" language="javascript1.2"> <!-- il.Util.addOnLoad(function () { il.Util.print(); }); //--> </script>'); $tpl->show(false); exit; }