Browse Source

Merge pull request #278 from emanuele45/admin_search

Admin search
emanuele45 11 years ago
parent
commit
45a2e3c5fc

+ 9 - 0
Sources/Admin.php

@@ -552,6 +552,15 @@ function AdminHome()
 
 	$context['sub_template'] = $context['admin_area'] == 'credits' ? 'credits' : 'admin';
 	$context['page_title'] = $context['admin_area'] == 'credits' ? $txt['support_credits_title'] : $txt['admin_center'];
+	if ($context['admin_area'] != 'credits')
+		$context[$context['admin_menu_name']]['tab_data'] = array(
+			'title' => $txt['admin_center'],
+			'help' => '',
+			'description' => '
+				<strong>' . $txt['hello_guest'] . ' ' . $context['user']['name'] . '!</strong>
+				' . sprintf($txt['admin_main_welcome'], $txt['admin_center'], $txt['help'], $txt['help']),
+		);
+
 
 	// The format of this array is: permission, action, title, description, icon.
 	$quick_admin_tasks = array(

+ 10 - 0
Sources/Drafts.php

@@ -652,6 +652,11 @@ function showProfileDrafts($memID, $draft_type = 0)
 	if ($reverse)
 		$context['drafts'] = array_reverse($context['drafts'], true);
 
+	// Menu tab
+	$context[$context['profile_menu_name']]['tab_data'] = array(
+		'title' => $txt['drafts_show'] . ' - ' . $context['member']['name'],
+		'icon' => 'message_sm.png'
+	);
 	$context['sub_template'] = 'showDrafts';
 }
 
@@ -867,6 +872,11 @@ function ModifyDraftSettings($return_config = false)
 	// Setup the template.
 	$context['page_title'] = $txt['managedrafts_settings'];
 	$context['sub_template'] = 'show_settings';
+	$context[$context['admin_menu_name']]['tab_data'] = array(
+		'title' => $txt['drafts'],
+		'help' => '',
+		'description' => $txt['managedrafts_settings_description'],
+	);
 
 	// Saving them ?
 	if (isset($_GET['save']))

+ 3 - 1
Sources/Groups.php

@@ -625,7 +625,6 @@ function GroupRequests()
 	// This is all the information required for a group listing.
 	$listOptions = array(
 		'id' => 'group_request_list',
-		'title' => $txt['mc_group_requests'],
 		'width' => '100%',
 		'items_per_page' => $modSettings['defaultMaxMessages'],
 		'no_items_label' => $txt['mc_groupr_none_found'],
@@ -735,6 +734,9 @@ function GroupRequests()
 	createList($listOptions);
 
 	$context['default_list'] = 'group_request_list';
+	$context[$context['moderation_menu_name']]['tab_data'] = array(
+		'title' => $txt['mc_group_requests'],
+	);
 }
 
 /**

+ 5 - 0
Sources/ManageSettings.php

@@ -476,6 +476,11 @@ function ModifyCoreFeatures($return_config = false)
 
 	$context['sub_template'] = 'core_features';
 	$context['page_title'] = $txt['core_settings_title'];
+	$context[$context['admin_menu_name']]['tab_data'] = array(
+		'title' => $txt['core_settings_title'],
+		'help' => '',
+		'description' => $txt['core_settings_desc'],
+	);
 
 	// We love our tokens.
 	createToken('admin-core');

+ 14 - 0
Sources/ModerationCenter.php

@@ -173,6 +173,15 @@ function ModerationMain($dont_call = false)
 	$context['moderation_menu_id'] = $context['max_menu_id'];
 	$context['moderation_menu_name'] = 'menu_data_' . $context['moderation_menu_id'];
 
+	// @todo: html in here is not good
+	$context[$context['moderation_menu_name']]['tab_data'] = array(
+		'title' => $txt['moderation_center'],
+		'help' => '',
+		'description' => '
+			<strong>' . $txt['hello_guest'] . ' ' . $context['user']['name'] . '!</strong>
+			<br /><br />
+			' . $txt['mc_description']);
+
 	// What a pleasant shortcut - even tho we're not *really* on the admin screen who cares...
 	$context['admin_area'] = $mod_include_data['current_area'];
 
@@ -2050,6 +2059,11 @@ function ModerationSettings()
 	loadTemplate('ModerationCenter');
 	$context['page_title'] = $txt['mc_settings'];
 	$context['sub_template'] = 'moderation_settings';
+	$context[$context['moderation_menu_name']]['tab_data'] = array(
+		'title' => $txt['mc_prefs_title'],
+		'help' => '',
+		'description' => $txt['mc_prefs_desc']
+	);
 
 	// What blocks can this user see?
 	$context['homepage_blocks'] = array(

+ 6 - 7
Sources/Modlog.php

@@ -156,7 +156,6 @@ function ViewModlog()
 	// This is all the information required for a watched user listing.
 	$listOptions = array(
 		'id' => 'moderation_log_list',
-		'title' => '<a href="' . $scripturl . '?action=helpadmin;help=' . ($context['log_type'] == 3 ? 'adminlog' : 'modlog') . '" onclick="return reqOverlayDiv(this.href);" class="help"><img src="' . $settings['images_url'] . '/helptopics.png" alt="' . $txt['help'] . '" /></a> ' . $txt['modlog_' . ($context['log_type'] == 3 ? 'admin' : 'moderation') . '_log'],
 		'width' => '100%',
 		'items_per_page' => $context['displaypage'],
 		'no_items_label' => $txt['modlog_' . ($context['log_type'] == 3 ? 'admin_log_' : '') . 'no_entries_found'],
@@ -274,12 +273,6 @@ function ViewModlog()
 			'token' => 'mod-ml',
 		),
 		'additional_rows' => array(
-			array(
-				'position' => 'after_title',
-				'value' => $txt['modlog_' . ($context['log_type'] == 3 ? 'admin' : 'moderation') . '_log_desc'],
-
-				'style' => 'padding: 1ex 2ex;',
-			),
 			array(
 				'position' => 'below_table_data',
 				'value' => '
@@ -301,6 +294,12 @@ function ViewModlog()
 
 	$context['sub_template'] = 'show_list';
 	$context['default_list'] = 'moderation_log_list';
+
+	$context[$context['moderation_menu_name']]['tab_data'] = array(
+		'title' => $txt['modlog_' . ($context['log_type'] == 3 ? 'admin' : 'moderation') . '_log'],
+		'help' => $context['log_type'] == 3 ? 'adminlog' : 'modlog',
+		'description' => $txt['modlog_' . ($context['log_type'] == 3 ? 'admin' : 'moderation') . '_log_desc']
+	);
 }
 
 /**

+ 8 - 1
Sources/PostModeration.php

@@ -517,7 +517,14 @@ function UnapprovedAttachments()
 	createToken('mod-ap');
 	createList($listOptions);
 
-	$context['sub_template'] = 'unapproved_attachments';
+	$context['sub_template'] = 'show_list';
+	$context['default_list'] = 'mc_unapproved_attach';
+
+	$context[$context['moderation_menu_name']]['tab_data'] = array(
+		'title' => $txt['mc_unapproved_attachments'],
+		'help' => '',
+		'description' => $txt['mc_unapproved_attachments_desc']
+	);
 }
 
 /**

+ 10 - 0
Sources/Profile-View.php

@@ -42,6 +42,11 @@ function summary($memID)
 
 	// Are there things we don't show?
 	$context['disabled_fields'] = isset($modSettings['disabled_profile_fields']) ? array_flip(explode(',', $modSettings['disabled_profile_fields'])) : array();
+	// Menu tab
+	$context[$context['profile_menu_name']]['tab_data'] = array(
+		'title' => $txt['summary'],
+		'icon' => 'profile_hd.png'
+	);
 
 	// See if they have broken any warning levels...
 	list ($modSettings['warning_enable'], $modSettings['user_limit']) = explode(',', $modSettings['warning_settings']);
@@ -951,6 +956,11 @@ function statPanel($memID)
 	$timeHours = floor(($user_profile[$memID]['total_time_logged_in'] % 86400) / 3600);
 	$context['time_logged_in'] = ($timeDays > 0 ? $timeDays . $txt['totalTimeLogged2'] : '') . ($timeHours > 0 ? $timeHours . $txt['totalTimeLogged3'] : '') . floor(($user_profile[$memID]['total_time_logged_in'] % 3600) / 60) . $txt['totalTimeLogged4'];
 	$context['num_posts'] = comma_format($user_profile[$memID]['posts']);
+	// Menu tab
+	$context[$context['profile_menu_name']]['tab_data'] = array(
+		'title' => $txt['statPanel_generalStats'] . ' - ' . $context['member']['name'],
+		'icon' => 'stats_info_hd.png'
+	);
 
 	// Number of topics started.
 	$result = $smcFunc['db_query']('', '

+ 6 - 0
Sources/Reports.php

@@ -61,6 +61,12 @@ function ReportsMain()
 	);
 
 	call_integration_hook('integrate_report_types');
+	// Load up all the tabs...
+	$context[$context['admin_menu_name']]['tab_data'] = array(
+		'title' => $txt['generate_reports'],
+		'help' => '',
+		'description' => $txt['generate_reports_desc'],
+	);
 
 	$is_first = 0;
 	foreach ($context['report_types'] as $k => $temp)

+ 6 - 0
Sources/Who.php

@@ -527,6 +527,12 @@ function Credits($in_admin = false)
 	// Don't blink. Don't even blink. Blink and you're dead.
 	loadLanguage('Who');
 
+	$context[$context['admin_menu_name']]['tab_data'] = array(
+		'title' => $txt['support_credits_title'],
+		'help' => '',
+		'description' => '',
+	);
+
 	$context['credits'] = array(
 		array(
 			'pretext' => $txt['credits_intro'],

+ 20 - 39
Themes/default/Admin.template.php

@@ -19,34 +19,7 @@ function template_admin()
 
 	// Welcome message for the admin.
 	echo '
-	<div id="admincenter">
-		<div id="section_header" class="cat_bar">
-			<h3 class="catbg">';
-
-	if ($context['user']['is_admin'])
-		echo '
-			<object id="quick_search">
-				<form action="', $scripturl, '?action=admin;area=search" method="post" accept-charset="', $context['character_set'], '" class="floatright">
-					<img class="icon" src="', $settings['images_url'] , '/filter.png" alt="" />
-					<input type="text" name="search_term" value="', $txt['admin_search'], '" onclick="if (this.value == \'', $txt['admin_search'], '\') this.value = \'\';" class="input_text" />
-					<select name="search_type">
-						<option value="internal"', (empty($context['admin_preferences']['sb']) || $context['admin_preferences']['sb'] == 'internal' ? ' selected="selected"' : ''), '>', $txt['admin_search_type_internal'], '</option>
-						<option value="member"', (!empty($context['admin_preferences']['sb']) && $context['admin_preferences']['sb'] == 'member' ? ' selected="selected"' : ''), '>', $txt['admin_search_type_member'], '</option>
-						<option value="online"', (!empty($context['admin_preferences']['sb']) && $context['admin_preferences']['sb'] == 'online' ? ' selected="selected"' : ''), '>', $txt['admin_search_type_online'], '</option>
-					</select>
-					<input type="submit" name="search_go" id="search_go" value="', $txt['admin_search_go'], '" class="button_submit" />
-				</form>
-			</object>';
-
-	echo $txt['admin_center'], '
-			</h3>
-		</div>
-		<div class="roundframe rfix">
-			<div id="welcome">
-				<strong>', $txt['hello_guest'], ' ', $context['user']['name'], '!</strong>
-				', sprintf($txt['admin_main_welcome'], $txt['admin_center'], $txt['help'], $txt['help']), '
-			</div>
-		</div>';
+	<div id="admincenter">';
 
 	// Is there an update available?
 	echo '
@@ -194,11 +167,6 @@ function template_credits()
 	echo '
 
 	<div id="admincenter">
-		<div id="section_header" class="cat_bar">
-			<h3 class="catbg">
-				', $txt['support_credits_title'], '
-			</h3>
-		</div>
 		<div id="support_credits">
 			<div class="cat_bar">
 				<h3 class="catbg">
@@ -1376,12 +1344,6 @@ function template_core_features()
 	}
 
 	echo '
-			<div id="section_header" class="cat_bar">
-				<h3 class="catbg">
-					', $txt['core_settings_title'], '
-				</h3>
-			</div>
-			<p class="description">', $txt['core_settings_desc'], '</p>
 			<form id="core_features" action="', $scripturl, '?action=admin;area=corefeatures" method="post" accept-charset="', $context['character_set'], '">
 			<div style="display:none" id="activation_message" class="errorbox"></div>';
 
@@ -1668,4 +1630,23 @@ function template_clean_cache_button_below()
 	</div>';
 }
 
+function template_admin_quick_search()
+{
+	global $context, $settings, $txt, $scripturl;
+	if ($context['user']['is_admin'])
+		echo '
+			<object id="quick_search">
+				<form action="', $scripturl, '?action=admin;area=search" method="post" accept-charset="', $context['character_set'], '" class="floatright">
+					<img class="icon" src="', $settings['images_url'] , '/filter.png" alt="" />
+					<input type="text" name="search_term" value="', $txt['admin_search'], '" onclick="if (this.value == \'', $txt['admin_search'], '\') this.value = \'\';" class="input_text" />
+					<select name="search_type">
+						<option value="internal"', (empty($context['admin_preferences']['sb']) || $context['admin_preferences']['sb'] == 'internal' ? ' selected="selected"' : ''), '>', $txt['admin_search_type_internal'], '</option>
+						<option value="member"', (!empty($context['admin_preferences']['sb']) && $context['admin_preferences']['sb'] == 'member' ? ' selected="selected"' : ''), '>', $txt['admin_search_type_member'], '</option>
+						<option value="online"', (!empty($context['admin_preferences']['sb']) && $context['admin_preferences']['sb'] == 'online' ? ' selected="selected"' : ''), '>', $txt['admin_search_type_online'], '</option>
+					</select>
+					<input type="submit" name="search_go" id="search_go" value="', $txt['admin_search_go'], '" class="button_submit" />
+				</form>
+			</object>';
+}
+
 ?>

+ 11 - 37
Themes/default/GenericList.template.php

@@ -19,7 +19,7 @@ function template_show_list($list_id = null)
 	$cur_list = &$context[$list_id];
 
 	// These are the main tabs that is used all around the template.
-	if (!empty($settings['use_tabs']) && isset($cur_list['list_menu'], $cur_list['list_menu']['show_on']) && ($cur_list['list_menu']['show_on'] == 'both' || $cur_list['list_menu']['show_on'] == 'top'))
+	if (isset($cur_list['list_menu'], $cur_list['list_menu']['show_on']) && ($cur_list['list_menu']['show_on'] == 'both' || $cur_list['list_menu']['show_on'] == 'top'))
 		template_create_list_menu($cur_list['list_menu'], 'top');
 
 	if (isset($cur_list['form']))
@@ -40,10 +40,6 @@ function template_show_list($list_id = null)
 				</h3>
 			</div>';
 
-	// This is for the old style menu with the arrows "> Test | Test 1"
-	if (empty($settings['use_tabs']) && isset($cur_list['list_menu'], $cur_list['list_menu']['show_on']) && ($cur_list['list_menu']['show_on'] == 'both' || $cur_list['list_menu']['show_on'] == 'top'))
-		template_create_list_menu($cur_list['list_menu'], 'top');
-
 	if (isset($cur_list['additional_rows']['after_title']))
 	{
 		echo '
@@ -177,7 +173,7 @@ function template_show_list($list_id = null)
 		</div>';
 
 	// Tabs at the bottom.  Usually bottom alligned.
-	if (!empty($settings['use_tabs']) && isset($cur_list['list_menu'], $cur_list['list_menu']['show_on']) && ($cur_list['list_menu']['show_on'] == 'both' || $cur_list['list_menu']['show_on'] == 'bottom'))
+	if (isset($cur_list['list_menu'], $cur_list['list_menu']['show_on']) && ($cur_list['list_menu']['show_on'] == 'both' || $cur_list['list_menu']['show_on'] == 'bottom'))
 		template_create_list_menu($cur_list['list_menu'], 'bottom');
 
 	if (isset($cur_list['javascript']))
@@ -234,15 +230,9 @@ function template_create_list_menu($list_menu, $direction = 'top')
 	$first = $context['right_to_left'] ? 'last' : 'first';
 	$last = $context['right_to_left'] ? 'first' : 'last';
 
-	// Tabs take preference over buttons in certain cases.
-	if (empty($settings['use_tabs']) && $list_menu['style'] == 'button')
-		$list_menu['style'] = 'tabs';
-
 	if (!isset($list_menu['style']) || isset($list_menu['style']) && $list_menu['style'] == 'tabs')
 	{
-		if (!empty($settings['use_tabs']))
-		{
-			echo '
+		echo '
 		<table cellpadding="0" cellspacing="0" style="margin-', $list_menu['position'], ': 10px; width: 100%;">
 			<tr>', $list_menu['position'] == 'right' ? '
 				<td>&nbsp;</td>' : '', '
@@ -251,23 +241,23 @@ function template_create_list_menu($list_menu, $direction = 'top')
 						<tr>
 							<td class="', $direction == 'top' ? 'mirror' : 'main', 'tab_', $first, '">&nbsp;</td>';
 
-			foreach ($list_menu['links'] as $link)
-			{
-				if ($link['is_selected'])
-					echo '
+		foreach ($list_menu['links'] as $link)
+		{
+			if ($link['is_selected'])
+				echo '
 							<td class="', $direction == 'top' ? 'mirror' : 'main', 'tab_active_', $first, '">&nbsp;</td>
 							<td valign="top" class="', $direction == 'top' ? 'mirrortab' : 'maintab', '_active_back">
 								<a href="', $link['href'], '">', $link['label'], '</a>
 							</td>
 							<td class="', $direction == 'top' ? 'mirror' : 'main', 'tab_active_', $last, '">&nbsp;</td>';
-				else
-					echo '
+			else
+				echo '
 							<td valign="top" class="', $direction == 'top' ? 'mirror' : 'main', 'tab_back">
 								<a href="', $link['href'], '">', $link['label'], '</a>
 							</td>';
-			}
+		}
 
-			echo '
+		echo '
 							<td class="', $direction == 'top' ? 'mirror' : 'main', 'tab_', $last, '">&nbsp;</td>
 						</tr>
 					</table>
@@ -275,22 +265,6 @@ function template_create_list_menu($list_menu, $direction = 'top')
 				<td>&nbsp;</td>' : '', '
 			</tr>
 		</table>';
-		}
-		else
-		{
-			echo '
-			<tr class="titlebg">
-				<td colspan="', $context['colspan'], '">';
-
-			$links = array();
-			foreach ($list_menu['links'] as $link)
-				$links[] = ($link['is_selected'] ? '<img src="' . $settings['images_url'] . '/selected.png" alt="&gt;" /> ' : '') . '<a href="' . $link['href'] . '">' . $link['label'] . '</a>';
-
-			echo '
-				', implode(' | ', $links), '
-				</td>
-			</tr>';
-		}
 	}
 	elseif (isset($list_menu['style']) && $list_menu['style'] == 'buttons')
 	{

+ 69 - 86
Themes/default/GenericMenu.template.php

@@ -193,7 +193,7 @@ function template_generic_menu_dropdown_above()
 <div id="admin_content">';
 
 	// It's possible that some pages have their own tabs they wanna force...
-	if (!empty($context['tabs']))
+// 	if (!empty($context['tabs']))
 		template_generic_menu_tabs($menu_context);
 }
 
@@ -214,92 +214,103 @@ function template_generic_menu_tabs(&$menu_context)
 	// Handy shortcut.
 	$tab_context = &$menu_context['tab_data'];
 
-	echo '
+	if (!empty($tab_context['title']))
+	{
+		echo '
 	<div class="cat_bar">
 		<h3 class="catbg">';
 
-	// Exactly how many tabs do we have?
-	foreach ($context['tabs'] as $id => $tab)
-	{
-		// Can this not be accessed?
-		if (!empty($tab['disabled']))
+		// The function is in Admin.template.php, but since this template is used elsewhere too better check if the function is available
+		if (function_exists('template_admin_quick_search'))
+			template_admin_quick_search();
+
+		// Exactly how many tabs do we have?
+		if (!empty($context['tabs']))
 		{
-			$tab_context['tabs'][$id]['disabled'] = true;
-			continue;
-		}
+			foreach ($context['tabs'] as $id => $tab)
+			{
+				// Can this not be accessed?
+				if (!empty($tab['disabled']))
+				{
+					$tab_context['tabs'][$id]['disabled'] = true;
+					continue;
+				}
 
-		// Did this not even exist - or do we not have a label?
-		if (!isset($tab_context['tabs'][$id]))
-			$tab_context['tabs'][$id] = array('label' => $tab['label']);
-		elseif (!isset($tab_context['tabs'][$id]['label']))
-			$tab_context['tabs'][$id]['label'] = $tab['label'];
+				// Did this not even exist - or do we not have a label?
+				if (!isset($tab_context['tabs'][$id]))
+					$tab_context['tabs'][$id] = array('label' => $tab['label']);
+				elseif (!isset($tab_context['tabs'][$id]['label']))
+					$tab_context['tabs'][$id]['label'] = $tab['label'];
 
-		// Has a custom URL defined in the main admin structure?
-		if (isset($tab['url']) && !isset($tab_context['tabs'][$id]['url']))
-			$tab_context['tabs'][$id]['url'] = $tab['url'];
+				// Has a custom URL defined in the main admin structure?
+				if (isset($tab['url']) && !isset($tab_context['tabs'][$id]['url']))
+					$tab_context['tabs'][$id]['url'] = $tab['url'];
 
-		// Any additional paramaters for the url?
-		if (isset($tab['add_params']) && !isset($tab_context['tabs'][$id]['add_params']))
-			$tab_context['tabs'][$id]['add_params'] = $tab['add_params'];
+				// Any additional paramaters for the url?
+				if (isset($tab['add_params']) && !isset($tab_context['tabs'][$id]['add_params']))
+					$tab_context['tabs'][$id]['add_params'] = $tab['add_params'];
 
-		// Has it been deemed selected?
-		if (!empty($tab['is_selected']))
-			$tab_context['tabs'][$id]['is_selected'] = true;
+				// Has it been deemed selected?
+				if (!empty($tab['is_selected']))
+					$tab_context['tabs'][$id]['is_selected'] = true;
 
-		// Does it have its own help?
-		if (!empty($tab['help']))
-			$tab_context['tabs'][$id]['help'] = $tab['help'];
+				// Does it have its own help?
+				if (!empty($tab['help']))
+					$tab_context['tabs'][$id]['help'] = $tab['help'];
 
-		// Is this the last one?
-		if (!empty($tab['is_last']) && !isset($tab_context['override_last']))
-			$tab_context['tabs'][$id]['is_last'] = true;
-	}
+				// Is this the last one?
+				if (!empty($tab['is_last']) && !isset($tab_context['override_last']))
+					$tab_context['tabs'][$id]['is_last'] = true;
+			}
 
-	// Find the selected tab
-	foreach ($tab_context['tabs'] as $sa => $tab)
-	{
-		if (!empty($tab['is_selected']) || (isset($menu_context['current_subsection']) && $menu_context['current_subsection'] == $sa))
-		{
-			$selected_tab = $tab;
-			$tab_context['tabs'][$sa]['is_selected'] = true;
+			// Find the selected tab
+			foreach ($tab_context['tabs'] as $sa => $tab)
+			{
+				if (!empty($tab['is_selected']) || (isset($menu_context['current_subsection']) && $menu_context['current_subsection'] == $sa))
+				{
+					$selected_tab = $tab;
+					$tab_context['tabs'][$sa]['is_selected'] = true;
+				}
+			}
 		}
-	}
 
-	// Show an icon and/or a help item?
-	if (!empty($selected_tab['icon']) || !empty($tab_context['icon']) || !empty($selected_tab['help']) || !empty($tab_context['help']))
-	{
-		if (!empty($selected_tab['icon']) || !empty($tab_context['icon']))
-			echo '<img src="', $settings['images_url'], '/icons/', !empty($selected_tab['icon']) ? $selected_tab['icon'] : $tab_context['icon'], '" alt="" class="icon" />';
+		// Show an icon and/or a help item?
+		if (!empty($selected_tab['icon']) || !empty($tab_context['icon']) || !empty($selected_tab['help']) || !empty($tab_context['help']))
+		{
+			if (!empty($selected_tab['icon']) || !empty($tab_context['icon']))
+				echo '<img src="', $settings['images_url'], '/icons/', !empty($selected_tab['icon']) ? $selected_tab['icon'] : $tab_context['icon'], '" alt="" class="icon" />';
 
-		if (!empty($selected_tab['help']) || !empty($tab_context['help']))
-			echo '<a href="', $scripturl, '?action=helpadmin;help=', !empty($selected_tab['help']) ? $selected_tab['help'] : $tab_context['help'], '" onclick="return reqOverlayDiv(this.href);" class="help"><img src="', $settings['images_url'], '/helptopics_hd.png" alt="', $txt['help'], '" class="icon" /></a>';
+			if (!empty($selected_tab['help']) || !empty($tab_context['help']))
+				echo '<a href="', $scripturl, '?action=helpadmin;help=', !empty($selected_tab['help']) ? $selected_tab['help'] : $tab_context['help'], '" onclick="return reqOverlayDiv(this.href);" class="help"><img src="', $settings['images_url'], '/helptopics_hd.png" alt="', $txt['help'], '" class="icon" /></a>';
 
-		echo $tab_context['title'];
-	}
-	else
-	{
-		echo '
-			', $tab_context['title'];
-	}
+			echo $tab_context['title'];
+		}
+		else
+		{
+			echo '
+				', $tab_context['title'];
+		}
 
-	echo '
+		echo '
 		</h3>
 	</div>';
+	}
 
-	// Shall we use the tabs?
-	if (!empty($settings['use_tabs']))
-	{
+	// Shall we use the tabs? Yes, it's the only known way!
+	if (!empty($selected_tab['description']) || !empty($tab_context['description']))
 		echo '
 	<p class="description">
 		', !empty($selected_tab['description']) ? $selected_tab['description'] : $tab_context['description'], '
 	</p>';
 
+	// Print out all the items in this tab (if any).
+	if (!empty($context['tabs']))
+	{
 		// The admin tabs.
 		echo '
 	<div id="adm_submenus">
 		<ul class="dropmenu">';
 
-		// Print out all the items in this tab.
 		foreach ($tab_context['tabs'] as $sa => $tab)
 		{
 			if (!empty($tab['disabled']))
@@ -324,35 +335,7 @@ function template_generic_menu_tabs(&$menu_context)
 		</ul>
 	</div>
 	<br class="clear" />';
-	}
-	// ...if not use the old style
-	else
-	{
-		echo '
-	<p class="tabs">';
-
-		// Print out all the items in this tab.
-		foreach ($tab_context['tabs'] as $sa => $tab)
-		{
-			if (!empty($tab['disabled']))
-				continue;
 
-			if (!empty($tab['is_selected']))
-			{
-				echo '
-		<img src="', $settings['images_url'], '/selected.png" alt="*" /> <strong><a href="', isset($tab['url']) ? $tab['url'] : $menu_context['base_url'] . ';area=' . $menu_context['current_area'] . ';sa=' . $sa, $menu_context['extra_parameters'], '">', $tab['label'], '</a></strong>';
-			}
-			else
-				echo '
-		<a href="', isset($tab['url']) ? $tab['url'] : $menu_context['base_url'] . ';area=' . $menu_context['current_area'] . ';sa=' . $sa, $menu_context['extra_parameters'], '">', $tab['label'], '</a>';
-
-			if (empty($tab['is_last']))
-				echo ' | ';
-		}
-
-		echo '
-	</p>
-	<p class="description">', isset($selected_tab['description']) ? $selected_tab['description'] : $tab_context['description'], '</p>';
 	}
 }
 

+ 1 - 37
Themes/default/ModerationCenter.template.php

@@ -16,16 +16,7 @@ function template_moderation_center()
 
 	// Show a welcome message to the user.
 	echo '
-	<div id="modcenter">
-		<div class="cat_bar">
-			<h3 class="catbg">', $txt['moderation_center'], '</h3>
-		</div>
-		<div class="information">
-			<strong>', $txt['hello_guest'], ' ', $context['user']['name'], '!</strong>
-			<p>
-				', $txt['mc_description'], '
-			</p>
-		</div>';
+	<div id="modcenter">';
 
 	$alternate = true;
 	// Show all the blocks they want to see.
@@ -398,27 +389,6 @@ function template_unapproved_posts()
 	</div>';
 }
 
-// List all attachments awaiting approval.
-function template_unapproved_attachments()
-{
-	global $settings, $options, $context, $txt, $scripturl;
-
-	// Show all the attachments still oustanding.
-	echo '
-	<div id="modcenter">
-		<div class="cat_bar">
-			<h3 class="catbg">', $txt['mc_unapproved_attachments'], '</h3>
-		</div>
-		<div class="information">
-			', $txt['mc_unapproved_attachments_desc'], '
-		</div>';
-
-	template_show_list('mc_unapproved_attach');
-
-	echo '
-	</div>';
-}
-
 function template_viewmodreport()
 {
 	global $context, $scripturl, $txt;
@@ -546,12 +516,6 @@ function template_moderation_settings()
 	echo '
 	<div id="modcenter">
 		<form action="', $scripturl, '?action=moderate;area=settings" method="post" accept-charset="', $context['character_set'], '">
-			<div class="cat_bar">
-				<h3 class="catbg">', $txt['mc_prefs_title'], '</h3>
-			</div>
-			<div class="information">
-				', $txt['mc_prefs_desc'], '
-			</div>
 			<div class="windowbg2">
 				<div class="content">
 					<dl class="settings">

+ 0 - 18
Themes/default/Profile.template.php

@@ -49,11 +49,6 @@ function template_summary()
 
 	// Display the basic information about the user
 	echo '
-<div class="cat_bar">
-	<h3 class="catbg">
-		<img src="', $settings['images_url'], '/icons/profile_hd.png" alt="" class="icon" />', $txt['summary'], '
-	</h3>
-</div>
 <div id="profileview" class="flow_auto">
 	<div id="basicinfo">
 		<div class="windowbg">
@@ -445,13 +440,6 @@ function template_showDrafts()
 	global $context, $settings, $options, $scripturl, $modSettings, $txt;
 
 	echo '
-		<div class="cat_bar">
-			<h3 class="catbg">
-				<span class="ie6_header floatleft"><img src="', $settings['images_url'], '/message_sm.png" alt="" class="icon" />
-					', $txt['drafts_show'], ' - ', $context['member']['name'], '
-				</span>
-			</h3>
-		</div>
 		<div class="pagesection" style="margin-bottom: 0;">
 			<div class="pagelinks">', $context['page_index'], '</div>
 		</div>';
@@ -1039,12 +1027,6 @@ function template_statPanel()
 
 	// First, show a few text statistics such as post/topic count.
 	echo '
-	<div class="cat_bar">
-		<h3 class="catbg">
-			<img src="', $settings['images_url'], '/stats_info_hd.png" alt="" class="icon" />
-			', $txt['statPanel_generalStats'], ' - ', $context['member']['name'], '
-		</h3>
-	</div>
 	<div id="profileview">
 		<div id="generalstats">
 			<div class="windowbg2">

+ 4 - 20
Themes/default/Recent.template.php

@@ -97,7 +97,7 @@ function template_unread()
 		echo '
 			<div class="pagesection">';
 
-		if (!empty($context['recent_buttons']) && !empty($settings['use_tabs']))
+		if (!empty($context['recent_buttons']))
 			template_button_strip($context['recent_buttons'], 'right');
 
 		echo '
@@ -194,14 +194,6 @@ function template_unread()
 						</tr>';
 		}
 
-		if (empty($settings['use_tabs']) && !empty($context['recent_buttons']))
-			echo '
-						<tr class="catbg">
-							<td colspan="', $context['showCheckboxes'] ? '6' : '5', '" align="right">
-								', template_button_strip($context['recent_buttons'], 'top'), '
-							</td>
-						</tr>';
-
 		if (empty($context['topics']))
 			echo '
 					<tr style="display: none;"><td></td></tr>';
@@ -212,7 +204,7 @@ function template_unread()
 			</div>
 			<div class="pagesection" id="readbuttons">';
 
-		if (!empty($settings['use_tabs']) && !empty($context['recent_buttons']))
+		if (!empty($context['recent_buttons']))
 			template_button_strip($context['recent_buttons'], 'right');
 
 		echo '
@@ -268,7 +260,7 @@ function template_replies()
 		echo '
 			<div class="pagesection">';
 
-		if (!empty($context['recent_buttons']) && !empty($settings['use_tabs']))
+		if (!empty($context['recent_buttons']))
 			template_button_strip($context['recent_buttons'], 'right');
 
 		echo '
@@ -365,21 +357,13 @@ function template_replies()
 						</tr>';
 		}
 
-		if (empty($settings['use_tabs']) && !empty($context['recent_buttons']))
-			echo '
-						<tr class="catbg">
-							<td colspan="', $context['showCheckboxes'] ? '6' : '5', '" align="right">
-								', template_button_strip($context['recent_buttons'], 'top'), '
-							</td>
-						</tr>';
-
 		echo '
 					</tbody>
 				</table>
 			</div>
 			<div class="pagesection">';
 
-		if (!empty($settings['use_tabs']) && !empty($context['recent_buttons']))
+		if (!empty($context['recent_buttons']))
 			template_button_strip($context['recent_buttons'], 'right');
 
 		echo '

+ 1 - 7
Themes/default/Reports.template.php

@@ -18,12 +18,6 @@ function template_report_type()
 	echo '
 	<div id="admincenter">
 		<form action="', $scripturl, '?action=admin;area=reports" method="post" accept-charset="', $context['character_set'], '">
-			<div class="cat_bar">
-				<h3 class="catbg">', $txt['generate_reports'], '</h3>
-			</div>
-			<div class="information">
-				', $txt['generate_reports_desc'], '
-			</div>
 			<div id="generate_reports_type">
 				<div class="cat_bar">
 					<h3 class="catbg">', $txt['generate_reports_type'], '</h3>
@@ -67,7 +61,7 @@ function template_main()
 		</div>
 		<div id="report_buttons">';
 
-	if (!empty($context['report_buttons']) && !empty($settings['use_tabs']))
+	if (!empty($context['report_buttons']))
 		template_button_strip($context['report_buttons'], 'right');
 
 	echo '

+ 0 - 3
Themes/default/index.template.php

@@ -56,9 +56,6 @@ function template_init()
 	// The version this template/theme is for. This should probably be the version of SMF it was created for.
 	$settings['theme_version'] = '2.0';
 
-	// Set a setting that tells the theme that it can render the tabs.
-	$settings['use_tabs'] = true;
-
 	// Use plain buttons - as opposed to text buttons?
 	$settings['use_buttons'] = true;
 

+ 1 - 1
Themes/default/languages/Admin.english.php

@@ -48,7 +48,7 @@ $txt['admin_agreement_select_language'] = 'Language to edit';
 $txt['admin_agreement_select_language_change'] = 'Change';
 $txt['admin_delete_members'] = 'Delete Selected Members';
 $txt['admin_repair'] = 'Repair All boards and topics';
-$txt['admin_main_welcome'] = 'This is your &quot;%1$s&quot;.  From here, you can edit settings, maintain your forum, view logs, install packages, manage themes, and many other things.<div style="margin-top: 1ex;">If you have any trouble, please look at the &quot;Support &amp; Credits&quot; page.  If the information there doesn\'t help you, feel free to <a href="http://www.simplemachines.org/community/index.php" target="_blank" class="new_win">look to us for help</a> with the problem.</div>You may also find answers to your questions or problems by clicking the <img src="' . $settings['images_url'] . '/helptopics.png" alt="%2$s" title="%3$s" /> symbols for more information on the related functions.';
+$txt['admin_main_welcome'] = 'This is your &quot;%1$s&quot;.  From here, you can edit settings, maintain your forum, view logs, install packages, manage themes, and many other things.<br /><br />If you have any trouble, please look at the &quot;Support &amp; Credits&quot; page.  If the information there doesn\'t help you, feel free to <a href="http://www.simplemachines.org/community/index.php" target="_blank" class="new_win">look to us for help</a> with the problem.<br />You may also find answers to your questions or problems by clicking the <img src="' . $settings['images_url'] . '/helptopics.png" alt="%2$s" title="%3$s" /> symbols for more information on the related functions.';
 $txt['admin_news_desc'] = 'Please place one news item per box. BBC tags, such as <span title="Are you bold?">[b]</span>, <span title="I tall icks!!">[i]</span> and <span title="Brackets are great, no?">[u]</span> are allowed in your news, as well as smileys. Clear a news item\'s text box to remove it.';
 $txt['administrators'] = 'Forum Administrators';
 $txt['admin_reserved_desc'] = 'Reserved names will keep members from registering certain usernames or using these words in their displayed names. Choose the options you wish to use from the bottom before submitting.';

+ 1 - 0
Themes/default/languages/index.english.php

@@ -211,6 +211,7 @@ $txt['welcome_guest_register'] = 'Welcome to <strong>'. $context['forum_name'].
 $txt['please_login'] = 'Please <a href="' . $scripturl . '?action=login">login</a>.';
 $txt['login_or_register'] = 'Please <a href="' . $scripturl . '?action=login">login</a> or <a href="' . $scripturl . '?action=register">register</a>.';
 $txt['welcome_guest_activate'] = '<br />Did you miss your <a href="' . $scripturl . '?action=activate">activation email</a>?';
+// @todo the following to sprintf
 $txt['hello_member'] = 'Hey,';
 // Use numeric entities in the below string.
 $txt['hello_guest'] = 'Welcome,';