8f3b770f53d2e1b3b35b12db98e8f5e5a1e7a9a7
[mw_sourceml] / app / out / default / views / sources / morceau / view.php
1 <article class="morceau">
2   <ul class="ariane">
3     <?php $ariane_params = array("morceau" => $this->out["morceau"]["id"]); ?>
4     <?php if(isset($this->out["album"]) && $this->out["album"]) : $ariane_params["album"] = $this->out["album"]["id"]; ?>
5     <li><a href="<?php echo $this->url("sources/album/view", $ariane_params) ?>">
6     <?php echo $this->out["album"]["titre"] ?>
7     </a></li>
8     <?php endif; ?>
9     <?php if($this->out["morceau"]["reference"]) : ?>
10     <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"] ?></a></li>
11     <?php else : ?>
12     <li><a href="<?php echo $this->url("sources/morceau/view", $ariane_params) ?>"><?php echo $this->out["morceau"]["titre"] ?></a></li>
13     <?php endif; ?>
14   </ul>
15   <div class="clear"><!-- --></div>
16   <header>
17     <h1>
18     <?php if($this->out["morceau"]["reference"]) : ?>
19     <span>r&eacute;f&eacute;rence &raquo;</span> <?php echo $this->out["morceau"]["reference"]["titre"] ?>
20     <?php else : ?>
21     <?php echo $this->out["morceau"]["titre"] ?>
22     <?php endif; ?>    
23     </h1>
24     <?php if($this->out["morceau"]["derivations"]) : ?>
25     <span class="derivation">
26       <span>d&eacute;rive de &raquo;</span>
27       <?php $n = 0; foreach($this->out["morceau"]["derivations"] as $derivation) : ?>
28       <?php echo $n ? ", " : "" ?><a href="<?php echo $derivation["from"] ?>"><?php echo $derivation["titre"] ?></a>
29       <?php $n++; endforeach; ?>
30     </span>
31     <?php endif; ?>
32   </header>
33
34 <?php
35
36   if
37   (    $this->out["morceau"]["image_uri"]
38     && file_exists($this->out["morceau"]["image_uri"])
39     && ($img_size = $data->img_size($this->out["morceau"]["image_uri"], 450, 450)) !== false
40   ) :
41 //  $margin_top = floor((450 - $img_size["height"]) / 2);
42   $margin_top = 10;
43   $morceau_image_uri = $this->path("web").$this->out["morceau"]["image_uri"];
44 ?>
45 <p class="logo_source">
46   <img src="<?php echo $morceau_image_uri ?>"
47        width="<?php echo $img_size["width"] ?>"
48        height="<?php echo $img_size["height"] ?>"
49        style="margin-top:<?php echo $margin_top ?>px"
50        alt="" />
51 </p>
52 <?php endif; ?>
53
54 <div class="source_arbo">
55
56 <?php
57
58   $morceau = $this->out["morceau"];
59   $display_name = false;
60   $url_params = array("morceau" => $morceau["id"]);
61
62 ?>
63
64 <ul class="sources">
65 <?php
66
67   $source = $morceau;
68   $source["url"] = $this->url("sources/morceau/view", $url_params);
69   require $this->out_file("views/sources/source.php");
70
71 ?>
72 </ul>
73
74 <?php if($this->action_allowed("users/morceaux/add")) : ?>
75 <form action="<?php echo $this->url("users/morceaux/add"); ?>" method="post">
76   <input type="hidden" name="button_derive" value="<?php echo $morceau["id"];?>" />
77   <ul class="button_derive">
78     <li><input type="submit" value="Publier une dérivation" /></li>
79   </ul>
80 </form>
81 <?php endif; ?>
82
83 <?php if(isset($morceau["description"]) && !$display_name) : ?>
84 <div class="description">
85   <?php echo $morceau["description"] ?>
86 </div>
87 <?php endif; ?>
88 <div class="clear"><!-- --></div>
89
90 </div>
91 </article>