Access to system settings moved from global scope to SysPrefs.
[fa-stable.git] / admin / inst_module.php
index e19523f1c314e86bb337eee9b09c4368de9e790b..eda65097e50426d5cfb4337ffc908d2772792a1d 100644 (file)
@@ -14,7 +14,7 @@ $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"));
@@ -42,13 +42,14 @@ function local_extension($id)
                        'active' => false
        );
 
-       @include_once($path_to_root.'/modules/'.$id.'/hooks.php');
+       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');
+       }
        $hooks_class = 'hooks_'.$id;
-       if (class_exists($hooks_class)) {
+       if (class_exists($hooks_class, false)) {
                $hooks = new $hooks_class;
                $hooks->install_extension(false);
        }
-       
        $Ajax->activate('ext_tbl'); // refresh settings display
        if (!update_extensions($exts))
                return false;
@@ -112,13 +113,12 @@ function display_extensions()
                $available = @$ext['available'];
                $installed = @$ext['version'];
                $id = @$ext['local_id'];
-               $is_mod = $ext['type'] == 'module';
 
                $entries = fmt_titles(@$ext['entries']);
                $tabs = fmt_titles(@$ext['tabs']);
 
                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($tabs);
                label_cell($entries);
@@ -153,7 +153,6 @@ function display_extensions()
        end_table(1);
 
        submit_center_first('Refresh', _("Update"), '', null);
-       submit_center_last('Add', _("Add third-party extension"), '', false);
 
        div_end();
 }
@@ -267,4 +266,3 @@ else
 end_form();
 
 end_page();
-?>
\ No newline at end of file