X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-admin_add.php;h=7e66899d8255772e00366d569d3a41ecaa06d892;hb=1d2ffc5e23e60c43ec73862ca2a3da9684c8e99b;hp=2ce5fe9133c1678fe216ea8af89c4327b5b25212;hpb=18e32f1a8971b18bace4f051094acf27800bd7d9;p=mailer.git diff --git a/inc/modules/admin/what-admin_add.php b/inc/modules/admin/what-admin_add.php index 2ce5fe9133..7e66899d82 100644 --- a/inc/modules/admin/what-admin_add.php +++ b/inc/modules/admin/what-admin_add.php @@ -55,8 +55,8 @@ if (!isFormSent()) { $menus = array(); $titles = array(); $below = array(); // Get all available main menus - $result = SQL_QUERY("SELECT action, title, sort FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE (`what`='' OR `what` IS NULL) ORDER BY `sort`", __FILE__, __LINE__); - if (SQL_NUMROWS($result) > 0) { + $result = SQL_QUERY("SELECT `action`, `title`, `sort` FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE (`what`='' OR `what` IS NULL) ORDER BY `sort` ASC", __FILE__, __LINE__); + if (!SQL_HASZERONUMS($result)) { // Read menu structure // @TODO Cant this be rewritten? while ($content = SQL_FETCHARRAY($result)) { @@ -93,9 +93,9 @@ if (!isFormSent()) { // Load sub menus :) foreach ($menus as $key_main => $value_main) { - $result = SQL_QUERY_ESC("SELECT `what`, `title`, `sort` FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort`", - array($value_main), __FILE__, __LINE__); - if (SQL_NUMROWS($result) > 0) { + $result = SQL_QUERY_ESC("SELECT `what`, `title`, `sort` FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort` ASC", + array($value_main), __FILE__, __LINE__); + if (!SQL_HASZERONUMS($result)) { // Init arrays $menus[$value_main] = array(); $titles[$value_main] = array(); @@ -134,24 +134,25 @@ if (!isFormSent()) { } } } - $OUT = " + '; foreach ($below as $key => $m) { if (is_array($m)) { foreach ($m as $key2 => $m2) { - $OUT .= " \n"; + $OUT .= ' (' . $titles[$k] . ')'; + } // END - if + } // END - foreach + $OUT .= ''; } } else { - $OUT .= " \n"; + $OUT .= ' '; } } - $OUT .= ""; + $OUT .= ''; // Prepare selections for template $content['below_selection'] = $OUT; @@ -159,7 +160,7 @@ if (!isFormSent()) { $content['action_selection'] = adminAddMenuSelectionBox('admin', 'action', 'menu'); // Display form - loadTemplate('admin_admin_add', false, $content); + loadTemplate('admin_add_admin_menu', false, $content); } elseif (!isDemoModeActive()) { // Insert new menu entry if (isPostRequestParameterSet('menu')) { @@ -184,10 +185,10 @@ if (!isFormSent()) { ), __FILE__, __LINE__ ); } - loadTemplate('admin_settings_saved', false, getMessage('SETTINGS_SAVED')); + loadTemplate('admin_settings_saved', false, '{--SETTINGS_SAVED--}'); } else { // Is demo login! - loadTemplate('admin_settings_saved', false, getMessage('SETTINGS_NOT_SAVED')); + loadTemplate('admin_settings_saved', false, '{--SETTINGS_NOT_SAVED--}'); } // [EOF]