Commit f3d91d52 authored by Petr Skoda's avatar Petr Skoda
Browse files

fixed imscp export support

closes #12
parent 0c9f1864
<?php
///////////////////////////////////////////////////////////////////////////
// //
// NOTICE OF COPYRIGHT //
// //
// Moodle - Modular Object-Oriented Dynamic Learning Environment //
// http://moodle.com //
// //
// Copyright (C) 2001-3001 Antonio Vicent http://ludens.es //
// (C) 2001-3001 Eloy Lafuente (stronk7) http://contiento.com //
// //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation; either version 2 of the License, or //
// (at your option) any later version. //
// //
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License for more details: //
// //
// http://www.gnu.org/copyleft/gpl.html //
// //
///////////////////////////////////////////////////////////////////////////
// This file is part of Book plugin for Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
die('Not converted to 2.0 yet, sorry');
/**
* Book IMSCP export plugin
*
* @package booktool
* @subpackage exportimscp
* @copyright 2001-3001 Antonio Vicent {@link http://ludens.es}
* @copyright 2001-3001 Eloy Lafuente (stronk7) {@link http://contiento.com}
* @copyright 2011 Petr Skoda {@link http://skodak.org}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require('../../config.php');
require(dirname(__FILE__).'/../../../../config.php');
require_once(dirname(__FILE__).'/locallib.php');
require_once($CFG->dirroot.'/mod/book/locallib.php');
require_once($CFG->dirroot.'/backup/lib.php');
require_once($CFG->libdir.'/filelib.php');
$id = required_param('id', PARAM_INT); // Course Module ID
$cm = get_coursemodule_from_id('book', $id, 0, false, MUST_EXIST);
$course = $DB->get_record('course', array('id'=>$cm->course), '*', MUST_EXIST);
$book = $DB->get_record('book', array('id'=>$cm->instance), '*', MUST_EXIST);
if (!$cm = get_coursemodule_from_id('book', $id)) {
error('Course Module ID was incorrect');
}
if (!$course = get_record('course', 'id', $cm->course)) {
error('Course is misconfigured');
}
$PAGE->set_url('/mod/book/tool/exportimscp/index.php', array('id'=>$id));
require_login($course, true, $cm);
require_login($course, false, $cm);
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
require_capability('mod/book:read', $context);
require_capability('mod/book:exportimscp', $context);
if (!$book = get_record('book', 'id', $cm->instance)) {
error('Course module is incorrect');
}
require_capability('booktool/exportimscp:export', $context);
$strbooks = get_string('modulenameplural', 'book');
$strbook = get_string('modulename', 'book');
$strtop = get_string('top', 'book');
add_to_log($course->id, 'book', 'generateimscp', 'generateimscp.php?id='.$cm->id, $book->id, $cm->id);
/// Get all the chapters
$chapters = get_records('book_chapters', 'bookid', $book->id, 'pagenum');
/// Generate the manifest and all the contents
chapters2imsmanifest($chapters, $book, $cm);
/// Now zip everything
make_upload_directory('temp');
$zipfile = $CFG->dataroot . "/temp/". time() . '.zip';
$files = get_directory_list($CFG->dataroot . "/$cm->course/moddata/book/$book->id", basename($zipfile), false, true, true);
foreach ($files as $key => $value) {
$files[$key] = $CFG->dataroot . "/$cm->course/moddata/book/$book->id/" . $value;
}
zip_files($files, $zipfile);
/// Now delete all the temp dirs
delete_dir_contents($CFG->dataroot . "/$cm->course/moddata/book/$book->id");
/// Now serve the file
send_temp_file($zipfile, clean_filename($book->name) . '.zip');
/**
* This function will create the default imsmanifest plus contents for the book chapters passed as array
* Everything will be created under the book moddata file area *
*/
function chapters2imsmanifest ($chapters, $book, $cm) {
global $CFG;
/// Init imsmanifest and others
$imsmanifest = '';
$imsitems = '';
$imsresources = '';
/// Moodle and Book version
$moodle_release = $CFG->release;
$moodle_version = $CFG->version;
$book_version = get_field('modules', 'version', 'name', 'book');
/// Load manifest header
$imsmanifest .= '<?xml version="1.0" encoding="UTF-8"?>
<!-- This package has been created with Moodle ' . $moodle_release . ' (' . $moodle_version . '), Book module version ' . $book_version . ' - http://moodle.org -->
<!-- One idea and implementation by Eloy Lafuente (stronk7) and Antonio Vicent (C) 2001-3001 -->
<manifest xmlns="http://www.imsglobal.org/xsd/imscp_v1p1" xmlns:imsmd="http://www.imsglobal.org/xsd/imsmd_v1p2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" identifier="MANIFEST-' . md5($CFG->wwwroot . '-' . $book->course . '-' . $book->id) . '" xsi:schemaLocation="http://www.imsglobal.org/xsd/imscp_v1p1 imscp_v1p1.xsd http://www.imsglobal.org/xsd/imsmd_v1p2 imsmd_v1p2p2.xsd">
<organizations default="MOODLE-' . $book->course . '-' . $book->id . '">
<organization identifier="MOODLE-' . $book->course . '-' . $book->id . '" structure="hierarchical">
<title>' . htmlspecialchars($book->name) . '</title>';
/// Create the temp directory
$moddir = "$cm->course/moddata/book/$book->id";
make_upload_directory($moddir);
/// For each chapter, create the corresponding directory and save contents there
/// To store the prev level (book only have 0 and 1)
$prevlevel = null;
foreach ($chapters as $chapter) {
/// Calculate current level ((book only have 0 and 1)
$currlevel = empty($chapter->subchapter) ? 0 : 1;
/// Based upon prevlevel and current one, decide what to close
if ($prevlevel !== null) {
/// Calculate the number of spaces (for visual xml-text formating)
$prevspaces = substr(' ', 0, $currlevel * 2);
/// Same level, simply close the item
if ($prevlevel == $currlevel) {
$imsitems .= $prevspaces . ' </item>' . "\n";
}
/// Bigger currlevel, nothing to close
/// Smaller currlevel, close both the current item and the parent one
if ($prevlevel > $currlevel) {
$imsitems .= ' </item>' . "\n";
$imsitems .= ' </item>' . "\n";
}
}
/// Update prevlevel
$prevlevel = $currlevel;
/// Calculate the number of spaces (for visual xml-text formating)
$currspaces = substr(' ', 0, $currlevel * 2);
/// Create the static html file + local attachments (images...)
$chapterdir = "$moddir/$chapter->pagenum";
make_upload_directory($chapterdir);
$chaptercontent = chapter2html($chapter, $book->course, $book->id);
file_put_contents($CFG->dataroot . "/" . $chapterdir . "/index.html", $chaptercontent->content);
/// Add the imsitems
$imsitems .= $currspaces .' <item identifier="ITEM-' . $book->course . '-' . $book->id . '-' . $chapter->pagenum .'" isvisible="true" identifierref="RES-' . $book->course . '-' . $book->id . '-' . $chapter->pagenum . '">
' . $currspaces . ' <title>' . htmlspecialchars($chapter->title) . '</title>' . "\n";
/// Add the imsresources
/// First, check if we have localfiles
$localfiles = '';
if ($chaptercontent->localfiles) {
foreach ($chaptercontent->localfiles as $localfile) {
$localfiles .= "\n" . ' <file href="' . $chapter->pagenum . '/' . $localfile . '" />';
}
}
/// Now add the dependency to css
$cssdependency = "\n" . ' <dependency identifierref="RES-' . $book->course . '-' . $book->id . '-css" />';
/// Now build the resources section
$imsresources .= ' <resource identifier="RES-' . $book->course . '-' . $book->id . '-' . $chapter->pagenum . '" type="webcontent" xml:base="' . $chapter->pagenum . '/" href="index.html">
<file href="' . $chapter->pagenum . '/index.html" />' . $localfiles . $cssdependency . '
</resource>' . "\n";
}
/// Close items (the latest chapter)
/// Level 1, close 1
if ($currlevel == 0) {
$imsitems .= ' </item>' . "\n";
}
/// Level 2, close 2
if ($currlevel == 1) {
$imsitems .= ' </item>' . "\n";
$imsitems .= ' </item>' . "\n";
}
/// Define the css common resource
$cssresource = ' <resource identifier="RES-' . $book->course . '-' . $book->id . '-css" type="webcontent" xml:base="css/" href="styles.css">
<file href="css/styles.css" />
</resource>' . "\n";
/// Add imsitems to manifest
$imsmanifest .= "\n" . $imsitems;
/// Close the organization
$imsmanifest .= " </organization>
</organizations>";
/// Add resources to manifest
$imsmanifest .= "\n <resources>\n" . $imsresources . $cssresource . " </resources>";
/// Close manifest
$imsmanifest .= "\n</manifest>\n";
file_put_contents($CFG->dataroot . "/" . $moddir . '/imsmanifest.xml', $imsmanifest );
/// Now send the css resource
make_upload_directory("$moddir/css");
file_put_contents($CFG->dataroot . "/" . $moddir . "/css/styles.css", file_get_contents("$CFG->dirroot/mod/book/generateimscp.css"));
}
/**
* This function will create one chaptercontent object, with the contents converted to html and
* one array of local images to be included
*/
function chapter2html($chapter, $courseid, $bookid) {
global $CFG;
$content = '';
$content .= '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">' . "\n";
$content .= '<html>' . "\n";
$content .= '<head>' . "\n";
$content .= '<meta http-equiv="content-type" content="text/html; charset=utf-8" />' . "\n";
$content .= '<link rel="stylesheet" type="text/css" href="../css/styles.css" />' . "\n";
$content .= '<title>' . $chapter->title . '</title>' . "\n";
$content .= '</head>' . "\n";
$content .= '<body>' . "\n";
$content .= '<h1 id="header">' . $chapter->title . '</h1>' ."\n";
$options = new object();
$options->noclean = true;
$content .= format_text($chapter->content, '', $options, $courseid) . "\n";
$content .= '</body>' . "\n";
$content .= '</html>' . "\n";
/// Now look for course-files in contents
$search = array($CFG->wwwroot.'/file.php/'.$courseid,
$CFG->wwwroot.'/file.php?file=/'.$courseid);
$replace = array('$@FILEPHP@$','$@FILEPHP@$');
$content = str_replace($search, $replace, $content);
$regexp = '/\$@FILEPHP@\$(.*?)"/is';
$localfiles = array();
$basefiles = array();
preg_match_all($regexp, $content, $list);
if ($list) {
/// Build the array of local files
foreach (array_unique($list[1]) as $key => $value) {
$localfiles['<#'. $key . '#>'] = $value;
$basefiles['<#'. $key . '#>'] = basename($value);
/// Copy files to current chapter directory
if (file_exists($CFG->dataroot . '/' . $courseid . '/' . $value)) {
copy($CFG->dataroot . '/' . $courseid . '/' . $value, $CFG->dataroot . '/' . $courseid . '/moddata/book/' . $bookid . '/' . $chapter->pagenum . '/' . basename ($value));
}
}
/// Replace contents by keys
$content = str_replace($localfiles, array_keys($localfiles), $content);
/// Replace keys by basefiles
$content = str_replace(array_keys($basefiles), $basefiles, $content);
/// Delete $@FILEPHP@$
$content = str_replace('$@FILEPHP@$', '', $content);
}
add_to_log($course->id, 'book', 'generateimscp', 'tool/generateimscp/index.php?id='.$cm->id, $book->id, $cm->id);
/// Build the final object needed to have all the info in order to create the manifest
$object = new object();
$object->content = $content;
$object->localfiles = $basefiles;
$file = booktool_exportimscp_build_package($book, $context);
return $object;
}
send_stored_file($file, 10, 0, true, clean_filename($book->name).'.zip');
......@@ -26,5 +26,5 @@
defined('MOODLE_INTERNAL') || die;
$string['exportimscp:export'] = 'Export book as IMS content package';
$string['generateimscp'] = 'Generate IMS content package';
$string['pluginname'] = 'Book IMSCP export';
$string['generateimscp'] = 'Generate IMS CP';
$string['pluginname'] = 'Book IMS CP export';
......@@ -18,7 +18,7 @@
* IMSCP export lib
*
* @package booktool
* @subpackage print
* @subpackage exportimscp
* @copyright 2011 Petr Skoda {@link http://skodak.org}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
......@@ -36,16 +36,9 @@ function booktool_exportimscp_extend_settings_navigation(settings_navigation $se
$PAGE->cm->context = get_context_instance(CONTEXT_MODULE, $PAGE->cm->instance);
}
$params = $PAGE->url->params();
if (empty($params['id']) or empty($params['chapterid'])) {
return;
}
if (has_capability('booktool/exportimscp:export', $PAGE->cm->context)) {
//TODO
/// Enable the IMS CP button
//$generateimscp = ($allowexport) ? '<a title="'.get_string('generateimscp', 'booktool_exportimscp').'" href="generateimscp.php?id='.$cm->id.'"><img class="bigicon" src="'.$OUTPUT->pix_url('generateimscp', 'mod_book').'" alt="'.get_string('generateimscp', 'book').'"></img></a>' : '';
$url = new moodle_url('/mod/book/tool/exportimscp/index.php', array('id'=>$PAGE->cm->id));
$icon = new pix_icon('generate', '', 'booktool_exportimscp', array('class'=>'icon'));
$booknode->add(get_string('generateimscp', 'booktool_exportimscp'), $url, navigation_node::TYPE_SETTING, null, null, $icon);
}
}
\ No newline at end of file
<?php
// This file is part of Book plugin for Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Book imscp export lib
*
* @package booktool
* @subpackage exportimscp
* @copyright 2001-3001 Antonio Vicent {@link http://ludens.es}
* @copyright 2001-3001 Eloy Lafuente (stronk7) {@link http://contiento.com}
* @copyright 2011 Petr Skoda {@link http://skodak.org}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die;
require_once(dirname(__FILE__).'/lib.php');
require_once($CFG->dirroot.'/mod/book/locallib.php');
function booktool_exportimscp_build_package($book, $context) {
global $DB;
$fs = get_file_storage();
if ($packagefile = $fs->get_file($context->id, 'booktool_exportimscp', 'package', $book->revision, '/', 'imscp.zip')) {
return $packagefile;
}
book_preload_chapters($book); //fix structure
// prepare temp area with package contents
booktool_exportimscp_prepare_files($book, $context);
$packer = get_file_packer('application/zip');
$areafiles = $fs->get_area_files($context->id, 'booktool_exportimscp', 'temp', $book->revision, "sortorder, itemid, filepath, filename", false);
$files = array();
foreach ($areafiles as $file) {
$path = $file->get_filepath().$file->get_filename();
$path = ltrim($path, '/');
$files[$path] = $file;
}
unset($areafiles);
$packagefile = $packer->archive_to_storage($files, $context->id, 'booktool_exportimscp', 'package', $book->revision, '/', 'imscp.zip');
// drop temp area
$fs->delete_area_files($context->id, 'booktool_exportimscp', 'temp', $book->revision);
// delete older versions
$sql = "SELECT DISTINCT itemid
FROM {files}
WHERE contextid = :contextid AND component = 'booktool_exportimscp' AND itemid < :revision";
$params = array('contextid'=>$context->id, 'revision'=>$book->revision);
$revisions = $DB->get_records_sql($sql, $params);
foreach ($revisions as $rev=>$unused) {
$fs->delete_area_files($context->id, 'booktool_exportimscp', 'temp', $rev);
$fs->delete_area_files($context->id, 'booktool_exportimscp', 'package', $rev);
}
return $packagefile;
}
function booktool_exportimscp_prepare_files($book, $context) {
global $CFG, $DB;
$fs = get_file_storage();
$temp_file_record = array('contextid'=>$context->id, 'component'=>'booktool_exportimscp', 'filearea'=>'temp', 'itemid'=>$book->revision);
$chapters = $DB->get_records('book_chapters', array('bookid'=>$book->id), 'pagenum');
$chapterresources = array();
foreach ($chapters as $chapter) {
$chapterresources[$chapter->id] = array();
$files = $fs->get_area_files($context->id, 'mod_book', 'chapter', $chapter->id, "sortorder, itemid, filepath, filename", false);
foreach ($files as $file) {
$temp_file_record['filepath'] = '/'.$chapter->pagenum.$file->get_filepath();
$fs->create_file_from_storedfile($temp_file_record, $file);
$chapterresources[$chapter->id][] = $chapter->pagenum.$file->get_filepath().$file->get_filename();
}
if ($file = $fs->get_file($context->id, 'booktool_exportimscp', 'temp', $book->revision, "/$chapter->pagenum/", 'index.html')) {
// this should not exist
$file->delete();
}
$content = booktool_exportimscp_chapter_content($chapter, $context);
$index_file_record = array('contextid'=>$context->id, 'component'=>'booktool_exportimscp', 'filearea'=>'temp', 'itemid'=>$book->revision, 'filepath'=>"/$chapter->pagenum/", 'filename'=>'index.html');
$fs->create_file_from_string($index_file_record, $content);
}
$css_file_record = array('contextid'=>$context->id, 'component'=>'booktool_exportimscp', 'filearea'=>'temp', 'itemid'=>$book->revision, 'filepath'=>"/css/", 'filename'=>'styles.css');
$fs->create_file_from_pathname($css_file_record, dirname(__FILE__).'/imscp.css');
// Init imsmanifest and others
$imsmanifest = '';
$imsitems = '';
$imsresources = '';
// Moodle and Book version
$moodle_release = $CFG->release;
$moodle_version = $CFG->version;
$book_version = $DB->get_field('modules', 'version', array('name'=>'book'));
$bookname = format_string($book->name, true, array('context'=>$context));
// Load manifest header
$imsmanifest .= '<?xml version="1.0" encoding="UTF-8"?>
<!-- This package has been created with Moodle ' . $moodle_release . ' (' . $moodle_version . ') http://moodle.org/, Book module version ' . $book_version . ' - https://github.com/skodak/moodle-mod_book -->
<!-- One idea and implementation by Eloy Lafuente (stronk7) and Antonio Vicent (C) 2001-3001 -->
<manifest xmlns="http://www.imsglobal.org/xsd/imscp_v1p1" xmlns:imsmd="http://www.imsglobal.org/xsd/imsmd_v1p2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" identifier="MANIFEST-' . md5($CFG->wwwroot . '-' . $book->course . '-' . $book->id) . '" xsi:schemaLocation="http://www.imsglobal.org/xsd/imscp_v1p1 imscp_v1p1.xsd http://www.imsglobal.org/xsd/imsmd_v1p2 imsmd_v1p2p2.xsd">
<organizations default="MOODLE-' . $book->course . '-' . $book->id . '">
<organization identifier="MOODLE-' . $book->course . '-' . $book->id . '" structure="hierarchical">
<title>' . htmlspecialchars($bookname) . '</title>';
// To store the prev level (book only have 0 and 1)
$prevlevel = null;
foreach ($chapters as $chapter) {
// Calculate current level ((book only have 0 and 1)
$currlevel = empty($chapter->subchapter) ? 0 : 1;
// Based upon prevlevel and current one, decide what to close
if ($prevlevel !== null) {
// Calculate the number of spaces (for visual xml-text formating)
$prevspaces = substr(' ', 0, $currlevel * 2);
// Same level, simply close the item
if ($prevlevel == $currlevel) {
$imsitems .= $prevspaces . ' </item>' . "\n";
}
// Bigger currlevel, nothing to close
// Smaller currlevel, close both the current item and the parent one
if ($prevlevel > $currlevel) {
$imsitems .= ' </item>' . "\n";
$imsitems .= ' </item>' . "\n";
}
}
// Update prevlevel
$prevlevel = $currlevel;
// Calculate the number of spaces (for visual xml-text formating)
$currspaces = substr(' ', 0, $currlevel * 2);
$chaptertitle = format_string($chapter->title, true, array('context'=>$context));
// Add the imsitems
$imsitems .= $currspaces .' <item identifier="ITEM-' . $book->course . '-' . $book->id . '-' . $chapter->pagenum .'" isvisible="true" identifierref="RES-' . $book->course . '-' . $book->id . '-' . $chapter->pagenum . '">
' . $currspaces . ' <title>' . htmlspecialchars($chaptertitle) . '</title>' . "\n";
// Add the imsresources
// First, check if we have localfiles
$localfiles = array();
foreach ($chapterresources[$chapter->id] as $localfile) {
$localfiles[] = "\n" . ' <file href="' . $localfile . '" />';
}
// Now add the dependency to css
$cssdependency = "\n" . ' <dependency identifierref="RES-' . $book->course . '-' . $book->id . '-css" />';
// Now build the resources section
$imsresources .= ' <resource identifier="RES-' . $book->course . '-' . $book->id . '-' . $chapter->pagenum . '" type="webcontent" xml:base="' . $chapter->pagenum . '/" href="index.html">
<file href="' . $chapter->pagenum . '/index.html" />' . implode($localfiles) . $cssdependency . '
</resource>' . "\n";
}
// Close items (the latest chapter)
// Level 1, close 1
if ($currlevel == 0) {
$imsitems .= ' </item>' . "\n";
}
// Level 2, close 2
if ($currlevel == 1) {
$imsitems .= ' </item>' . "\n";
$imsitems .= ' </item>' . "\n";
}
// Define the css common resource
$cssresource = ' <resource identifier="RES-' . $book->course . '-' . $book->id . '-css" type="webcontent" xml:base="css/" href="styles.css">
<file href="css/styles.css" />
</resource>' . "\n";
// Add imsitems to manifest
$imsmanifest .= "\n" . $imsitems;
// Close the organization
$imsmanifest .= " </organization>
</organizations>";
// Add resources to manifest
$imsmanifest .= "\n <resources>\n" . $imsresources . $cssresource . " </resources>";
// Close manifest
$imsmanifest .= "\n</manifest>\n";
$manifest_file_record = array('contextid'=>$context->id, 'component'=>'booktool_exportimscp', 'filearea'=>'temp', 'itemid'=>$book->revision, 'filepath'=>"/", 'filename'=>'imsmanifest.xml');
$fs->create_file_from_string($manifest_file_record, $imsmanifest);
}
function booktool_exportimscp_chapter_content($chapter, $context) {
$options = new object();
$options->noclean = true;
$options->context = $context;
$chaptercontent = str_replace('@@PLUGINFILE@@/', '', $chapter->content);
$chaptercontent = format_text($chaptercontent, $chapter->contentformat, $options);
$chaptertitle = format_string($chapter->title, true, array('context'=>$context));
$content = '';
$content .= '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">' . "\n";
$content .= '<html>' . "\n";
$content .= '<head>' . "\n";
$content .= '<meta http-equiv="content-type" content="text/html; charset=utf-8" />' . "\n";
$content .= '<link rel="stylesheet" type="text/css" href="../css/styles.css" />' . "\n";
$content .= '<title>' . $chaptertitle . '</title>' . "\n";
$content .= '</head>' . "\n";
$content .= '<body>' . "\n";
$content .= '<h1 id="header">' . $chaptertitle . '</h1>' ."\n";
$content .= $chaptercontent . "\n";
$content .= '</body>' . "\n";
$content .= '</html>' . "\n";
return $content;
}
......@@ -15,7 +15,7 @@
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Book print plugin version info
* Book IMSCP export plugin version info
*
* @package booktool
* @subpackage exportimscp
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment