Cleanups
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Sat, 24 Jul 2010 22:00:55 +0000 (22:00 +0000)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Sat, 24 Jul 2010 22:00:55 +0000 (22:00 +0000)
admin/inst_module.php
includes/current_user.inc
includes/packages.inc

index 52190ca7eabe2fe968df80479462ce59eb36f2d8..044df94dcb85381caeeedebdb36387ee9b73a836 100644 (file)
@@ -47,7 +47,7 @@ function check_data($id, $exts)
                return false;
        }
        if ($id == -1 && !is_uploaded_file($_FILES['uploadfile']['tmp_name'])) {
-               display_error(_("You have to select plugin file to upload"));
+               display_error(_("You have to select extension file to upload"));
                return false; 
        }
        return true;
@@ -79,8 +79,8 @@ function handle_submit()
        $entry['title'] = $_POST['title'];
        $entry['section'] = 2; // menu section aka module
 
-       // Only plugin extensions can be installed manually.
-       $extensions[$id]['type'] = 'plugin';
+       // Only plugin type extensions can be installed manually.
+       $extensions[$id]['type'] = 'extension';
        $directory = $path_to_root . "/modules/" . $_POST['path'];
        if (!file_exists($directory))
        {
@@ -231,7 +231,7 @@ function display_extensions()
        end_table(1);
 
        submit_center_first('Refresh', _("Update"), '', null);
-       submit_center_last('Add', _("Add third-party plugin"), '', false);
+       submit_center_last('Add', _("Add third-party extension"), '', false);
 
        div_end();
 }
@@ -306,20 +306,23 @@ function display_ext_edit($selected_id)
                hidden('selected_id', $selected_id);
        }
        text_row_ex(_("Name"), 'name', 30);
-       text_row_ex(_("Folder"), 'path', 20);
+       text_row_ex(_("Subfolder (in modules directory)"), 'path', 20);
 
        tab_list_row(_("Menu Tab"), 'tab', null, true);
        text_row_ex(_("Menu Link Text"), 'title', 30);
 
        record_status_list_row(_("Default status"), 'active');
 
-       file_row(_("Module File"), 'uploadfile');
-       file_row(_("Access Levels Extensions"), 'uploadfile3');
+       file_row(_("Extension File"), 'uploadfile');
+       file_row(_("Access Levels File"), 'uploadfile3');
        file_row(_("SQL File"), 'uploadfile2');
 
        end_table(0);
-       display_note(_("Select your module PHP file from your local harddisk."), 0, 1);
-       submit_add_or_update_center($selected_id == -1, '', 'both');
+       display_note(_("Select your extension PHP files from your local harddisk."), 0, 1);
+       echo '<center>';
+       submit_add_or_update($selected_id == -1, '', 'both');
+       submit('RESET', _('Cancel'), true, '', 'cancel');
+       echo '</center>';
 }
 
 //---------------------------------------------------------------------------------------------
index c1c68e439a287070a98d1d543b9a2566b7eca056..571779925f73e168c480498deea62b49b90d5ae9 100644 (file)
@@ -483,7 +483,7 @@ function array_search_keys($needle, $haystack, $valuekey=null)
        $keys = array();
        if($haystack)
                foreach($haystack as $key => $value) {
-                       $val = isset($valuekey) ? $value[$valuekey] : $value;
+                       $val = isset($valuekey) ? @$value[$valuekey] : $value;
                        if ($needle == $val){
                                $keys[] = $key;
                        }
index 5738cbfda1c706ae2ab9179b0573d31c6d141e31..300741387d754f294a3c5a30dbca847706d88c41 100644 (file)
@@ -14,14 +14,6 @@ include_once($path_to_root. "/includes/archive.inc");
 define('PKG_CACHE_PATH', $path_to_root.'/modules/_cache');
 define('PUBKEY_PATH', $path_to_root);
 define('REPO_URL', "$repository/$FA_repo_version");
-/*
-$pkg_data_basedir = array(
-       'language'      => '/lang/', 
-//     'module'        => '/', 
-       'extension'     => '/modules/', 
-//     'plugin'        => '/modules/',
-       'theme'         => '/themes/');
-*/
 //
 // FrontAccounting package class       
 //
@@ -463,7 +455,7 @@ function get_languages_list()
                $list = array_search_keys($l['code'], $pkgs, 'code');   // get all packages with this code
                foreach ($list as $name) {
                        if ($l['encoding'] == $pkgs[$name]['encoding']) {       // if the same encoding
-                               $pkgs[$name]['version'] = $l['version'];                // set installed version
+                               $pkgs[$name]['version'] = @$l['version'];               // set installed version
                                $pkgs[$name]['local_id'] = $id;         // index in installed_languages
                                continue 2;
                        }
@@ -529,7 +521,7 @@ function get_themes_list()
        $local = get_company_extensions();
        
        foreach($local as $extno => $ext) {
-               if (isset($pkgs[$ext['package']])) {
+               if (isset($pkgs[@$ext['package']])) {
                        $ext['local_id'] = $extno;
                        $pkgs[$ext['package']] = array_merge($pkgs[$ext['package']], $ext);
                }
@@ -553,7 +545,7 @@ function install_language($pkg_name)
                if ($i === null)
                        $i = count($installed_languages);
                else {  // remove another already installed package for this language 
-                       $old_pkg = $installed_languages[$i]['package'];
+                       $old_pkg = @$installed_languages[$i]['package'];
                        if ($old_pkg && ($pkg['Package'] != $old_pkg))
                                uninstall_package($old_pkg);
                }