X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=admin%2Finst_module.php;h=2309292bef911ddfda922060b78dfa1900e74010;hb=9cd7f3275f7ddac4944f6783a68a6478834fbe6d;hp=77a16cbd5ba85b1536fa8676b49ffa56a7fa1889;hpb=0b63d898491b6577a5a5bf90e771dca0dcbbcf1f;p=fa-stable.git diff --git a/admin/inst_module.php b/admin/inst_module.php index 77a16cbd..2309292b 100644 --- a/admin/inst_module.php +++ b/admin/inst_module.php @@ -14,10 +14,10 @@ $path_to_root=".."; include_once($path_to_root . "/includes/session.inc"); include_once($path_to_root."/includes/packages.inc"); -if ($use_popup_windows) { +if ($SysPrefs->use_popup_windows) { $js = get_js_open_window(900, 500); } -page(_($help_context = "Install/Activate extensions")); +page(_($help_context = "Install/Activate extensions"), false, false, "", $js); include_once($path_to_root . "/includes/date_functions.inc"); include_once($path_to_root . "/admin/db/company_db.inc"); @@ -94,7 +94,7 @@ function fmt_titles($defs) // // Display list of all extensions - installed and available from repository // -function display_extensions() +function display_extensions($mods) { global $installed_extensions; @@ -106,7 +106,6 @@ function display_extensions() table_header($th); $k = 0; - $mods = get_extensions_list('extension'); foreach($mods as $pkg_name => $ext) { @@ -211,12 +210,16 @@ if (get_post('Refresh')) { $result = true; foreach($exts as $i => $ext) { - if ($ext['package'] && ($ext['active'] ^ check_value('Active'.$i))) { - if (!$ext['active']) - $activated = activate_hooks($ext['package'], $comp); - else - $activated = hook_invoke($ext['package'], check_value('Active'.$i) ? - 'activate_extension':'deactivate_extension', $comp, false); + if ($ext['package'] && ($ext['active'] ^ check_value('Active'.$i))) + { + if (check_value('Active'.$i) && !check_src_ext_version($ext['version'])) + { + display_warning(sprintf(_("Package '%s' is incompatible with current application version and cannot be activated.\n") + . _("Check Install/Activate page for newer package version."), $ext['name'])); + continue; + } + $activated = activate_hooks($ext['package'], $comp, !$ext['active']); // change active state + if ($activated !== null) $result &= $activated; if ($activated || ($activated === null)) @@ -258,12 +261,16 @@ echo extset_list('extset', null, true); echo "
"; if ($set == -1) - display_extensions(); -else +{ + $mods = get_extensions_list('extension'); + if (!$mods) + display_note(_("No optional extension module is currently available.")); + else + display_extensions($mods); +} else company_extensions($set); //--------------------------------------------------------------------------------------------- end_form(); end_page(); -?> \ No newline at end of file