modifications sur le template default
[mw_sourceml] / app / out / default / views / users / albums / list.php
1 <h2>Albums</h2>
2
3 <ul class="buttons">
4   <li><a class="add" href="<?php echo $this->url("users/albums/add") ?>">Nouvel album</a></li>
5 </ul>
6
7 <?php if($this->out["groupes"]["total"] > 0) : ?>
8
9 <ul class="filters">
10   <li>
11 <?php
12
13   $url_params = array();
14
15 ?>
16     <select onchange="document.location=this.options[this.selectedIndex].value;">
17       <option value="<?php echo $this->url("users/albums", $url_params) ?>"<?php echo $_GET[$this->param("groupe")] == "0" ? " selected=\"selected\"" : "" ?>>Tous les groupes</option>
18       <?php foreach($this->out["groupes"]["list"] as $id_groupe => $groupe) : $url_params["groupe"] = $id_groupe; ?>
19       <option value="<?php echo $this->url("users/albums", $url_params) ?>"<?php echo $_GET[$this->param("groupe")] == $id_groupe ? " selected=\"selected\"" : "" ?>><?php echo $groupe["nom"] ?></option>
20       <?php endforeach; ?>
21     </select>
22   </li>
23 </ul>
24
25 <?php endif; ?>
26
27 <?php if($this->out["albums"]["list"]) : ?>
28
29 <?php $items = "albums"; $legend = "albums"; require $this->out_file("views/navig.php"); ?>
30
31 <?php
32
33   $get_params = array();
34   if(isset($_GET[$this->param("groupe")]) && $_GET[$this->param("groupe")]) $get_params["groupe"] = $_GET[$this->param("groupe")];
35
36 ?>
37 <form name="sources_form" action="<?php echo $this->url("users/albums", $get_params) ?>" method="post">
38   <fieldset>
39     <table class="admin">
40       <tr>
41         <th>titre</th>
42         <th>ordre</th>
43         <th align="center" colspan="2">actions</th>
44       </tr>
45     <?php foreach($this->out["albums"]["list"] as $id_album => $album) : ?>
46       <tr class="hl">
47         <td>
48     <?php if($album["reference"]) : ?>
49           r&eacute;f&eacute;rence &raquo; <a href="<?php echo $album["reference"]["from"] ?>"><?php echo $album["reference"]["titre"] ?> (<?php echo $album["reference"]["auteur"] ?>)</a>
50     <?php else : ?>
51       <?php if($album["permissions"]["editeur"]) : ?>
52           <a href="<?php echo $this->url("users/albums/edit", array("id" => $id_album)) ?>"><?php echo $album["titre"] ?></a>
53       <?php else : ?>
54           <?php echo $album["titre"] ?>
55       <?php endif; ?>
56     <?php endif; ?>
57     <?php if($album["derivations"]) : ?>
58           <br />
59           <span class="small">
60             d&eacute;rive de &raquo;
61     <?php $n = 0; foreach($album["derivations"] as $derivation) : ?>
62             <?php echo $n ? ", " : "" ?><a href="<?php echo $album["from"] ?>"><?php echo $album["titre"] ?> (<?php echo $album["auteur"] ?>)</a>
63     <?php $n++; endforeach; ?>
64           </span>
65     <?php endif; ?>
66         </td>
67         <td class="action"><input type="text" name="ordre_<?php echo $id_album ?>" value="<?php echo isset($album["ordre"]) ? $album["ordre"] : 0 ?>" size="3" /></td>
68         <td class="action">
69     <?php if($album["permissions"]["editeur"]) : ?>
70         <a href="<?php echo $this->url("users/albums/edit", array("id" => $id_album)) ?>"
71            class="admin_link"
72            title="modifier cet album"><img src="<?php echo $this->out_url("icons/edit.gif") ?>" /></a>
73     <?php else : ?>
74         &nbsp;
75     <?php endif; ?>
76         </td>
77         <td class="action">
78     <?php if($album["permissions"]["admin"]) : ?>
79         <a href="<?php echo $this->url("users/albums/del", array("id" => $id_album)) ?>"
80            class="admin_link"
81            title="supprimer cet album"><img src="<?php echo $this->out_url("icons/del.gif") ?>"
82            onclick="return confirm('Supprimer cet album ?')"/></a>
83     <?php else : ?>
84         &nbsp;
85     <?php endif; ?>
86         </td>
87       </tr>
88     <?php endforeach; ?>
89     </table>
90     <ul class="form">
91       <li class="buttons">
92         <div class="form_buttons">
93           <input type="submit" value="Enregistrer l'ordre" />
94         </div>
95       </li>
96     </ul>
97   </fieldset>
98 </form>
99
100 <?php $items = "album"; $legend = "album"; require $this->out_file("views/navig.php"); ?>
101
102 <?php else : ?>
103 <p>Aucun album pour le moment</p>
104 <?php endif; ?>