MDL-18910 full support for module intro editor with embedded images
This commit is contained in:
@@ -24,7 +24,6 @@ $string['allsubscribe'] = 'Subscribe to all forums';
|
||||
$string['allunsubscribe'] = 'Unsubscribe from all forums';
|
||||
$string['alreadyfirstpost'] = 'This is already the first post in the discussion';
|
||||
$string['anyfile'] = 'Any file';
|
||||
$string['areaintro'] = 'Forum introduction';
|
||||
$string['attachment'] = 'Attachment';
|
||||
$string['attachments'] = 'Attachments';
|
||||
$string['attachmentnopost'] = 'You cannot export attachments without a post id';
|
||||
|
||||
@@ -15,7 +15,6 @@ $string['allowprintview'] = 'Allow print view';
|
||||
$string['allowratings'] = 'Allow entries to be rated?';
|
||||
$string['answer'] = 'Answer';
|
||||
$string['approve'] = 'Approve';
|
||||
$string['areaintro'] = 'Glossary introduction';
|
||||
$string['areyousuredelete'] = 'Are you sure you want to delete this entry?';
|
||||
$string['areyousuredeletecomment'] = 'Are you sure you want to delete this comment?';
|
||||
$string['areyousureexport'] = 'Are you sure you want to export this entry to';
|
||||
|
||||
@@ -9,7 +9,6 @@ $string['apidebugmask'] = 'API debug capture mask (simple regex on <username&
|
||||
$string['allowtypeexternal'] = 'Enable external package type';
|
||||
$string['allowtypeimsrepository'] = 'Enable IMS package type';
|
||||
$string['allowtypelocalsync'] = 'Enable downloaded package type';
|
||||
$string['areaintro'] = 'Introduction files';
|
||||
$string['areacontent'] = 'Content files';
|
||||
$string['areapackage'] = 'Package file';
|
||||
$string['asset'] = 'Asset';
|
||||
|
||||
@@ -474,8 +474,17 @@ class file_browser {
|
||||
if (function_exists($fileinfofunction)) {
|
||||
$areas = $fileinfofunction($course, $cm, $context);
|
||||
} else {
|
||||
$areas = array();
|
||||
}
|
||||
if (!isset($areas[$modname.'_intro'])
|
||||
and plugin_supports('mod', $modname, FEATURE_MOD_INTRO, true)
|
||||
and has_capability('moodle/course:managefiles', $context)) {
|
||||
$areas[$modname.'_intro'] = get_string('moduleintro');
|
||||
}
|
||||
if (empty($areas)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (is_null($filearea) or is_null($itemid)) {
|
||||
return new file_info_module($this, $course, $cm, $context, $areas);
|
||||
|
||||
|
||||
@@ -2466,9 +2466,6 @@ function data_get_exportdata($dataid, $fields, $selectedfields) {
|
||||
*/
|
||||
function data_get_file_areas($course, $cm, $context) {
|
||||
$areas = array();
|
||||
if (has_capability('moodle/course:managefiles', $context)) {
|
||||
$areas['data_intro'] = get_string('areaintro', 'data');
|
||||
}
|
||||
return $areas;
|
||||
}
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ class mod_data_mod_form extends moodleform_mod {
|
||||
function data_preprocessing(&$default_values){
|
||||
if (empty($default_values['scale'])){
|
||||
$default_values['assessed'] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+10
-10
@@ -19,7 +19,7 @@ class mod_feedback_mod_form extends moodleform_mod {
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
$mform->addElement('header', 'general', get_string('general', 'form'));
|
||||
|
||||
|
||||
$mform->addElement('text', 'name', get_string('name', 'feedback'), array('size'=>'64'));
|
||||
$mform->setType('name', PARAM_TEXT);
|
||||
$mform->addRule('name', null, 'required', null, 'client');
|
||||
@@ -28,40 +28,40 @@ class mod_feedback_mod_form extends moodleform_mod {
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
$mform->addElement('header', 'timinghdr', get_string('timing', 'form'));
|
||||
|
||||
|
||||
$enableopengroup = array();
|
||||
$enableopengroup[] =& $mform->createElement('checkbox', 'openenable', get_string('feedbackopen', 'feedback'));
|
||||
$enableopengroup[] =& $mform->createElement('date_time_selector', 'timeopen', '');
|
||||
$mform->addGroup($enableopengroup, 'enableopengroup', get_string('feedbackopen', 'feedback'), ' ', false);
|
||||
$mform->setHelpButton('enableopengroup', array('timeopen', get_string('feedbackopens', 'feedback'), 'feedback'));
|
||||
$mform->disabledIf('enableopengroup', 'openenable', 'notchecked');
|
||||
|
||||
|
||||
$enableclosegroup = array();
|
||||
$enableclosegroup[] =& $mform->createElement('checkbox', 'closeenable', get_string('feedbackclose', 'feedback'));
|
||||
$enableclosegroup[] =& $mform->createElement('date_time_selector', 'timeclose', '');
|
||||
$mform->addGroup($enableclosegroup, 'enableclosegroup', get_string('feedbackclose', 'feedback'), ' ', false);
|
||||
$mform->setHelpButton('enableclosegroup', array('timeclose', get_string('feedbackcloses', 'feedback'), 'feedback'));
|
||||
$mform->disabledIf('enableclosegroup', 'closeenable', 'notchecked');
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
$mform->addElement('header', 'feedbackhdr', get_string('feedback_options', 'feedback'));
|
||||
|
||||
|
||||
$options=array();
|
||||
$options[1] = get_string('anonymous', 'feedback');
|
||||
$options[2] = get_string('non_anonymous', 'feedback');
|
||||
$mform->addElement('select', 'anonymous', get_string('anonymous_edit', 'feedback'), $options);
|
||||
|
||||
|
||||
$mform->addElement('selectyesno', 'publish_stats', get_string('show_analysepage_after_submit', 'feedback'));
|
||||
$mform->addElement('selectyesno', 'email_notification', get_string('email_notification', 'feedback'));
|
||||
$mform->setHelpButton('email_notification', array('emailnotification', get_string('email_notification', 'feedback'), 'feedback'));
|
||||
|
||||
|
||||
// check if there is existing responses to this feedback
|
||||
if (is_numeric($this->_instance) AND $this->_instance and $feedback = $DB->get_record("feedback", array("id"=>$this->_instance))) {
|
||||
$completedFeedbackCount = feedback_get_completeds_group_count($feedback);
|
||||
} else {
|
||||
$completedFeedbackCount = false;
|
||||
}
|
||||
|
||||
|
||||
if($completedFeedbackCount) {
|
||||
$multiple_submit_value = $feedback->multiple_submit ? get_string('yes') : get_string('no');
|
||||
$mform->addElement('text', 'multiple_submit_static', get_string('multiple_submit', 'feedback'), array('size'=>'4','disabled'=>'disabled', 'value'=>$multiple_submit_value));
|
||||
@@ -73,10 +73,10 @@ class mod_feedback_mod_form extends moodleform_mod {
|
||||
}
|
||||
$mform->addElement('selectyesno', 'autonumbering', get_string('autonumbering', 'feedback'));
|
||||
$mform->setHelpButton('autonumbering', array('autonumbering', get_string('autonumbering', 'feedback'), 'feedback'));
|
||||
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
$mform->addElement('header', 'aftersubmithdr', get_string('after_submit', 'feedback'));
|
||||
|
||||
|
||||
$mform->addElement('text', 'site_after_submit', get_string('site_after_submit', 'feedback'), array('size'=>'64','maxlength'=>'255'));
|
||||
$mform->setType('site_after_submit', PARAM_TEXT);
|
||||
|
||||
|
||||
@@ -4048,9 +4048,6 @@ function forum_print_attachments($post, $cm, $type) {
|
||||
*/
|
||||
function forum_get_file_areas($course, $cm, $context) {
|
||||
$areas = array();
|
||||
if (has_capability('moodle/course:managefiles', $context)) {
|
||||
$areas['forum_intro'] = get_string('areaintro', 'forum');
|
||||
}
|
||||
return $areas;
|
||||
}
|
||||
|
||||
|
||||
@@ -1068,9 +1068,6 @@ function glossary_print_attachments($entry, $cm, $type=NULL, $align="left") {
|
||||
*/
|
||||
function glossary_get_file_areas($course, $cm, $context) {
|
||||
$areas = array();
|
||||
if (has_capability('moodle/course:managefiles', $context)) {
|
||||
$areas['glossary_intro'] = get_string('areaintro', 'glossary');
|
||||
}
|
||||
return $areas;
|
||||
}
|
||||
|
||||
|
||||
@@ -173,7 +173,7 @@ class mod_glossary_mod_form extends moodleform_mod {
|
||||
function data_preprocessing(&$default_values){
|
||||
if (empty($default_values['scale'])){
|
||||
$default_values['assessed'] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($default_values['assessed'])){
|
||||
$default_values['userating'] = 0;
|
||||
|
||||
@@ -3,7 +3,7 @@ require_once ($CFG->dirroot.'/course/moodleform_mod.php');
|
||||
require_once ($CFG->dirroot.'/mod/hotpot/lib.php');
|
||||
|
||||
$HOTPOT_TEXTSOURCE = array(
|
||||
HOTPOT_TEXTSOURCE_QUIZ => get_string('textsourcequiz', 'hotpot'),
|
||||
HOTPOT_TEXTSOURCE_QUIZ => get_string('textsourcequiz', 'hotpot'),
|
||||
HOTPOT_TEXTSOURCE_FILENAME => get_string('textsourcefilename', 'hotpot'),
|
||||
HOTPOT_TEXTSOURCE_FILEPATH => get_string('textsourcefilepath', 'hotpot'),
|
||||
HOTPOT_TEXTSOURCE_SPECIFIC => get_string('textsourcespecific', 'hotpot')
|
||||
|
||||
@@ -28,7 +28,7 @@ require_once($CFG->dirroot . '/mod/quiz/locallib.php');
|
||||
|
||||
/**
|
||||
* Settings form for the quiz module.
|
||||
*
|
||||
*
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
|
||||
* @package quiz
|
||||
*/
|
||||
|
||||
@@ -690,7 +690,6 @@ function scorm_get_extra_capabilities() {
|
||||
function scorm_get_file_areas($course, $cm, $context) {
|
||||
$areas = array();
|
||||
if (has_capability('moodle/course:managefiles', $context)) {
|
||||
$areas['scorm_intro'] = get_string('areaintro', 'scorm');
|
||||
$areas['scorm_content'] = get_string('areacontent', 'scorm');
|
||||
$areas['scorm_package'] = get_string('areapackage', 'scorm');
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ class mod_scorm_mod_form extends moodleform_mod {
|
||||
$mform->addElement('select', 'grademethod', get_string('grademethod', 'scorm'), scorm_get_grade_method_array());
|
||||
$mform->setHelpButton('grademethod', array('grademethod', get_string('grademethod', 'scorm'),'scorm'));
|
||||
$mform->setDefault('grademethod', $cfg_scorm->grademethod);
|
||||
|
||||
|
||||
// Maximum Grade
|
||||
for ($i=0; $i<=100; $i++) {
|
||||
$grades[$i] = "$i";
|
||||
@@ -100,17 +100,17 @@ class mod_scorm_mod_form extends moodleform_mod {
|
||||
$mform->addElement('select', 'maxattempt', get_string('maximumattempts', 'scorm'), scorm_get_attempts_array());
|
||||
$mform->setHelpButton('maxattempt', array('maxattempt',get_string('maximumattempts', 'scorm'), 'scorm'));
|
||||
$mform->setDefault('maxattempt', $cfg_scorm->maxattempts);
|
||||
|
||||
|
||||
// Display attempt status
|
||||
$mform->addElement('selectyesno', 'displayattemptstatus', get_string('displayattemptstatus', 'scorm'));
|
||||
$mform->setHelpButton('displayattemptstatus', array('displayattemptstatus',get_string('displayattemptstatus', 'scorm'), 'scorm'));
|
||||
$mform->setDefault('displayattemptstatus', $cfg_scorm->displayattemptstatus);
|
||||
|
||||
|
||||
// Display course structure
|
||||
$mform->addElement('selectyesno', 'displaycoursestructure', get_string('displaycoursestructure', 'scorm'));
|
||||
$mform->setHelpButton('displaycoursestructure', array('displaycoursestructure',get_string('displaycoursestructure', 'scorm'), 'scorm'));
|
||||
$mform->setDefault('displaycoursestructure', $cfg_scorm->displaycoursestructure);
|
||||
|
||||
|
||||
// Force completed
|
||||
$mform->addElement('selectyesno', 'forcecompleted', get_string('forcecompleted', 'scorm'));
|
||||
$mform->setHelpButton('forcecompleted', array('forcecompleted',get_string('forcecompleted', 'scorm'), 'scorm'));
|
||||
@@ -122,13 +122,13 @@ class mod_scorm_mod_form extends moodleform_mod {
|
||||
$mform->setHelpButton('forcenewattempt', array('forcenewattempt',get_string('forcenewattempt', 'scorm'), 'scorm'));
|
||||
$mform->setDefault('forcenewattempt', $cfg_scorm->forcenewattempt);
|
||||
$mform->setAdvanced('forcenewattempt');
|
||||
|
||||
|
||||
// Last attempt lock - lock the enter button after the last available attempt has been made
|
||||
$mform->addElement('selectyesno', 'lastattemptlock', get_string('lastattemptlock', 'scorm'));
|
||||
$mform->setHelpButton('lastattemptlock', array('lastattemptlock',get_string('lastattemptlock', 'scorm'), 'scorm'));
|
||||
$mform->setDefault('lastattemptlock', $cfg_scorm->lastattemptlock);
|
||||
$mform->setAdvanced('lastattemptlock');
|
||||
|
||||
|
||||
// What Grade
|
||||
$mform->addElement('select', 'whatgrade', get_string('whatgrade', 'scorm'), scorm_get_what_grade_array());
|
||||
$mform->disabledIf('whatgrade', 'maxattempt','eq',1);
|
||||
@@ -155,7 +155,7 @@ class mod_scorm_mod_form extends moodleform_mod {
|
||||
$mform->setDefault('enddisabled', 1);
|
||||
$mform->disabledIf('dateendgrp', 'enddisabled', 'checked');
|
||||
*/
|
||||
|
||||
|
||||
// Stage Size
|
||||
$mform->addElement('static', '', '' ,'<hr />');
|
||||
$mform->addElement('static', 'stagesize', get_string('stagesize','scorm'));
|
||||
|
||||
Reference in New Issue
Block a user