PluginProbe
User Access Manager / 2.1.8
User Access Manager v2.1.8
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.8, at src/View/UserGroups/UserGroupList.php

147 lines 5.3 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 } elseif ($userGroup->getWriteAccess() === 'none') {
82 echo TXT_UAM_NONE;
83 }
84 ?>
85 </td>
86 <td>
87 <?php
88 $roleNames = $controller->getRoleNames();
89 $groupRoles = $userGroup->getAssignedObjectsByType(
90 \UserAccessManager\Object\ObjectHandler::GENERAL_ROLE_OBJECT_TYPE
91 );
92
93 if (count($groupRoles) > 0) {
94 ?>
95 <ul style="margin: 0;">
96 <?php
97 foreach ($groupRoles as $key => $role) {
98 ?>
99 <li><?php echo isset($roleNames[$key]) ? $roleNames[$key] : $key; ?></li>
100 <?php
101 }
102 ?>
103 </ul>
104 <?php
105 } else {
106 echo TXT_UAM_NONE;
107 }
108 ?>
109 </td>
110 <td>
111 <?php
112 $ipRanges = $userGroup->getIpRangeArray();
113
114 if (count($ipRanges) > 0) {
115 ?>
116 <ul>
117 <?php
118 foreach ($ipRanges as $ipRange) {
119 ?>
120 <li><?php echo htmlentities($ipRange); ?></li>
121 <?php
122 }
123 ?>
124 </ul>
125 <?php
126 } else {
127 echo TXT_UAM_NONE;
128 }
129 ?>
130 </td>
131 </tr>
132 <?php
133 }
134 ?>
135 </tbody>
136 </table>
137 <div class="tablenav">
138 <div class="alignleft">
139 <input type="submit"
140 class="button-secondary delete"
141 name="deleteit"
142 value="<?php echo TXT_UAM_DELETE; ?>"/>
143 </div>
144 <br class="clear"/>
145 </div>
146 </form>
147