css pour le debug
[mtweb] / mw / app / out / default / views / config / roles / index.php
1 <h2>Les r&ocirc;les</h2>
2
3 <h3>Politique d'acc&egrave;s</h3>
4 <p>
5   <label for="default_allow">Autoriser l'acc&egrave;s par d&eacute;faut</label>
6   <select id="default_allow" onchange="document.location=this.options[this.selectedIndex].value;">
7     <option value="<?php echo $this->url("config/roles/set_default_allow", array("id" => "1")); ?>"<?php echo $this->config("default_allow") ? " selected" : ""; ?>>oui</option>
8     <option value="<?php echo $this->url("config/roles/set_default_allow", array("id" => "0")); ?>"<?php echo $this->config("default_allow") ? "" : " selected"; ?> />non</option>
9   </select>
10 </p>
11 <br />
12
13 <h3>
14   Autorisations d'accès pour
15   <select onchange="document.location=this.options[this.selectedIndex].value;">
16     <?php foreach($this->out["roles"] as $id_role => $role) : ?>
17     <option value="<?php echo $this->url("config/roles", array("id" => $id_role)); ?>"<?php echo $this->out["id_role"] == $id_role ? " selected" : ""; ?>><?php echo $role["intitule"]; ?></option>
18     <?php endforeach; ?>
19   </select>
20   <?php if($this->out["id_role"]) : ?>
21   <a href="<?php echo $this->url("config/roles/edit_role", array("id" => $this->out["id_role"])); ?>"
22        class="admin_link"
23        title="modifier ce role"><img src="<?php echo $this->out_url("icons/edit.gif"); ?>" /></a>
24   <a href="<?php echo $this->url("config/roles/del_role", array("id" => $this->out["id_role"])); ?>"
25        class="admin_link"
26        title="supprimer ce role"><img src="<?php echo $this->out_url("icons/del.gif"); ?>"
27        onclick="return confirm('Supprimer ce role ?')"/></a>
28   <?php endif; ?>
29   <a href="<?php echo $this->url("config/roles/add_role"); ?>"
30        class="admin_link"
31        title="ajouter un role"><img src="<?php echo $this->out_url("icons/add.gif"); ?>" /></a>
32 </h3>
33
34
35 <?php if($this->out["actions"]) : ?>
36 <form action="<?php echo $this->url("config/roles/save_role"); ?>" method="post">
37   <input type="hidden" name="id_role" value="<?php echo $this->out["id_role"]; ?>" />
38   <ul class="actions">
39   <?php $index_al = 0; foreach($this->out["actions"] as $module_name => $module) : ?>
40     <li<?php echo $module["is_public"] ? " class=\"public\"" : "" ?>>
41       <input type="checkbox" name="module_<?php echo $module_name; ?>"<?php echo $module["module_allowed"] ? " checked" : "" ?> />
42       <label><?php echo $module_name; ?></label>
43       <?php if($module["controleurs"]) : ?>
44       <ul>
45         <?php foreach($module["controleurs"] as $controleur_name => $controleur) : ?>
46         <li<?php echo $controleur["is_public"] ? " class=\"public\"" : "" ?>>
47           <input type="checkbox" name="controleur_<?php echo $module_name."/".$controleur_name; ?>"<?php echo $controleur["controleur_allowed"] ? " checked" : "" ?> />
48           <label><?php echo $controleur_name; ?></label>
49           <?php if($controleur["als"]) : ?>
50           <ul>
51             <?php foreach($controleur["als"] as $al) : $index_al++; ?>
52             <li<?php echo $al["is_public"] ? " class=\"public\"" : "" ?>>
53               <input type="checkbox" name="al_<?php echo $index_al; ?>"<?php echo $al["action_allowed"] ? " checked" : "" ?> />
54               <?php foreach($al["actions"] as $index_action=> $action_name) : ?>
55               <input type="hidden" name="action_<?php echo $index_al; ?>_<?php echo $index_action; ?>" value="<?php echo $module_name."/".$controleur_name."/".$action_name; ?>" />
56               <?php endforeach; ?>
57               <label><?php echo $al["title"]; ?></label>
58             </li>
59             <?php endforeach; ?>
60           </ul>
61           <?php endif; ?>
62         </li>
63         <?php endforeach; ?>
64       </ul>
65       <?php endif; ?>
66     </li>
67   <?php endforeach; ?>
68     <li>
69       <div class="form_buttons">
70         <input type="submit" value="Enregistrer" />
71       </div>
72     </li>
73   </ul>
74 </form>
75 <?php else : ?>
76 <p>Aucune action d&eacute;clar&eacute;e</p>
77 <?php endif; ?>
78