|
@@ -120,7 +120,8 @@ function get_all_themes()
|
|
|
|
|
|
function get_theme_info($path)
|
|
|
{
|
|
|
- global $sourcedir, $forum_version, $explicit_images;
|
|
|
+ global $sourcedir, $forum_version, $txt, $scripturl, $context;
|
|
|
+ global $explicit_images;
|
|
|
|
|
|
if (empty($path))
|
|
|
return false;
|
|
@@ -128,6 +129,15 @@ function get_theme_info($path)
|
|
|
$xml_data = array();
|
|
|
$explicit_images = false;
|
|
|
|
|
|
+
|
|
|
+ if (file_exists($path . '/package-info.xml'))
|
|
|
+ {
|
|
|
+ loadLanguage('Errors');
|
|
|
+
|
|
|
+ $txt['package_get_error_is_mod'] = str_replace('{MANAGEMODURL}', $scripturl . '?action=admin;area=packages;' . $context['session_var'] . '=' . $context['session_id'], $txt['package_get_error_is_mod']);
|
|
|
+ fatal_lang_error('package_theme_upload_error_broken', false, $txt['package_get_error_is_mod']);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
require_once($sourcedir . '/Class-Package.php');
|
|
|
$theme_info_xml = new xmlArray(file_get_contents($path . '/theme_info.xml'));
|
|
@@ -181,8 +191,8 @@ function get_theme_info($path)
|
|
|
|
|
|
function theme_install($to_install = array())
|
|
|
{
|
|
|
- global $smcFunc, $txt, $context, $themedir, $themeurl;
|
|
|
- global $settings, $explicit_images, $modSettings;
|
|
|
+ global $smcFunc, $context, $themedir, $themeurl, $modSettings;
|
|
|
+ global $settings, $explicit_images;
|
|
|
|
|
|
|
|
|
if ($to_install)
|
|
@@ -192,13 +202,6 @@ function theme_install($to_install = array())
|
|
|
if (empty($context['to_install']['theme_dir']) || basename($context['to_install']['theme_dir']) == 'Themes')
|
|
|
fatal_lang_error('theme_install_invalid_dir', false);
|
|
|
|
|
|
-
|
|
|
- if (file_exists($context['to_install']['theme_dir'] . '/package-info.xml'))
|
|
|
- {
|
|
|
- $txt['package_get_error_is_mod'] = str_replace('{MANAGEMODURL}', $scripturl . '?action=admin;area=packages;' . $context['session_var'] . '=' . $context['session_id'], $txt['package_get_error_is_mod']);
|
|
|
- fatal_lang_error('package_theme_upload_error_broken', false, $txt['package_get_error_is_mod']);
|
|
|
- }
|
|
|
-
|
|
|
|
|
|
if (!empty($context['to_install']['version']))
|
|
|
{
|