new WCF.ACP.User.Group.Copy({@$groupID});
{/if}
- {if $action == 'edit' && ($groupIsEveryone || $groupIsGuest || $groupIsUsers)}
+ {if $action === 'add' && $isBlankForm}
+ elBySelAll('.jsBbcodeSelectOptionHtml input[type="checkbox"]', undefined, function (checkbox) {
+ checkbox.checked = true;
+ });
+ {elseif $action == 'edit' && ($groupIsEveryone || $groupIsGuest || $groupIsUsers)}
elBySelAll('.jsBbcodeSelectOptionHtml', undefined, function (bbcodeHtml) {
elBySel('input[type="checkbox"]', bbcodeHtml).checked = true;
else {
parent.appendChild(fragment);
}
+
+ [{@$everyoneGroupID}, {@$guestGroupID}, {@$userGroupID}].forEach(function(groupID) {
+ elBySelAll('dl[data-group-id="' + groupID + '"] .jsBbcodeSelectOptionHtml', undefined, function (bbcodeHtml) {
+ elBySel('input[type="checkbox"]', bbcodeHtml).checked = true;
+
+ elHide(bbcodeHtml);
+ });
+ });
})();
</script>
</header>
{foreach from=$groups item=group}
- <dl>
+ <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>
<dd>
{@$formElements[$group->groupID]}
'priority' => $this->priority,
'userOnlineMarking' => $this->userOnlineMarking,
'showOnTeamPage' => $this->showOnTeamPage,
- 'groupIsGuest' => false
+ 'groupIsGuest' => false,
+ 'isBlankForm' => empty($_POST)
]);
}
public function assignVariables() {
parent::assignVariables();
- $guestGroupID = 0;
+ $everyoneGroupID = $guestGroupID = $userGroupID = 0;
foreach ($this->groups as $group) {
- if ($group->groupType == UserGroup::GUESTS) {
+ if ($group->groupType == UserGroup::EVERYONE) {
+ $everyoneGroupID = $group->groupID;
+ }
+ else if ($group->groupType == UserGroup::GUESTS) {
$guestGroupID = $group->groupID;
- break;
+ }
+ else if ($group->groupType == UserGroup::USERS) {
+ $userGroupID = $group->groupID;
}
}
'parentCategories' => $this->parentCategories,
'userGroupOption' => $this->userGroupOption,
'values' => $this->values,
- 'guestGroupID' => $guestGroupID
+ 'everyoneGroupID' => $everyoneGroupID,
+ 'guestGroupID' => $guestGroupID,
+ 'userGroupID' => $userGroupID
]);
}