d7f45a19780edec21a2a68b0c62004805ba3cf98
[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           <a href="<?php echo $this->url("users/albums/edit", array("id" => $id_album)) ?>"><?php echo $album["titre"] ?></a>
52     <?php endif; ?>
53     <?php if($album["derivations"]) : ?>
54           <br />
55           <span class="small">
56             d&eacute;rive de &raquo;
57     <?php $n = 0; foreach($album["derivations"] as $derivation) : ?>
58             <?php echo $n ? ", " : "" ?><a href="<?php echo $album["from"] ?>"><?php echo $album["titre"] ?> (<?php echo $album["auteur"] ?>)</a>
59     <?php $n++; endforeach; ?>
60           </span>
61     <?php endif; ?>
62         </td>
63         <td class="action"><input type="text" name="ordre_<?php echo $id_album ?>" value="<?php echo isset($album["ordre"]) ? $album["ordre"] : 0 ?>" size="3" /></td>
64         <td class="action">
65     <?php if($album["permissions"]["editeur"]) : ?>
66         <a href="<?php echo $this->url("users/albums/edit", array("id" => $id_album)) ?>"
67            class="admin_link"
68            title="modifier cet album"><img src="<?php echo $this->out_url("icons/edit.gif") ?>" /></a>
69     <?php else : ?>
70         &nbsp;
71     <?php endif; ?>
72         </td>
73         <td class="action">
74     <?php if($album["permissions"]["admin"]) : ?>
75         <a href="<?php echo $this->url("users/albums/del", array("id" => $id_album)) ?>"
76            class="admin_link"
77            title="supprimer cet album"><img src="<?php echo $this->out_url("icons/del.gif") ?>"
78            onclick="return confirm('Supprimer cet album ?')"/></a>
79     <?php else : ?>
80         &nbsp;
81     <?php endif; ?>
82         </td>
83       </tr>
84     <?php endforeach; ?>
85     </table>
86     <ul class="form">
87       <li class="buttons">
88         <div class="form_buttons">
89           <input type="submit" value="Enregistrer l'ordre" />
90         </div>
91       </li>
92     </ul>
93   </fieldset>
94 </form>
95
96 <?php $items = "album"; $legend = "album"; require $this->out_file("views/navig.php"); ?>
97
98 <?php else : ?>
99 <p>Aucun album pour le moment</p>
100 <?php endif; ?>