mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
MDL-22594
Putting back wiki editors and disabling file attachement
This commit is contained in:
parent
09e6fedbf1
commit
44c0751bbf
@ -33,6 +33,8 @@ class mod_wiki_create_form extends moodleform {
|
||||
$mform =& $this->_form;
|
||||
|
||||
$formats = $this->_customdata['formats'];
|
||||
$defaultformat = $this->_customdata['defaultformat'];
|
||||
$forceformat = $this->_customdata['forceformat'];
|
||||
|
||||
$mform->addElement('header', 'general', get_string('createpage', 'wiki'));
|
||||
|
||||
@ -42,13 +44,13 @@ class mod_wiki_create_form extends moodleform {
|
||||
}
|
||||
$mform->addElement('text', 'pagetitle', get_string('newpagetitle', 'wiki'), $textoptions);
|
||||
|
||||
// TODO: disable creole and nwiki format until moodle core text format lib added
|
||||
$disabled_formats = array('creole', 'nwiki');
|
||||
foreach ($formats as $format) {
|
||||
if (in_array($format, $disabled_formats)) {
|
||||
$attr = array('disabled'=>'disabled');
|
||||
} else {
|
||||
if ($format == $defaultformat) {
|
||||
$attr = array('checked'=>'checked');
|
||||
}else if (!empty($forceformat)){
|
||||
$attr = array('disabled'=>'disabled');
|
||||
} else {
|
||||
$attr = array();
|
||||
}
|
||||
$mform->addElement('radio', 'pageformat', '', get_string('format'.$format, 'wiki'), $format, $attr);
|
||||
}
|
||||
|
@ -68,20 +68,20 @@ class mod_wiki_edit_form extends moodleform {
|
||||
$mform->addElement('hidden', 'contentformat');
|
||||
$mform->setDefault('contentformat', $format);
|
||||
|
||||
if ($format != 'html') {
|
||||
//uploads
|
||||
$mform->addElement('header', 'attachments_tags', get_string('attachments', 'wiki'));
|
||||
$mform->addElement('filemanager', 'attachments', get_string('attachments', 'wiki'), null, page_wiki_edit::$attachmentoptions);
|
||||
$fileinfo = array(
|
||||
'contextid'=>$contextid,
|
||||
'component'=>'mod_wiki',
|
||||
'filearea'=>$filearea,
|
||||
'itemid'=>$fileitemid,
|
||||
);
|
||||
|
||||
$mform->addElement('wikifiletable', 'deleteuploads', get_string('wikifiletable', 'wiki'), null, $fileinfo, $format);
|
||||
$mform->addElement('submit', 'editoption', get_string('upload', 'wiki'), array('id' => 'tags'));
|
||||
}
|
||||
// if ($format != 'html') {
|
||||
// //uploads
|
||||
// $mform->addElement('header', 'attachments_tags', get_string('attachments', 'wiki'));
|
||||
// $mform->addElement('filemanager', 'attachments', get_string('attachments', 'wiki'), null, page_wiki_edit::$attachmentoptions);
|
||||
// $fileinfo = array(
|
||||
// 'contextid'=>$contextid,
|
||||
// 'component'=>'mod_wiki',
|
||||
// 'filearea'=>$filearea,
|
||||
// 'itemid'=>$fileitemid,
|
||||
// );
|
||||
//
|
||||
// $mform->addElement('wikifiletable', 'deleteuploads', get_string('wikifiletable', 'wiki'), null, $fileinfo, $format);
|
||||
// $mform->addElement('submit', 'editoption', get_string('upload', 'wiki'), array('id' => 'tags'));
|
||||
// }
|
||||
|
||||
if (!empty($CFG->usetags)) {
|
||||
$mform->addElement('header', 'tagshdr', get_string('tags', 'tag'));
|
||||
|
@ -548,9 +548,7 @@ function wiki_increment_pageviews($page) {
|
||||
* Text format supported by wiki module
|
||||
*/
|
||||
function wiki_get_formats() {
|
||||
// TODO: disable creole and nwiki format until moodle core text format lib added
|
||||
return array('html');
|
||||
//return array('html', 'creole', 'nwiki');
|
||||
return array('html', 'creole', 'nwiki');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -888,7 +888,7 @@ class page_wiki_create extends page_wiki {
|
||||
require_once(dirname(__FILE__) . '/create_form.php');
|
||||
$url = new moodle_url('/mod/wiki/create.php', array('action' => 'create', 'wid' => $PAGE->activityrecord->id, 'gid' => $this->gid, 'uid' => $this->uid));
|
||||
$formats = wiki_get_formats();
|
||||
$options = array('formats' => $formats);
|
||||
$options = array('formats' => $formats, 'defaultformat' => $PAGE->activityrecord->defaultformat,'forceformat' => $PAGE->activityrecord->forceformat);
|
||||
if ($this->title != get_string('newpage', 'wiki')) {
|
||||
$options['disable_pagetitle'] = true;
|
||||
}
|
||||
|
@ -32,5 +32,5 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
$module->version = 2010040109; // The current module version (Date: YYYYMMDDXX)
|
||||
$module->version = 2010071900; // The current module version (Date: YYYYMMDDXX)
|
||||
$module->cron = 0; // Period for cron to check this module (secs)
|
||||
|
Loading…
x
Reference in New Issue
Block a user