Ejemplo n.º 1
0
 public static function getPermissionForm(Key $key)
 {
     if (Current_User::isUnrestricted($key->module) && Current_User::allow($key->module, $key->edit_permission)) {
         $tpl = User_Form::permissionMenu($key, true);
         return PHPWS_Template::process($tpl, 'users', 'forms/permission_pop.tpl');
     }
 }
Ejemplo n.º 2
0
 public static function permissionMenu()
 {
     $key = Key::getCurrent();
     if (empty($key) || $key->isDummy() || empty($key->edit_permission)) {
         return;
     }
     if (Current_User::isUnrestricted($key->module) && Current_User::allow($key->module, $key->edit_permission)) {
         if (!javascriptEnabled()) {
             $tpl = User_Form::permissionMenu($key);
             $content = PHPWS_Template::process($tpl, 'users', 'forms/permission_menu.tpl');
             Layout::add($content, 'users', 'permissions');
         } else {
             $links[] = Current_User::popupPermission($key->id, sprintf(dgettext('users', 'Set permissions'), $key->title));
             MiniAdmin::add('users', $links);
         }
     }
 }