waveforms pour les sources de type reference
authordj3c1t <dj3c1t@free.fr>
Sat, 10 May 2014 22:52:46 +0000 (00:52 +0200)
committerdj3c1t <dj3c1t@free.fr>
Sat, 10 May 2014 22:52:46 +0000 (00:52 +0200)
app/controllers/sources/waveforms.php

index eadba06..556f22d 100644 (file)
@@ -72,7 +72,8 @@
           "ogg" => false,
           "mp3" => false
         );
-        foreach($source["documents"] as $document){
+        $source_documents = $source["reference"] ? $source["reference"]["documents"] : $source["documents"];
+        foreach($source_documents as $document){
           $file_name = false;
           if(substr(urldecode($document["url"]), 0, strlen($base_url)) == $base_url){
             $file_name = $document_root.substr(urldecode($document["url"]), strlen($base_url));
             "ogg" => false,
             "mp3" => false
           );
-          foreach($source["documents"] as $document){
+          $source_documents = $source["reference"] ? $source["reference"]["documents"] : $source["documents"];
+          foreach($source_documents as $document){
             $file_name = false;
             if(substr(urldecode($document["url"]), 0, strlen($base_url)) == $base_url){
               $file_name = $document_root.substr(urldecode($document["url"]), strlen($base_url));