Browse Source

Evolution #196: Liste de lecture

Sevajol Bastien 11 years ago
parent
commit
76697c137c

+ 8 - 4
src/Muzich/CoreBundle/Controller/ElementController.php View File

@@ -1020,13 +1020,17 @@ class ElementController extends Controller
1020 1020
         throw $this->createNotFoundException('Not found');
1021 1021
       }
1022 1022
       
1023
+      $tags = null;
1023 1024
       $tag_ids = json_decode($data);
1024 1025
       $search_object = new ElementSearcher();
1025
-
1026
-      $tags = array();
1027
-      foreach ($tag_ids as $id)
1026
+      
1027
+      if (count($tag_ids))
1028 1028
       {
1029
-        $tags[$id] = $id;
1029
+        $tags = array();
1030
+        foreach ($tag_ids as $id)
1031
+        {
1032
+          $tags[$id] = $id;
1033
+        }
1030 1034
       }
1031 1035
 
1032 1036
       $search_object->init(array(

+ 9 - 4
src/Muzich/HomeBundle/Controller/ShowController.php View File

@@ -156,13 +156,18 @@ class ShowController extends Controller
156 156
       throw new \Exception("Wrong Type.");
157 157
     }
158 158
     
159
-    $tag_ids = json_decode($tags_ids_json);
160 159
     $search_object = new ElementSearcher();
160
+    $tags = null;
161
+    $tag_ids = json_decode($tags_ids_json);
161 162
     
162
-    $tags = array();
163
-    foreach ($tag_ids as $id)
163
+    if (count($tag_ids))
164 164
     {
165
-      $tags[$id] = $id;
165
+
166
+      $tags = array();
167
+      foreach ($tag_ids as $id)
168
+      {
169
+        $tags[$id] = $id;
170
+      }
166 171
     }
167 172
     
168 173
     $search_object->init(array(

+ 2 - 2
src/Muzich/HomeBundle/Resources/views/Show/showGroup.html.twig View File

@@ -57,7 +57,7 @@
57 57
   <a href="{{ path('elements_get_filter_data_autoplay_show', {
58 58
         'show_type'  : 'group',
59 59
         'show_id'    : group.id, 
60
-        'data'       : tags_id_json
60
+        'data'       : '[]'
61 61
       }) }}" class="button" id="autoplay_launch" 
62 62
      title="{{ 'elements.autoplay.launch'|trans({}, 'elements') }}" >
63 63
     <img src="{{ asset('/bundles/muzichcore/img/1353494305_player_play.png') }}" alt="" />
@@ -109,7 +109,7 @@
109 109
      <a href="{{ path('show_elements_get', {
110 110
         'type'          : 'group',
111 111
         'object_id'     : group.id, 
112
-        'tags_ids_json' : tags_id_json
112
+        'tags_ids_json' : '[]'
113 113
       }) }}" class="elements_more button" >
114 114
        {{ 'more'|trans({}, 'userui') }}
115 115
      </a>

+ 2 - 2
src/Muzich/HomeBundle/Resources/views/Show/showUser.html.twig View File

@@ -88,7 +88,7 @@
88 88
   <a href="{{ path('elements_get_filter_data_autoplay_show', {
89 89
         'show_type'  : 'user',
90 90
         'show_id'    : viewed_user.id, 
91
-        'data'       : tags_id_json
91
+        'data'       : '[]'
92 92
       }) }}" class="button" id="autoplay_launch" 
93 93
      title="{{ 'elements.autoplay.launch'|trans({}, 'elements') }}" >
94 94
     <img src="{{ asset('/bundles/muzichcore/img/1353494305_player_play.png') }}" alt="" />
@@ -116,7 +116,7 @@
116 116
      <a href="{{ path('show_elements_get', {
117 117
         'type'          : 'user',
118 118
         'object_id'     : viewed_user.id, 
119
-        'tags_ids_json' : tags_id_json
119
+        'tags_ids_json' : '[]'
120 120
       }) }}" class="elements_more button" >
121 121
        {{ 'more'|trans({}, 'userui') }}
122 122
      </a>

+ 1 - 0
web/bundles/muzichcore/js/autoplay.js View File

@@ -33,6 +33,7 @@ $(document).ready(function(){
33 33
       {
34 34
         // On récupère la liste d'élèments
35 35
         autoplay_list = response.data;
36
+        console.debug(autoplay_list);
36 37
         autoplay_run(0);
37 38
       }
38 39