| 1 |
<?php |
| 2 |
/** |
| 3 |
* GroupSelectionFrom.php |
| 4 |
* |
| 5 |
* Shows the group selection 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 |
<input type="hidden" name="uam_update_groups" value="1"/> |
| 17 |
<ul class="uam_group_selection"> |
| 18 |
<?php |
| 19 |
/** |
| 20 |
* @var \UserAccessManager\Controller\AdminObjectController $controller |
| 21 |
*/ |
| 22 |
|
| 23 |
$groupsFormName = $controller->getGroupsFromName(); |
| 24 |
$objectType = $controller->getObjectType(); |
| 25 |
$objectId = $controller->getObjectId(); |
| 26 |
$userGroups = $controller->getFilteredUserGroups(); |
| 27 |
$objectUserGroups = $controller->getObjectUserGroups(); |
| 28 |
|
| 29 |
/** |
| 30 |
* @var \UserAccessManager\UserGroup\UserGroup[] $userGroups |
| 31 |
*/ |
| 32 |
foreach ($userGroups as $userGroup) { |
| 33 |
$addition = ''; |
| 34 |
$attributes = ''; |
| 35 |
|
| 36 |
/** |
| 37 |
* @var \UserAccessManager\UserGroup\UserGroup[] $objectUserGroups |
| 38 |
*/ |
| 39 |
if (isset($objectUserGroups[$userGroup->getId()]) === true) { |
| 40 |
$attributes .= 'checked="checked" '; |
| 41 |
|
| 42 |
if ($objectUserGroups[$userGroup->getId()]->isLockedRecursive($objectType, $objectId) === true) { |
| 43 |
$attributes .= 'disabled="disabled" '; |
| 44 |
$addition .= ' [LR]'; |
| 45 |
} |
| 46 |
} |
| 47 |
|
| 48 |
|
| 49 |
?> |
| 50 |
<li> |
| 51 |
<input type="checkbox" |
| 52 |
id="<?php echo $groupsFormName; ?>-<?php echo $userGroup->getId(); ?>" <?php echo $attributes; ?> |
| 53 |
value="<?php echo $userGroup->getId(); ?>" name="<?php echo $groupsFormName; ?>[]"/> |
| 54 |
<label for="<?php echo $groupsFormName; ?>-<?php echo $userGroup->getId(); ?>" class="selectit" |
| 55 |
style="display:inline;"> |
| 56 |
<?php echo htmlentities($userGroup->getName()).$addition; ?> |
| 57 |
</label> |
| 58 |
<a class="uam_group_info_link">(<?php echo TXT_UAM_INFO; ?>)</a> |
| 59 |
<?php include 'GroupInfo.php'; ?> |
| 60 |
</li> |
| 61 |
<?php |
| 62 |
} |
| 63 |
?> |
| 64 |
</ul> |