Ver código fonte

Say goodbye to tabs! YAY!

Signed-off-by: emanuele <[email protected]>
emanuele 12 anos atrás
pai
commit
14f3ef426e

+ 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')
 	{

+ 18 - 50
Themes/default/GenericMenu.template.php

@@ -290,74 +290,42 @@ function template_generic_menu_tabs(&$menu_context)
 		</h3>
 	</div>';
 
-	// Shall we use the tabs?
-	if (!empty($settings['use_tabs']))
-	{
-		echo '
+	// Shall we use the tabs? Yes, it's the only known way!
+	echo '
 	<p class="description">
 		', !empty($selected_tab['description']) ? $selected_tab['description'] : $tab_context['description'], '
 	</p>';
 
-		// The admin tabs.
-		echo '
+	// 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']))
-				continue;
+	// 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 '
+		if (!empty($tab['is_selected']))
+		{
+			echo '
 			<li>
 				<a class="active" href="', isset($tab['url']) ? $tab['url'] : $menu_context['base_url'] . ';area=' . $menu_context['current_area'] . ';sa=' . $sa, $menu_context['extra_parameters'], isset($tab['add_params']) ? $tab['add_params'] : '', '">', $tab['label'], '</a>
 			</li>';
-			}
-			else
-				echo '
+		}
+		else
+			echo '
 			<li>
 				<a href="', isset($tab['url']) ? $tab['url'] : $menu_context['base_url'] . ';area=' . $menu_context['current_area'] . ';sa=' . $sa, $menu_context['extra_parameters'], isset($tab['add_params']) ? $tab['add_params'] : '', '">', $tab['label'], '</a>
 			</li>';
-		}
+	}
 
-		// the end of tabs
-		echo '
+	// the end of tabs
+	echo '
 		</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>';
-	}
 }
 
 ?>

+ 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 - 1
Themes/default/Reports.template.php

@@ -71,7 +71,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;