Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-26674 wiki2.0: cleaned wiki event logging patch

  • Loading branch information...
commit fe8d2efe52210b3c7c95e2f6f83ab04da3ad07ca 1 parent f346322
@rajeshtaneja rajeshtaneja authored
View
3  mod/wiki/admin.php
@@ -58,7 +58,8 @@
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
require_capability('mod/wiki:managewiki', $context);
-add_to_log($course->id, "wiki", "admin", "admin.php?id=$cm->id", "$wiki->id");
+
+add_to_log($course->id, "wiki", "admin", "admin.php?pageid=".$page->id, $page->id, $cm->id);
//Delete page if a page ID to delete was supplied
if (!empty($delete) && confirm_sesskey()) {
View
2  mod/wiki/comments.php
@@ -59,7 +59,7 @@
require_login($course->id, true, $cm);
-add_to_log($course->id, 'wiki', 'view comments', "comments.php?pageid=$pageid", $page->title, $cm->id);
+add_to_log($course->id, 'wiki', 'comments', "comments.php?pageid=".$pageid, $pageid, $cm->id);
/// Print the page header
$wikipage = new page_wiki_comments($wiki, $subwiki, $cm);
View
10 mod/wiki/create.php
@@ -89,16 +89,14 @@
switch ($action) {
case 'create':
$newpageid = $wikipage->create_page($title);
- $newtitle = $wikipage->get_title();
- add_to_log($course->id, 'wiki', 'add page', "view.php?pageid=$newpageid", "$newtitle", $cm->id);
- redirect($CFG->wwwroot . '/mod/wiki/edit.php?pageid=' . $newpageid);
+ add_to_log($course->id, 'wiki', 'add page', "view.php?pageid=".$newpageid, $newpageid, $cm->id);
+ redirect($CFG->wwwroot . '/mod/wiki/edit.php?pageid='.$newpageid);
break;
case 'new':
if ((int)$wiki->forceformat == 1 && !empty($title)) {
$newpageid = $wikipage->create_page($title);
- $newtitle = $wikipage->get_title();
- add_to_log($course->id, 'wiki', 'add page', "view.php?pageid=$newpageid", "$newtitle", $cm->id);
- redirect($CFG->wwwroot . '/mod/wiki/edit.php?pageid=' . $newpageid);
+ add_to_log($course->id, 'wiki', 'add page', "view.php?pageid=".$newpageid, $newpageid, $cm->id);
+ redirect($CFG->wwwroot . '/mod/wiki/edit.php?pageid='.$newpageid);
} else {
// create link from moodle navigation block without pagetitle
$wikipage->print_header();
View
3  mod/wiki/diff.php
@@ -67,14 +67,13 @@
}
require_login($course->id, true, $cm);
-add_to_log($course->id, "wiki", "diff", "diff.php?id=$cm->id", "$wiki->id");
$wikipage = new page_wiki_diff($wiki, $subwiki, $cm);
$wikipage->set_page($page);
$wikipage->set_comparison($compare, $comparewith);
-add_to_log($course->id, "wiki", "view diff", "diff.php?pageid=$pageid&comparewith=$comparewith&compare=$compare", "$page->title", $cm->id);
+add_to_log($course->id, "wiki", "diff", "diff.php?pageid=".$pageid."&comparewith=".$comparewith."&compare=".$compare, $pageid, $cm->id);
$wikipage->print_header();
View
2  mod/wiki/edit.php
@@ -85,7 +85,7 @@
$wikipage->set_page($page);
$wikipage->set_newcontent($newcontent);
$wikipage->set_upload(true);
- add_to_log($course->id, 'wiki', 'update', "view.php?pageid=$pageid", "$page->title", $cm->id);
+ add_to_log($course->id, 'wiki', 'edit', "view.php?pageid=".$pageid, $pageid, $cm->id);
} else {
if ($option == get_string('preview')) {
if (!confirm_sesskey()) {
View
2  mod/wiki/history.php
@@ -61,7 +61,7 @@
require_login($course->id, true, $cm);
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
require_capability('mod/wiki:viewpage', $context);
-add_to_log($course->id, 'wiki', 'view history', "history.php?pageid=$pageid", "$page->title", $cm->id);
+add_to_log($course->id, 'wiki', 'history', "history.php?pageid=".$pageid, $pageid, $cm->id);
/// Print the page header
$wikipage = new page_wiki_history($wiki, $subwiki, $cm);
View
2  mod/wiki/index.php
@@ -45,7 +45,7 @@
$PAGE->set_pagelayout('incourse');
$context = get_context_instance(CONTEXT_COURSE, $course->id);
-add_to_log($course->id, 'wiki', 'view all', "index.php?id=$id", "");
+add_to_log($course->id, 'wiki', 'view', "index.php?id=".$id, "");
/// Get all required stringswiki
$strwikis = get_string("modulenameplural", "wiki");
View
4 mod/wiki/instancecomments.php
@@ -82,7 +82,6 @@
}
if ($action == 'delete') {
- add_to_log($course->id, 'wiki', 'delete comment', "comments.php?pageid=$pageid", "$page->title", $cm->id);
$comm->set_action($action, $commentid, 0);
} else {
if (empty($newcontent)) {
@@ -94,14 +93,13 @@
}
if ($action == 'edit') {
- add_to_log($course->id, 'wiki', 'update comment', "comments.php?pageid=$pageid", "$page->title", $cm->id);
$comm->set_action($action, $id, $content);
} else {
- add_to_log($course->id, 'wiki', 'add comment', "comments.php?pageid=$pageid", "$page->title", $cm->id);
$action = 'add';
$comm->set_action($action, 0, $content);
}
}
+add_to_log($course->id, 'wiki', 'comment', "comments.php?pageid=".$pageid, $pageid, $cm->id);
$comm->print_header();
$comm->print_content();
View
7 mod/wiki/map.php
@@ -56,14 +56,11 @@
require_login($course->id, true, $cm);
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
require_capability('mod/wiki:viewpage', $context);
-add_to_log($course->id, "wiki", "map", "map.php?id=$cm->id", "$wiki->id");
-/// Print page header
-
-/// Finish the page
$wikipage = new page_wiki_map($wiki, $subwiki, $cm);
-add_to_log($course->id, "wiki", "view map", "map.php?pageid=$pageid", "$page->title", $cm->id);
+add_to_log($course->id, "wiki", "map", "map.php?pageid=".$pageid, $pageid, $cm->id);
+// Print page header
$wikipage->set_view($option);
$wikipage->set_page($page);
$wikipage->print_header();
View
2  mod/wiki/overridelocks.php
@@ -77,7 +77,7 @@
if (!empty($section)) {
$wikipage->set_section($sectioncontent, $section);
}
-add_to_log($course->id, "wiki", "overridelocks", "view.php?pageid=$pageid", "$page->title", $cm->id);
+add_to_log($course->id, "wiki", "overridelocks", "view.php?pageid=".$pageid, $pageid, $cm->id);
$wikipage->print_header();
View
8 mod/wiki/pagelib.php
@@ -221,14 +221,6 @@ function set_title($title) {
}
/**
- * returns title of the wiki page
- * @return string
- */
- function get_title() {
- return $this->title;
- }
-
- /**
* Method to set current group id
* @param int $gid Current group id
*/
View
2  mod/wiki/prettyview.php
@@ -59,7 +59,7 @@
$wikipage = new page_wiki_prettyview($wiki, $subwiki, $cm);
$wikipage->set_page($page);
-add_to_log($course->id, "wiki", "view pretty", "prettyview.php?pageid=$pageid", "$page->title", $cm->id);
+add_to_log($course->id, "wiki", "view", "prettyview.php?pageid=".$pageid, $pageid, $cm->id);
$wikipage->print_header();
$wikipage->print_content();
View
2  mod/wiki/restoreversion.php
@@ -75,7 +75,7 @@
$wikipage->set_versionid($versionid);
}
-add_to_log($course->id, "wiki", "restore", "view.php?pageid=$pageid", "$page->title : $versionid", $cm->id);
+add_to_log($course->id, "wiki", "restore", "view.php?pageid=".$pageid, $pageid, $cm->id);
$wikipage->print_header();
$wikipage->print_content();
View
6 mod/wiki/view.php
@@ -293,11 +293,11 @@
$wikipage->set_page($page);
if($pageid) {
- add_to_log($course->id, 'wiki', 'view', "view.php?pageid=$pageid", "$page->title", $cm->id);
+ add_to_log($course->id, 'wiki', 'view', "view.php?pageid=".$pageid, $pageid, $cm->id);
} else if($id) {
- add_to_log($course->id, 'wiki', 'view', "view.php?id=$id", "$page->title", $cm->id);
+ add_to_log($course->id, 'wiki', 'view', "view.php?id=".$id, $id, $cm->id);
} else if($wid && $title) {
- add_to_log($course->id, 'wiki', 'view', "view.php?wid=$wid&title=$title", "$page->title", $cm->id);
+ add_to_log($course->id, 'wiki', 'view', "view.php?wid=".$wid."&title=".$title, $wid, $cm->id);
}
$wikipage->print_header();
View
5 mod/wiki/viewversion.php
@@ -59,16 +59,15 @@
$course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
require_login($course->id, true, $cm);
-add_to_log($course->id, "wiki", "history", "history.php?id=$cm->id", "$wiki->id");
-/// Print the page header
$wikipage = new page_wiki_viewversion($wiki, $subwiki, $cm);
$wikipage->set_page($page);
$wikipage->set_versionid($versionid);
-add_to_log($course->id, "wiki", "view version", "viewversion.php?pageid=$pageid&versionid=$versionid", "$page->title", $cm->id);
+add_to_log($course->id, "wiki", "history", "viewversion.php?pageid=".$pageid."&versionid=".$versionid, $pageid, $cm->id);
+// Print the page header
$wikipage->print_header();
$wikipage->print_content();
Please sign in to comment.
Something went wrong with that request. Please try again.