Parcourir la source

! When browsing files in a theme in the admin panel, display the name of the theme too.

Signed-off-by: Peter Spicer <[email protected]>
Peter Spicer il y a 10 ans
Parent
commit
6c52c8e23b

+ 2 - 1
Sources/Themes.php

@@ -1637,7 +1637,7 @@ function SetJavaScript()
  */
 function EditTheme()
 {
-	global $context, $settings, $scripturl, $boarddir, $smcFunc;
+	global $context, $settings, $scripturl, $boarddir, $smcFunc, $txt;
 
 	// @todo Should this be removed?
 	if (isset($_REQUEST['preview']))
@@ -1672,6 +1672,7 @@ function EditTheme()
 	// Get the directory of the theme we are editing.
 	$currentTheme = get_single_theme($_GET['th']);
 	$context['theme_id'] = $currentTheme['id'];
+	$context['browse_title'] = sprintf($txt['themeadmin_browsing_theme'], $currentTheme['name']);
 
 	if (!file_exists($currentTheme['theme_dir'] . '/index.template.php') && !file_exists($currentTheme['theme_dir'] . '/css/index.css'))
 		fatal_lang_error('theme_edit_missing', false);

+ 9 - 1
Themes/default/Themes.template.php

@@ -887,7 +887,15 @@ function template_edit_browse()
 	global $context, $scripturl, $txt;
 
 	echo '
-	<div id="admincenter">
+	<div id="admincenter">';
+
+	if (!empty($context['browse_title']))
+		echo '
+		<div class="cat_bar">
+			<h3 class="catbg">', $context['browse_title'], '</h3>
+		</div>';
+
+	echo '
 		<table class="table_grid tborder">
 		<thead>
 			<tr class="catbg">

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

@@ -155,6 +155,7 @@ $txt['themeadmin_edit_copy_warning'] = 'When SMF needs a template or language fi
 $txt['themeadmin_edit_copy_confirm'] = 'Are you sure you want to copy this template?';
 $txt['themeadmin_edit_overwrite_confirm'] = 'Are you sure you want to copy this template over the one that already exists?\nThis will OVERWRITE any changes you\\\'ve made';
 $txt['themeadmin_edit_no_copy'] = '<em>(can\'t copy)</em>';
+$txt['themeadmin_browsing_theme'] = 'Browsing files in theme: %1$s';
 $txt['themeadmin_edit_filename'] = 'Filename';
 $txt['themeadmin_edit_modified'] = 'Last Modified';
 $txt['themeadmin_edit_size'] = 'Size';