- 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
+