Group_Role

Bedienelement zum Auswählen von Gruppen/Rollen-Kombinationen.

Attribut Typ Erforderlich Beschreibung
single boolean Nein Wenn single=true, dann kann nur eine Gruppen/Rollen-Kombination ausgwählt werden.
size int Nein Gibt die Größe des Inputs an. (Die Anzahl an Gruppen/Rollen-Kombinationen, die auf einmal angezeigt werden (Standard: 8))

Vorschau

Group_Role-Beispiel

Beispiel

<form name="extra"> <div align="center"> <table> <tr> <td> {input type="group_role" name="mygrouprole" title="Gruppen/Rollen-Kombination"}    </td> </tr> </table> </div> </form> <script> {literal} function do_load() { } function do_unload() { window.parent.unload_extra(); } {/literal} </script>

Die Prüfung in PHP kann z.B. folgendermaßen erfolgen:

if ($this->extra['mygrouprole']) { $rights = explode(";",$this->extra['mygrouprole']); $hasRight = false; foreach ($rights as $right) { $r = explode(",", $right); if ($GLOBALS['auth']->hasPermission($r[0], $r[1])) { $hasRight = true; } } $smarty->assign("hasRight", $hasRight); } $smarty->assign("hasRight", false);