PluginProbe
User Access Manager / 2.2.21
User Access Manager v2.2.21
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 / UserGroupEditForm.php

UserGroupEditForm.php in User Access Manager 2.2.21, at src/View/UserGroups/UserGroupEditForm.php

169 lines 6.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * UserGroupEditForm.php
4 *
5 * Shows the user group edit form 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 UserGroupController $controller
18 */
19
20 use UserAccessManager\Controller\Backend\UserGroupController;
21 use UserAccessManager\Object\ObjectHandler;
22
23 $userGroup = $controller->getUserGroup();
24 ?>
25 <form method="post" action="<?php echo $controller->getRequestUrl(); ?>">
26 <input type="hidden" value="insert_update_user_group" name="uam_action"/>
27 <?php
28 $controller->createNonceField($controller::INSERT_UPDATE_GROUP_NONCE);
29
30 if ($userGroup->getId() !== null) {
31 ?>
32 <input type="hidden" value="<?php echo $userGroup->getId(); ?>" name="userGroupId"/>
33 <?php
34 }
35 ?>
36 <table class="form-table">
37 <tbody>
38 <tr class="form-field form-required">
39 <th valign="top"><label for="userGroupName"><?php echo TXT_UAM_GROUP_NAME; ?></label></th>
40 <td>
41 <input size="40" value="<?php echo htmlentities($userGroup->getName()); ?>"
42 id="userGroupName" name="userGroupName"/><br/>
43 <?php echo TXT_UAM_GROUP_NAME_DESC; ?>
44 </td>
45 </tr>
46 <tr class="form-field form-required">
47 <th valign="top"><label for="userGroupDescription"><?php echo TXT_UAM_GROUP_DESC; ?></label>
48 </th>
49 <td>
50 <input size="40" value="<?php echo htmlentities($userGroup->getDescription()); ?>"
51 id="userGroupDescription" name="userGroupDescription"/><br/>
52 <?php echo TXT_UAM_GROUP_DESC_DESC; ?>
53 </td>
54 </tr>
55 <tr class="form-field form-required">
56 <th valign="top"><label for="ipRange"><?php echo TXT_UAM_GROUP_IP_RANGE; ?></label></th>
57 <td><input size="40" value="<?php echo htmlentities($userGroup->getIpRange()); ?>"
58 id="ipRange" name="ipRange"/><br/>
59 <?php echo TXT_UAM_GROUP_IP_RANGE_DESC; ?>
60 </td>
61 </tr>
62 <tr class="form-field form-required">
63 <th valign="top"><label for="readAccess"><?php echo TXT_UAM_GROUP_READ_ACCESS; ?></label>
64 </th>
65 <td>
66 <select id="readAccess" name="readAccess">
67 <option value="group"
68 <?php
69 if ($userGroup->getReadAccess() === 'group') {
70 echo 'selected="selected"';
71 }
72 ?>
73 >
74 <?php echo TXT_UAM_ONLY_GROUP_USERS ?>
75 </option>
76 <option value="all"
77 <?php
78 if ($userGroup->getReadAccess() === 'all') {
79 echo 'selected="selected"';
80 }
81 ?>
82 >
83 <?php echo TXT_UAM_ALL_USERS ?>
84 </option>
85 </select><br/>
86 <?php echo TXT_UAM_GROUP_READ_ACCESS_DESC; ?>
87 </td>
88 </tr>
89 <tr class="form-field form-required">
90 <th valign="top"><label for="writeAccess"><?php echo TXT_UAM_GROUP_WRITE_ACCESS; ?></label>
91 </th>
92 <td>
93 <select id="writeAccess" name="writeAccess">
94 <option value="none"
95 <?php
96 if ($userGroup->getWriteAccess() === 'none') {
97 echo 'selected="selected"';
98 }
99 ?>
100 >
101 <?php echo TXT_UAM_NONE ?>
102 </option>
103 <option value="group"
104 <?php
105 if ($userGroup->getWriteAccess() === 'group') {
106 echo 'selected="selected"';
107 }
108 ?>
109 >
110 <?php echo TXT_UAM_ONLY_GROUP_USERS ?>
111 </option>
112 <option value="all"
113 <?php
114 if ($userGroup->getWriteAccess() === 'all') {
115 echo 'selected="selected"';
116 }
117 ?>
118 >
119 <?php echo TXT_UAM_ALL_USERS ?>
120 </option>
121 </select><br/>
122 <?php echo TXT_UAM_GROUP_WRITE_ACCESS_DESC; ?>
123 </td>
124 </tr>
125 <tr>
126 <th valign="top"><?php echo TXT_UAM_GROUP_ROLE; ?></th>
127 <td>
128 <ul class='uam_role'>
129 <?php
130 $groupRoles = $userGroup->getAssignedObjectsByType(
131 ObjectHandler::GENERAL_ROLE_OBJECT_TYPE
132 );
133 $roleNames = $controller->getRoleNames();
134
135 foreach ($roleNames as $role => $name) {
136 if ($role !== 'administrator') {
137 ?>
138 <li class="selectit">
139 <input id="role-<?php echo $role; ?>" type="checkbox"
140 <?php
141 if (isset($groupRoles[$role]) === true) {
142 echo 'checked="checked"';
143 }
144 ?>
145 value="<?php echo $role; ?>" name="roles[]"/>
146 <label for="role-<?php echo $role; ?>">
147 <?php echo $name; ?>
148 </label>
149 </li>
150 <?php
151 }
152 }
153 ?>
154 </ul>
155 </td>
156 </tr>
157 </tbody>
158 </table>
159 <p class="submit">
160 <input type="submit" value="<?php
161 if ($userGroup->getId() !== null) {
162 echo TXT_UAM_UPDATE_GROUP;
163 } else {
164 echo TXT_UAM_ADD_GROUP;
165 }
166 ?>" name="submit" class="button"/>
167 </p>
168 </form>
169