]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-admin_add.php
Better 'Aufgabe' for german text
[mailer.git] / inc / modules / admin / what-admin_add.php
index 2ce5fe9133c1678fe216ea8af89c4327b5b25212..7e66899d8255772e00366d569d3a41ecaa06d892 100644 (file)
@@ -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 = "    <select class=\"admin_select\" name=\"sort\" size=\"1\">
-      <option value=\"0\">{--IS_FIRST_MENU--}</option>\n";
+
+       $OUT = '    <select class="admin_select" name="sort" size="1">
+      <option value="0">{--IS_FIRST_MENU--}</option>';
        foreach ($below as $key => $m) {
                if (is_array($m)) {
                        foreach ($m as $key2 => $m2) {
-                               $OUT .= "      <option value=\"".$m2."\">".$titles[$key][$key2];
+                               $OUT .= '      <option value="' . $m2 . '">' . $titles[$key][$key2];
                                foreach ($menus as $k => $v) {
                                        if (($v == $key) && (!is_array($v))) {
-                                               $OUT .= " (" . $titles[$k] . ')';
-                                       }
-                               }
-                               $OUT .= "</option>\n";
+                                               $OUT .= ' (' . $titles[$k] . ')';
+                                       } // END - if
+                               } // END - foreach
+                               $OUT .= '</option>';
                        }
                } else {
-                       $OUT .= "      <option value=\"".$m."\">".$titles[$key]."</option>\n";
+                       $OUT .= '      <option value="' . $m . '">' . $titles[$key] . '</option>';
                }
        }
-       $OUT .= "</select>";
+       $OUT .= '</select>';
 
        // 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]