Selaa lähdekoodia

Call the right function.

Signed-off-by: Suki <suki@missallsunday.com>
Suki 11 vuotta sitten
vanhempi
commit
ff7705014b
2 muutettua tiedostoa jossa 18 lisäystä ja 0 poistoa
  1. 17 0
      Sources/Themes.php
  2. 1 0
      Themes/default/languages/Themes.english.php

+ 17 - 0
Sources/Themes.php

@@ -1284,12 +1284,29 @@ function ThemeInstall()
 	loadTemplate('Themes');
 	loadLanguage('Errors');
 
+	// Everything went better than expected!
 	if (isset($_GET['theme_id']) && empty($_GET['theme_id']))
 	{
 		$context['sub_template'] = 'installed';
 		$context['page_title'] = $txt['theme_installed'];
 		$context['installed_theme'] = get_single_theme($_GET['theme_id']);
+
+		return;
 	}
+
+	$subActions = array(
+		'file' => 'InstallFile',
+		'copy' => 'InstallCopy',
+		'dir' => 'InstallDir',
+	);
+
+	// Call the right function.
+	if (isset($_GET['do']) && empty($_GET['do']) && isset($subActions[$_GET['do']]))
+		$subActions[$_GET['do']]();
+
+	// Nope, show a nice error.
+	else
+		fatal_lang_error('theme_install_no_action', false);
 }
 
 /**

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

@@ -25,6 +25,7 @@ $txt['theme_install_writable'] = 'Warning - you cannot create or install a new t
 $txt['theme_installed'] = 'Installed Successfully';
 $txt['theme_installed_message'] = 'was installed successfully.';
 $txt['theme_updated_message'] = 'was updated successfully.';
+$txt['theme_install_no_action'] = 'This isn\'t a valid install action.';
 
 $txt['theme_latest'] = 'Latest and Greatest Themes';
 $txt['theme_latest_fetch'] = 'Fetching latest themes from www.simplemachines.org...';