53 lines
3.8 KiB
Twig
Executable File
53 lines
3.8 KiB
Twig
Executable File
/* DATA_FOR_MXDESKTOP: Ne pas supprimer cette ligne */
|
|
var username='{{ username }}';
|
|
var source=MX.getSource('{{ id }}');
|
|
if (!source) {
|
|
console.log("Source {{ id }} introuvable");
|
|
} else {
|
|
source.setData('{"xml":"<main><buttondatas>{% set mycategs = [] %}
|
|
{% for itemcategory in itemcategorys %}
|
|
{% set haveitem=false %}
|
|
{% for item in items if item.itemcategory==itemcategory %}
|
|
{% if loop.index ==1 %}
|
|
{% set mycategs = mycategs|merge({ (loop.index) : itemcategory}) %}
|
|
{% endif %}
|
|
{% endfor %}
|
|
{% endfor %}
|
|
{% set firstcat=true %}
|
|
{% for itemcategory in mycategs %}
|
|
{% set haveitem=false %}
|
|
{% for item in items if item.itemcategory==itemcategory %}
|
|
{% if loop.index ==1 %}
|
|
{% set haveitem=true %}
|
|
{% if (bookmarks is not empty) %}
|
|
{% set toview=true %}
|
|
{% if menu and not menuall%}
|
|
{% set toview=false %}
|
|
{% endif %}
|
|
{% else %}
|
|
{% if menu and not menuall%}
|
|
{% if firstcat %}
|
|
{% set toview=true %}
|
|
{% else %}
|
|
{% set toview=false %}
|
|
{% endif %}
|
|
{% else %}
|
|
{% set toview=true %}
|
|
{% endif %}
|
|
{% endif %}
|
|
{% set firstcat=false %}
|
|
{% endif %}<buttondata><nom>{{ item.title|lower }}<\/nom><icon>{% if item.icon %}{{ app.request.getSchemeAndHttpHost() }}/{{ alias }}/{{ item.icon.label }}{% else %}{{ app.request.getSchemeAndHttpHost() }}/{{ alias }}/uploads/icon/icon_pin.png{% endif %}<\/icon><libelle>{{ item.subtitle | e('js') }}<\/libelle><url>{{ item.url }}<\/url><categoriename>{{ item.itemcategory.label|lower }}<\/categoriename><categorieid>{{ item.itemcategory.id }}<\/categorieid><infos_url><\/infos_url><infos_type><\/infos_type><infos_message><\/infos_message><\/buttondata>{% endfor %}{% endfor %}{% if (bookmarks is not empty) %}
|
|
{% for bookmark in bookmarks %}
|
|
{% if bookmark.item %}<buttondata><nom>{{ bookmark.item.title|lower }}<\/nom><icon>{% if bookmark.item.icon %}{{ app.request.getSchemeAndHttpHost() }}/{{ alias }}/{{ bookmark.item.icon.label }}{% else %}{{ app.request.getSchemeAndHttpHost() }}/{{ alias }}/uploads/icon/icon_pin.png{% endif %}<libelle>{{ bookmark.item.subtitle|lower|e('js') }}<\/libelle>;<url>{{ bookmark.item.url }}<\/url><categoriename>{{ bookmark.item.itemcategory.label|lower }}<\/categoriename><categorieid>{{ bookmark.item.itemcategory.id }}<\/categorieid><infos_url><\/infos_url><infos_type><\/infos_type><infos_message><\/infos_message><\/buttondata>{% endif %}
|
|
{% endfor %}
|
|
{% endif %}
|
|
<\/buttondatas><description><services_url>undefined<\/services_url><\/description><categories>{% for itemcategory in mycategs %}<categorie><nom>{{ itemcategory.label }}<\/nom><couleur>{% if itemcategory.color is null %}#A0A0A0{% else %}{{ itemcategory.color }}{% endif %}<\/couleur><indice>{{ itemcategory.rowOrder }}<\/indice><icone>{% if itemcategory.icon is null %}fa-square{% else %}{{ itemcategory.icon }}{% endif %}<\/icone><\/categorie>{% endfor %}<\/categories><\/main>","favoris":"{% if (bookmarks is not empty) %}[
|
|
{% for bookmark in bookmarks %}
|
|
{% if bookmark.item %}
|
|
{"url":"{{ bookmark.item.url }}","libelle":"{{ bookmark.item.title|lower }}","icon":"{% if bookmark.item.icon %}{{ app.request.getSchemeAndHttpHost() }}/{{ alias }}/{{ bookmark.item.icon.label }}{% else %}{{ app.request.getSchemeAndHttpHost() }}/{{ alias }}/uploads/icon/icon_pin.png{% endif %}"},
|
|
{% endif %}
|
|
{% endfor %}
|
|
{% endif %}
|
|
"userinfos":{"profil":"{{ profil }}","rne":"{{ rne }}","groupes":"{{ groupe }}"}","id":{{ id }}}');
|
|
}
|