PluginProbe
User Access Manager / 2.1.10
User Access Manager v2.1.10
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.1.10, at src/View/UserGroups/UserGroupEditForm.php

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