Permalink
Browse files

Merge branch 'wip-MDL-35653-MOODLE_22_STABLE' of git://github.com/abg…

…reeve/moodle into MOODLE_22_STABLE
  • Loading branch information...
Sam Hemelryk
Sam Hemelryk committed Dec 23, 2012
2 parents 8f1b34c + 2e22e64 commit 7093fdd80639c794d5113b1d8a1c9c5e0df93082
Showing with 5 additions and 3 deletions.
  1. +3 −3 mod/wiki/create.php
  2. +2 −0 mod/wiki/pagelib.php
View
@@ -111,14 +111,14 @@
redirect($CFG->wwwroot . '/mod/wiki/edit.php?pageid='.$newpageid);
break;
case 'new':
- if ((int)$wiki->forceformat == 1 && !empty($title)) {
+ // Go straight to editing if we know the page title and we're in force format mode.
+ if ((int)$wiki->forceformat == 1 && $title != get_string('newpage', 'wiki')) {
$newpageid = $wikipage->create_page($title);
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();
- // new page without page title
+ // Create a new page.
$wikipage->print_content($title);
}
$wikipage->print_footer();
View
@@ -936,6 +936,8 @@ function create_page($pagetitle) {
$data = $this->mform->get_data();
if (isset($data->groupinfo)) {
$groupid = $data->groupinfo;
+ } else if (!empty($this->gid)) {
+ $groupid = $this->gid;
} else {
$groupid = '0';
}

0 comments on commit 7093fdd

Please sign in to comment.