コード例 #1
0
ファイル: mUserdataGUI.class.php プロジェクト: nemiah/fheME
 public function rolesPopup($UserID)
 {
     echo "<p class=\"highlight\">Die Rollen fassen mehrere Berechtigungen aus unterschiedlichen Plugins zusammen.</p><div style=\"max-height:400px;overflow:auto;\">";
     $ps = $_SESSION["CurrentAppPlugins"]->getAllPlugins();
     foreach ($this->roles() as $R => $O) {
         $T = new HTMLTable(3, $R);
         $T->weight("light");
         $T->setColWidth(1, 70);
         $T->setColWidth(3, 30);
         $i = 0;
         foreach ($O as $c => $s) {
             if ($c == "cantEdit" or $c == "cantDelete" or $c == "cantCreate") {
                 foreach ($s as $p) {
                     if ($p == "WAdresse") {
                         continue;
                     }
                     if ($c == "cantEdit") {
                         $T->addRow(array($p, "Kann nicht bearbeiten"));
                     }
                     if ($c == "cantDelete") {
                         $T->addRow(array($p, "Kann nicht löschen"));
                     }
                     if ($c == "cantCreate") {
                         $T->addRow(array($p, "Kann nicht erstellen"));
                     }
                 }
                 continue;
             }
             if ($c == "hidePlugin") {
                 foreach ($s as $p) {
                     $T->addRow(array(array_search($p, $ps), "Plugin ausblenden"));
                 }
                 continue;
             }
             $B = new Button("Rolle aktivieren", "./plugins/Userdata/role.png", "icon");
             $B->rmePCR("mUserdata", "-1", "rolesActivate", array($UserID, "'{$R}'"), OnEvent::reload("Left"));
             $class = new $c();
             $pSs = $class->getPluginSpecificRestrictions();
             $l = "";
             foreach ($s as $k => $p) {
                 $l .= ($k > 0 ? "<br>" : "") . $pSs[$p];
             }
             $T->addRow(array(array_search($c, $ps) . ":", $l, $i == 0 ? $B : ""));
             if ($i == 0) {
                 $T->addColStyle(3, "vertical-align:top;");
                 $T->addColRowspan(3, 3);
             }
             $i++;
         }
         #$T->addRow(array($l, $B));
         #$T->addColStyle(2, "vertical-align:top;");
         echo $T;
     }
     echo "</div>";
 }