MDL-35042 blocks: Allow HTML block advanced setting to be toggled

This commit is contained in:
Aaron Barnes
2012-08-24 14:11:33 +12:00
parent d71c486507
commit 055cc8353d
4 changed files with 30 additions and 6 deletions
+7 -3
View File
@@ -31,6 +31,8 @@
*/
class block_html_edit_form extends block_edit_form {
protected function specific_definition($mform) {
global $CFG;
// Fields for editing HTML block title and contents.
$mform->addElement('header', 'configheader', get_string('blocksettings', 'block'));
@@ -42,9 +44,11 @@ class block_html_edit_form extends block_edit_form {
$mform->addRule('config_text', null, 'required', null, 'client');
$mform->setType('config_text', PARAM_RAW); // XSS is prevented when printing the block contents and serving files
$mform->addElement('text', 'config_classes', get_string('configclasses', 'block_html'));
$mform->setType('config_classes', PARAM_TEXT);
$mform->addHelpButton('config_classes', 'configclasses', 'block_html');
if (!empty($CFG->block_html_allowcssclasses)) {
$mform->addElement('text', 'config_classes', get_string('configclasses', 'block_html'));
$mform->setType('config_classes', PARAM_TEXT);
$mform->addHelpButton('config_classes', 'configclasses', 'block_html');
}
}
function set_data($defaults) {