Skip to content

Commit

Permalink
MDL-22449, improve wiki help info
Browse files Browse the repository at this point in the history
  • Loading branch information
Dongsheng Cai committed Nov 17, 2010
1 parent d4f866e commit 6f1b029
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
13 changes: 10 additions & 3 deletions mod/wiki/edit_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,21 @@ protected function definition() {
$fileitemid = $this->_customdata['fileitemid'];
}

if (isset($this->_customdata['pagetitle'])) {
$pagetitle = get_string('editingpage', 'wiki', $this->_customdata['pagetitle']);
} else {
$pagetitle = get_string('editing', 'wiki');
}

//editor
$mform->addElement('header', 'general', get_string('general'));
$mform->addElement('header', 'general', $pagetitle);

$fieldname = get_string('format' . $format, 'wiki');
if ($format != 'html') {
$mform->addElement('wikieditor', 'newcontent', get_string('content'), array('cols' => 50, 'rows' => 20, 'wiki_format' => $format));
$mform->addElement('wikieditor', 'newcontent', $fieldname, array('cols' => 50, 'rows' => 20, 'wiki_format' => $format));
$mform->addHelpButton('newcontent', 'format'.$format, 'wiki');
} else {
$mform->addElement('editor', 'newcontent_editor', get_string('content'), null, page_wiki_edit::$attachmentoptions);
$mform->addElement('editor', 'newcontent_editor', $fieldname, null, page_wiki_edit::$attachmentoptions);
$mform->addHelpButton('newcontent_editor', 'formathtml', 'wiki');

}
Expand Down
2 changes: 2 additions & 0 deletions mod/wiki/lang/en/wiki.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@
$string['edit'] = 'Edit';
$string['editcomment'] = 'Edit comment';
$string['editblocks'] = 'Turn edit blocks on';
$string['editing'] = 'Editing wiki page';
$string['editingcomment'] = 'Editing comment';
$string['editingpage'] = 'Editing this page \'{$a}\'';
$string['editblocks'] = 'Turn edit blocks on';
$string['filenotuploadederror'] = 'File \'{$a}\' could not be uploaded correctly.';
$string['filtername'] = 'Wiki Auto-linking';
Expand Down
2 changes: 1 addition & 1 deletion mod/wiki/pagelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ protected function print_edit($content = null) {
$url .= "&section=" . $this->section;
}

$params = array('attachmentoptions' => page_wiki_edit::$attachmentoptions, 'format' => $version->contentformat, 'version' => $versionnumber);
$params = array('attachmentoptions' => page_wiki_edit::$attachmentoptions, 'format' => $version->contentformat, 'version' => $versionnumber, 'pagetitle'=>$this->page->title);

$data = new StdClass();
$data->newcontent = $content;
Expand Down

0 comments on commit 6f1b029

Please sign in to comment.