Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-43398 Wiki: Choose... options cause SQL errors or seen inappropri…

…ate.
  • Loading branch information...
commit ec7de91744fe08c31136a905e0cedeb64664eb96 1 parent b8604eb
@mouneyrac mouneyrac authored marinaglancy committed
Showing with 9 additions and 8 deletions.
  1. +1 −4 mod/wiki/pagelib.php
  2. +8 −4 mod/wiki/renderer.php
View
5 mod/wiki/pagelib.php
@@ -1425,14 +1425,11 @@ function print_content() {
echo $this->wikioutput->menu_map($this->page->id, $this->view);
$this->print_index_content();
break;
- case 5:
- echo $this->wikioutput->menu_map($this->page->id, $this->view);
- $this->print_page_list_content();
- break;
case 6:
echo $this->wikioutput->menu_map($this->page->id, $this->view);
$this->print_updated_content();
break;
+ case 5:
default:
echo $this->wikioutput->menu_map($this->page->id, $this->view);
$this->print_page_list_content();
View
12 mod/wiki/renderer.php
@@ -344,7 +344,7 @@ public function wiki_print_subwiki_selector($wiki, $subwiki, $page, $pagetype =
$baseurl->params($params);
$name = 'uid';
$selected = $subwiki->userid;
- echo $this->output->single_select($baseurl, $name, $options, $selected);
+ echo $this->output->single_select($baseurl, $name, $options, $selected, null);
echo $this->output->container_end();
}
return;
@@ -404,7 +404,7 @@ public function wiki_print_subwiki_selector($wiki, $subwiki, $page, $pagetype =
$baseurl->params($params);
$name = 'groupanduser';
$selected = $subwiki->groupid . '-' . $subwiki->userid;
- echo $this->output->single_select($baseurl, $name, $options, $selected);
+ echo $this->output->single_select($baseurl, $name, $options, $selected, null);
echo $this->output->container_end();
return;
@@ -451,7 +451,7 @@ public function wiki_print_subwiki_selector($wiki, $subwiki, $page, $pagetype =
$baseurl->params($params);
$name = 'groupanduser';
$selected = $subwiki->groupid . '-' . $subwiki->userid;
- echo $this->output->single_select($baseurl, $name, $options, $selected);
+ echo $this->output->single_select($baseurl, $name, $options, $selected, null);
echo $this->output->container_end();
return;
@@ -469,6 +469,10 @@ public function wiki_print_subwiki_selector($wiki, $subwiki, $page, $pagetype =
}
function menu_map($pageid, $currentselect) {
+ if (empty($currentselect)) {
+ // The wiki uses digit number to match the options and 5 is the default one.
+ $currentselect = 5;
+ }
$options = array('contributions', 'links', 'orphaned', 'pageindex', 'pagelist', 'updatedpages');
$items = array();
foreach ($options as $opt) {
@@ -509,7 +513,7 @@ function menu_admin($pageid, $currentselect) {
foreach ($items as $key => $item) {
$selectoptions[$key + 1] = $item;
}
- $select = new single_select(new moodle_url('/mod/wiki/admin.php', array('pageid' => $pageid)), 'option', $selectoptions, $currentselect);
+ $select = new single_select(new moodle_url('/mod/wiki/admin.php', array('pageid' => $pageid)), 'option', $selectoptions, $currentselect, null);
$select->label = get_string('adminmenu', 'wiki') . ': ';
return $this->output->container($this->output->render($select), 'midpad');
}
Please sign in to comment.
Something went wrong with that request. Please try again.