Missing theme extension fixed in theme_edit/theme_import
[mailer.git] / inc / modules / admin / what-theme_import.php
index 027223f087bbf2c91a1c0676ffb7c814f1b00ef3..8d8e5de725bf5bc60a714edd222ed0863588d776 100644 (file)
  ************************************************************************/
 
 // Some security stuff...
-if ((!defined('__SECURITY')) || (!is_admin())) {
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
+} elseif (!EXT_IS_ACTIVE("theme")) {
+       ADD_FATAL(sprintf(EXTENSION_PROBLEM_NOT_INSTALLED, "theme"));
+       return;
 }
 
 // Add description as navigation point
-ADD_DESCR("admin", basename(__FILE__));
+ADD_DESCR("admin", __FILE__);
 
 // Switch to testing mode
 $THEME_MODE = "test";
@@ -54,8 +57,8 @@ if (!empty($_POST['theme'])) {
                        include($file);
 
                        // Register it ith the exchange
-                       $result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_themes (theme_path, theme_active, theme_ver, theme_name)
-VALUES ('%s', 'N', '%s', '%s')",
+                       $result = SQL_QUERY_ESC("INSERT INTO `"._MYSQL_PREFIX."_themes` (`theme_path`, `theme_active`, `theme_ver`, `theme_name`)
+VALUES ('%s','N','%s','%s')",
                                array($_POST['theme'], $THEME_VERSION, $THEME_NAME), __FILE__, __LINE__);
 
                        // Destroy cache