module config et role webmaster
[mtweb] / mw / app / out / default / views / config / roles / index.php
diff --git a/mw/app/out/default/views/config/roles/index.php b/mw/app/out/default/views/config/roles/index.php
new file mode 100644 (file)
index 0000000..02ac1a1
--- /dev/null
@@ -0,0 +1,78 @@
+<h2>Les r&ocirc;les</h2>
+
+<h3>Politique d'acc&egrave;s</h3>
+<p>
+  <label for="default_allow">Autoriser l'acc&egrave;s par d&eacute;faut</label>
+  <select id="default_allow" onchange="document.location=this.options[this.selectedIndex].value;">
+    <option value="<?php echo $this->url("config/roles/set_default_allow", array("id" => "1")); ?>"<?php echo $this->config("default_allow") ? " selected" : ""; ?>>oui</option>
+    <option value="<?php echo $this->url("config/roles/set_default_allow", array("id" => "0")); ?>"<?php echo $this->config("default_allow") ? "" : " selected"; ?> />non</option>
+  </select>
+</p>
+<br />
+
+<h3>
+  Autorisations d'accès pour
+  <select onchange="document.location=this.options[this.selectedIndex].value;">
+    <?php foreach($this->out["roles"] as $id_role => $role) : ?>
+    <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>
+    <?php endforeach; ?>
+  </select>
+  <?php if($this->out["id_role"]) : ?>
+  <a href="<?php echo $this->url("config/roles/edit_role", array("id" => $this->out["id_role"])); ?>"
+       class="admin_link"
+       title="modifier ce role"><img src="<?php echo $this->out_url("icons/edit.gif"); ?>" /></a>
+  <a href="<?php echo $this->url("config/roles/del_role", array("id" => $this->out["id_role"])); ?>"
+       class="admin_link"
+       title="supprimer ce role"><img src="<?php echo $this->out_url("icons/del.gif"); ?>"
+       onclick="return confirm('Supprimer ce role ?')"/></a>
+  <?php endif; ?>
+  <a href="<?php echo $this->url("config/roles/add_role"); ?>"
+       class="admin_link"
+       title="ajouter un role"><img src="<?php echo $this->out_url("icons/add.gif"); ?>" /></a>
+</h3>
+
+
+<?php if($this->out["actions"]) : ?>
+<form action="<?php echo $this->url("config/roles/save_role"); ?>" method="post">
+  <input type="hidden" name="id_role" value="<?php echo $this->out["id_role"]; ?>" />
+  <ul class="actions">
+  <?php $index_al = 0; foreach($this->out["actions"] as $module_name => $module) : ?>
+    <li<?php echo $module["is_public"] ? " class=\"public\"" : "" ?>>
+      <input type="checkbox" name="module_<?php echo $module_name; ?>"<?php echo $module["module_allowed"] ? " checked" : "" ?> />
+      <label><?php echo $module_name; ?></label>
+      <?php if($module["controleurs"]) : ?>
+      <ul>
+        <?php foreach($module["controleurs"] as $controleur_name => $controleur) : ?>
+        <li<?php echo $controleur["is_public"] ? " class=\"public\"" : "" ?>>
+          <input type="checkbox" name="controleur_<?php echo $module_name."/".$controleur_name; ?>"<?php echo $controleur["controleur_allowed"] ? " checked" : "" ?> />
+          <label><?php echo $controleur_name; ?></label>
+          <?php if($controleur["als"]) : ?>
+          <ul>
+            <?php foreach($controleur["als"] as $al) : $index_al++; ?>
+            <li<?php echo $al["is_public"] ? " class=\"public\"" : "" ?>>
+              <input type="checkbox" name="al_<?php echo $index_al; ?>"<?php echo $al["action_allowed"] ? " checked" : "" ?> />
+              <?php foreach($al["actions"] as $index_action=> $action_name) : ?>
+              <input type="hidden" name="action_<?php echo $index_al; ?>_<?php echo $index_action; ?>" value="<?php echo $module_name."/".$controleur_name."/".$action_name; ?>" />
+              <?php endforeach; ?>
+              <label><?php echo $al["title"]; ?></label>
+            </li>
+            <?php endforeach; ?>
+          </ul>
+          <?php endif; ?>
+        </li>
+        <?php endforeach; ?>
+      </ul>
+      <?php endif; ?>
+    </li>
+  <?php endforeach; ?>
+    <li>
+      <div class="form_buttons">
+        <input type="submit" value="Enregistrer" />
+      </div>
+    </li>
+  </ul>
+</form>
+<?php else : ?>
+<p>Aucune action d&eacute;clar&eacute;e</p>
+<?php endif; ?>
+