PluginProbe
User Access Manager / 2.1.4
User Access Manager v2.1.4
2.3.20 2.3.19 2.3.18 2.3.17 2.3.16 2.3.15 2.3.14 2.3.13 trunk 0.6 0.6.1 0.6.2 0.7 0.7 Beta 0.7.0.1 0.8 0.8.0.1 0.8.0.2 0.9 0.9.1 0.9.1.1 0.9.1.2 0.9.1.3 0.9.1.4 1.0 All 136 releases
user-access-manager / src / View / UserGroups / UserGroupList.php

UserGroupList.php in User Access Manager 2.1.4, at src/View/UserGroups/UserGroupList.php

145 lines 5.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * UserGroupList.php
4 *
5 * Shows the user group edit list at the admin panel.
6 *
7 * PHP versions 5
8 *
9 * @author Alexander Schneider <alexanderschneider85@gmail.com>
10 * @copyright 2008-2017 Alexander Schneider
11 * @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2
12 * @version SVN: $id$
13 * @link http://wordpress.org/extend/plugins/user-access-manager/
14 */
15
16 /**
17 * @var \UserAccessManager\Controller\Backend\UserGroupController $controller
18 */
19 ?>
20 <form method="post" action="<?php echo $controller->getRequestUrl(); ?>">
21 <?php $controller->createNonceField('uamDeleteGroup'); ?>
22 <input type="hidden" value="delete_user_group" name="uam_action"/>
23 <div class="tablenav">
24 <div class="alignleft">
25 <input type="submit" class="button-secondary delete" name="deleteit"
26 value="<?php echo TXT_UAM_DELETE; ?>"/>
27 </div>
28 <br class="clear"/>
29 </div>
30 <table class="widefat">
31 <thead>
32 <tr class="thead">
33 <th scope="col"></th>
34 <th scope="col"><?php echo TXT_UAM_NAME; ?></th>
35 <th scope="col"><?php echo TXT_UAM_DESCRIPTION; ?></th>
36 <th scope="col"><?php echo TXT_UAM_READ_ACCESS; ?></th>
37 <th scope="col"><?php echo TXT_UAM_WRITE_ACCESS; ?></th>
38 <th scope="col"><?php echo TXT_UAM_GROUP_ROLE; ?></th>
39 <th scope="col"><?php echo TXT_UAM_IP_RANGE; ?></th>
40 </tr>
41 </thead>
42 <tbody>
43 <?php
44 $currentAdminPage = $controller->getRequestParameter('page');
45 $userGroups = $controller->getUserGroups();
46 foreach ($userGroups as $userGroup) {
47 ?>
48 <tr class="alternate" id="group-<?php echo $userGroup->getId(); ?>">
49 <th class="check-column">
50 <label>
51 <input type="checkbox" value="<?php echo $userGroup->getId(); ?>" name="delete[]"/>
52 </label>
53 </th>
54 <td>
55 <strong>
56 <?php
57 $link = "?page={$currentAdminPage}&amp;uam_action=edit_user_group"
58 ."&amp;userGroupId={$userGroup->getId()}";
59 ?>
60 <a href="<?php echo $link; ?>">
61 <?php echo htmlentities($userGroup->getName()); ?>
62 </a>
63 </strong>
64 </td>
65 <td><?php echo htmlentities($userGroup->getDescription()) ?></td>
66 <td>
67 <?php
68 if ($userGroup->getReadAccess() === 'all') {
69 echo TXT_UAM_ALL;
70 } elseif ($userGroup->getReadAccess() === 'group') {
71 echo TXT_UAM_ONLY_GROUP_USERS;
72 }
73 ?>
74 </td>
75 <td>
76 <?php
77 if ($userGroup->getWriteAccess() === 'all') {
78 echo TXT_UAM_ALL;
79 } elseif ($userGroup->getWriteAccess() === 'group') {
80 echo TXT_UAM_ONLY_GROUP_USERS;
81 }
82 ?>
83 </td>
84 <td>
85 <?php
86 $roleNames = $controller->getRoleNames();
87 $groupRoles = $userGroup->getAssignedObjectsByType(
88 \UserAccessManager\Object\ObjectHandler::GENERAL_ROLE_OBJECT_TYPE
89 );
90
91 if (count($groupRoles) > 0) {
92 ?>
93 <ul style="margin: 0;">
94 <?php
95 foreach ($groupRoles as $key => $role) {
96 ?>
97 <li><?php echo isset($roleNames[$key]) ? $roleNames[$key] : $key; ?></li>
98 <?php
99 }
100 ?>
101 </ul>
102 <?php
103 } else {
104 echo TXT_UAM_NONE;
105 }
106 ?>
107 </td>
108 <td>
109 <?php
110 $ipRanges = $userGroup->getIpRangeArray();
111
112 if (count($ipRanges) > 0) {
113 ?>
114 <ul>
115 <?php
116 foreach ($ipRanges as $ipRange) {
117 ?>
118 <li><?php echo htmlentities($ipRange); ?></li>
119 <?php
120 }
121 ?>
122 </ul>
123 <?php
124 } else {
125 echo TXT_UAM_NONE;
126 }
127 ?>
128 </td>
129 </tr>
130 <?php
131 }
132 ?>
133 </tbody>
134 </table>
135 <div class="tablenav">
136 <div class="alignleft">
137 <input type="submit"
138 class="button-secondary delete"
139 name="deleteit"
140 value="<?php echo TXT_UAM_DELETE; ?>"/>
141 </div>
142 <br class="clear"/>
143 </div>
144 </form>
145