Common subdirectories: wiki.orig/backup and wiki/backup diff -u wiki.orig/comments.php wiki/comments.php --- wiki.orig/comments.php 2011-06-09 20:01:50.000000000 -0400 +++ wiki/comments.php 2011-07-03 14:30:27.000000000 -0400 @@ -59,7 +59,7 @@ require_login($course->id, true, $cm); -add_to_log($course->id, 'wiki', 'comments', 'comments.php?id=' . $cm->id, $wiki->id); +add_to_log($course->id, 'wiki', 'view comments', "comments.php?pageid=$pageid", "$page->title", $cm->id); /// Print the page header $wikipage = new page_wiki_comments($wiki, $subwiki, $cm); diff -u wiki.orig/create.php wiki/create.php --- wiki.orig/create.php 2010-11-08 19:01:50.000000000 -0500 +++ wiki/create.php 2011-07-03 14:30:27.000000000 -0400 @@ -66,10 +66,10 @@ require_login($course->id, true, $cm); -add_to_log($course->id, 'createpage', 'createpage', 'view.php?id=' . $cm->id, $wiki->id); $wikipage = new page_wiki_create($wiki, $subwiki, $cm); + if (!empty($swid)) { $wikipage->set_gid($subwiki->groupid); $wikipage->set_uid($subwiki->userid); @@ -80,22 +80,28 @@ $wikipage->set_uid($uid); } -if (!empty($title)) { - $wikipage->set_title($title); -} else { - $wikipage->set_title(get_string('newpage', 'wiki')); +if (empty($title)) { + $title = get_string('newpage', 'wiki'); } +$wikipage->set_title($title); + // set page action, and initialise moodle form $wikipage->set_action($action); switch ($action) { case 'create': - $wikipage->create_page($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); break; case 'new': if ((int)$wiki->forceformat == 1 && !empty($title)) { - $wikipage->create_page($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); } else { // create link from moodle navigation block without pagetitle $wikipage->print_header(); Common subdirectories: wiki.orig/db and wiki/db Common subdirectories: wiki.orig/diff and wiki/diff diff -u wiki.orig/diff.php wiki/diff.php --- wiki.orig/diff.php 2011-06-09 20:01:50.000000000 -0400 +++ wiki/diff.php 2011-07-03 14:38:30.000000000 -0400 @@ -74,6 +74,8 @@ $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); + $wikipage->print_header(); $wikipage->print_content(); diff -u wiki.orig/edit.php wiki/edit.php --- wiki.orig/edit.php 2011-06-16 20:01:39.000000000 -0400 +++ wiki/edit.php 2011-07-03 14:30:27.000000000 -0400 @@ -77,7 +77,6 @@ $context = get_context_instance(CONTEXT_MODULE, $cm->id); require_capability('mod/wiki:editpage', $context); -add_to_log($course->id, 'wiki', 'edit', "edit.php?id=$cm->id", "$wiki->id"); if ($option == get_string('save', 'wiki')) { if (!confirm_sesskey()) { @@ -87,6 +86,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); } else { if ($option == get_string('preview')) { if (!confirm_sesskey()) { Common subdirectories: wiki.orig/editors and wiki/editors diff -u wiki.orig/history.php wiki/history.php --- wiki.orig/history.php 2011-06-09 20:01:50.000000000 -0400 +++ wiki/history.php 2011-07-03 14:41:40.000000000 -0400 @@ -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', 'history', 'history.php?id=' . $cm->id, $wiki->id); +add_to_log($course->id, 'wiki', 'view history', "history.php?pageid=$pageid", "$page->title", $cm->id); /// Print the page header $wikipage = new page_wiki_history($wiki, $subwiki, $cm); diff -u wiki.orig/index.php wiki/index.php --- wiki.orig/index.php 2011-06-09 20:01:50.000000000 -0400 +++ wiki/index.php 2011-07-03 14:30:27.000000000 -0400 @@ -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=$course->id", ""); +add_to_log($course->id, 'wiki', 'view all', "index.php?id=$id", ""); /// Get all required stringswiki $strwikis = get_string("modulenameplural", "wiki"); diff -u wiki.orig/instancecomments.php wiki/instancecomments.php --- wiki.orig/instancecomments.php 2010-11-02 20:01:40.000000000 -0400 +++ wiki/instancecomments.php 2011-07-03 14:30:27.000000000 -0400 @@ -63,6 +63,7 @@ $comm->set_page($page); 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)) { @@ -74,9 +75,11 @@ } 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); } Common subdirectories: wiki.orig/lang and wiki/lang diff -u wiki.orig/lock.php wiki/lock.php --- wiki.orig/lock.php 2011-06-09 20:01:50.000000000 -0400 +++ wiki/lock.php 2011-07-03 14:30:27.000000000 -0400 @@ -71,11 +71,12 @@ $context = get_context_instance(CONTEXT_MODULE, $cm->id); require_capability('mod/wiki:editpage', $context); -//add_to_log($course->id, "wiki", "lock", "lock.php?id=$cm->id", "$wiki->id"); + $wikipage = new page_wiki_lock($wiki, $subwiki, $cm); $wikipage->set_page($page); + if (!empty($section)) { $wikipage->set_section($sectioncontent, $section); } diff -u wiki.orig/map.php wiki/map.php --- wiki.orig/map.php 2011-06-09 20:01:50.000000000 -0400 +++ wiki/map.php 2011-07-03 14:30:27.000000000 -0400 @@ -65,6 +65,9 @@ $wikipage->set_view($option); $wikipage->set_page($page); + +add_to_log($course->id, "wiki", "view map", "map.php?pageid=$pageid", "$page->title", $cm->id); + $wikipage->print_header(); $wikipage->print_content(); diff -u wiki.orig/overridelocks.php wiki/overridelocks.php --- wiki.orig/overridelocks.php 2010-08-12 20:01:34.000000000 -0400 +++ wiki/overridelocks.php 2011-07-03 14:30:27.000000000 -0400 @@ -67,7 +67,6 @@ $context = get_context_instance(CONTEXT_MODULE, $cm->id); require_capability('mod/wiki:overridelock', $context); -add_to_log($course->id, "wiki", "overridelocks", "overridelocks.php?id=$cm->id", "$wiki->id"); if (!confirm_sesskey()) { print_error(get_string('invalidsesskey', 'wiki')); @@ -80,6 +79,8 @@ $wikipage->set_section($sectioncontent, $section); } +add_to_log($course->id, "wiki", "overridelocks", "view.php?pageid=$pageid", "$page->title", $cm->id); + $wikipage->print_header(); $wikipage->print_content(); diff -u wiki.orig/pagelib.php wiki/pagelib.php --- wiki.orig/pagelib.php 2011-07-01 18:25:24.000000000 -0400 +++ wiki/pagelib.php 2011-07-03 14:30:27.000000000 -0400 @@ -191,7 +191,7 @@ $this->title = $page->title; $PAGE->set_title($this->title); } - + /** * Method to set the current page title. * This method must be called when the current page is not created yet. @@ -205,6 +205,10 @@ $PAGE->set_title($this->title); } + function get_title() { + return $this->title; + } + /** * Method to set current group id * @param int $gid Current group id @@ -917,12 +921,17 @@ $swid = wiki_add_subwiki($PAGE->activityrecord->id, $this->gid, $this->uid); $this->subwiki = wiki_get_subwiki($swid); } + if ($data) { + $this->set_title($data->pagetitle); $id = wiki_create_page($this->subwiki->id, $data->pagetitle, $data->pageformat, $USER->id); } else { + $this->set_title($pagetitle); $id = wiki_create_page($this->subwiki->id, $pagetitle, $PAGE->activityrecord->defaultformat, $USER->id); } - redirect($CFG->wwwroot . '/mod/wiki/edit.php?pageid=' . $id); + + $this->page = $id; + return $id; } } Common subdirectories: wiki.orig/parser and wiki/parser Common subdirectories: wiki.orig/pix and wiki/pix diff -u wiki.orig/prettyview.php wiki/prettyview.php --- wiki.orig/prettyview.php 2011-06-09 20:01:50.000000000 -0400 +++ wiki/prettyview.php 2011-07-03 14:30:27.000000000 -0400 @@ -56,12 +56,12 @@ $context = get_context_instance(CONTEXT_MODULE, $cm->id); require_capability('mod/wiki:viewpage', $context); -add_to_log($course->id, "wiki", "view", "prettyview.php?pageid=$pageid", "$wiki->id"); - $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); + $wikipage->print_header(); $wikipage->print_content(); $wikipage->print_footer(); diff -u wiki.orig/restoreversion.php wiki/restoreversion.php --- wiki.orig/restoreversion.php 2010-08-12 20:01:35.000000000 -0400 +++ wiki/restoreversion.php 2011-07-03 14:30:27.000000000 -0400 @@ -60,8 +60,6 @@ require_login($course->id, true, $cm); -add_to_log($course->id, "restore", "restore", "view.php?id=$cm->id", "$wiki->id"); - if ($confirm) { $wikipage = new page_wiki_confirmrestore($wiki, $subwiki, $cm); @@ -76,6 +74,8 @@ } +add_to_log($course->id, "wiki", "restore", "view.php?pageid=$pageid", "$page->title : $versionid", $cm->id); + $wikipage->print_header(); $wikipage->print_content(); Common subdirectories: wiki.orig/simpletest and wiki/simpletest diff -u wiki.orig/view.php wiki/view.php --- wiki.orig/view.php 2011-06-09 20:01:50.000000000 -0400 +++ wiki/view.php 2011-07-03 14:30:27.000000000 -0400 @@ -256,7 +256,6 @@ $context = get_context_instance(CONTEXT_MODULE, $cm->id); require_capability('mod/wiki:viewpage', $context); -add_to_log($course->id, 'wiki', 'view', 'view.php?id=' . $cm->id, $wiki->id); if (($edit != - 1) and $PAGE->user_allowed_editing()) { $USER->editing = $edit; @@ -276,6 +275,15 @@ $wikipage->set_gid($currentgroup); $wikipage->set_page($page); + +if($pageid) { + add_to_log($course->id, 'wiki', 'view', "view.php?pageid=$pageid", "$page->title", $cm->id); +} else if($id) { + add_to_log($course->id, 'wiki', 'view', "view.php?id=$id", "$page->title", $cm->id); +} else if($wid && $title) { + add_to_log($course->id, 'wiki', 'view', "view.php?wid=$wid&title=$title", "$page->title", $cm->id); +} + $wikipage->print_header(); $wikipage->print_content(); diff -u wiki.orig/viewversion.php wiki/viewversion.php --- wiki.orig/viewversion.php 2011-06-09 20:01:50.000000000 -0400 +++ wiki/viewversion.php 2011-07-03 14:30:27.000000000 -0400 @@ -67,6 +67,8 @@ $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); + $wikipage->print_header(); $wikipage->print_content();