MDL-11844 new option for conditional stripping of tags from activity names; backported from HEAD

This commit is contained in:
skodak
2008-07-26 15:17:03 +00:00
parent a6017978a2
commit 054fabfbb8
17 changed files with 82 additions and 18 deletions
+5
View File
@@ -62,6 +62,11 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
$temp->add(new admin_setting_emoticons());
$ADMIN->add('appearance', $temp);
// "htmlsettings" settingpage
$temp = new admin_settingpage('htmlsettings', get_string('htmlsettings', 'admin'));
$temp->add(new admin_setting_configcheckbox('formatstringstriptags', get_string('stripalltitletags', 'admin'), get_string('configstripalltitletags', 'admin'), 1));
$ADMIN->add('appearance', $temp);
// "documentation" settingpage
$temp = new admin_settingpage('documentation', get_string('moodledocs'));
$temp->add(new admin_setting_configtext('docroot', get_string('docroot', 'admin'), get_string('configdocroot', 'admin'), 'http://docs.moodle.org', PARAM_URL));
+3
View File
@@ -231,6 +231,7 @@ $string['configstatsmaxruntime'] = 'Stats processing can be quite intensive, so
$string['configstatsmaxruntime2'] = 'Stats processing can be quite intensive, specify maximum time allowed for gathering of one day of statistics. Maximum number of days processed in one cron execution is 3.';
$string['configstatsruntimestart'] = 'What time should the cronjob that does the stats processing <b>start</b>? Please specify different times if there are multiple Moodles on one physical server.';
$string['configstatsuserthreshold'] = 'If you enter a non-zero, non numeric value here, for ranking courses, courses with less than this number of enrolled users (all roles) will be ignored';
$string['configstripalltitletags'] = 'By default all HTML tags are removed from all titles of activities, posts, blogs, etc. Uncheck this if you want to allow html tags in activity names.';
$string['configsupportemail'] = 'This email address will be published to users of this site as the one to email when they need general help (for example, when new users create their own accounts). If this email is left blank then no such helpful email address is supplied.';
$string['configsupportname'] = 'This is the name of a person or other entity offering general help via the support email or web address.';
$string['configsupportpage'] = 'This web address will be published to users of this site as the one to go to when they need general help (for example, when new users create their own accounts). If this address is left blank then no link will be supplied.';
@@ -395,6 +396,7 @@ $string['hidefromall'] = 'Hide from all users';
$string['hidefromnone'] = 'Hide from nobody';
$string['hidefromstudents'] = 'Hide from students';
$string['htmleditor'] = 'HTML editor';
$string['htmlsettings'] = 'HTML settings';
$string['http'] = 'HTTP';
$string['httpsecurity'] = 'HTTP security';
$string['iconvrecommended'] = 'Installing the optional ICONV library is highly recommended in order to improve site performance, particularly if your site is supporting non-Latin languages.';
@@ -664,6 +666,7 @@ $string['stickyblockscourseview'] = 'Course page';
$string['stickyblocksduplicatenotice'] = 'If any block you add here is already present in a particular page, it will result in a duplicate.<br />Only the pinned block will be non-editable, the duplicate will still be editable.';
$string['stickyblocksmymoodle'] = 'My Moodle';
$string['stickyblockspagetype'] = 'Page type to configure';
$string['stripalltitletags'] = 'Remove HTML tags from all titles';
$string['supportemail'] = 'Support email';
$string['supportname'] = 'Support name';
$string['supportpage'] = 'Support page';
+5 -1
View File
@@ -32,7 +32,11 @@ class mod_assignment_mod_form extends moodleform_mod {
// $mform->addElement('static', 'statictype', get_string('assignmenttype', 'assignment'), get_string('type'.$type,'assignment'));
$mform->addElement('text', 'name', get_string('assignmentname', 'assignment'), array('size'=>'64'));
$mform->setType('name', PARAM_TEXT);
if (!empty($CFG->formatstringstriptags)) {
$mform->setType('name', PARAM_TEXT);
} else {
$mform->setType('name', PARAM_CLEAN);
}
$mform->addRule('name', null, 'required', null, 'client');
$mform->addElement('htmleditor', 'description', get_string('description', 'assignment'));
+5 -1
View File
@@ -12,7 +12,11 @@ class mod_chat_mod_form extends moodleform_mod {
$mform->addElement('header', 'general', get_string('general', 'form'));
$mform->addElement('text', 'name', get_string('chatname', 'chat'), array('size'=>'64'));
$mform->setType('name', PARAM_TEXT);
if (!empty($CFG->formatstringstriptags)) {
$mform->setType('name', PARAM_TEXT);
} else {
$mform->setType('name', PARAM_CLEAN);
}
$mform->addRule('name', null, 'required', null, 'client');
$mform->addElement('htmleditor', 'intro', get_string('chatintro', 'chat'));
+6 -2
View File
@@ -4,7 +4,7 @@ require_once ($CFG->dirroot.'/course/moodleform_mod.php');
class mod_choice_mod_form extends moodleform_mod {
function definition() {
global $CHOICE_SHOWRESULTS, $CHOICE_PUBLISH, $CHOICE_DISPLAY;
global $CFG, $CHOICE_SHOWRESULTS, $CHOICE_PUBLISH, $CHOICE_DISPLAY;
$mform =& $this->_form;
@@ -12,7 +12,11 @@ class mod_choice_mod_form extends moodleform_mod {
$mform->addElement('header', 'general', get_string('general', 'form'));
$mform->addElement('text', 'name', get_string('choicename', 'choice'), array('size'=>'64'));
$mform->setType('name', PARAM_TEXT);
if (!empty($CFG->formatstringstriptags)) {
$mform->setType('name', PARAM_TEXT);
} else {
$mform->setType('name', PARAM_CLEAN);
}
$mform->addRule('name', null, 'required', null, 'client');
$mform->addElement('htmleditor', 'text', get_string('choicetext', 'choice'));
+5 -1
View File
@@ -12,7 +12,11 @@ class mod_data_mod_form extends moodleform_mod {
$mform->addElement('header', 'general', get_string('general', 'form'));
$mform->addElement('text', 'name', get_string('name'), array('size'=>'64'));
$mform->setType('name', PARAM_TEXT);
if (!empty($CFG->formatstringstriptags)) {
$mform->setType('name', PARAM_TEXT);
} else {
$mform->setType('name', PARAM_CLEAN);
}
$mform->addRule('name', null, 'required', null, 'client');
$mform->addElement('htmleditor', 'intro', get_string('intro', 'data'));
+5 -1
View File
@@ -12,7 +12,11 @@ class mod_exercise_mod_form extends moodleform_mod {
$mform->addElement('header', 'general', get_string('general', 'form'));
$mform->addElement('text', 'name', get_string('title', 'exercise'), array('size'=>'64'));
$mform->setType('name', PARAM_TEXT);
if (!empty($CFG->formatstringstriptags)) {
$mform->setType('name', PARAM_TEXT);
} else {
$mform->setType('name', PARAM_CLEAN);
}
$mform->addRule('name', null, 'required', null, 'client');
$mform->addElement('static', 'description', get_string('description', 'exercise'), get_string('descriptionofexercise', 'exercise', $COURSE->students));
+5 -1
View File
@@ -12,7 +12,11 @@ class mod_forum_mod_form extends moodleform_mod {
$mform->addElement('header', 'general', get_string('general', 'form'));
$mform->addElement('text', 'name', get_string('forumname', 'forum'), array('size'=>'64'));
$mform->setType('name', PARAM_TEXT);
if (!empty($CFG->formatstringstriptags)) {
$mform->setType('name', PARAM_TEXT);
} else {
$mform->setType('name', PARAM_CLEAN);
}
$mform->addRule('name', null, 'required', null, 'client');
$mform->addRule('name', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');
+5 -1
View File
@@ -12,7 +12,11 @@ class mod_glossary_mod_form extends moodleform_mod {
$mform->addElement('header', 'general', get_string('general', 'form'));
$mform->addElement('text', 'name', get_string('name'), array('size'=>'64'));
$mform->setType('name', PARAM_TEXT);
if (!empty($CFG->formatstringstriptags)) {
$mform->setType('name', PARAM_TEXT);
} else {
$mform->setType('name', PARAM_CLEAN);
}
$mform->addRule('name', null, 'required', null, 'client');
$mform->addElement('htmleditor', 'intro', get_string('description'));
+5 -1
View File
@@ -58,7 +58,11 @@ class mod_hotpot_mod_form extends moodleform_mod {
$mform->addElement('text', 'name', get_string('name'), array('size' => '40'));
}
$mform->setType('namesource', PARAM_INT);
$mform->setType('name', PARAM_TEXT);
if (!empty($CFG->formatstringstriptags)) {
$mform->setType('name', PARAM_TEXT);
} else {
$mform->setType('name', PARAM_CLEAN);
}
// Location
$sitecontext = get_context_instance(CONTEXT_SYSTEM);
+6 -2
View File
@@ -5,14 +5,18 @@ class mod_journal_mod_form extends moodleform_mod {
function definition() {
global $COURSE;
global $CFG, $COURSE;
$mform =& $this->_form;
//-------------------------------------------------------------------------------
$mform->addElement('header', 'general', get_string('general', 'form'));
$mform->addElement('text', 'name', get_string('journalname', 'journal'), array('size'=>'64'));
$mform->setType('name', PARAM_TEXT);
if (!empty($CFG->formatstringstriptags)) {
$mform->setType('name', PARAM_TEXT);
} else {
$mform->setType('name', PARAM_CLEAN);
}
$mform->addRule('name', null, 'required', null, 'client');
$mform->addElement('htmleditor', 'intro', get_string('journalquestion', 'journal'));
+6 -2
View File
@@ -14,7 +14,7 @@ require_once('locallib.php');
class mod_lesson_mod_form extends moodleform_mod {
function definition() {
global $LESSON_NEXTPAGE_ACTION, $COURSE;
global $CFG, $LESSON_NEXTPAGE_ACTION, $COURSE;
$mform =& $this->_form;
@@ -22,7 +22,11 @@ class mod_lesson_mod_form extends moodleform_mod {
$mform->addElement('header', 'general', get_string('general', 'form'));
$mform->addElement('text', 'name', get_string('name'), array('size'=>'64'));
$mform->setType('name', PARAM_TEXT);
if (!empty($CFG->formatstringstriptags)) {
$mform->setType('name', PARAM_TEXT);
} else {
$mform->setType('name', PARAM_CLEAN);
}
$mform->addRule('name', null, 'required', null, 'client');
// Create a text box that can be enabled/disabled for lesson time limit
+5 -1
View File
@@ -15,7 +15,11 @@ class mod_quiz_mod_form extends moodleform_mod {
$mform->addElement('header', 'general', get_string('general', 'form'));
$mform->addElement('text', 'name', get_string('name'), array('size'=>'64'));
$mform->setType('name', PARAM_TEXT);
if (!empty($CFG->formatstringstriptags)) {
$mform->setType('name', PARAM_TEXT);
} else {
$mform->setType('name', PARAM_CLEAN);
}
$mform->addRule('name', null, 'required', null, 'client');
$mform->addElement('htmleditor', 'intro', get_string("introduction", "quiz"));
+5 -1
View File
@@ -31,7 +31,11 @@ class mod_resource_mod_form extends moodleform_mod {
// $mform->addElement('static', 'statictype', get_string('assignmenttype', 'assignment'), get_string('type'.$type,'assignment'));
$mform->addElement('text', 'name', get_string('name'), array('size'=>'48'));
$mform->setType('name', PARAM_TEXT);
if (!empty($CFG->formatstringstriptags)) {
$mform->setType('name', PARAM_TEXT);
} else {
$mform->setType('name', PARAM_CLEAN);
}
$mform->addRule('name', null, 'required', null, 'client');
$mform->addElement('htmleditor', 'summary', get_string('summary'));
+5 -1
View File
@@ -14,7 +14,11 @@ class mod_scorm_mod_form extends moodleform_mod {
// Name
$mform->addElement('text', 'name', get_string('name'));
$mform->setType('name', PARAM_TEXT);
if (!empty($CFG->formatstringstriptags)) {
$mform->setType('name', PARAM_TEXT);
} else {
$mform->setType('name', PARAM_CLEAN);
}
$mform->addRule('name', null, 'required', null, 'client');
// Summary
+5 -1
View File
@@ -14,7 +14,11 @@ class mod_survey_mod_form extends moodleform_mod {
$mform->addElement('header', 'general', get_string('general', 'form'));
$mform->addElement('text', 'name', get_string('name'), array('size'=>'64'));
$mform->setType('name', PARAM_TEXT);
if (!empty($CFG->formatstringstriptags)) {
$mform->setType('name', PARAM_TEXT);
} else {
$mform->setType('name', PARAM_CLEAN);
}
$mform->addRule('name', null, 'required', null, 'client');
if (!$options = get_records_menu("survey", "template", 0, "name", "id, name")) {
+1 -1
View File
@@ -6,7 +6,7 @@
// This is compared against the values stored in the database to determine
// whether upgrades should be performed (see lib/db/*.php)
$version = 2007101520.02; // YYYYMMDD = date of the 1.9 branch (don't change)
$version = 2007101520.03; // YYYYMMDD = date of the 1.9 branch (don't change)
// X = release number 1.9.[0,1,2,3...]
// Y.YY = micro-increments between releases