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

#4593 / Punktetool 2.0 / Annotate / Fabric - FE.element.type='annotate' rendered in QFQ Form

parent 044ed902
......@@ -167,6 +167,7 @@ abstract class AbstractBuildForm {
$htmlSubrecords = '';
$htmlElements = '';
$json = array();
$flagFabric = false;
// After action 'afterSave', it's necessary to reinitialize the FeSpecNative
if (!empty($latestFeSpecNative)) {
......@@ -184,6 +185,9 @@ abstract class AbstractBuildForm {
// <form>
if ($mode === FORM_LOAD) {
$htmlHead = $this->head();
if (count(OnArray::filter($this->feSpecNative, FE_TYPE, FE_TYPE_ANNOTATE)) > 0) {
$flagFabric = true;
}
}
$filter = $this->getProcessFilter();
......@@ -215,7 +219,7 @@ abstract class AbstractBuildForm {
// <form>
if ($mode === FORM_LOAD) {
$htmlT3vars = $this->prepareT3VarsForSave();
$htmlTail = $this->tail();
$htmlTail = $this->tail($flagFabric);
$htmlSubrecords = $this->doSubrecords();
}
$htmlHidden = $this->buildAdditionalFormElements();
......@@ -778,7 +782,7 @@ abstract class AbstractBuildForm {
/**
*
*/
abstract public function tail();
abstract public function tail($flagFabric = false);
/**
*
......@@ -2868,7 +2872,8 @@ abstract class AbstractBuildForm {
$attributeImage .= Support::doAttribute('class', 'qfq-fabric-image');
$htmlImage = Support::wrapTag('<img ' . $attributeImage . '>', '', false);
$attributeFabric = Support::doAttribute('id', 'fabric');
// $attributeFabric = Support::doAttribute('id', 'fabric');
$attributeFabric = Support::doAttribute('class', FABRIC_CSS_CLASS);
$attributeFabric .= Support::doAttribute('data-cotrol-name', $formElement[FE_HTML_ID]);
$attributeFabric .= Support::doAttribute('data-buttons', 'typo3conf/ext/qfq/Resources/Public/Json/fabric.buttons.json');
$attributeFabric .= Support::doAttribute('data-emojis', 'typo3conf/ext/qfq/Resources/Public/Json/qfq.emoji.json');
......
......@@ -489,7 +489,7 @@ class BuildFormBootstrap extends AbstractBuildForm {
/**
* @return string
*/
public function tail() {
public function tail($flagFabric = false) {
$html = '';
$deleteUrl = '';
......@@ -531,6 +531,8 @@ class BuildFormBootstrap extends AbstractBuildForm {
$dirtyAction = ($this->formSpec[F_DIRTY_MODE] == DIRTY_MODE_NONE) ? '' : "dirtyUrl: '$apiDir/dirty.php',";
$fabricJs = $flagFabric ? 'var qfqFabric = new QfqNS.Fabric(); qfqFabric.initialize($(".' . FABRIC_CSS_CLASS . '"));' : '';
$html .= '</form>'; // <form class="form-horizontal" ...
$html .= <<<EOF
<script type="text/javascript">
......@@ -550,6 +552,8 @@ class BuildFormBootstrap extends AbstractBuildForm {
});
var qfqRecordList = new QfqNS.QfqRecordList('$apiDeletePhp');
$fabricJs
})
</script>
EOF;
......
......@@ -96,7 +96,7 @@ class BuildFormPlain extends AbstractBuildForm {
/**
* @return string
*/
public function tail() {
public function tail($flagFabric = false) {
$html = '';
// $html .= $this->buildNewSip();
......
......@@ -130,7 +130,7 @@ class BuildFormTable extends AbstractBuildForm {
/**
* @return string
*/
public function tail() {
public function tail($flagFabric = false) {
$html = '';
......
......@@ -1186,3 +1186,5 @@ const AUTOCRON_SQL1 = 'sql1';
const AUTOCRON_UNIT = 'unit';
const AUTOCRON_COUNT = 'count';
// Annotate
const FABRIC_CSS_CLASS = 'fabric';
\ No newline at end of file
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