From 5d4ee8b501edb925ac63118602387af9d7b8d294 Mon Sep 17 00:00:00 2001 From: Aparup Banerjee Date: Fri, 20 Aug 2010 08:36:49 +0000 Subject: [PATCH] database MDL-23789 fixed disable/enable editor button in templates tab. --- mod/data/templates.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/mod/data/templates.php b/mod/data/templates.php index 156f5fe6766..e4d5f0c8262 100755 --- a/mod/data/templates.php +++ b/mod/data/templates.php @@ -29,6 +29,7 @@ require_once('lib.php'); $id = optional_param('id', 0, PARAM_INT); // course module id $d = optional_param('d', 0, PARAM_INT); // database id $mode = optional_param('mode', 'singletemplate', PARAM_ALPHA); +$disableeditor = optional_param('switcheditor', false, PARAM_ALPHA); $url = new moodle_url('/mod/data/templates.php'); if ($mode !== 'singletemplate') { @@ -157,6 +158,9 @@ if (empty($data->addtemplate) and empty($data->singletemplate) and editors_head_setup(); $format = FORMAT_HTML; +if ($disableeditor) { + $format = FORMAT_PLAIN; +} $editor = editors_get_preferred_editor($format); $strformats = format_text_menu(); $formats = $editor->get_supported_formats(); @@ -185,7 +189,7 @@ echo $OUTPUT->box_start('generalbox boxaligncenter boxwidthwide'); echo ''; /// Add the HTML editor(s). -$usehtmleditor = can_use_html_editor() && ($mode != 'csstemplate') && ($mode != 'jstemplate'); +$usehtmleditor = can_use_html_editor() && ($mode != 'csstemplate') && ($mode != 'jstemplate') && !$disableeditor; if ($mode == 'listtemplate'){ // Print the list template header. echo ''; @@ -270,10 +274,11 @@ if ($mode != 'csstemplate' and $mode != 'jstemplate') { echo '

'; if ($usehtmleditor) { $switcheditor = get_string('editordisable', 'data'); + echo ''; } else { $switcheditor = get_string('editorenable', 'data'); + echo ''; } - echo ''; } } else { echo '



'; -- 2.43.0