]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-admin_add.php
A lot CSS classes rewritten, please update all your themes.
[mailer.git] / inc / modules / admin / what-admin_add.php
index f4155ec8c9ab9aa5fa0101c6b78b0de14b06a864..a661994fc2ed202d2b7e7e7ffac203f81ac30aa8 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();
@@ -135,7 +135,7 @@ if (!isFormSent()) {
                }
        }
 
-       $OUT = '    <select class="admin_select" name="sort" size="1">
+       $OUT = '    <select class="form_select" name="sort" size="1">
       <option value="0">{--IS_FIRST_MENU--}</option>';
        foreach ($below as $key => $m) {
                if (is_array($m)) {
@@ -160,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')) {
@@ -185,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]