Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
moodle
moodle
Commits
63d7b1ac
Commit
63d7b1ac
authored
Sep 05, 2016
by
Andrew Nicols
Browse files
MDL-42041 mod_book: Add Turn Editing On to page body
parent
5c33a0db
Changes
1
Hide whitespace changes
Inline
Side-by-side
mod/book/lib.php
View file @
63d7b1ac
...
...
@@ -291,7 +291,7 @@ function book_supports($feature) {
* @return void
*/
function
book_extend_settings_navigation
(
settings_navigation
$settingsnav
,
navigation_node
$booknode
)
{
global
$USER
,
$PAGE
;
global
$USER
,
$PAGE
,
$OUTPUT
;
$plugins
=
core_component
::
get_plugin_list
(
'booktool'
);
foreach
(
$plugins
as
$plugin
=>
$dir
)
{
...
...
@@ -306,7 +306,8 @@ function book_extend_settings_navigation(settings_navigation $settingsnav, navig
$params
=
$PAGE
->
url
->
params
();
if
(
!
empty
(
$params
[
'id'
])
and
!
empty
(
$params
[
'chapterid'
])
and
has_capability
(
'mod/book:edit'
,
$PAGE
->
cm
->
context
))
{
if
(
$PAGE
->
cm
->
modname
===
'book'
and
!
empty
(
$params
[
'id'
])
and
!
empty
(
$params
[
'chapterid'
])
and
has_capability
(
'mod/book:edit'
,
$PAGE
->
cm
->
context
))
{
if
(
!
empty
(
$USER
->
editing
))
{
$string
=
get_string
(
"turneditingoff"
);
$edit
=
'0'
;
...
...
@@ -316,6 +317,7 @@ function book_extend_settings_navigation(settings_navigation $settingsnav, navig
}
$url
=
new
moodle_url
(
'/mod/book/view.php'
,
array
(
'id'
=>
$params
[
'id'
],
'chapterid'
=>
$params
[
'chapterid'
],
'edit'
=>
$edit
,
'sesskey'
=>
sesskey
()));
$booknode
->
add
(
$string
,
$url
,
navigation_node
::
TYPE_SETTING
);
$PAGE
->
set_button
(
$OUTPUT
->
single_button
(
$url
,
$string
));
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment