From 845ddc30b8993d5112393377dd47b1b43f3f266d Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Sat, 24 Jul 2010 22:00:55 +0000 Subject: [PATCH] Cleanups --- admin/inst_module.php | 21 ++++++++++++--------- includes/current_user.inc | 2 +- includes/packages.inc | 14 +++----------- 3 files changed, 16 insertions(+), 21 deletions(-) diff --git a/admin/inst_module.php b/admin/inst_module.php index 52190ca7..044df94d 100644 --- a/admin/inst_module.php +++ b/admin/inst_module.php @@ -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 '
'; + submit_add_or_update($selected_id == -1, '', 'both'); + submit('RESET', _('Cancel'), true, '', 'cancel'); + echo '
'; } //--------------------------------------------------------------------------------------------- diff --git a/includes/current_user.inc b/includes/current_user.inc index c1c68e43..57177992 100644 --- a/includes/current_user.inc +++ b/includes/current_user.inc @@ -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; } diff --git a/includes/packages.inc b/includes/packages.inc index 5738cbfd..30074138 100644 --- a/includes/packages.inc +++ b/includes/packages.inc @@ -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); } -- 2.30.2