Fix for inserted codes while registering of extensions, many rewrites/cleanups:
[mailer.git] / inc / modules / admin / what-admin_add.php
index 980d6f85774ecaca40cf74a0f6470e875607ce2b..7e66899d8255772e00366d569d3a41ecaa06d892 100644 (file)
@@ -55,7 +55,7 @@ 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__);
+       $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?
@@ -93,8 +93,8 @@ 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__);
+                       $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();