elHide(bbcodeHtml);
});
});
+
+ {if $ownerGroupID}
+ {if $userGroupOption->optionName === 'admin.user.accessibleGroups'}
+ elBySelAll('dl[data-group-id]', container, function(dl) {
+ var groupId = parseInt(elData(dl, 'group-id'), 10);
+ console.log("Group", groupId);
+
+ elBySelAll('input[name="values[' + groupId + '][]"', undefined, function(input) {
+ if (groupId === {@$ownerGroupID}) {
+ var shadow = elCreate('input');
+ shadow.type = 'hidden';
+ shadow.name = input.name;
+ shadow.value = input.value;
+
+ input.parentNode.appendChild(shadow);
+
+ input.disabled = true;
+ }
+ else {
+ if (parseInt(input.value, 10) === {@$ownerGroupID}) {
+ elRemove(input.closest('label'));
+ }
+ }
+ });
+ });
+ {elseif $userGroupOption->optionName|in_array:$ownerGroupPermissions}
+ elBySelAll('input[name="values[{@$ownerGroupID}]"]', undefined, function (input) {
+ if (input.value === '1') {
+ input.checked = true;
+ }
+ else {
+ input.disabled = true;
+ }
+ });
+ {/if}
+ {/if}
})();
</script>
{foreach from=$groups item=group}
<dl data-group-id="{@$group->groupID}">
- <dt>{if VISITOR_USE_TINY_BUILD && $guestGroupID == $group->groupID && $userGroupOption->excludedInTinyBuild}<span class="icon icon16 fa-bolt red jsTooltip" title="{lang}wcf.acp.group.excludedInTinyBuild{/lang}"></span> {/if}<label for="userGroupOption{@$group->groupID}">{lang}{$group->groupName}{/lang}</label></dt>
+ <dt>
+ {if VISITOR_USE_TINY_BUILD && $guestGroupID == $group->groupID && $userGroupOption->excludedInTinyBuild}<span class="icon icon16 fa-bolt red jsTooltip" title="{lang}wcf.acp.group.excludedInTinyBuild{/lang}"></span> {/if}
+ {if $ownerGroupID == $group->groupID && $userGroupOption->optionName|in_array:$ownerGroupPermissions}<span class="icon icon16 fa-shield jsTooltip" title="{lang}wcf.acp.group.ownerGroupPermission{/lang}"></span> {/if}
+ <label for="userGroupOption{@$group->groupID}">{lang}{$group->groupName}{/lang}</label>
+ </dt>
<dd>
{@$formElements[$group->groupID]}
public function assignVariables() {
parent::assignVariables();
- $everyoneGroupID = $guestGroupID = $userGroupID = 0;
+ $everyoneGroupID = $guestGroupID = $ownerGroupID = $userGroupID = 0;
foreach ($this->groups as $group) {
if ($group->groupType == UserGroup::EVERYONE) {
$everyoneGroupID = $group->groupID;
else if ($group->groupType == UserGroup::GUESTS) {
$guestGroupID = $group->groupID;
}
+ else if ($group->groupType == UserGroup::OWNER) {
+ $ownerGroupID = $group->groupID;
+ }
else if ($group->groupType == UserGroup::USERS) {
$userGroupID = $group->groupID;
}
}
+ $ownerGroupPermissions = [];
+ if ($ownerGroupID) {
+ $ownerGroupPermissions = UserGroup::getOwnerPermissions();
+ $ownerGroupPermissions[] = 'admin.user.accessibleGroups';
+ }
+
WCF::getTPL()->assign([
'formElements' => $this->formElements,
'groups' => $this->groups,
'values' => $this->values,
'everyoneGroupID' => $everyoneGroupID,
'guestGroupID' => $guestGroupID,
- 'userGroupID' => $userGroupID
+ 'userGroupID' => $userGroupID,
+ 'ownerGroupID' => $ownerGroupID,
+ 'ownerGroupPermissions' => $ownerGroupPermissions,
]);
}