Commit 255c9705 authored by Carsten  Rose's avatar Carsten Rose
Browse files

TemplateGroup: implemented tags 'tgAddClass', 'tgAdd Text', 'tgRemoveClass', 'tgRemovceText'

AbstractBuildForm.php: see title
parent f5272fc4
Version 0.12
============
Changes
-------
* Table 'FormElement'
* new column: rowLabelInputNote
ALTER TABLE `FormElement` ADD `rowLabelInputNote` set('row','label','/label','input','/input','note','/note','/row') NOT NULL DEFAULT 'row,label,/label,input,/input,note,/note,/row' AFTER `bsNoteColumns` ;
* modified column: 'type' - new value 'templateGroup'
ALTER TABLE `FormElement` CHANGE `type` `type` ENUM( 'checkbox', 'date', 'datetime', 'dateJQW', 'datetimeJQW', 'extra',
'gridJQW', 'text', 'editor', 'time', 'note', 'password', 'radio', 'select', 'subrecord', 'upload', 'fieldset', 'pill',
'templateGroup', 'beforeLoad', 'beforeSave', 'beforeInsert', 'beforeUpdate', 'beforeDelete', 'afterLoad', 'afterSave',
'afterInsert', 'afterUpdate', 'afterDelete', 'sendMail' ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'text';
* Play 'sql/formEditor.sql' - this replaces the existing formEditor (any changes will be lost).
Features
--------
Bug fixes
---------
Version 0.11
============
......
......@@ -411,9 +411,6 @@ abstract class AbstractBuildForm {
// Render pure element
$elementHtml = $this->$buildElementFunctionName($formElement, $htmlFormElementId, $value, $jsonElement, $mode);
// $fake0 = $fe['dynamicUpdate'];
// $fake1 = $formElement['dynamicUpdate'];
// container elements do not have dynamicUpdate='yes'. Instead they deliver nested elements.
if ($formElement['class'] == 'container') {
if (count($jsonElement) > 0) {
......@@ -2337,6 +2334,11 @@ abstract class AbstractBuildForm {
$attribute = '';
$html = '';
$addClass = Support::setIfNotSet($formElement, FE_TMPLATE_GROUP_ADD_CLASS, 'btn btn-default');
$addText = Support::setIfNotSet($formElement, FE_TMPLATE_GROUP_ADD_TEXT, 'Add');
$removeClass = Support::setIfNotSet($formElement, FE_TMPLATE_GROUP_REMOVE_CLASS, 'btn btn-default');
$removeText = Support::setIfNotSet($formElement, FE_TMPLATE_GROUP_REMOVE_TEXT, 'Remove');
// save parent processed FE's
$tmpStore = $this->feSpecNative;
......@@ -2370,12 +2372,12 @@ abstract class AbstractBuildForm {
EOT;
$htmlAdd = <<<EOT
<button type="button" onclick="QfqNS.addFields('#$templateName', '#$targetName', $max)">Add</button>
<button type="button" class="$addClass" onclick="QfqNS.addFields('#$templateName', '#$targetName', $max)">$addText</button>
EOT;
$htmlDelete = <<<EOT
<div class="qfq-delete-button">
<button type="button" onclick="QfqNS.removeFields(this)">Remove</button>
<button type="button" class="$removeClass" onclick="QfqNS.removeFields(this)">$removeText</button>
</div>
EOT;
......
......@@ -549,6 +549,10 @@ const FE_WRAP_ROW = 'wrapRow';
const FE_WRAP_LABEL = 'wrapLabel';
const FE_WRAP_INPUT = 'wrapInput';
const FE_WRAP_NOTE = 'wrapNote';
const FE_TMPLATE_GROUP_ADD_CLASS = 'tgAddClass';
const FE_TMPLATE_GROUP_ADD_TEXT = 'tgAddText';
const FE_TMPLATE_GROUP_REMOVE_CLASS = 'tgRemoveClass';
const FE_TMPLATE_GROUP_REMOVE_TEXT = 'tgRemoveText';
const RETYPE_FE_NAME_EXTENSION = 'RETYPE';
......
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