瀏覽代碼

Evolution #196: Liste de lecture

Sevajol Bastien 12 年之前
父節點
當前提交
76697c137c

+ 8 - 4
src/Muzich/CoreBundle/Controller/ElementController.php 查看文件

1020
         throw $this->createNotFoundException('Not found');
1020
         throw $this->createNotFoundException('Not found');
1021
       }
1021
       }
1022
       
1022
       
1023
+      $tags = null;
1023
       $tag_ids = json_decode($data);
1024
       $tag_ids = json_decode($data);
1024
       $search_object = new ElementSearcher();
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
       $search_object->init(array(
1036
       $search_object->init(array(

+ 9 - 4
src/Muzich/HomeBundle/Controller/ShowController.php 查看文件

156
       throw new \Exception("Wrong Type.");
156
       throw new \Exception("Wrong Type.");
157
     }
157
     }
158
     
158
     
159
-    $tag_ids = json_decode($tags_ids_json);
160
     $search_object = new ElementSearcher();
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
     $search_object->init(array(
173
     $search_object->init(array(

+ 2 - 2
src/Muzich/HomeBundle/Resources/views/Show/showGroup.html.twig 查看文件

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

+ 2 - 2
src/Muzich/HomeBundle/Resources/views/Show/showUser.html.twig 查看文件

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

+ 1 - 0
web/bundles/muzichcore/js/autoplay.js 查看文件

33
       {
33
       {
34
         // On récupère la liste d'élèments
34
         // On récupère la liste d'élèments
35
         autoplay_list = response.data;
35
         autoplay_list = response.data;
36
+        console.debug(autoplay_list);
36
         autoplay_run(0);
37
         autoplay_run(0);
37
       }
38
       }
38
       
39