X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=admin%2Finst_module.php;h=d0d8a366069a21b1bad6e61d7d7e5c1a071985d5;hb=3aebde86793f495095e09160ebaae3e7b7040747;hp=76cb83635f02bdb4b56cc63696389db1190d1616;hpb=bb28e21c206894803222151e73a36feee629766c;p=fa-stable.git diff --git a/admin/inst_module.php b/admin/inst_module.php index 76cb8363..d0d8a366 100644 --- a/admin/inst_module.php +++ b/admin/inst_module.php @@ -1,6 +1,6 @@ " . $names[$i]. "\n"; - else + else echo "\n"; - } + } echo "\n"; echo "\n"; } @@ -66,6 +66,8 @@ function tab_list_row($label, $name, $selected) function check_data() { + if ($_POST['name'] == "" || $_POST['path'] == "") + return false; return true; } @@ -83,15 +85,15 @@ function array_natsort($aryData, $strIndex, $strSortBy, $strSortType=false) if (!is_array($aryData) || !$strIndex || !$strSortBy) // return the array return $aryData; - + // create our temporary arrays $arySort = $aryResult = array(); - + // loop through the array foreach ($aryData as $aryRow) // set up the value in the array $arySort[$aryRow[$strIndex]] = $aryRow[$strSortBy]; - + // apply the natural sort natsort($arySort); @@ -99,7 +101,7 @@ function array_natsort($aryData, $strIndex, $strSortBy, $strSortType=false) if ($strSortType=="desc") // reverse the array arsort($arySort); - + // loop through the sorted and original data foreach ($arySort as $arySortKey => $arySorted) foreach ($aryData as $aryOriginal) @@ -110,7 +112,7 @@ function array_natsort($aryData, $strIndex, $strSortBy, $strSortType=false) // return the return return $aryResult; -} +} function write_modules() { @@ -119,9 +121,9 @@ function write_modules() $mods = array_natsort($installed_modules, 'tab', 'tab'); $installed_modules = $mods; //reset($installed_languages); - $n = count($installed_modules); + $n = count($installed_modules); $msg = ""; - + start_table($table_style2); - if ($selected_id != -1) + if ($selected_id != -1) { $mod = $installed_modules[$selected_id]; $_POST['tab'] = $mod['tab']; @@ -316,7 +318,7 @@ function display_module_edit($selected_id) $_POST['filename'] = $mod['filename']; hidden('selected_id', $selected_id); hidden('filename', $_POST['filename']); - } + } tab_list_row(_("Menu Tab"), 'tab', null); text_row_ex(_("Name"), 'name', 30); text_row_ex(_("Folder"), 'path', 20); @@ -326,7 +328,7 @@ function display_module_edit($selected_id) end_table(0); display_note(_("Select your module PHP file from your local harddisk."), 0, 1); - echo "
"; + echo "
"; end_form(); @@ -337,18 +339,18 @@ function display_module_edit($selected_id) if (isset($_GET['c'])) { - if ($_GET['c'] == 'df') + if ($_GET['c'] == 'df') { handle_delete(); } - if ($_GET['c'] == 'u') + if ($_GET['c'] == 'u') { - if (handle_submit()) + if (handle_submit()) { //meta_forward($_SERVER['PHP_SELF']); } - } + } } //---------------------------------------------------------------------------------------------