update configuration for document_list_profile
authorcavaliet
Wed, 16 May 2012 12:46:57 +0200
changeset 94 95ccb3524522
parent 93 dff31c10f751
child 95 5d10273e892a
update configuration for document_list_profile
Controller/WikiTagController.php
Resources/public/js/wikiTag.js
Resources/views/WikiTag/documentTags.html.twig
Resources/views/WikiTag/javascript.html.twig
Resources/views/WikiTag/tagTable.html.twig
--- a/Controller/WikiTagController.php	Wed May 02 13:45:37 2012 +0200
+++ b/Controller/WikiTagController.php	Wed May 16 12:46:57 2012 +0200
@@ -64,6 +64,7 @@
         $categories = json_encode($ar);
         // Management of profiles for the list of displayed columns and reorder tag button
         $profile_array = $this->container->getParameter("wiki_tag.document_list_profile");
+        #var_dump($profile_array[$profile_name]);
         $columns_array = null;
         if($profile_array!=null && $profile_name!=null && $profile_name!=""){
             $columns_array = $profile_array[$profile_name];
--- a/Resources/public/js/wikiTag.js	Wed May 02 13:45:37 2012 +0200
+++ b/Resources/public/js/wikiTag.js	Wed May 16 12:46:57 2012 +0200
@@ -176,8 +176,8 @@
         },
         dragHandle: "wikitag_updown_td"
     });
-    // Hide/show column management. We disable the possibility to hide menu (column 14).
-    $('#wikitag_table').columnManager({listTargetID:'wikitag_ul_target', onClass: 'wikitag_advon', offClass: 'wikitag_advoff', hideInList: [14], saveState: true, colsHidden: columsToHide});
+    // Hide/show column management.
+    $('#wikitag_table').columnManager({listTargetID:'wikitag_ul_target', onClass: 'wikitag_advon', offClass: 'wikitag_advoff', hideInList: notInList, saveState: true, colsHidden:columsToHide });
     //create the clickmenu from the target
     $('#wikitag_ulSelectColumn').clickMenu({onClick: function(){}});
 }
--- a/Resources/views/WikiTag/documentTags.html.twig	Wed May 02 13:45:37 2012 +0200
+++ b/Resources/views/WikiTag/documentTags.html.twig	Wed May 16 12:46:57 2012 +0200
@@ -10,7 +10,7 @@
 {% block document_tags %}
 <div id="tags_commands" style="float:left;width: 100%" >
     <div style="float:right;" id="wikitag_actions">
-     {% if columns is null or "sort_tag" in columns %}
+     {% if columns["sort_tag"].visibility is defined and columns["sort_tag"].visibility==1 %}
       <span>Trier les tags : <input type="image" src="{{ asset('bundles/wikitag/images/sort-descending.png') }}" name="trier" id="wikitag_tags_sort" /></span>
      {% endif %}
       <span>Ajouter un tag : <input type="text" name="wikitag_wp_search" id="wikitag_wp_search" size="35" /> <span id="wikitag_ok_search" class="wikitag_hand_cursor"><b>OK</b></span></span>
--- a/Resources/views/WikiTag/javascript.html.twig	Wed May 02 13:45:37 2012 +0200
+++ b/Resources/views/WikiTag/javascript.html.twig	Wed May 16 12:46:57 2012 +0200
@@ -39,9 +39,66 @@
     var categories_list = '{{ categories|raw }}';
     // We prepare the list of the columns to hide
     var columsToHide = [];
-    {% if columns is not null and 'order' not in columns %}columsToHide.push(1);{% endif %}
+    var notInList = [];
+    
+    {% if columns['order'].visibility is defined %}
+	    {% if columns['order'].visibility==2 %}columsToHide.push(1);{% endif %}
+        {% if columns['order'].visibility==0 %}columsToHide.push(1);notInList.push(1);{% endif %}
+    {% else %}columsToHide.push(1);notInList.push(1);{% endif %}
+    {% if columns['move_up_down'].visibility is defined %}
+        {% if columns['move_up_down'].visibility==2 %}columsToHide.push(2);{% endif %}
+        {% if columns['move_up_down'].visibility==0 %}columsToHide.push(2);notInList.push(2);{% endif %}
+    {% else %}columsToHide.push(2);notInList.push(2);{% endif %}
+    {% if columns['id'].visibility is defined %}
+        {% if columns['id'].visibility==2 %}columsToHide.push(3);{% endif %}
+        {% if columns['id'].visibility==0 %}columsToHide.push(3);notInList.push(3);{% endif %}
+    {% else %}columsToHide.push(3);notInList.push(3);{% endif %}
+    {% if columns['label'].visibility is defined %}
+        {% if columns['label'].visibility==2 %}columsToHide.push(4);{% endif %}
+        {% if columns['label'].visibility==0 %}columsToHide.push(4);notInList.push(4);{% endif %}
+    {% else %}columsToHide.push(4);notInList.push(4);{% endif %}
+    {% if columns['wikipedia_link'].visibility is defined %}
+        {% if columns['wikipedia_link'].visibility==2 %}columsToHide.push(5);{% endif %}
+        {% if columns['wikipedia_link'].visibility==0 %}columsToHide.push(5);notInList.push(5);{% endif %}
+    {% else %}columsToHide.push(5);notInList.push(5);{% endif %}
+    {% if columns['wikipedia_permalink'].visibility is defined %}
+        {% if columns['wikipedia_permalink'].visibility==2 %}columsToHide.push(6);{% endif %}
+        {% if columns['wikipedia_permalink'].visibility==0 %}columsToHide.push(6);notInList.push(6);{% endif %}
+    {% else %}columsToHide.push(6);notInList.push(6);{% endif %}
+    {% if columns['dbpedia_link'].visibility is defined %}
+        {% if columns['dbpedia_link'].visibility==2 %}columsToHide.push(7);{% endif %}
+        {% if columns['dbpedia_link'].visibility==0 %}columsToHide.push(7);notInList.push(7);{% endif %}
+    {% else %}columsToHide.push(7);notInList.push(7);{% endif %}
+    {% if columns['category'].visibility is defined %}
+        {% if columns['category'].visibility==2 %}columsToHide.push(8);{% endif %}
+        {% if columns['category'].visibility==0 %}columsToHide.push(8);notInList.push(8);{% endif %}
+    {% else %}columsToHide.push(8);notInList.push(8);{% endif %}
+    {% if columns['remove_wikipedia_link'].visibility is defined %}
+        {% if columns['remove_wikipedia_link'].visibility==2 %}columsToHide.push(9);{% endif %}
+        {% if columns['remove_wikipedia_link'].visibility==0 %}columsToHide.push(9);notInList.push(9);{% endif %}
+    {% else %}columsToHide.push(9);notInList.push(9);{% endif %}
+    {% if columns['alias'].visibility is defined %}
+        {% if columns['alias'].visibility==2 %}columsToHide.push(10);{% endif %}
+        {% if columns['alias'].visibility==0 %}columsToHide.push(10);notInList.push(10);{% endif %}
+    {% else %}columsToHide.push(10);notInList.push(10);{% endif %}
+    {% if columns['remove_tag_from_list'].visibility is defined %}
+        {% if columns['remove_tag_from_list'].visibility==2 %}columsToHide.push(11);{% endif %}
+        {% if columns['remove_tag_from_list'].visibility==0 %}columsToHide.push(11);notInList.push(11);{% endif %}
+    {% else %}columsToHide.push(11);notInList.push(11);{% endif %}
+    {% if columns['alternative_label'].visibility is defined %}
+        {% if columns['alternative_label'].visibility==2 %}columsToHide.push(12);{% endif %}
+        {% if columns['alternative_label'].visibility==0 %}columsToHide.push(12);notInList.push(12);{% endif %}
+    {% else %}columsToHide.push(12);notInList.push(12);{% endif %}
+    {% if columns['alternative_wikipedia_url'].visibility is defined %}
+        {% if columns['alternative_wikipedia_url'].visibility==2 %}columsToHide.push(13);{% endif %}
+        {% if columns['alternative_wikipedia_url'].visibility==0 %}columsToHide.push(13);notInList.push(13);{% endif %}
+    {% else %}columsToHide.push(13);notInList.push(13);{% endif %}
+
+    
+    
+    /*{% if columns is not null and 'order' not in columns %}columsToHide.push(1);{% endif %}
+    {% if columns is not null and 'move_up_down' not in columns %}columsToHide.push(3);{% endif %}
     {% if columns is not null and 'id' not in columns %}columsToHide.push(2);{% endif %}
-    {% if columns is not null and 'move_up_down' not in columns %}columsToHide.push(3);{% endif %}
     {% if columns is not null and 'label' not in columns %}columsToHide.push(4);{% endif %}
     {% if columns is not null and 'wikipedia_link' not in columns %}columsToHide.push(5);{% endif %}
     {% if columns is not null and 'wikipedia_permalink' not in columns %}columsToHide.push(6);{% endif %}
@@ -51,7 +108,9 @@
     {% if columns is not null and 'alias' not in columns %}columsToHide.push(10);{% endif %}
     {% if columns is not null and 'remove_tag_from_list' not in columns %}columsToHide.push(11);{% endif %}
     {% if columns is not null and 'alternative_label' not in columns %}columsToHide.push(12);{% endif %}
-    {% if columns is not null and 'alternative_wikipedia_url' not in columns %}columsToHide.push(13);{% endif %}
+    {% if columns is not null and 'alternative_wikipedia_url' not in columns %}columsToHide.push(13);{% endif %}*/
+    
+    notInList.push(14);
     
     $(document).ready(function(){
         wikitag_init_tags_events();
--- a/Resources/views/WikiTag/tagTable.html.twig	Wed May 02 13:45:37 2012 +0200
+++ b/Resources/views/WikiTag/tagTable.html.twig	Wed May 16 12:46:57 2012 +0200
@@ -10,22 +10,22 @@
   <table id="wikitag_table">
    <thead>
    <tr class="nodrop nodrag">
-    <th>#</th>
-    <th class="wikitag_updown_td wikitag_td_icon"><span>Haut Bas</span></th>
-    <th>id</th>
-    <th>label</th>
-    <th class="wikitag_text_centered">Lien W</th>
-    <th class="wikitag_text_centered">pLien W</th>
-    <th class="wikitag_text_centered">Lien D</th>
-    <th>Catégorie</th>
-    <th class="wikitag_large_25 wikitag_text_centered">Supprimer<br/> le lien W</th>
-    <th>Alias</th>
-    <th class="wikitag_large_25 wikitag_text_centered">Retirer le tag</th>
-    <th>Label redirigé</th>
-    <th class="wikitag_text_centered">Lien<br/> redirigé</th>
-    <th id="wikitag_thSelectColumn"><ul id="wikitag_ulSelectColumn"><li><img src="{{ asset('bundles/wikitag/images/sort-desc.png') }}" alt="select columns" title="select columns" />
+     <th>#</th>
+     <th class="wikitag_updown_td wikitag_td_icon"><span>Haut Bas</span></th>
+     <th>id</th>
+     <th>label</th>
+     <th class="wikitag_text_centered">Lien W</th>
+     <th class="wikitag_text_centered">pLien W</th>
+     <th class="wikitag_text_centered">Lien D</th>
+     <th>Catégorie</th>
+     <th class="wikitag_large_25 wikitag_text_centered">Supprimer<br/> le lien W</th>
+     <th>Alias</th>
+     <th class="wikitag_large_25 wikitag_text_centered">Retirer le tag</th>
+     <th>Label redirigé</th>
+     <th class="wikitag_text_centered">Lien<br/> redirigé</th>
+     <th id="wikitag_thSelectColumn"><ul id="wikitag_ulSelectColumn"><li><img src="{{ asset('bundles/wikitag/images/sort-desc.png') }}" alt="select columns" title="select columns" />
       <ul id="wikitag_ul_target"></ul></li></ul>
-    </th>
+     </th>
   </tr>
   </thead>