From de803ac336a5aa983e7f39bba6358aaf752c4f58 Mon Sep 17 00:00:00 2001 From: afornerot Date: Fri, 17 Jul 2020 12:02:25 +0200 Subject: [PATCH] =?UTF-8?q?pouvoir=20g=C3=A9rer=20les=20icones=20directeme?= =?UTF-8?q?nt=20via=20la=20selection=20des=20icones=20(ref=20#188)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/IconController.php | 6 +- .../views/Alertcategory/edit.html.twig | 42 ++++--------- .../Resources/views/Bookmark/edit.html.twig | 56 ++++-------------- .../Resources/views/Icon/select.html.twig | 10 ++-- .../Resources/views/Item/edit.html.twig | 44 ++++---------- .../Resources/views/Pagewidget/edit.html.twig | 59 +++++-------------- 6 files changed, 58 insertions(+), 159 deletions(-) diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/IconController.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/IconController.php index 3ef5ba5a..be8974f4 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/IconController.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Controller/IconController.php @@ -32,7 +32,7 @@ class IconController extends Controller return $this->render($this->labelentity.':list.html.twig',[ 'useheader' => !($inframe), 'usemenu' => false, - 'usesidebar' => ($access=="config"), + 'usesidebar' => ($access=="config"&&!$inframe), 'access' => $access, $this->labeldatas => $icons, 'inframe' => $inframe @@ -74,7 +74,7 @@ class IconController extends Controller return $this->render($this->labelentity.':edit.html.twig', [ 'useheader' => !($inframe), 'usemenu' => false, - 'usesidebar' => ($access=="config"), + 'usesidebar' => ($access=="config"&&!$inframe), 'access' => $access, $this->labeldata => $data, 'mode' => 'submit', @@ -119,7 +119,7 @@ class IconController extends Controller return $this->render($this->labelentity.':edit.html.twig', [ 'useheader' => !($inframe), 'usemenu' => false, - 'usesidebar' => ($access=="config"), + 'usesidebar' => ($access=="config"&&!$inframe), 'access' => $access, $this->labeldata => $data, 'mode' => 'update', diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Alertcategory/edit.html.twig b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Alertcategory/edit.html.twig index 2a2f0045..a5f80c5d 100755 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Alertcategory/edit.html.twig +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Alertcategory/edit.html.twig @@ -57,49 +57,31 @@
{{ form_row(form.idicon) }} - Selectionner une Icône + Selectionner une Icône Détacher l'Icône
- {{ form_end(form) }} {% endblock %} {% block localjavascript %} - function selIcon(idicon) { + function selIcon(idicon,label) { $("#alertcategory_idicon").val(idicon); $("#diviconsel img").remove(); - $("#icon-"+idicon).clone().appendTo($("#diviconsel")); + url="/{{ alias }}/"+label; + $("#diviconsel").append(""); $("#diviconsel img").attr("height","100px"); - $('#selicon').modal('hide'); + $("#mymodal").modal("hide"); + } + + function selectIcon() { + $("#mymodal").find(".modal-title").html("SELECTIONNER UNE ICONE"); + var url="{{ path('cadoles_portal_config_icon_select') }}"; + $("#mymodal").find("#framemodal").attr("src",url); + $("#mymodal").modal("show"); } function delIcon() { diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Bookmark/edit.html.twig b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Bookmark/edit.html.twig index be282445..b60f448f 100755 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Bookmark/edit.html.twig +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Bookmark/edit.html.twig @@ -69,51 +69,11 @@
{{ form_row(form.idicon) }} - Selectionner une Icône + Selectionner une Icône Détacher l'Icône
- - {{ form_end(form) }} {% endblock %} @@ -126,13 +86,21 @@ showhide(); }); - function selIcon(idicon) { + function selIcon(idicon,label) { $("#bookmark_idicon").val(idicon); $("#diviconsel img").remove(); - $("#icon-"+idicon).clone().appendTo($("#diviconsel")); + url="/{{ alias }}/"+label; + $("#diviconsel").append(""); $("#diviconsel img").attr("height","100px"); - $('#selicon').modal('hide'); + $("#mymodal").modal("hide"); + } + + function selectIcon() { + $("#mymodal").find(".modal-title").html("SELECTIONNER UNE ICONE"); + var url="{{ path('cadoles_portal_user_icon_select') }}"; + $("#mymodal").find("#framemodal").attr("src",url); + $("#mymodal").modal("show"); } function delIcon() { diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Icon/select.html.twig b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Icon/select.html.twig index 3a5bbdcd..c6d02ba0 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Icon/select.html.twig +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Icon/select.html.twig @@ -6,6 +6,8 @@ Fermer {% if access=="user" %} Gérer mes Icônes + {% else %} + Gérer les Icônes {% endif %} @@ -13,17 +15,13 @@ {% if iconsuser is not empty %}

Mes Icônes

{% for icon in iconsuser %} - - - + {% endfor %}

Icônes Communs

{% endif %} {% for icon in icons %} - - - + {% endfor %} diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Item/edit.html.twig b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Item/edit.html.twig index 29ad6d25..c09e4bfe 100755 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Item/edit.html.twig +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Item/edit.html.twig @@ -71,37 +71,10 @@
{{ form_row(form.idicon) }} - Selectionner une Icône + Selectionner une Icône Détacher l'Icône
- - - {{ form_end(form) }} {% endblock %} @@ -115,15 +88,24 @@ showhide(); }); - function selIcon(idicon) { + function selIcon(idicon,label) { $("#item_idicon").val(idicon); $("#diviconsel img").remove(); - $("#icon-"+idicon).clone().appendTo($("#diviconsel")); + url="/{{ alias }}/"+label; + $("#diviconsel").append(""); $("#diviconsel img").attr("height","100px"); - $('#selicon').modal('hide'); + $("#mymodal").modal("hide"); } + function selectIcon() { + $("#mymodal").find(".modal-title").html("SELECTIONNER UNE ICONE"); + var url="{{ path('cadoles_portal_config_icon_select') }}"; + $("#mymodal").find("#framemodal").attr("src",url); + $("#mymodal").modal("show"); + } + + function delIcon() { $("#diviconsel img").remove(); $("#item_idicon").val(null); diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/edit.html.twig b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/edit.html.twig index bae13ed4..606b7f14 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/edit.html.twig +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Pagewidget/edit.html.twig @@ -61,7 +61,7 @@
{{ form_row(form.idicon) }} - Selectionner une Icône + Selectionner une Icône
@@ -88,46 +88,6 @@ {{ form_widget(form) }} - {{ form_end(form) }} {% endblock %} @@ -155,13 +115,22 @@ }); }); - function selIcon(idicon) { + function selIcon(idicon,label) { $("#pagewidget_idicon").val(idicon); $("#diviconsel img").remove(); - $("#icon-"+idicon).clone().appendTo($("#diviconsel")); + url="/{{ alias }}/"+label; + $("#diviconsel").append(""); $("#diviconsel img").attr("height","100px"); - $('#selicon').modal('hide'); - } + $("#mymodal").modal("hide"); + } + + function selectIcon() { + $("#mymodal").find(".modal-title").html("SELECTIONNER UNE ICONE"); + var url="{{ path('cadoles_portal_user_icon_select') }}"; + $("#mymodal").find("#framemodal").attr("src",url); + $("#mymodal").modal("show"); + } + {% endblock %} \ No newline at end of file