nom falcultatif des fichiers (nom = extention par defaut)
[mw_sourceml] / app / out / default / views / sources / source / documents.php
index df8d6a8..540057a 100644 (file)
       <?php endif; ?>
       <div class="no_player"><!-- --></div>
       <?php
-        $ext = explode(".", $document["url"]);
-        if(count($ext) > 1) $ext = $ext[count($ext) - 1];
-        else $ext = $document["url"];
-        if(strlen($ext) > 16) $ext = "(...) ".substr($ext, -16);
+        if(!($nom = $document["nom"])){
+          $nom = explode(".", $document["url"]);
+          if(count($nom) > 1) $nom = $nom[count($nom) - 1];
+          else $nom = $document["url"];
+          if(strlen($nom) > 16) $nom = "(...) ".substr($nom, -16);
+        }
       ?>
-      <a href="<?php echo $document["url"] ?>" title="<?php echo $mw_out->esc_attr($document["nom"]); ?>"><?php echo $ext; ?></a>
+      <a href="<?php echo $document["url"] ?>" title="<?php echo $mw_out->esc_attr($document["nom"]); ?>"><?php echo $nom; ?></a>
     </li>
 
   <?php endforeach; ?>