', sprintf($txt['permission_cannot_edit'], $scripturl . '?action=admin;area=permissions;sa=profiles'), ' '; echo '
'; if (!empty($context['profile'])) echo '

', $txt['permissions_for_profile'], ': "', $context['profile']['name'], '"

'; else echo '

', $txt['permissions_title'], '

'; echo ' '; if (empty($modSettings['permission_enable_deny'])) echo ' '; else echo ' '; echo ' '; $alternate = false; foreach ($context['groups'] as $group) { $alternate = !$alternate; echo ' '; if (empty($modSettings['permission_enable_deny'])) echo ' '; else echo ' '; echo ' '; } echo '
', $txt['membergroups_name'], ' ', $txt['membergroups_members_top'], '', $txt['membergroups_permissions'], '', $txt['permissions_allowed'], ' ', $txt['permissions_denied'], '', $context['can_modify'] ? $txt['permissions_modify'] : $txt['permissions_view'], ' ', $context['can_modify'] ? '' : '', '
', !empty($group['help']) ? ' ' . $txt['help'] . '' : '' . $txt['help'] . '', ' ', $group['name'], ''; if (!empty($group['children'])) echo '
', $txt['permissions_includes_inherited'], ': "', implode('", "', $group['children']), '"'; echo '
', $group['can_search'] ? $group['link'] : $group['num_members'], '', $group['num_permissions']['allowed'], '', $group['num_permissions']['allowed'], ' ', $group['num_permissions']['denied'], '', $group['allow_modify'] ? '' . ($context['can_modify'] ? $txt['permissions_modify'] : $txt['permissions_view']). '' : '', ' ', $group['allow_modify'] && $context['can_modify'] ? '' : '', '

'; // Advanced stuff... if ($context['can_modify']) { echo '
', $txt['permissions_with_selection'], '
' . $txt['help'] . '', $txt['permissions_apply_pre_defined'], ':
', $txt['permissions_like_group'], ':
'; // Javascript for the advanced stuff. echo ' '; if (!empty($context['profile'])) echo ' '; echo ' '; } else echo ' '; echo '
'; } function template_by_board() { global $context, $scripturl, $txt, $modSettings; echo '

', $txt['permissions_boards'], '

', $txt['permissions_boards_desc'], '

', $txt['board_name'], ' ', $txt['permission_profile'], ''; echo '

'; foreach ($context['categories'] as $category) { echo '

', $category['name'], '

'; if (!empty($category['boards'])) echo '
'; } echo '
'; if ($context['edit_all']) echo ' '; else echo ' ', $txt['permissions_board_all'], ''; echo '
'; } // Edit permission profiles (predefined). function template_edit_profiles() { global $context, $scripturl, $txt, $modSettings; echo '

', $txt['permissions_profile_edit'], '

', $txt['permissions_profile_used_by'], ' '; $alternate = false; foreach ($context['profiles'] as $profile) { echo ' '; $alternate = !$alternate; } echo '
', $txt['permissions_profile_name'], '
'; if (!empty($context['show_rename_boxes']) && $profile['can_edit']) echo ' '; else echo ' ', $profile['name'], ''; echo ' ', !empty($profile['boards_text']) ? $profile['boards_text'] : $txt['permissions_profile_used_by_none'], '
'; if ($context['can_edit_something']) echo ' '; echo '

', $txt['permissions_profile_new'], '

', $txt['permissions_profile_name'], ':
', $txt['permissions_profile_copy_from'], ':

'; } function template_modify_group() { global $context, $scripturl, $txt, $modSettings; // Cannot be edited? if (!$context['profile']['can_modify']) { echo '
', sprintf($txt['permission_cannot_edit'], $scripturl . '?action=admin;area=permissions;sa=profiles'), '
'; } else { echo ' '; } echo '
'; if (!empty($modSettings['permission_enable_deny']) && $context['group']['id'] != -1) echo '
', $txt['permissions_option_desc'], '
'; echo '

'; if ($context['permission_type'] == 'board') echo ' ', $txt['permissions_local_for'], ' "', $context['group']['name'], '" ', $txt['permissions_on'], ' "', $context['profile']['name'], '"'; else echo ' ', $context['permission_type'] == 'membergroup' ? $txt['permissions_general'] : $txt['permissions_board'], ' - "', $context['group']['name'], '"'; echo '

'; // Draw out the main bits. template_modify_group_display($context['permission_type']); // If this is general permissions also show the default profile. if ($context['permission_type'] == 'membergroup') { echo '

', $txt['permissions_board'], '

', $txt['permissions_board_desc'], '
'; template_modify_group_display('board'); echo '
'; } if ($context['profile']['can_modify']) echo '
'; 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 ' '; if (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1) echo ' '; else echo ' '; echo ' '; } } $alternate = false; foreach ($permissionGroup['permissions'] as $permission) { // If it's hidden keep the last value. if ($permission['hidden'] || $permissionGroup['hidden']) { echo ' '; } else { echo ' '; if ($permission['has_own_any']) { echo ' '; // Guests can't do their own thing. if ($context['group']['id'] != -1) { echo ' '; if (empty($modSettings['permission_enable_deny'])) echo ' '; else echo ' '; echo ' '; } echo ' '; if (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1) echo ' '; else echo ' '; echo ' '; } else { echo ' '; if (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1) echo ' '; else echo ' '; echo ' '; } } $alternate = !$alternate; } if (!$permissionGroup['hidden'] && $has_display_content) echo ' '; } echo '
', $permissionGroup['name'], '
', $txt['permissions_option_on'], '
', $txt['permissions_option_off'], '
', $txt['permissions_option_deny'], '
'; if ($permission['has_own_any']) { // Guests can't have own permissions. if ($context['group']['id'] != -1) echo ' '; echo ' '; } else echo ' '; echo '
', $permission['show_help'] ? '' . $txt['help'] . '' : '', ' ', $permission['name'], '
', $permission['own']['name'], ':
', $permission['any']['name'], ':
', $permission['name'], '
'; } echo '
'; } function template_inline_permissions() { global $context, $txt, $modSettings; // This looks really weird, but it keeps things nested properly... echo '
', $txt['avatar_select_permission'], ''; if (empty($modSettings['permission_enable_deny'])) echo ' '; else echo ' '; echo '
'; } // Edit post moderation permissions. function template_postmod_permissions() { global $context, $settings, $scripturl, $txt, $modSettings; echo '

', $txt['permissions_post_moderation'], '

'; // First, we have the bit where we can enable or disable this bad boy. echo '
', $txt['permissions_post_moderation_enable'], '

'; // If we're not active, there's a bunch of stuff we don't need to show. if (!empty($modSettings['postmod_active'])) { // Got advanced permissions - if so warn! if (!empty($modSettings['permission_enable_deny'])) echo '
', $txt['permissions_post_moderation_deny_note'], '
'; echo '

', $txt['permissions_post_moderation_legend'], ':
', $txt['permissions_post_moderation_allow'], ' - ', $txt['permissions_post_moderation_allow'], '
', $txt['permissions_post_moderation_moderate'], ' - ', $txt['permissions_post_moderation_moderate'], '
', $txt['permissions_post_moderation_disallow'], ' - ', $txt['permissions_post_moderation_disallow'], '




', $txt['permissions_post_moderation_select'], ':
'; if ($modSettings['attachmentEnable'] == 1) echo ' '; echo ' '; if ($modSettings['attachmentEnable'] == 1) echo ' '; echo ' '; foreach ($context['profile_groups'] as $group) { echo ' '; // Guests can't have "own" permissions if ($group['id'] == '-1') { echo ' '; } else { echo ' '; } echo ' '; if ($modSettings['attachmentEnable'] == 1) { echo ' '; } echo ' '; } echo '
', $txt['permissions_post_moderation_new_topics'], ' ', $txt['permissions_post_moderation_replies_own'], ' ', $txt['permissions_post_moderation_replies_any'], ' ', $txt['permissions_post_moderation_attachments'], '
', $txt['permissions_post_moderation_group'], ' ', $txt['permissions_post_moderation_allow'], ' ', $txt['permissions_post_moderation_moderate'], ' ', $txt['permissions_post_moderation_disallow'], ' ', $txt['permissions_post_moderation_allow'], ' ', $txt['permissions_post_moderation_moderate'], ' ', $txt['permissions_post_moderation_disallow'], ' ', $txt['permissions_post_moderation_allow'], ' ', $txt['permissions_post_moderation_moderate'], ' ', $txt['permissions_post_moderation_disallow'], '', $txt['permissions_post_moderation_allow'], ' ', $txt['permissions_post_moderation_moderate'], ' ', $txt['permissions_post_moderation_disallow'], '
', $group['name'], ''; if (!empty($group['children'])) echo '
', $txt['permissions_includes_inherited'], ': "', implode('", "', $group['children']), '"'; echo '
'; } echo '
'; echo '
'; } ?>