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

AbstractBuildForm.php: added FE type 'editorJQW'

parent a6355e5c
......@@ -89,6 +89,7 @@ abstract class AbstractBuildForm {
'gridJQW' => 'GridJQW',
FE_TYPE_EXTRA => 'Extra',
'text' => 'Input',
'editorJQW' => 'EditorJQW',
'time' => 'DateTime',
'note' => 'Note',
'password' => 'Input',
......@@ -110,6 +111,7 @@ abstract class AbstractBuildForm {
'gridJQW' => 'Native',
FE_TYPE_EXTRA => 'Native',
'text' => 'Native',
'editorJQW' => 'Native',
'time' => 'Native',
'note' => 'Native',
'password' => 'Native',
......@@ -1977,6 +1979,38 @@ abstract class AbstractBuildForm {
return $element . $this->getHelpBlock();
}
/**
* @param array $formElement
* @param $htmlFormElementId
* @param $value
* @param array $json
* @param string $mode
* @return string
* @throws \qfq\UserFormException
*/
public function buildEditorJQW(array $formElement, $htmlFormElementId, $value, array &$json, $mode = FORM_LOAD) {
$this->adjustMaxLength($formElement);
$attribute = Support::doAttribute('name', $htmlFormElementId);
// $attribute .= Support::doAttribute('id', $htmlFormElementId);
$attribute .= Support::doAttribute('class', 'jqw-editor');
$attribute .= Support::doAttribute('data-control-name', "$htmlFormElementId");
$attribute .= Support::doAttribute('data-placeholder', $formElement['placeholder']);
// $attribute .= Support::doAttribute('data-value', htmlentities($value), false);
// $attribute .= Support::doAttribute('data-autofocus', $formElement['autofocus']);
$attribute .= Support::doAttribute('data-load', ($formElement['dynamicUpdate'] === 'yes') ? 'data-load' : '');
$attribute .= Support::doAttribute('data-title', $formElement['tooltip']);
$attribute .= $this->getAttributeFeMode($formElement[FE_MODE]);
$json = $this->getJsonElementUpdate($htmlFormElementId, $value, $formElement[FE_MODE]);
$element = Support::wrapTag("<textarea $attribute>", htmlentities($value), false);
return $element . $this->getHelpBlock();
}
/**
* Build Grid JQW element.
*
......
......@@ -67,8 +67,8 @@ CREATE TABLE IF NOT EXISTS `FormElement` (
`mode` ENUM('show', 'required', 'readonly', 'hidden') NOT NULL DEFAULT 'show',
`modeSql` TEXT NOT NULL,
`class` ENUM('native', 'action', 'container') NOT NULL DEFAULT 'native',
`type` ENUM('checkbox', 'date', 'datetime', 'dateJQW', 'datetimeJQW', 'extra', 'gridJQW', 'text', 'time',
'note', 'password', 'radio', 'select', 'subrecord', 'upload', 'fieldset', 'pill',
`type` ENUM('checkbox', 'date', 'datetime', 'dateJQW', 'datetimeJQW', 'extra', 'gridJQW', 'text',
'editorJQW', 'time', 'note', 'password', 'radio', 'select', 'subrecord', 'upload', 'fieldset', 'pill',
'beforeLoad', 'beforeSave', 'beforeInsert', 'beforeUpdate', 'beforeDelete', 'afterLoad',
'afterSave', 'afterInsert', 'afterUpdate', 'afterDelete', 'sendmail') NOT NULL DEFAULT 'text',
`subrecordOption` SET('edit', 'delete', 'new') NOT NULL DEFAULT '',
......@@ -208,7 +208,7 @@ VALUES
(2, 'modeSql', 'Mode sql', 'show', 'text', 'all', 'native', 170, '70,2', 255, '', '', '', '', '', '', 100, '', 'no', '', '', '', ''),
(2, 'class', 'Class', 'show', 'select', 'all', 'native', 180, 0, 255, '', '', '{{class:FSRD0:alnumx}}', '', '', '', 100, '', 'yes', '', '', '', ''),
(2, 'type', 'Type', 'show', 'select', 'all', 'native', 190, 0, 255, '', '', '', '', '',
'itemList={{SELECT IF( "{{class:FRD0:alnumx}}"="native","checkbox,date,time,datetime,dateJQW,datetimeJQW,extra,gridJQW,text,note,password,radio,select,subrecord,upload", IF("{{class:FRD0:alnumx}}"="action","beforeLoad,beforeSave,beforeInsert,beforeUpdate,beforeDelete,afterLoad,afterSave,afterInsert,afterUpdate,afterDelete,sendmail", "fieldset,pill") ) }}',
'itemList={{SELECT IF( "{{class:FRD0:alnumx}}"="native","checkbox,date,time,datetime,dateJQW,datetimeJQW,extra,gridJQW,text,editorJQW,note,password,radio,select,subrecord,upload", IF("{{class:FRD0:alnumx}}"="action","beforeLoad,beforeSave,beforeInsert,beforeUpdate,beforeDelete,afterLoad,afterSave,afterInsert,afterUpdate,afterDelete,sendmail", "fieldset,pill") ) }}',
100, '', 'yes', '', '', '', ''),
(2, 'subrecordOption', 'Subrecord Option', 'show', 'checkbox', 'all', 'native', 200, 0, 0, '', '', '', '', '', '', 100, '', 'no', '', '', '',
''),
......
......@@ -67,7 +67,7 @@ CREATE TABLE IF NOT EXISTS `FormElement` (
`mode` ENUM('show', 'readonly', 'required', 'lock', 'disabled') NOT NULL DEFAULT 'show',
`modeSql` TEXT NOT NULL,
`class` ENUM('native', 'action', 'container') NOT NULL DEFAULT 'native',
`type` ENUM('checkbox', 'date', 'datetime', 'dateJQW', 'datetimeJQW', 'extra', 'gridJQW', 'text', 'time',
`type` ENUM('checkbox', 'date', 'datetime', 'dateJQW', 'datetimeJQW', 'extra', 'gridJQW', 'text', 'editorJQW', 'time',
'note', 'password', 'radio', 'select', 'subrecord', 'upload', 'fieldset', 'pill',
'beforeLoad', 'beforeSave', 'beforeInsert', 'beforeUpdate', 'beforeDelete', 'afterLoad',
'afterSave', 'afterInsert', 'afterUpdate', 'afterDelete',
......
Markdown is supported
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