X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=admin%2Finst_theme.php;h=7c15dd53297c3a881d960165d50cc88c6d5bbe67;hb=0ce53780d575e7bf4eefaa1b7edc0603131cc2b3;hp=76b0843303a8c0246ced42819067c1002528d811;hpb=a2f8f9875f40d98cf33c61c718f9bdee3521a86d;p=fa-stable.git diff --git a/admin/inst_theme.php b/admin/inst_theme.php index 76b08433..7c15dd53 100644 --- a/admin/inst_theme.php +++ b/admin/inst_theme.php @@ -12,27 +12,27 @@ $page_security = 'SA_CREATEMODULES'; $path_to_root=".."; include_once($path_to_root . "/includes/session.inc"); + include_once($path_to_root."/includes/packages.inc"); +include_once($path_to_root . "/admin/db/maintenance_db.inc"); +include_once($path_to_root . "/includes/ui.inc"); 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 . "/admin/db/maintenance_db.inc"); -include_once($path_to_root . "/includes/ui.inc"); - //--------------------------------------------------------------------------------------------- -if (($id = find_submit('Delete', false)) +if (($id = find_submit('Delete', false)) && isset($installed_extensions[$id]) && clean_user_themes($installed_extensions[$id]['package'])) { $extensions = get_company_extensions(); $theme = $extensions[$id]['package']; + $path = $extensions[$id]['path']; + if (uninstall_package($theme)) { - $dirname = $path_to_root.'/themes/'.$theme; + $dirname = $path_to_root.'/'.$path; flush_dir($dirname, true); rmdir($dirname); unset($extensions[$id]); @@ -54,6 +54,7 @@ start_form(true); $th = array(_("Theme"), _("Installed"), _("Available"), "", ""); $k = 0; + $mods = get_themes_list(); if (!$mods) @@ -70,7 +71,6 @@ start_form(true); alt_table_row_color($k); -// label_cell(is_array($ext['Descr']) ? $ext['Descr'][0] : $ext['Descr']); label_cell($available ? get_package_view_str($pkg_name, $ext['name']) : $ext['name']); label_cell($id === null ? _("None") : @@ -79,7 +79,7 @@ start_form(true); if ($available && check_pkg_upgrade($installed, $available)) // outdated or not installed theme in repo button_cell('Update'.$pkg_name, $installed ? _("Update") : _("Install"), - _('Upload and install latest extension package'), ICON_DOWN); + _('Upload and install latest extension package'), ICON_DOWN, 'process'); else label_cell('');