| 1 |
<?php |
| 2 |
/** |
| 3 |
* DefaultUserGroupEditForm.php |
| 4 |
* |
| 5 |
* Shows the default 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 |
<form method="post" action="<?php echo $controller->getRequestUrl(); ?>"> |
| 21 |
<input type="hidden" value="set_default_user_groups" name="uam_action"/> |
| 22 |
<?php $controller->createNonceField($controller::SET_DEFAULT_USER_GROUPS_NONCE); ?> |
| 23 |
<ul class="uam_group_selection uam_default_groups"> |
| 24 |
<?php |
| 25 |
$objectType = $controller->getCurrentTabGroupSection(); |
| 26 |
$userGroups = $controller->getUserGroups(); |
| 27 |
|
| 28 |
/** |
| 29 |
* @var \UserAccessManager\UserGroup\UserGroup[] $userGroups |
| 30 |
*/ |
| 31 |
foreach ($userGroups as $userGroup) { |
| 32 |
/** |
| 33 |
* @var \UserAccessManager\UserGroup\AssignmentInformation $assignmentInformation |
| 34 |
*/ |
| 35 |
if ($userGroup instanceof \UserAccessManager\UserGroup\DynamicUserGroup |
| 36 |
&& $userGroup->getId() !== \UserAccessManager\UserGroup\DynamicUserGroup::USER_TYPE.'|0' |
| 37 |
) { |
| 38 |
continue; |
| 39 |
} |
| 40 |
|
| 41 |
$attributes = ($userGroup->isDefaultGroupForObjectType($objectType, $fromTime, $toTime) === true) ? |
| 42 |
'checked="checked"' : ''; |
| 43 |
|
| 44 |
?> |
| 45 |
<li> |
| 46 |
<input type="checkbox" <?php echo $attributes; ?> |
| 47 |
id="defaultGroups-<?php echo $userGroup->getId(); ?>" |
| 48 |
value="<?php echo $userGroup->getId(); ?>" |
| 49 |
name="default_user_groups[<?php echo $userGroup->getId(); ?>][id]" /> |
| 50 |
<label for="defaultGroups-<?php echo $userGroup->getId(); ?>" |
| 51 |
class="selectit" |
| 52 |
style="display:inline;"> |
| 53 |
<?php echo htmlentities($userGroup->getName()); ?> |
| 54 |
</label> |
| 55 |
<div class="uam_group_date_form"> |
| 56 |
<div> |
| 57 |
<label for="defaultGroups-<?php echo $userGroup->getId(); ?>-fromTime"> |
| 58 |
<?php echo TXT_UAM_GROUP_FROM_TIME; ?> |
| 59 |
</label> |
| 60 |
<input id="defaultGroups-<?php echo $userGroup->getId(); ?>-fromTime" |
| 61 |
name="default_user_groups[<?php echo $userGroup->getId(); ?>][fromTime]" |
| 62 |
class="uam_time_input" |
| 63 |
value="<?php echo $fromTime; ?>" |
| 64 |
placeholder="ddd-hh:mm:ss"/> |
| 65 |
</div> |
| 66 |
<div> |
| 67 |
<label for="defaultGroups-<?php echo $userGroup->getId(); ?>-toTime"> |
| 68 |
<?php echo TXT_UAM_GROUP_TO_TIME; ?> |
| 69 |
</label> |
| 70 |
<input id="defaultGroups-<?php echo $userGroup->getId(); ?>-toTime" |
| 71 |
name="default_user_groups[<?php echo $userGroup->getId(); ?>][toTime]" |
| 72 |
class="uam_time_input" |
| 73 |
value="<?php echo $toTime; ?>" |
| 74 |
placeholder="ddd-hh:mm:ss"/> |
| 75 |
</div> |
| 76 |
</div> |
| 77 |
</li> |
| 78 |
<?php |
| 79 |
} |
| 80 |
?> |
| 81 |
</ul> |
| 82 |
<p class="submit"> |
| 83 |
<input type="submit" |
| 84 |
value="<?php echo TXT_UAM_UPDATE_DEFAULT_USER_GROUPS; ?>" |
| 85 |
name="submit" class="button"/> |
| 86 |
</p> |
| 87 |
</form> |