X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=admin%2Finst_module.php;h=2309292bef911ddfda922060b78dfa1900e74010;hb=c0f5875022fad0f717908c17ce4e3ba42315cffc;hp=01169034e2563ff95b02e00efe67a59fb85e8db9;hpb=17b390efcf904072b02ec866b2a427490471a260;p=fa-stable.git diff --git a/admin/inst_module.php b/admin/inst_module.php index 01169034..2309292b 100644 --- a/admin/inst_module.php +++ b/admin/inst_module.php @@ -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,8 +261,13 @@ 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); //---------------------------------------------------------------------------------------------