diff --git a/administrator/components/com_templates/forms/source.xml b/administrator/components/com_templates/forms/source.xml index c6493937c37e7..46bb9587353b6 100644 --- a/administrator/components/com_templates/forms/source.xml +++ b/administrator/components/com_templates/forms/source.xml @@ -36,6 +36,7 @@ syntax="php" filter="raw" readonly="true" + readonlymode="true" /> $this->autofocus, 'readonly' => $this->readonly || $this->disabled, 'syntax' => (string) $this->element['syntax'], + 'readonlymode' => (string) $this->element['readonlymode'], ); return $editor->display( diff --git a/plugins/editors/codemirror/codemirror.php b/plugins/editors/codemirror/codemirror.php index 8267223af49f7..4da3dc72bbe32 100644 --- a/plugins/editors/codemirror/codemirror.php +++ b/plugins/editors/codemirror/codemirror.php @@ -129,6 +129,11 @@ public function onDisplay( if (!empty($params['readonly'])) { $options->readOnly = 'nocursor'; + + if (!empty($params['readonlymode'])) + { + $options->readOnly = $params['readonlymode']; + } } // Should we focus on the editor on load?