Add tab for create, update and remove user group

refs #5543
This commit is contained in:
Eric Lippmann 2015-10-01 10:03:29 +02:00
parent 631f5d8071
commit 380c8743c0
9 changed files with 46 additions and 36 deletions

View File

@ -156,8 +156,7 @@ class GroupController extends AuthBackendController
$form->setRepository($backend); $form->setRepository($backend);
$form->add()->handleRequest(); $form->add()->handleRequest();
$this->view->form = $form; $this->renderForm($form, $this->translate('New User Group'));
$this->render('form');
} }
/** /**
@ -181,8 +180,7 @@ class GroupController extends AuthBackendController
$this->httpNotFound(sprintf($this->translate('Group "%s" not found'), $groupName)); $this->httpNotFound(sprintf($this->translate('Group "%s" not found'), $groupName));
} }
$this->view->form = $form; $this->renderForm($form, $this->translate('Update User Group'));
$this->render('form');
} }
/** /**
@ -204,8 +202,7 @@ class GroupController extends AuthBackendController
$this->httpNotFound(sprintf($this->translate('Group "%s" not found'), $groupName)); $this->httpNotFound(sprintf($this->translate('Group "%s" not found'), $groupName));
} }
$this->view->form = $form; $this->renderForm($form, $this->translate('Remove User Group'));
$this->render('form');
} }
/** /**
@ -232,8 +229,7 @@ class GroupController extends AuthBackendController
$this->httpNotFound(sprintf($this->translate('Group "%s" not found'), $groupName)); $this->httpNotFound(sprintf($this->translate('Group "%s" not found'), $groupName));
} }
$this->view->form = $form; $this->renderForm($form, $this->translate('New User Group Member'));
$this->render('form');
} }
/** /**

View File

@ -3,7 +3,7 @@
</div> </div>
<div class="content"> <div class="content">
<?= $this->qlink( <?= $this->qlink(
$this->translate('Create A New Resource') , $this->translate('Create a New Resource') ,
'config/createresource', 'config/createresource',
null, null,
array( array(

View File

@ -3,7 +3,7 @@
</div> </div>
<div class="content"> <div class="content">
<?= $this->qlink( <?= $this->qlink(
$this->translate('Create A New User Backend') , $this->translate('Create a New User Backend') ,
'config/createuserbackend', 'config/createuserbackend',
null, null,
array( array(

View File

@ -25,12 +25,29 @@ if (! isset($backend)) {
$extensible = $this->hasPermission('config/authentication/groups/add') && $backend instanceof Extensible; $extensible = $this->hasPermission('config/authentication/groups/add') && $backend instanceof Extensible;
$reducible = $this->hasPermission('config/authentication/groups/remove') && $backend instanceof Reducible; $reducible = $this->hasPermission('config/authentication/groups/remove') && $backend instanceof Reducible;
} }
?>
<?php if ($extensible): ?>
<?= $this->qlink(
$this->translate('Add a New User Group') ,
'group/add',
array('backend' => $backend->getName()),
array(
'class' => 'button-link',
'data-base-target' => '_next',
'icon' => 'plus',
'title' => $this->translate('Create a new user')
)
) ?>
<?php endif ?>
<?php
// @TODO(el): Remove $firstRow stuff
$firstRow = true; $firstRow = true;
foreach ($groups as $group): ?> foreach ($groups as $group): ?>
<?php if ($firstRow): ?> <?php if ($firstRow): ?>
<?php $firstRow = false; ?> <?php $firstRow = false; ?>
<table data-base-target="_next" class="action group-list alternating"> <table data-base-target="_next" class="action-table listing-table">
<thead> <thead>
<tr> <tr>
<th class="group-name"><?= $this->translate('Group'); ?></th> <th class="group-name"><?= $this->translate('Group'); ?></th>
@ -72,11 +89,4 @@ foreach ($groups as $group): ?>
<?php else: ?> <?php else: ?>
<p><?= $this->translate('No groups found matching the filter'); ?></p> <p><?= $this->translate('No groups found matching the filter'); ?></p>
<?php endif ?> <?php endif ?>
<?php if ($extensible): ?>
<?= $this->qlink($this->translate('Add a new group'), 'group/add', array('backend' => $backend->getName()), array(
'icon' => 'plus',
'data-base-target' => '_next',
'class' => 'group-add'
)); ?>
<?php endif ?>
</div> </div>

View File

@ -50,6 +50,20 @@ if ($this->hasPermission('config/authentication/groups/edit') && $backend instan
<?php endif ?> <?php endif ?>
</div> </div>
<div class="content members" data-base-target="_next"> <div class="content members" data-base-target="_next">
<?php if ($extensible): ?>
<?= $this->qlink(
$this->translate('Add User to Group') ,
'group/addmember',
null,
array(
'class' => 'button-link',
'data-base-target' => '_next',
'icon' => 'plus',
'title' => $this->translate('Add user to group')
)
) ?>
<?php endif ?>
<?php <?php
$firstRow = true; $firstRow = true;
@ -97,14 +111,4 @@ foreach ($members as $member): ?>
<?php else: ?> <?php else: ?>
<p><?= $this->translate('No group member found matching the filter'); ?></p> <p><?= $this->translate('No group member found matching the filter'); ?></p>
<?php endif ?> <?php endif ?>
<?php if ($extensible): ?>
<?= $this->qlink($this->translate('Add a new member'), 'group/addmember', array(
'backend' => $backend->getName(),
'group' => $group->group_name
), array(
'icon' => 'plus',
'data-base-target' => '_next',
'class' => 'member-add'
)); ?>
<?php endif ?>
</div> </div>

View File

@ -9,7 +9,7 @@
<?php endif ?> <?php endif ?>
<div class="content"> <div class="content">
<?= $this->qlink( <?= $this->qlink(
$this->translate('Create A New Navigation Item') , $this->translate('Create a New Navigation Item') ,
'navigation/add', 'navigation/add',
null, null,
array( array(

View File

@ -3,7 +3,7 @@
</div> </div>
<div class="content"> <div class="content">
<?= $this->qlink( <?= $this->qlink(
$this->translate('Create A New Role') , $this->translate('Create a New Role') ,
'role/add', 'role/add',
null, null,
array( array(

View File

@ -3,7 +3,7 @@
</div> </div>
<div class="content"> <div class="content">
<?= $this->qlink( <?= $this->qlink(
$this->translate('Create A New User Group Backend') , $this->translate('Create a New User Group Backend') ,
'usergroupbackend/create', 'usergroupbackend/create',
null, null,
array( array(

View File

@ -6,7 +6,7 @@
<div> <div>
<h2><?= $this->translate('Monitoring Backends') ?></h2> <h2><?= $this->translate('Monitoring Backends') ?></h2>
<?= $this->qlink( <?= $this->qlink(
$this->translate('Create A New Monitoring Backend') , $this->translate('Create a New Monitoring Backend') ,
'monitoring/config/createbackend', 'monitoring/config/createbackend',
null, null,
array( array(
@ -61,7 +61,7 @@
<div> <div>
<h2><?= $this->translate('Command Transports') ?></h2> <h2><?= $this->translate('Command Transports') ?></h2>
<?= $this->qlink( <?= $this->qlink(
$this->translate('Create A New Command Transport') , $this->translate('Create a New Command Transport') ,
'monitoring/config/createtransport', 'monitoring/config/createtransport',
null, null,
array( array(