Commit 59844782 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Refs #10013 Add phpDoc. Set CM defaults.

parent b9dab562
Pipeline #3200 passed with stages
in 4 minutes and 7 seconds
......@@ -3174,6 +3174,8 @@ abstract class AbstractBuildForm {
}
/**
* Build an Editor input element: TinyMCE / CodeMirror
*
* @param array $formElement
* @param $htmlFormElementName
* @param $value
......@@ -3253,6 +3255,9 @@ abstract class AbstractBuildForm {
}
/**
* Build a HTML 'textarea' element which becomes a CodeMirror Editor.
* https://codemirror.net/doc/manual.html#overview
*
* @param array $formElement
* @param $htmlFormElementName
* @param $value
......@@ -3268,7 +3273,6 @@ abstract class AbstractBuildForm {
$attribute .= Support::doAttribute('id', $formElement[FE_HTML_ID]);
$attribute .= Support::doAttribute('name', $htmlFormElementName);
// $attribute .= Support::doAttribute('id', $htmlFormElementName);
$attribute .= Support::doAttribute(ATTRIBUTE_DATA_REFERENCE, $formElement[FE_DATA_REFERENCE]);
$attribute .= Support::doAttribute('class', 'qfq-codemirror');
......@@ -3279,11 +3283,17 @@ abstract class AbstractBuildForm {
// $attribute .= Support::doAttribute('data-title', $formElement[FE_TOOLTIP]);
// $formElement = $this->setEditorTinyMCEConfig($formElement, $htmlFormElementName);
// $formElement['editor-plugins']='autoresize code'
// $formElement['editor-contextmenu']='link image | cell row column'
// $formElement['editor-plugins']='autoresize code'
// $formElement['editor-contextmenu']='link image | cell row column'
// Defaults: fits good to QFQ style programming
$formElement[FE_EDITOR_PREFIX . 'mode'] = $formElement[FE_EDITOR_PREFIX . 'mode'] ?? "text/x-sql";
$formElement[FE_EDITOR_PREFIX . 'lineNumbers'] = $formElement[FE_EDITOR_PREFIX . 'lineNumbers'] ?? true;
$formElement[FE_EDITOR_PREFIX . 'lineWrapping'] = $formElement[FE_EDITOR_PREFIX . 'lineNumbers'] ?? true;
if ($formElement[FE_MODE] == FE_MODE_READONLY) {
$formElement[FE_EDITOR_PREFIX . 'readOnly'] = true;
}
$json = $this->getPrefixedElementsAsJSON(FE_EDITOR_PREFIX, $formElement);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment