From: Joe Hunt Date: Tue, 19 Dec 2017 08:35:41 +0000 (+0100) Subject: Installed Third Party extension version display X-Git-Tag: v2.4.4~40 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=b4f083ca955e8daee64702b6491d858dce0d2f90;hp=4f45af036e84e77b72dce1157829e00a758203b0;p=fa-stable.git Installed Third Party extension version display --- diff --git a/admin/inst_module.php b/admin/inst_module.php index 2309292b..6c974ddb 100644 --- a/admin/inst_module.php +++ b/admin/inst_module.php @@ -42,8 +42,18 @@ function local_extension($id) 'active' => false ); - if (file_exists($path_to_root.'/modules/'.clean_file_name($id).'/hooks.php')) { - include_once($path_to_root.'/modules/'.clean_file_name($id).'/hooks.php'); + $local_module_path = $path_to_root.'/modules/'.clean_file_name($id); + $local_config_file = $local_module_path.'/_init/config'; + $local_hook_file = $local_module_path.'/hooks.php'; + + if (file_exists($local_config_file)) { + $ctrl = get_control_file($local_config_file); + if (key_exists('Name', $ctrl)) $exts[$next_extension_id-1]['name'] = $ctrl['Name']; + if (key_exists('Version', $ctrl)) $exts[$next_extension_id-1]['version'] = $ctrl['Version']; + } + if (file_exists($local_hook_file)) { + include_once($local_hook_file); + } $hooks_class = 'hooks_'.$id; if (class_exists($hooks_class, false)) { @@ -123,7 +133,7 @@ function display_extensions($mods) label_cell($entries); label_cell($id === null ? _("None") : - ($available && $installed ? $installed : _("Unknown"))); + (($installed && ($installed != '-' || $installed != '')) ? $installed : _("Unknown"))); label_cell($available ? $available : _("Unknown")); if (!$available && $ext['type'] == 'extension') {// third-party plugin