modifications sur le template default
[mw_sourceml] / app / out / default / views / sources / morceau / view.php
index 4010f48..77d3357 100644 (file)
@@ -1,31 +1,56 @@
-<h2>
-<?php $ariane_params = array("morceau" => $this->out["morceau"]["id"]); ?>
-<?php if(isset($this->out["album"]) && $this->out["album"]) : $ariane_params["album"] = $this->out["album"]["id"]; ?>
-<a href="<?php echo $this->url("sources/album/view", $ariane_params) ?>">
-<?php echo $this->out["album"]["titre"] ?>
-</a>
-&raquo;
-<?php endif; ?>
+<article class="morceau">
+  <ul class="ariane">
+    <?php $ariane_params = array("morceau" => $this->out["morceau"]["id"]); ?>
+    <?php if(isset($this->out["album"]) && $this->out["album"]) : $ariane_params["album"] = $this->out["album"]["id"]; ?>
+    <li><a href="<?php echo $this->url("sources/album/view", $ariane_params) ?>">
+    <?php echo $this->out["album"]["titre"] ?>
+    </a></li>
+    <?php endif; ?>
+    <?php if($this->out["morceau"]["reference"]) : ?>
+    <li><span>r&eacute;f&eacute;rence &raquo;</span> <a href="<?php echo $this->out["morceau"]["reference"]["from"] ?>"><?php echo $this->out["morceau"]["reference"]["titre"] ?> (<?php echo $this->out["morceau"]["reference"]["auteur"] ?>)</a></li>
+    <?php else : ?>
+    <li><a href="<?php echo $this->url("sources/morceau/view", $ariane_params) ?>"><?php echo $this->out["morceau"]["titre"] ?></a></li>
+    <?php endif; ?>
+  </ul>
+  <div class="clear"><!-- --></div>
+  <header>
+    <h1>
+    <?php if($this->out["morceau"]["reference"]) : ?>
+    <span>r&eacute;f&eacute;rence &raquo;</span> <?php echo $this->out["morceau"]["reference"]["titre"] ?> (<?php echo $this->out["morceau"]["reference"]["auteur"] ?>)
+    <?php else : ?>
+    <?php echo $this->out["morceau"]["titre"] ?>
+    <?php endif; ?>    
+    </h1>
+    <?php if($this->out["morceau"]["derivations"]) : ?>
+    <span class="derivation">
+      <span>d&eacute;rive de &raquo;</span>
+      <?php $n = 0; foreach($this->out["morceau"]["derivations"] as $derivation) : ?>
+      <?php echo $n ? ", " : "" ?><a href="<?php echo $derivation["from"] ?>"><?php echo $derivation["titre"] ?> (<?php echo $derivation["auteur"] ?>)</a>
+      <?php $n++; endforeach; ?>
+    </span>
+    <?php endif; ?>
+  </header>
 
-<?php if($this->out["morceau"]["reference"]) : ?>
-<span>r&eacute;f&eacute;rence </span>&raquo; <a href="<?php echo $this->out["morceau"]["reference"]["from"] ?>"><strong><?php echo $this->out["morceau"]["reference"]["titre"] ?> (<?php echo $this->out["morceau"]["reference"]["auteur"] ?>)</strong></a>
-<?php else : ?>
-<a href="<?php echo $this->url("sources/morceau/view", $ariane_params) ?>"><?php echo $this->out["morceau"]["titre"] ?></a>
-
-<?php if($this->out["morceau"]["derivations"]) : ?>
-      <br />
-      <span class="small">
-        d&eacute;rive de &raquo;
-<?php $n = 0; foreach($this->out["morceau"]["derivations"] as $derivation) : ?>
-        <?php echo $n ? ", " : "" ?><a href="<?php echo $derivation["from"] ?>"><?php echo $derivation["titre"] ?> (<?php echo $derivation["auteur"] ?>)</a>
-<?php $n++; endforeach; ?>
-      </span>
-<?php endif; ?>
+<?php
 
+  if
+  (    $this->out["morceau"]["image_uri"]
+    && file_exists($this->out["morceau"]["image_uri"])
+    && ($img_size = $data->img_size($this->out["morceau"]["image_uri"], 450, 450)) !== false
+  ) :
+//  $margin_top = floor((450 - $img_size["height"]) / 2);
+  $margin_top = 10;
+  $morceau_image_uri = $this->path("web").$this->out["morceau"]["image_uri"];
+?>
+<p class="logo_source">
+  <img src="<?php echo $morceau_image_uri ?>"
+       width="<?php echo $img_size["width"] ?>"
+       height="<?php echo $img_size["height"] ?>"
+       style="margin-top:<?php echo $margin_top ?>px"
+       alt="" />
+</p>
 <?php endif; ?>
 
-</h2>
-
 <div class="source_arbo">
 
 <?php
@@ -46,7 +71,7 @@
 ?>
 </ul>
 
-<?php if(!$display_name) : ?>
+<?php if(isset($morceau["description"]) && !$display_name) : ?>
 <div class="description">
   <?php echo $morceau["description"] ?>
 </div>
@@ -54,3 +79,4 @@
 <div class="clear"><!-- --></div>
 
 </div>
+</article>
\ No newline at end of file