This commit is contained in:
Sara Arjona 2024-03-21 17:00:32 +01:00
commit 578226b8fa
No known key found for this signature in database
6 changed files with 52 additions and 38 deletions

View File

@ -0,0 +1,38 @@
<?php
// This file is part of 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/>.
/**
* List of deprecated mod_book functions
*
* @package mod_book
* @copyright 2024 Paul Holden <paulh@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* @deprecated since Moodle 3.8
*/
function book_scale_used() {
throw new coding_exception('book_scale_used() can not be used anymore. Plugins can implement ' .
'<modname>_scale_used_anywhere, all implementations of <modname>_scale_used are now ignored');
}
/**
* @deprecated since Moodle 4.0
*/
function book_get_nav_types() {
throw new coding_exception(__FUNCTION__ . '() has been removed.');
}

View File

@ -72,14 +72,11 @@ $string['search:activity'] = 'Book - resource information';
$string['search:chapter'] = 'Book - chapters';
$string['showchapter'] = 'Show chapter "{$a}"';
$string['subchapter'] = 'Subchapter';
$string['navimages'] = 'Images';
$string['navoptions'] = 'Available options for navigational links';
$string['navoptions_desc'] = 'Options for displaying navigation on the book pages';
$string['navstyle'] = 'Style of navigation';
$string['navstyle_help'] = '* Images - Icons are used for navigation
* Text - Chapter titles are used for navigation';
$string['navtext'] = 'Text';
$string['navtoc'] = 'TOC Only';
$string['nocontent'] = 'No content has been added to this book yet.';
$string['numbering'] = 'Chapter formatting';
$string['numbering_help'] = '* None - Chapter and subchapter titles have no formatting
@ -117,3 +114,8 @@ $string['subplugintype_booktool_plural'] = 'Book tools';
$string['removeallbooktags'] = 'Remove all book tags';
$string['tagarea_book_chapters'] = 'Book chapters';
$string['tagsdeleted'] = 'Book tags have been deleted';
// Deprecated since Moodle 4.4.
$string['navimages'] = 'Images';
$string['navtext'] = 'Text';
$string['navtoc'] = 'TOC Only';

View File

@ -0,0 +1,3 @@
navimages,mod_book
navtext,mod_book
navtoc,mod_book

View File

@ -24,6 +24,8 @@
defined('MOODLE_INTERNAL') || die;
require_once(__DIR__ . '/deprecatedlib.php');
/**
* Returns list of available numbering types
* @return array
@ -41,23 +43,6 @@ function book_get_numbering_types() {
);
}
/**
* Returns list of available navigation link types.
*
* @deprecated since Moodle 4.0. MDL-72376.
* @return array
*/
function book_get_nav_types() {
debugging("book_get_nav_types() is deprecated. There is no replacement. Navigation is now only next and previous.");
require_once(__DIR__.'/locallib.php');
return array (
BOOK_LINK_TOCONLY => get_string('navtoc', 'mod_book'),
BOOK_LINK_IMAGE => get_string('navimages', 'mod_book'),
BOOK_LINK_TEXT => get_string('navtext', 'mod_book'),
);
}
/**
* Returns list of available navigation link CSS classes.
* @return array
@ -217,14 +202,6 @@ function book_grades($bookid) {
return null;
}
/**
* @deprecated since Moodle 3.8
*/
function book_scale_used() {
throw new coding_exception('book_scale_used() can not be used anymore. Plugins can implement ' .
'<modname>_scale_used_anywhere, all implementations of <modname>_scale_used are now ignored');
}
/**
* Checks if scale is being used by any instance of book
*

View File

@ -39,16 +39,6 @@ define('BOOK_NUM_NUMBERS', '1');
define('BOOK_NUM_BULLETS', '2');
define('BOOK_NUM_INDENTED', '3');
/**
* The following defines are used to define the navigation style used within a book.
* BOOK_LINK_TOCONLY Only the table of contents is shown, in a side region.
* BOOK_LINK_IMAGE Arrows link to previous/next/exit pages, in addition to the TOC.
* BOOK_LINK_TEXT Page names and arrows link to previous/next/exit pages, in addition to the TOC.
*/
define ('BOOK_LINK_TOCONLY', '0');
define ('BOOK_LINK_IMAGE', '1');
define ('BOOK_LINK_TEXT', '2');
/**
* Preload book chapters and fix toc structure if necessary.
*

View File

@ -1,5 +1,9 @@
This files describes API changes in the book code.
=== 4.4 ===
* The previously deprecated `book_get_nav_types` method has been removed, along with the `BOOK_LINK_*` constants
=== 4.0 ===
* book_get_nav_types() has been deprecated. Related settings have been removed. The navigation is now set to only "next" and