PluginProbe
User Access Manager / 2.1.11
User Access Manager v2.1.11
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.1.11, at src/View/MediaAjaxEditForm.php

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