include_once($path_to_root . "/includes/session.inc");
include_once($path_to_root."/includes/packages.inc");
-page(_($help_context = "Install Themes"));
+if ($SysPrefs->use_popup_windows) {
+ $js = get_js_open_window(900, 500);
+}
+page(_($help_context = "Install Themes"), false, false, '', $js);
include_once($path_to_root . "/includes/date_functions.inc");
include_once($path_to_root . "/admin/db/company_db.inc");
include_once($path_to_root . "/includes/ui.inc");
//---------------------------------------------------------------------------------------------
-// If theme is used in customer record set to default
-//
-function clean_user_themes($id)
-{
- global $db_connections, $db, $installed_extensions;
-
- $theme = $installed_extensions[$id]['package'];
- $db_sav = $db;
-
- foreach ($db_connections as $n => $conn) {
- $db = $_SESSION["wa_current_user"]->get_db_connection($n);
- $sql = "UPDATE {$conn['tbpref']}users SET theme='default' WHERE theme='$theme'";
- if (!db_query($sql, 'Cannot update user theme settings'))
- return false;
- }
- $db = $db_sav;
- $_SESSION['wa_current_user']->prefs->theme = 'default';
- return true;
-}
-if (($id = find_submit('Delete', false)) && clean_user_themes($id))
+if (($id = find_submit('Delete', false))
+ && clean_user_themes($installed_extensions[$id]['package']))
{
$extensions = get_company_extensions();
$theme = $extensions[$id]['package'];
end_form();
end_page();
-?>
\ No newline at end of file