nom falcultatif des fichiers (nom = extention par defaut)
[mw_sourceml] / app / out / default / views / sources / source / documents.php
index 56af9e0..540057a 100644 (file)
@@ -2,7 +2,7 @@
 
   $documents = $source["reference"] ? $source["reference"]["documents"] : $source["documents"];
   if($documents) :
-
+  $mw_out = $this->helper("mw_helper_out");
 ?>
 
 
       </div>
       <?php endif; ?>
       <div class="no_player"><!-- --></div>
-      <a href="<?php echo $document["url"] ?>"><?php echo $document["nom"]; ?></a>
+      <?php
+        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 $nom; ?></a>
     </li>
 
   <?php endforeach; ?>