';
}
function template_by_board()
{
global $context, $scripturl, $txt, $modSettings;
echo '
';
}
// Edit permission profiles (predefined).
function template_edit_profiles()
{
global $context, $scripturl, $txt, $modSettings;
echo '
';
}
function template_modify_group()
{
global $context, $scripturl, $txt, $modSettings;
// Cannot be edited?
if (!$context['profile']['can_modify'])
{
echo '
';
}
// The way of looking at permissions.
function template_modify_group_display($type)
{
global $context, $settings, $scripturl, $txt, $modSettings;
$permission_type = &$context['permissions'][$type];
$disable_field = $context['profile']['can_modify'] ? '' : 'disabled ';
echo '
';
foreach ($permission_type['columns'] as $column)
{
echo '
';
foreach ($column as $permissionGroup)
{
if (empty($permissionGroup['permissions']))
continue;
// Are we likely to have something in this group to display or is it all hidden?
$has_display_content = false;
if (!$permissionGroup['hidden'])
{
// Before we go any further check we are going to have some data to print otherwise we just have a silly heading.
foreach ($permissionGroup['permissions'] as $permission)
if (!$permission['hidden'])
$has_display_content = true;
if ($has_display_content)
{
echo '
', $permissionGroup['name'], '
';
if (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1)
echo '
';
else
echo '
', $txt['permissions_option_on'], '
', $txt['permissions_option_off'], '
', $txt['permissions_option_deny'], '
';
echo '
';
}
}
$alternate = false;
foreach ($permissionGroup['permissions'] as $permission)
{
// If it's hidden keep the last value.
if ($permission['hidden'] || $permissionGroup['hidden'])
{
echo '
';
if ($permission['has_own_any'])
{
// Guests can't have own permissions.
if ($context['group']['id'] != -1)
echo '
';
echo '
';
}
else
echo '
';
echo '
';
}
else
{
echo '
', $permission['show_help'] ? '' : '', '
';
if ($permission['has_own_any'])
{
echo '
', $permission['name'], '
';
// Guests can't do their own thing.
if ($context['group']['id'] != -1)
{
echo '
', $permission['own']['name'], ':
';
if (empty($modSettings['permission_enable_deny']))
echo '
';
else
echo '
';
echo '
';
}
echo '
', $permission['any']['name'], ':
';
if (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1)
echo '
';
else
echo '
';
echo '
';
}
else
{
echo '
', $permission['name'], '
';
if (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1)
echo '
';
}
function template_inline_permissions()
{
global $context, $txt, $modSettings;
// This looks really weird, but it keeps things nested properly...
echo '
[ ', $txt['avatar_select_permission'], ' ]
';
}
// Edit post moderation permissions.
function template_postmod_permissions()
{
global $context, $settings, $scripturl, $txt, $modSettings;
echo '