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
131688cf
Commit
131688cf
authored
Oct 05, 2012
by
Ankit Agarwal
Browse files
MDL-34274 book: Adding ability to log chapter view and chapter print
parent
ccd90e76
Changes
6
Hide whitespace changes
Inline
Side-by-side
mod/book/db/log.php
View file @
131688cf
...
...
@@ -25,7 +25,8 @@
defined
(
'MOODLE_INTERNAL'
)
||
die
();
$logs
=
array
(
array
(
'module'
=>
'book'
,
'action'
=>
'add'
,
'mtable'
=>
'book'
,
'field'
=>
'name'
),
array
(
'module'
=>
'book'
,
'action'
=>
'update'
,
'mtable'
=>
'book'
,
'field'
=>
'name'
),
array
(
'module'
=>
'book'
,
'action'
=>
'view'
,
'mtable'
=>
'book'
,
'field'
=>
'name'
)
array
(
'module'
=>
'book'
,
'action'
=>
'add'
,
'mtable'
=>
'book'
,
'field'
=>
'name'
),
array
(
'module'
=>
'book'
,
'action'
=>
'update'
,
'mtable'
=>
'book'
,
'field'
=>
'name'
),
array
(
'module'
=>
'book'
,
'action'
=>
'view'
,
'mtable'
=>
'book'
,
'field'
=>
'name'
),
array
(
'module'
=>
'book'
,
'action'
=>
'view chapter'
,
'mtable'
=>
'book_chapters'
,
'field'
=>
'title'
)
);
mod/book/tool/print/db/log.php
View file @
131688cf
...
...
@@ -25,5 +25,6 @@
defined
(
'MOODLE_INTERNAL'
)
||
die
();
$logs
=
array
(
array
(
'module'
=>
'book'
,
'action'
=>
'print'
,
'mtable'
=>
'book'
,
'field'
=>
'name'
)
array
(
'module'
=>
'book'
,
'action'
=>
'print'
,
'mtable'
=>
'book'
,
'field'
=>
'name'
),
array
(
'module'
=>
'book'
,
'action'
=>
'print chapter'
,
'mtable'
=>
'book_chapters'
,
'field'
=>
'title'
)
);
mod/book/tool/print/index.php
View file @
131688cf
...
...
@@ -77,7 +77,7 @@ if ($chapter) {
require_capability
(
'mod/book:viewhiddenchapters'
,
$context
);
}
add_to_log
(
$course
->
id
,
'book'
,
'print'
,
'tool/print/index.php?id='
.
$cm
->
id
.
'&chapterid='
.
$chapter
->
id
,
$
book
->
id
,
$cm
->
id
);
add_to_log
(
$course
->
id
,
'book'
,
'print
chapter
'
,
'tool/print/index.php?id='
.
$cm
->
id
.
'&chapterid='
.
$chapter
->
id
,
$
chapter
->
id
,
$cm
->
id
);
// page header
?>
...
...
mod/book/tool/print/version.php
View file @
131688cf
...
...
@@ -25,5 +25,5 @@
defined
(
'MOODLE_INTERNAL'
)
||
die
;
$plugin
->
component
=
'booktool_print'
;
// Full name of the plugin (used for diagnostics)
$plugin
->
version
=
2012
0617
00
;
// The current plugin version (Date: YYYYMMDDXX)
$plugin
->
version
=
2012
1005
00
;
// The current plugin version (Date: YYYYMMDDXX)
$plugin
->
requires
=
2012061700
;
// Requires this Moodle version
mod/book/version.php
View file @
131688cf
...
...
@@ -25,6 +25,6 @@
defined
(
'MOODLE_INTERNAL'
)
||
die
;
$module
->
component
=
'mod_book'
;
// Full name of the plugin (used for diagnostics)
$module
->
version
=
2012
0904
00
;
// The current module version (Date: YYYYMMDDXX)
$module
->
version
=
2012
1005
00
;
// The current module version (Date: YYYYMMDDXX)
$module
->
requires
=
2012061700
;
// Requires this Moodle version
$module
->
cron
=
0
;
// Period for cron to check this module (secs)
mod/book/view.php
View file @
131688cf
...
...
@@ -75,6 +75,7 @@ if ($allowedit and !$chapters) {
}
// Check chapterid and read chapter data
if
(
$chapterid
==
'0'
)
{
// Go to first chapter if no given.
add_to_log
(
$course
->
id
,
'book'
,
'view'
,
'view.php?id='
.
$cm
->
id
,
$book
->
id
,
$cm
->
id
);
foreach
(
$chapters
as
$ch
)
{
if
(
$edit
)
{
$chapterid
=
$ch
->
id
;
...
...
@@ -106,7 +107,7 @@ unset($chapterid);
// Security checks END.
add_to_log
(
$course
->
id
,
'book'
,
'view'
,
'view.php?id='
.
$cm
->
id
.
'&chapterid='
.
$chapter
->
id
,
$
book
->
id
,
$cm
->
id
);
add_to_log
(
$course
->
id
,
'book'
,
'view
chapter
'
,
'view.php?id='
.
$cm
->
id
.
'&chapterid='
.
$chapter
->
id
,
$
chapter
->
id
,
$cm
->
id
);
// Read standard strings.
$strbooks
=
get_string
(
'modulenameplural'
,
'mod_book'
);
...
...
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