{% if editmode %}
<div class="areablock-main">
<div class="areablock-title area-box-padding">
Tabellen-Object einbinden
</div>
<div class="areablock-body area-box-padding">
<p class="hl" style="display: inline-block;text-indent: 37px;">Title Accordion:</p>
<div class="schreiben">
<span class="parentbox">
{{ pimcore_input("Accordiontitle", {'width': 725}) }}
</span>
</div>
<p class="hl" style="display: inline-block;text-indent: 37px;">Optionaler Text über Tabelle:</p>
<div class="schreiben"><span class="parentbox" style="background-color:#fff">
{{ pimcore_wysiwyg('text-wysiwyg-top', {
"height": 80,
"width": 735,
"customConfig": '/bundles/app/static/backend/js/ckeditor/documents/text-wysiwyg.js'
})
}}
</span></div>
<br /><br /><br />
<p class="hl" style="display: inline-block;text-indent: 37px;">Bitte (einzel) Tabellen-Object zuweisen:</p>
<div class="dragdrop">
<span class="parentboxhref">
{{ pimcore_relation("TableObject",{
"types": ["object"],
"subtypes": {
"object": ["object"],
},
"classes": ["preistabellen"],
"width": 735,
}) }}
</span>
</div>
<br /><br /><br />
<p class="hl" style="display: inline-block;text-indent: 37px;">Optionaler Text unter Tabelle:</p>
<div class="schreiben"><span class="parentbox" style="background-color:#fff">
{{ pimcore_wysiwyg('text-wysiwyg-bottom', {
"height": 80,
"width": 735,
"customConfig": '/bundles/app/static/backend/js/ckeditor/documents/text-wysiwyg.js'
})
}}
</span></div>
</div>
</div>
{% else %}
{% set triggerID = random() %}
{% if accordion == 1 %}
<div class="bellows-tab" data-bellow-trigger="{{ triggerID }}">
<figure class="bellows-sign">
<img class="bellow-sign-open" src="/bundles/app/static/frontend/images/icons/accordion_auf.svg" alt=""/>
<img class="bellow-sign-closed" src="/bundles/app/static/frontend/images/icons/accordion_zu.svg" alt=""/>
</figure>
<h5 class="font-bold">{{ pimcore_input("Accordiontitle") }}</h5>
</div>
<div class="bellows-content" data-bellow="{{ triggerID }}">
{% endif %}
{% if accordion == 0 %}
<div id="tablesaw-{{ triggerID }}" class="constrainer-inner edgepadding">
{% endif %}
{% if pimcore_wysiwyg("text-wysiwyg-top").isEmpty() == false %}
<div class="text-wysiwyg-top">
{{ pimcore_wysiwyg("text-wysiwyg-top") |raw }}
</div>
{% endif %}
{% set spalten_str = "" %}
{% if pimcore_relation("TableObject").isEmpty() == false %}
{% set lang = document.getProperty('language') %}
{% set tableObjId = pimcore_relation("TableObject").getId() %}
{% set tblObj = pimcore_object(tableObjId) %}
{% set spalten_str = attribute(tblObj, 'getSpalten_str') is defined ? tblObj.getSpalten_str()|trim : '' %}
{{ table_data(tableObjId, spalten_str, lang) |raw }}
{% endif %}
{# <?php
$objId = (int)$this->href("TableObject")->getid();
$obj = \Pimcore\Model\DataObject::getById($objId);
$spalten_str = '';
if( method_exists($obj,'getSpalten_str' ) )
{
$spalten_str = trim($obj->getSpalten_str());
}
$zebraStripe = (empty($spalten_str)) ? true : false;
if(is_numeric($objId) && ($objId != 0))
{
$lg = $this->document->getProperty('language');
echo AppBundle\Services\Table::getTable($this, $objId, $lg, $zebraStripe);
}
?> #}
{% if pimcore_wysiwyg("text-wysiwyg-bottom").isEmpty() == false %}
<div class="text-wysiwyg-bottom">
{{ pimcore_wysiwyg("text-wysiwyg-bottom") |raw }}
</div>
{% endif %}
{% if accordion == 0 %}</div>{% endif %}
{% if accordion == 1 %}
<style>
{% set hiliteArray = spalten_str|split(',') %}
{% for value in hiliteArray %}
{{ '[data-hilite-index="' ~value~'"]{background-color:#e4e1de85;}' }}
{% endfor %}
</style>
<script type="text/javascript">
(function () {
'use strict';
var moduleName = 'tablesaw_{{ triggerID }}_module'; // naming convention XXX_module
if (typeof selt === 'undefined') {
selt = {
modules: {}
};
} else if (!selt.modules) {
selt.modules = {};
}
selt.modules[moduleName] = {
name: moduleName,
init: function () {
$('[data-bellow="{{ triggerID }}"]').on('bellowsopen', function () {
Tablesaw.init(this);
$(this).off('bellowsopen');
});
}
}
})();//EOS
</script>
{% endif %}
{% if accordion == 0 %}
<script type="text/javascript">
(function () {
'use strict';
var moduleName = 'tablesaw_{{ triggerID }}_module'; // naming convention XXX_module
if (typeof selt === 'undefined') {
selt = {
modules: {}
};
} else if (!selt.modules) {
selt.modules = {};
}
// limit only one tablesaw instance per page
if (!selt.modules[moduleName]) {
selt.modules[moduleName] = {
name: moduleName,
init: function () {
Tablesaw.init( $('#tablesaw-{{ triggerID }}')[0] );
}
};
}
})(typeof window !== "undefined" ? window : this);//EOS
</script>
{% endif %}
{% endif %}