crop pour miniatures des sources
[mw_sourceml] / app / out / default / views / sources / source / header.php
1 <?php
2
3   if($source["reference"]){
4     $groupes = array();
5     foreach($source["reference"]["groupes"] as $groupe){
6       $groupes[] = array(
7         "nom" => $groupe["nom"],
8         "url" => $source["reference"] ? $source["reference"]["from"] : $source["url"]
9       );
10     }
11   }
12   else{
13     $groupes = $data->get_editor_groupes($source["reference"] ? $source["reference"]["groupes"] : $source["groupes"]);
14     foreach($groupes as $k => $groupe) $groupes[$k]["url"] = $this->url("sources/groupe/view", array("id" => $groupe["id"]));
15   }
16
17 ?>
18 <header>
19
20   <?php if($groupes) : ?>
21   <ul class="authors">
22     <?php foreach($groupes as $groupe) : ?>
23     <li><a class="auteur" href="<?php echo $groupe["url"] ?>"><?php echo $groupe["nom"] ?></a></li>
24     <?php endforeach; ?>
25   </ul>
26   <?php endif; ?>
27   <?php if(!isset($display_name) || $display_name) : ?>
28   <?php
29
30     $source_image_url = false;
31     if($source["reference"]){
32       if(
33            isset($source["reference"]["image"])
34         && $source["reference"]["image"]
35       ){
36         $source_image_url = $source["reference"]["image"];
37       }
38     }
39     else{
40       if
41       (    isset($source["image_uri"])
42         && $source["image_uri"]
43         && file_exists($source["image_uri"])
44       ){
45         $source_image_url = $source["image_uri"];
46       }
47     }
48     if($source_image_url){
49       $source_thumb = false;
50       if($data->mw_thumbs_activated()){
51         $source_thumb = $data->img_thumb(
52           $source_image_url,
53           100,
54           100,
55           $this->path("content")."thumbs",
56           array(255, 255, 255),
57           true
58         );
59       }
60     }
61
62   ?>
63   <?php if($source_image_url) : ?>
64   <p class="logo_source">
65     <a href="<?php echo $source["reference"] ? $source["reference"]["from"] : $source["url"] ?>">
66       <?php if($source_thumb) : ?>
67       <img src="<?php echo $this->path("content")."thumbs/".$source_thumb["thumb_file"] ?>"
68            width="<?php echo $source_thumb["thumb_width"] ?>"
69            height="<?php echo $source_thumb["thumb_height"] ?>"
70            alt="" />
71       <?php else : ?>
72       <img src="<?php echo $source_image_url ?>" style="width: 100px; height: auto" alt="" />
73       <?php endif; ?>
74     </a>
75   </p>
76   <?php endif; ?>
77   <h1<?php if($source_image_url): ?> class="with_image"<?php endif; ?>>
78     <?php if($source["reference"]) : ?>
79     <span>r&eacute;f&eacute;rence &raquo; <a href="<?php echo $source["reference"]["from"] ?>"><strong><?php echo $source["reference"]["titre"] ?></strong></a></span>
80     <?php else : ?>
81     <a href="<?php echo $source["url"] ?>"><?php echo $source["titre"] ?></a>
82     <?php endif; ?>
83     <?php if($source["derivations"]) : ?>
84     <br />
85     <span class="small">
86       d&eacute;rive de &raquo;
87       <?php $n = 0; foreach($source["derivations"] as $derivation) : ?>
88       <?php echo $n ? ", " : "" ?><a href="<?php echo $derivation["from"] ?>"><strong><?php echo $derivation["titre"] ?></strong></a>
89       <?php $n++; endforeach; ?>
90     </span>
91     <?php endif; ?>
92   </h1>
93   <?php endif; ?>
94
95   <br class="clear" />
96
97 </header>