mirror of
https://github.com/moodle/moodle.git
synced 2025-02-13 12:34:28 +01:00
MDL-32709 Pre-integration trivial clean up
* 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.
This commit is contained in:
parent
079be74dd5
commit
2cd972c1c6
16
mod/book/.gitignore
vendored
16
mod/book/.gitignore
vendored
@ -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
|
@ -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
|
||||
|
@ -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()) {
|
||||
|
@ -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}
|
||||
|
Loading…
x
Reference in New Issue
Block a user