/* 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":"&lt;main&gt;&lt;buttondatas&gt;{% 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 %}&lt;buttondata&gt&lt;nom&gt;{{ item.title|lower }}&lt;\/nom&gt;&lt;icon&gt;{% if item.icon %}{{ app.request.getSchemeAndHttpHost() }}/{{ alias }}{{ item.icon.label }}{% else %}{{ app.request.getSchemeAndHttpHost() }}/{{ alias }}uploads/icon/icon_pin.png{% endif %}&lt;\/icon&gt;&lt;libelle&gt;{{ item.subtitle | e('js') }}&lt;\/libelle&gt;&lt;url&gt;{{ item.url }}&lt;\/url&gt;&lt;categoriename&gt;{{ item.itemcategory.label|lower }}&lt;\/categoriename&gt;&lt;categorieid&gt;{{ item.itemcategory.id }}&lt;\/categorieid&gt;&lt;infos_url&gt;&lt;\/infos_url&gt;&lt;infos_type&gt;&lt;\/infos_type&gt;&lt;infos_message&gt;&lt;\/infos_message&gt;&lt;\/buttondata&gt;{% endfor %}{% endfor %}{% if (bookmarks is not empty)  %}
{% for bookmark in bookmarks %}
{% if bookmark.item %}&lt;buttondata&gt&lt;nom&gt;{{ bookmark.item.title|lower }}&lt;\/nom&gt;&lt;icon&gt;{% if bookmark.item.icon %}{{ app.request.getSchemeAndHttpHost() }}/{{ alias }}{{ bookmark.item.icon.label }}{% else %}{{ app.request.getSchemeAndHttpHost() }}/{{ alias }}uploads/icon/icon_pin.png{% endif %}&lt;libelle&gt;{{ bookmark.item.subtitle|lower|e('js') }}&lt;\/libelle&gt;;&lt;url&gt;{{ bookmark.item.url }}&lt;\/url&gt;&lt;categoriename&gt;{{ bookmark.item.itemcategory.label|lower }}&lt;\/categoriename&gt;&lt;categorieid&gt;{{ bookmark.item.itemcategory.id }}&lt;\/categorieid&gt;&lt;infos_url&gt;&lt;\/infos_url&gt;&lt;infos_type&gt;&lt;\/infos_type&gt;&lt;infos_message&gt;&lt;\/infos_message&gt;&lt;\/buttondata&gt;{% endif %}
{% endfor %}
{% endif %}
&lt;\/buttondatas&gt;&lt;description&gt;&lt;services_url&gt;undefined&lt;\/services_url&gt;&lt;\/description&gt;&lt;categories&gt;{% for itemcategory in mycategs %}&lt;categorie&gt;&lt;nom&gt;{{ itemcategory.label }}&lt;\/nom&gt;&lt;couleur&gt;{% if itemcategory.color is null %}#A0A0A0{% else %}{{ itemcategory.color }}{% endif %}&lt;\/couleur&gt;&lt;indice&gt;{{ itemcategory.rowOrder }}&lt;\/indice&gt;&lt;icone&gt;{% if itemcategory.icon is null %}fa-square{% else %}{{ itemcategory.icon }}{% endif %}&lt;\/icone&gt;&lt;\/categorie&gt;{% endfor %}&lt;\/categories&gt;&lt;\/main&gt;","favoris":"{% if (bookmarks is not empty)  %}[
{% for bookmark in bookmarks %}
{% if bookmark.item %}
{&quot;url&quot;:&quot;{{ bookmark.item.url }}&quot;,&quot;libelle&quot;:&quot;{{ bookmark.item.title|lower }}&quot;,&quot;icon&quot;:&quot;{% if bookmark.item.icon %}{{ app.request.getSchemeAndHttpHost() }}/{{ alias }}{{ bookmark.item.icon.label }}{% else %}{{ app.request.getSchemeAndHttpHost() }}/{{ alias }}uploads/icon/icon_pin.png{% endif %}&quot;},
{% endif %}
{% endfor %}
{% endif %}
"userinfos":{&quot;profil&quot;:&quot;{{ profil }}&quot;,&quot;rne&quot;:&quot;{{ rne }}&quot;,&quot;groupes&quot;:&quot;{{ groupe }}&quot;}","id":{{ id }}}');
    }
