Skip to content
Code-Schnipsel Gruppen Projekte
Commit fe45fae8 erstellt von Michael Danielczok's avatar Michael Danielczok
Dateien durchsuchen

Merge branch 'dev' into 'master'

Dev

See merge request !13
Übergeordnete a5e363a2 fd1dacb3
No related branches found
No related tags found
3 Merge Requests!19Dev,!18Feat menu manager improvement,!13Dev
<div class="quiqqer-menu-navTabsVerticalSettings-entry" style="display: none;"> <form name="quiqqer-bricks-customerReviewsSlider-settings-entry"
<label class="entry-title"> class="quiqqer-bricks-customerReviewsSlider-settings-entry-form"
<span class="entry-title">{{titleIcon}}</span> >
<input class="media-image hide-select-image-button" data-qui-options-cssclasses="1" <table class="data-table data-table-flexbox">
name="titleIcon" /> <tbody>
</label> <tr>
<label> <td>
<span class="entry-title">{{title}}</span> <label class="field-container">
<input type="text" <span class="field-container-item">
name="entryTitle" /> {{fieldIsDisabled}}
</label> </span>
<label class="entry-title"> <span id="isDisabledWrapper" class="field-container-field"></span>
<span class="entry-title">{{image}}</span> </label>
<input class="media-image" data-qui-options-selectable_types="image" </td>
name="entryImage"/> </tr>
</label> <tr>
<label> <td>
<span class="entry-title">{{content}}</span> <label class="field-container">
<input class="field-container-field field-description" data-qui="controls/editors/Input" <span class="field-container-item">
name="entryContent" /> {{fieldTitleIcon}}
</label> </span>
</div> <input name="titleIcon" data-qui-options-cssclasses="1" class="field-container-field media-image"/>
\ No newline at end of file </label>
</td>
</tr>
<tr>
<td>
<label class="field-container">
<span class="field-container-item">
{{fieldEntryTitle}}
</span>
<input name="entryTitle" class="field-container-field field-customerName"/>
</label>
</td>
</tr>
<tr>
<td>
<label class="field-container">
<span class="field-container-item">
{{fieldEntryImage}}
</span>
<input name="entryImage" class="field-container-field media-image"/>
</label>
</td>
</tr>
<tr>
<td>
<label class="field-container">
<span class="field-container-item">
{{fieldEntryContent}}
</span>
<input name="entryContent" class="field-container-field field-entryContent" data-qui="controls/editors/Input"/>
</label>
</td>
</tr>
</tbody>
</table>
</form>
/** /**
* @module package/quiqqer/menu/bin/Controls/NavTabsVertical
* @author Dominik Chrzanowski
* *
* @module package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings
*
* @require qui/controls/elements/FormList
* @require css!package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings.css
*/ */
define('package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings', [ define('package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings', [
'qui/controls/elements/FormList', 'qui/QUI',
'utils/Controls', 'qui/controls/Control',
'qui/controls/windows/Confirm',
'qui/controls/buttons/Button',
'qui/controls/buttons/Switch',
'Locale', 'Locale',
'Mustache', 'Mustache',
'controls/grid/Grid',
'utils/Controls',
'text!package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings.html', 'text!package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings.html',
'css!package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings.css' 'css!package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings.css'
], function (QUIFormList, QUIControls, QUILocale, Mustache, template) { ], function (
QUI,
QUIControl,
QUIConfirm,
QUIButton,
QUISwitch,
QUILocale,
Mustache,
Grid,
ControlsUtils,
templateEntry
) {
"use strict"; "use strict";
var lg = 'quiqqer/menu'; var lg = 'quiqqer/menu';
return new Class({ return new Class({
Extends: QUIFormList, Extends: QUIControl,
Type : 'package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings', Type : 'package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings',
Binds: [ Binds: [
'$onParsed' '$onImport',
'$openAddDialog',
'$openDeleteDialog',
'$openEditDialog',
'$toggleSlideStatus',
'update'
], ],
initialize: function (options) { initialize: function (options) {
this.parent(options); this.parent(options);
this.$Project = null; this.$Input = null;
this.$Grid = null;
this.$data = [];
this.addEvents({ this.addEvents({
onParsed: this.$onParsed onImport: this.$onImport
});
},
/**
* event: on import
*/
$onImport: function () {
this.$Input = this.getElm();
this.$Elm = new Element('div', {
'class': 'quiqqer-menu-navTabsVertival-settings',
styles : {
clear : 'both',
'float' : 'left',
height : 400,
overflow: 'hidden',
position: 'relative',
margin : '10px 0 0 0',
width : '100%'
}
}).wraps(this.$Input);
// grid and sizes
var size = this.$Elm.getSize();
var Desktop = new Element('div', {
styles: {
width: size.x
}
}).inject(this.$Elm);
this.$Grid = new Grid(Desktop, {
height : 400,
width : size.x,
buttons : [
{
name : 'up',
icon : 'fa fa-angle-up',
disabled: true,
events : {
onClick: function () {
this.$Grid.moveup();
this.$refreshSorting();
}.bind(this)
}
}, {
name : 'down',
icon : 'fa fa-angle-down',
disabled: true,
events : {
onClick: function () {
this.$Grid.movedown();
this.$refreshSorting();
}.bind(this)
}
}, {
type: 'separator'
}, {
name : 'add',
textimage: 'fa fa-plus',
text : QUILocale.get('quiqqer/quiqqer', 'add'),
events : {
onClick: this.$openAddDialog
}
}, {
type: 'separator'
}, {
name : 'edit',
textimage: 'fa fa-edit',
text : QUILocale.get('quiqqer/quiqqer', 'edit'),
disabled : true,
events : {
onClick: this.$openEditDialog
}
}, {
name : 'delete',
textimage: 'fa fa-trash',
text : QUILocale.get('quiqqer/quiqqer', 'delete'),
disabled : true,
events : {
onClick: this.$openDeleteDialog
}
}
],
columnModel: [
{
header : QUILocale.get(lg, 'control.navTabsVertical.entries.isDisable'),
dataIndex: 'isDisabledDisplay',
dataType : 'QUI',
width : 80
}, {
dataIndex: 'isDisabled',
hidden : true
}, {
header : QUILocale.get(lg, 'control.navTabsVertical.entries.entryTitleIcon'),
dataIndex: 'titleIconPreview',
dataType : 'node',
width : 120
},
{
header : QUILocale.get(lg, 'control.navTabsVertical.entries.entryTitle'),
dataIndex: 'entryTitle',
dataType : 'code',
width : 120
},
{
header : QUILocale.get(lg, 'control.navTabsVertical.entries.entryImage'),
dataIndex: 'entryImagePreview',
dataType : 'node',
width : 60
},
{
header : QUILocale.get(lg, 'control.navTabsVertical.entries.entryContent'),
dataIndex: 'entryContent',
dataType : 'code',
width : 250
},
{
dataIndex: 'newTab',
hidden : true
}, {
dataIndex: 'image',
dataType : 'string',
hidden : true
}
]
}); });
this.getElm().addClass('qui-controls-formlist-navTabsVerticalSettings'); this.$Grid.addEvents({
onClick: function () {
this.setAttributes({ var buttons = this.$Grid.getButtons(),
buttonText: QUILocale.get(lg, 'control.navTabsVertical.entries.addButton'),
entry : Mustache.render(template, { Edit = buttons.filter(function (Btn) {
'title' : QUILocale.get(lg, 'control.navTabsVertical.entries.entryTitle'), return Btn.getAttribute('name') === 'edit';
'titleIcon' : QUILocale.get(lg, 'control.navTabsVertical.entries.entryTitleIcon'), })[0],
'titleIconColor': QUILocale.get(lg, 'control.navTabsVertical.entries.entryTitleIconColor'),
'image' : QUILocale.get(lg, 'control.navTabsVertical.entries.entryImage'), Up = buttons.filter(function (Btn) {
'content' : QUILocale.get(lg, 'control.navTabsVertical.entries.entryContent') return Btn.getAttribute('name') === 'up';
}) })[0],
Down = buttons.filter(function (Btn) {
return Btn.getAttribute('name') === 'down';
})[0],
Delete = buttons.filter(function (Btn) {
return Btn.getAttribute('name') === 'delete';
})[0];
Up.enable();
Down.enable();
Edit.enable();
Delete.enable();
}.bind(this),
onDblClick: this.$openEditDialog
}); });
this.$Grid.getElm().setStyles({
position: 'absolute'
});
try {
this.$data = JSON.decode(this.$Input.value);
if (typeOf(this.$data) !== 'array') {
this.$data = [];
}
this.refresh();
} catch (e) {
}
}, },
/** /**
* @event on import * Toggles the slide's status between enabled and disabled
* *
* https://dev.quiqqer.com/quiqqer/package-bricks/issues/97 * @param {Object} [Caller] - the object calling this event
*/ */
$onImport: function () { $toggleSlideStatus: function (Caller) {
// look if some value exist if (!Caller) {
var value = this.getElm().value;
if (value === '') {
this.parent();
return; return;
} }
value = JSON.decode(value); // get cell number
var row = Caller.getElm().getParent('li').get('data-row');
if (typeOf(value) !== 'array') { this.$data[row].isDisabled = Caller.getStatus();
this.parent(); this.update();
return; },
}
/**
* Resize the control
*
* @return {Promise}
*/
resize: function () {
var size = this.getElm().getSize();
return this.$Grid.setWidth(size.x).then(function () {
this.$Grid.resize();
}.bind(this));
},
/**
* refresh the display
*/
refresh: function () {
var i, len, entry, insert;
var data = [];
for (i = 0, len = this.$data.length; i < len; i++) {
entry = this.$data[i];
insert = {
titleIcon : '',
entryImage : '',
titleIconPreview : new Element('span', {html: '&nbsp;'}),
entryImagePreview: new Element('span', {html: '&nbsp;'})
};
for (var i = 0, len = value.length; i < len; i++) { entry.isDisabled = parseInt(entry.isDisabled);
if (typeof value[i].content !== 'undefined') {
value[i]['entryContent'] = value[i].content; insert.isDisabledDisplay = new QUISwitch({
status: entry.isDisabled,
name : i,
uid : i,
events: {
onChange: this.$toggleSlideStatus
}
});
if ("titleIcon" in entry && entry.titleIcon !== '') {
insert.titleIcon = entry.titleIcon;
if (entry.titleIcon.includes('fa ')) {
insert.titleIconPreview = new Element('span', {
'class': insert.titleIcon
});
} else {
insert.titleIconPreview = new Element('img', {
src : URL_DIR + insert.titleIcon + '&maxwidth=50&maxheight=50',
width : 50,
height: 50
});
}
} }
if (typeof value[i].title !== 'undefined') { if ("entryTitle" in entry) {
value[i]['entryTitle'] = value[i].title; insert.entryTitle = entry.entryTitle;
} }
if (typeof value[i].image !== 'undefined') { if ("entryImage" in entry && entry.entryImage !== '') {
value[i]['entryImage'] = value[i].title; insert.entryImage = entry.entryImage;
insert.entryImagePreview = new Element('img', {
src : URL_DIR + insert.entryImage + '&maxwidth=50&maxheight=50',
width : 50,
height: 50
});
}
if ("entryContent" in entry) {
insert.entryContent = entry.entryContent;
}
data.push(insert);
}
this.$Grid.setData({
data: data
});
var buttons = this.$Grid.getButtons(),
Edit = buttons.filter(function (Btn) {
return Btn.getAttribute('name') === 'edit';
})[0],
Up = buttons.filter(function (Btn) {
return Btn.getAttribute('name') === 'up';
})[0],
Down = buttons.filter(function (Btn) {
return Btn.getAttribute('name') === 'down';
})[0],
Delete = buttons.filter(function (Btn) {
return Btn.getAttribute('name') === 'delete';
})[0];
Up.disable();
Down.disable();
Edit.disable();
Delete.disable();
},
/**
* Update the field
*/
update: function () {
this.$Input.value = JSON.encode(this.$data);
},
/**
* Add an entry
*
* @param {Object} params
*/
add: function (params) {
var entry = {
titleIcon : '',
entryTitle : '',
entryImage : '',
entryContent: '',
isDisabled : 0
};
if ("isDisabled" in params) {
entry.isDisabled = parseInt(params.isDisabled);
}
if ("titleIcon" in params && params.titleIcon !== '') {
entry.titleIcon = params.titleIcon;
}
if ("entryTitle" in params) {
entry.entryTitle = params.entryTitle;
}
if ("entryImage" in params) {
entry.entryImage = params.entryImage;
}
if ("entryContent" in params) {
entry.entryContent = params.entryContent;
}
this.$data.push(entry);
this.refresh();
this.update();
},
/**
* Edit an entry
*
* @param {number} index
* @param {object} params
*/
edit: function (index, params) {
if (typeof index === 'undefined') {
return;
}
var entry = {
titleIcon : '',
entryTitle : '',
entryImage : '',
entryContent: '',
isDisabled : 0
};
if ("isDisabled" in params) {
entry.isDisabled = parseInt(params.isDisabled);
}
if ("titleIcon" in params) {
entry.titleIcon = params.titleIcon;
}
if ("entryTitle" in params) {
entry.entryTitle = params.entryTitle;
}
if ("entryImage" in params) {
entry.entryImage = params.entryImage;
}
if ("entryContent" in params) {
entry.entryContent = params.entryContent;
}
this.$data[index] = entry;
this.refresh();
this.update();
},
/**
* Delete one entry or multiple entries
*
* @param {number|array} index
*/
del: function (index) {
var newList = [];
if (typeOf(index) !== 'array') {
index = [index];
}
for (var i = 0, len = this.$data.length; i < len; i++) {
if (!index.contains(i)) {
newList.push(this.$data[i]);
} }
} }
this.getElm().value = JSON.encode(value); this.$data = newList;
this.parent();
}, },
/** /**
* set the project to the control * Set the used project
* *
* @param Project * @param {string|object} Project
*/ */
setProject: function (Project) { setProject: function (Project) {
this.$Project = Project; this.setAttribute('project', Project);
this.$onParsed(false, this.getElm());
var controls = QUI.Controls.getControlsInElement(this.getElm());
controls.each(function (Control) {
if (Control === this) {
return;
}
if ("setProject" in Control) {
Control.setProject(Project);
}
}.bind(this));
},
/**
* Refresh the data sorting in dependence of the grid
*/
$refreshSorting: function () {
var gridData = this.$Grid.getData(),
data = [];
for (var i = 0, len = gridData.length; i < len; i++) {
data.push({
isDisabled : parseInt(gridData[i].isDisabled),
titleIcon : gridData[i].titleIcon,
entryTitle : gridData[i].entryTitle,
entryImage : gridData[i].entryImage,
entryContent: gridData[i].entryContent
});
}
this.$data = data;
this.update();
}, },
/** /**
* Parses QUI controls when a new entry is created * Dialogs
*/
/**
* opens the delete dialog
* *
* Fired after (inherited) FormList has parsed the content * @return {Promise}
*/
$openDeleteDialog: function () {
new QUIConfirm({
icon : 'fa fa-icon',
text : QUILocale.get(lg, 'control.navTabsVertical.entries.delete.title'),
information: QUILocale.get(lg, 'control.navTabsVertical.entries.delete.information'),
texticon : false,
maxWidth : 600,
maxHeight : 400,
ok_button : {
text : QUILocale.get('quiqqer/quiqqer', 'delete'),
textimage: 'fa fa-trash'
},
events : {
onSubmit: function () {
var selected = this.$Grid.getSelectedIndices();
this.$Grid.deleteRows(selected);
this.del(selected);
this.update();
}.bind(this)
}
}).open();
},
/**
* Open edit dialog
* *
* @param event * @retrun {Promise}
* @param Node - The element that was previously parsed by (inherited) FormList
*/ */
$onParsed: function (event, Node) { $openEditDialog: function () {
if (!this.$Project) { var self = this,
return; data = this.$Grid.getSelectedData(),
index = this.$Grid.getSelectedIndices();
if (!data.length) {
return Promise.resolve();
} }
this.$executeParsing(Node); data = data[0];
index = index[0];
return this.$createDialog().then(function (Dialog) {
Dialog.addEvent('onSubmit', function () {
Dialog.Loader.show();
var Content = Dialog.getContent();
var Form = Content.getElement('form');
var Image = Form.elements.titleIcon;
var entryTitle = Form.elements.entryTitle;
var entryImage = Form.elements.entryImage;
var entryContent = Form.elements.entryContent;
self.edit(index, {
titleIcon : Image.value,
entryTitle : entryTitle.value,
entryImage : entryImage.value,
entryContent: entryContent.value,
isDisabled : Dialog.IsDisabledSwitch.getStatus()
});
Dialog.close();
});
Dialog.addEvent('onOpenAfterCreate', function () {
var Content = Dialog.getContent();
var Form = Content.getElement('form');
var Image = Form.elements.titleIcon;
var entryTitle = Form.elements.entryTitle;
var entryImage = Form.elements.entryImage;
var entryContent = Form.elements.entryContent;
if (data.isDisabled) {
Dialog.IsDisabledSwitch.on();
} else {
Dialog.IsDisabledSwitch.off();
}
Image.value = data.titleIcon;
entryTitle.value = data.entryTitle;
entryImage.value = data.entryImage;
entryContent.value = data.entryContent;
if (data.newTab && data.newTab.getAttribute('data-enabled') === "1") {
Dialog.NewTabSwitch.on();
} else {
Dialog.NewTabSwitch.off();
}
Image.fireEvent('change');
entryTitle.fireEvent('change');
entryImage.fireEvent('change');
entryContent.fireEvent('change');
});
Dialog.setAttribute('title', QUILocale.get(lg, 'control.navTabsVertical.entries.edit.title'));
Dialog.open();
});
}, },
/** /**
* Parse the editor * opens the add dialog
* *
* @param Node * @return {Promise}
* @returns {Promise}
*/ */
$executeParsing: function (Node) { $openAddDialog: function () {
var self = this; var self = this;
return QUIControls.parse(Node).then(function () { return this.$createDialog().then(function (Dialog) {
// Element is fully parsed so we can finally show it Dialog.addEvent('onSubmit', function () {
Node.getElements('.quiqqer-menu-navTabsVerticalSettings-entry').show(); Dialog.Loader.show();
self.getElm().addClass('qui-controls-formlist-navTabsVerticalSettings');
var Content = Dialog.getContent();
var Form = Content.getElement('form');
var Image = Form.elements.titleIcon;
var entryTitle = Form.elements.entryTitle;
var entryImage = Form.elements.entryImage;
var entryContent = Form.elements.entryContent;
self.add({
titleIcon : Image.value,
entryTitle : entryTitle.value,
entryImage : entryImage.value,
entryContent: entryContent.value,
isDisabled : Dialog.IsDisabledSwitch.getStatus()
});
var inputEditors = Node.getElements('[data-qui="controls/editors/Input"]').map(function (InnerNode) { Dialog.close();
return QUI.Controls.getById(InnerNode.get('data-quiid'));
}); });
for (var i = 0, len = inputEditors.length; i < len; i++) { Dialog.open();
if (inputEditors[i]) { });
inputEditors[i].setProject(self.$Project); },
/**
* Create a edit / add entry dialog
*
* @return {Promise}
*/
$createDialog: function () {
var self = this;
return new Promise(function (resolve) {
var Dialog = new QUIConfirm({
title : QUILocale.get(lg, 'control.navTabsVertical.entries.add.title'),
icon : 'fa fa-edit',
maxWidth : 800,
maxHeight : 600,
autoclose : false,
IsDisabledSwitch: false,
NewTabSwitch : false,
events : {
onOpen: function (Win) {
Win.Loader.show();
Win.getContent().set('html', '');
var prefix = 'control.navTabsVertical.entries.',
Container = new Element('div', {
html : Mustache.render(templateEntry, {
fieldIsDisabled : QUILocale.get(lg, prefix + 'isDisable'),
fieldTitleIcon : QUILocale.get(lg, prefix + 'entryTitleIcon'),
fieldEntryTitle : QUILocale.get(lg, prefix + 'entryTitle'),
fieldEntryImage : QUILocale.get(lg, prefix + 'entryImage'),
fieldEntryContent: QUILocale.get(lg, prefix + 'entryContent')
}),
'class': 'quiqqer-menu-navTabsVertival-settings'
}).inject(Win.getContent());
var Text = Container.getElement('.field-entryContent');
Text.getParent().setStyles({
height: 100
});
Win.IsDisabledSwitch = new QUISwitch({
name : 'isDisabled',
status: false
}).inject(Container.getElement('#isDisabledWrapper'));
Win.NewTabSwitch = new QUISwitch({
name: 'newTab'
}).inject(Container.getElement('#newTabWrapper'));
QUI.parse(Container).then(function () {
return ControlsUtils.parse(Container);
}).then(function () {
var controls = QUI.Controls.getControlsInElement(Container),
project = self.getAttribute('project');
controls.each(function (Control) {
if (Control === self) {
return;
}
if ("setProject" in Control) {
Control.setProject(project);
}
});
Win.fireEvent('openAfterCreate', [Win]);
moofx(Container).animate({
opacity: 1,
top : 0
}, {
duration: 250,
callback: function () {
resolve(Container);
Win.Loader.hide();
}
});
});
}
} }
} });
resolve(Dialog);
}); });
} }
}); });
......
...@@ -135,11 +135,10 @@ ...@@ -135,11 +135,10 @@
var="control.navTabsVertical.navContent"/> var="control.navTabsVertical.navContent"/>
</setting> </setting>
<setting name="entries" <setting name="entries" type="hidden" data-qui="package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings">
data-qui="package/quiqqer/menu/bin/Controls/NavTabsVerticalSettings"> <locale group="quiqqer/menu" var="control.navTabsVertical.entries"/>
<locale group="quiqqer/menu"
var="control.navTabsVertical.entries"/>
</setting> </setting>
</settings> </settings>
</brick> </brick>
......
...@@ -203,10 +203,30 @@ ...@@ -203,10 +203,30 @@
<de><![CDATA[Tabs]]></de> <de><![CDATA[Tabs]]></de>
<en><![CDATA[Tabs]]></en> <en><![CDATA[Tabs]]></en>
</locale> </locale>
<locale name="control.navTabsVertical.entries.add.title">
<de><![CDATA[Eintrag hinzufügen]]></de>
<en><![CDATA[Add Entry]]></en>
</locale>
<locale name="control.navTabsVertical.entries.edit.title">
<de><![CDATA[Eintrag bearbeiten]]></de>
<en><![CDATA[Edit Entry]]></en>
</locale>
<locale name="control.navTabsVertical.entries.delete.title">
<de><![CDATA[Möchten Sie diesen Eintrag wirklich entfernen?]]></de>
<en><![CDATA[Do you really want to remove this entry?]]></en>
</locale>
<locale name="control.navTabsVertical.entries.delete.information">
<de><![CDATA[Der Eintrag kann nicht wiederhergestellt werden]]></de>
<en><![CDATA[The entries can not be restored]]></en>
</locale>
<locale name="control.navTabsVertical.entries.addButton"> <locale name="control.navTabsVertical.entries.addButton">
<de><![CDATA[Eintrag hinzufügen]]></de> <de><![CDATA[Eintrag hinzufügen]]></de>
<en><![CDATA[Add entry]]></en> <en><![CDATA[Add entry]]></en>
</locale> </locale>
<locale name="control.navTabsVertical.entries.isDisable">
<de><![CDATA[Deaktiviert]]></de>
<en><![CDATA[Disabled]]></en>
</locale>
<locale name="control.navTabsVertical.entries.entryTitle"> <locale name="control.navTabsVertical.entries.entryTitle">
<de><![CDATA[Titel]]></de> <de><![CDATA[Titel]]></de>
<en><![CDATA[Title]]></en> <en><![CDATA[Title]]></en>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
{/if} {/if}
{if $this->getAttribute('content') != ""} {if $this->getAttribute('content') != ""}
<div class="control-body"> <div class="control-body default-content">
{$this->getAttribute('content')} {$this->getAttribute('content')}
</div> </div>
{/if} {/if}
...@@ -89,7 +89,11 @@ ...@@ -89,7 +89,11 @@
</div> </div>
{/if} {/if}
{$entryContent} {if $entryContent}
<div class="default-content">
{$entryContent}
</div>
{/if}
{if $entryImage && $imagePos == 'bottom'} {if $entryImage && $imagePos == 'bottom'}
<div class="quiqqer-menu-navTabsVertical-content-image <div class="quiqqer-menu-navTabsVertical-content-image
......
...@@ -50,14 +50,23 @@ public function getBody() ...@@ -50,14 +50,23 @@ public function getBody()
{ {
$Engine = QUI::getTemplateManager()->getEngine(); $Engine = QUI::getTemplateManager()->getEngine();
$entries = $this->getAttribute('entries'); $entries = $this->getAttribute('entries');
$enabledEntries = [];
if (is_string($entries)) { if (is_string($entries)) {
$entries = json_decode($entries, true); $entries = json_decode($entries, true);
} }
foreach ($entries as $entry) {
if (isset($entry['isDisabled']) && $entry['isDisabled'] === 1) {
continue;
}
array_push($enabledEntries, $entry);
}
$Engine->assign([ $Engine->assign([
'this' => $this, 'this' => $this,
'entries' => $entries, 'entries' => $enabledEntries,
'navTitle' => $this->getAttribute('navTitle'), 'navTitle' => $this->getAttribute('navTitle'),
'navContent' => $this->getAttribute('navContent'), 'navContent' => $this->getAttribute('navContent'),
'imagePos' => $this->getAttribute('imagePos') 'imagePos' => $this->getAttribute('imagePos')
......
0% oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren