MDL-32709 Pre-integration trivial clean up
authorSam Hemelryk <sam@moodle.com>
Mon, 21 May 2012 02:06:00 +0000 (14:06 +1200)
committerSam Hemelryk <sam@moodle.com>
Mon, 21 May 2012 02:06:00 +0000 (14:06 +1200)
* Added a comment for the BOOK_NUM_* defines.
* Fixed broken redirects in tool/importhtml/index.php
* Fixed typo in book_preload_chapters [subchpaters => subchapters]
* Fixed copy paste docblock error in tool/print/locallib.php
* Removed the .gitignore file as Eloy had previously mentioned that.

mod/book/.gitignore [deleted file]
mod/book/locallib.php
mod/book/tool/importhtml/index.php
mod/book/tool/print/locallib.php

diff --git a/mod/book/.gitignore b/mod/book/.gitignore
deleted file mode 100644 (file)
index 043a39b..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-# See gitignore(5) man page for more details
-#
-*~
-*.swp
-/tags
-/TAGS
-/cscope.*
-/.patches/
-/.idea/
-/nbproject/
-CVS
-.DS_Store
-/.settings/
-/.project
-/.buildpath
-/.cache
index 3ba4af5..96f9f45 100644 (file)
@@ -27,6 +27,13 @@ defined('MOODLE_INTERNAL') || die;
 require_once(dirname(__FILE__).'/lib.php');
 require_once($CFG->libdir.'/filelib.php');
 
+/**
+ * The following defines are used to define how the chapters and subchapters of a book should be displayed in that table of contents.
+ * BOOK_NUM_NONE        No special styling will applied and the editor will be able to do what ever thay want in the title
+ * BOOK_NUM_NUMBERS     Chapters and subchapters are numbered (1, 1.1, 1.2, 2, ...)
+ * BOOK_NUM_BULLETS     Subchapters are indented and displayed with bullets
+ * BOOK_NUM_INDENTED    Subchapters are indented
+ */
 define('BOOK_NUM_NONE',     '0');
 define('BOOK_NUM_NUMBERS',  '1');
 define('BOOK_NUM_BULLETS',  '2');
@@ -88,7 +95,7 @@ function book_preload_chapters($book) {
             $hidesub = $ch->hidden;
             $parent = $ch->id;
             $ch->parent = null;
-            $ch->subchpaters = array();
+            $ch->subchapters = array();
         } else {
             $ch->prev = $prevsub;
             $ch->next = null;
@@ -96,7 +103,7 @@ function book_preload_chapters($book) {
                 $chapters[$prevsub]->next = $ch->id;
             }
             $ch->parent = $parent;
-            $ch->subchpaters = null;
+            $ch->subchapters = null;
             $chapters[$parent]->subchapters[$ch->id] = $ch->id;
             if ($hidesub) {
                 // all subchapters in hidden chapter must be hidden too
index f28bd44..95bdd38 100644 (file)
@@ -61,9 +61,9 @@ $mform = new booktool_importhtml_form(null, array('id'=>$id, 'chapterid'=>$chapt
 // If data submitted, then process and store.
 if ($mform->is_cancelled()) {
     if (empty($chapter->id)) {
-        redirect("view.php?id=$cm->id");
+        redirect("/mod/book/view.php?id=$cm->id");
     } else {
-        redirect("view.php?id=$cm->id&chapterid=$chapter->id");
+        redirect("/mod/book/view.php?id=$cm->id&chapterid=$chapter->id");
     }
 
 } else if ($data = $mform->get_data()) {
index 821c278..524ad16 100644 (file)
@@ -15,7 +15,7 @@
 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 
 /**
- * HTML import lib
+ * Book print lib
  *
  * @package    booktool_print
  * @copyright  2011 Petr Skoda {@link http://skodak.org}