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
794604db
Commit
794604db
authored
May 21, 2019
by
Mihail Geshoski
Committed by
Juan Leyva
Aug 15, 2019
Browse files
MDL-65653 book: Display hidden chapters in WS when user has capability
parent
8e9e9a5f
Changes
2
Hide whitespace changes
Inline
Side-by-side
course/externallib.php
View file @
794604db
...
...
@@ -489,6 +489,7 @@ class core_course_external extends external_api {
VALUE_OPTIONAL
),
'repositorytype'
=>
new
external_value
(
PARAM_PLUGIN
,
'The repository type for external files.'
,
VALUE_OPTIONAL
),
'ishidden'
=>
new
external_value
(
PARAM_BOOL
,
'Whether the content is hidden.'
,
VALUE_OPTIONAL
),
// copyright related info
'userid'
=>
new
external_value
(
PARAM_INT
,
'User who added this content to moodle'
),
...
...
mod/book/lib.php
View file @
794604db
...
...
@@ -570,7 +570,7 @@ function book_export_contents($cm, $baseurl) {
$currentchapter
=
0
;
foreach
(
$chapters
as
$chapter
)
{
if
(
$chapter
->
hidden
)
{
if
(
$chapter
->
hidden
&&
!
has_capability
(
'mod/book:viewhiddenchapters'
,
$context
)
)
{
continue
;
}
...
...
@@ -612,6 +612,7 @@ function book_export_contents($cm, $baseurl) {
$chapterindexfile
[
'author'
]
=
null
;
$chapterindexfile
[
'license'
]
=
null
;
$chapterindexfile
[
'tags'
]
=
\
core_tag\external\util
::
get_item_tags
(
'mod_book'
,
'book_chapters'
,
$chapter
->
id
);
$chapterindexfile
[
'ishidden'
]
=
(
bool
)
$chapter
->
hidden
;
$contents
[]
=
$chapterindexfile
;
// Chapter files (images usually).
...
...
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