', 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, $settings, $options, $scripturl, $txt, $modSettings; echo '

', $txt['permissions_boards'], '

', $txt['permissions_boards_desc'], '

', $txt['board_name'], ' ', $txt['permission_profile'], ''; if (!$context['edit_all']) echo ' ', $txt['permissions_board_all'], ''; 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, $settings, $options, $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, $settings, $options, $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 '

', $txt['permissions_change_view'], ': ', ($context['view_type'] == 'simple' ? '*' : ''), '', $txt['permissions_view_simple'], ' | ', ($context['view_type'] == 'classic' ? '*' : ''), '', $txt['permissions_view_classic'], '
'; // Draw out the main bits. if ($context['view_type'] == 'simple') template_modify_group_simple($context['permission_type']); else template_modify_group_classic($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'], '
'; if ($context['view_type'] == 'simple') template_modify_group_simple('board'); else template_modify_group_classic('board'); echo '
'; } if ($context['profile']['can_modify']) echo '
'; echo '
'; } // A javascript enabled clean permissions view. function template_modify_group_simple($type) { global $context, $settings, $options, $scripturl, $txt, $modSettings; // Simple only has one column so we only need bother ourself with that one. $permission_data = &$context['permissions'][$type]['columns'][0]; // Short cut for disabling fields we can't change. $disable_field = $context['profile']['can_modify'] ? '' : 'disabled="disabled" '; echo ' '; if (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1) echo ' '; else echo ' '; echo ' '; foreach ($permission_data as $id_group => $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 (empty($modSettings['permission_enable_deny']) || $context['group']['id'] == -1) echo ' '; else echo ' '; echo ' '; } $alternate = !$alternate; } if (!$permissionGroup['hidden'] && $has_display_content) echo ' '; } echo '
 ', $txt['permissions_option_on'], ' ', $txt['permissions_option_off'], ' ', $txt['permissions_option_deny'], '
* ', $permissionGroup['name'], '
', $permission['help_index'] ? '' . $txt['help'] . '' : '', ' ', $permission['name'], '
'; } // The SMF 1.x way of looking at permissions. function template_modify_group_classic($type) { global $context, $settings, $options, $scripturl, $txt, $modSettings; $permission_type = &$context['permissions'][$type]; $disable_field = $context['profile']['can_modify'] ? '' : 'disabled="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, $settings, $options, $txt, $modSettings; 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, $options, $scripturl, $txt, $modSettings; echo '

', $txt['permissions_post_moderation'], '

'; // 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 '

', $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'], '

'; } ?>