PluginProbe
User Access Manager / 2.2.1
User Access Manager v2.2.1
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 / MediaAjaxEditForm.php

MediaAjaxEditForm.php in User Access Manager 2.2.1, at src/View/MediaAjaxEditForm.php

79 lines 2.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * MediaAjaxEditFrom.php
4 *
5 * Shows the group selection form for the ajax attachment from.
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 ObjectController $controller
18 */
19
20 use UserAccessManager\Controller\Backend\ObjectController;
21 use UserAccessManager\UserGroup\UserGroup;
22
23 $userGroups = $controller->getFilteredUserGroups();
24 $controller->sortUserGroups($userGroups);
25 $objectUserGroups = $controller->getObjectInformation()->getObjectUserGroups();
26
27 if (count($userGroups) > 0) {
28 ?>
29 <input type="hidden" name="uam_update_groups" value="1"/>
30 <ul class="uam_group_selection_ajax" style="margin: 0;">
31 <?php
32 $groupsFormName = $controller->getGroupsFormName();
33 $objectType = $controller->getObjectInformation()->getObjectType();
34 $objectId = $controller->getObjectInformation()->getObjectId();
35
36 /**
37 * @var UserGroup[] $userGroups
38 */
39 foreach ($userGroups as $userGroup) {
40 $addition = '';
41 $attributes = '';
42
43 /**
44 * @var UserGroup[] $objectUserGroups
45 */
46 if (isset($objectUserGroups[$userGroup->getId()]) === true) {
47 $attributes .= 'checked="checked" ';
48
49 if ($objectUserGroups[$userGroup->getId()]->isLockedRecursive($objectType, $objectId)) {
50 $attributes .= 'disabled="disabled" ';
51 $addition .= ' [LR]';
52 }
53 }
54 ?>
55 <li>
56 <input type="checkbox"
57 id="<?php echo $groupsFormName; ?>-<?php echo $userGroup->getId(); ?>" <?php echo $attributes; ?>
58 value="<?php echo $userGroup->getId(); ?>"
59 name="<?php echo "{$groupsFormName}[{$userGroup->getId()}][id]"; ?>"
60 data-="uam_user_groups"/>
61 <label for="<?php echo $groupsFormName; ?>-<?php echo $userGroup->getId(); ?>" class="selectit"
62 style="display:inline;">
63 <?php echo htmlentities($userGroup->getName()) . $addition; ?>
64 </label>
65 <a class="uam_group_info_link">(<?php echo TXT_UAM_INFO; ?>)</a>
66 <?php include 'GroupInfo.php'; ?>
67 </li>
68 <?php
69 }
70 ?>
71 </ul>
72 <?php
73 } elseif ($controller->checkUserAccess()) {
74 ?>
75 <a href='?page=uam_user_group'><?php echo TXT_UAM_CREATE_GROUP_FIRST; ?></a>
76 <?php
77 } else {
78 echo TXT_UAM_NO_GROUP_AVAILABLE;
79 }