35 const NAME =
'group_delete';
37 function __construct()
39 parent::__construct(self::NAME, array(
40 self::TITLE => _(
"Delete Group"),
41 self::MENU_LIST =>
"Admin::Groups::Delete Group",
43 self::REQUIRES_LOGIN => TRUE
51 protected function handle(Request $request)
58 $groupMap = $userDao->getDeletableAdminGroupMap($userId,
61 $groupId = $request->get(
'grouppk');
62 if (! empty($groupId)) {
64 $userDao->deleteGroup($groupId);
65 $vars[
'message'] = _(
"Group") .
' ' . $groupMap[$groupId] .
' ' . _(
"deleted") .
'.';
66 unset($groupMap[$groupId]);
67 }
catch (\Exception $e) {
68 $vars[
'message'] = $e->getMessage();
72 if (empty($groupMap)) {
73 $vars[
'content'] = _(
"You have no groups you can delete.");
74 return $this->
render(
'include/base.html.twig', $this->mergeWithDefault($vars));
76 $vars[
'groupMap'] = $groupMap;
78 $vars[
'groupMap'] = $groupMap;
79 return $this->
render(
'admin_group_delete.html.twig', $this->mergeWithDefault($vars));
Traceback_uri()
Get the URI without query to this location.
static getUserId()
Get the current user's id.
render($templateName, $vars=null, $headers=null)