New (template) wrapper function fixEmptyContentToDashes() introduced, EL rewrites:
[mailer.git] / inc / modules / admin / what-config_admins.php
index 360ec7b2e5e3d9eddbca256c8931085599747f22..552a7b84f0d2c04e51cf6419b68919e5ef31ccc9 100644 (file)
@@ -109,30 +109,16 @@ if ((isFormSent('edit')) && (countPostSelection() > 0)) {
        $OUT = ''; $SW = 2;
        foreach (postRequestParameter('sel') as $id => $selected) {
                // Load data for the id
-               $result = SQL_QUERY_ESC("SELECT admin_id, action_menu, what_menu, access_mode FROM `{?_MYSQL_PREFIX?}_admins_acls` WHERE `id`=%s LIMIT 1",
+               $result = SQL_QUERY_ESC("SELECT `id`, `admin_id`, `action_menu`, `what_menu`, `access_mode` FROM `{?_MYSQL_PREFIX?}_admins_acls` WHERE `id`=%s LIMIT 1",
                        array(bigintval($id)), __FILE__, __LINE__);
-               list($admin, $action, $what, $mode) = SQL_FETCHROW($result);
+               $content = SQL_FETCHARRAY($result);
                SQL_FREERESULT($result);
 
-               // Prepare variables
-               if (empty($action)) $action = '---';
-               if (empty($what)) $what = '---';
-
                // Get admin mode
-               $mode = '{--ADMINS_' . strtoupper($mode) . '_MODE--}';
+               $content['access_mode'] = '{--ADMINS_' . strtoupper($content['access_mode']) . '_MODE--}';
 
-               // Generate link
-               $admin = generateAdminLink($admin);
-
-               // Prepare data for the row template
-               $content = array(
-                       'sw'     => $SW,
-                       'id'     => $id,
-                       'admin'  => $admin,
-                       'action' => $action,
-                       'what'   => $what,
-                       'mode'   => $mode,
-               );
+               // Add color switch
+               $content['sw'] = $SW;
 
                // Load row template and switch colors
                $OUT .= loadTemplate('admin_config_admins_del_row', true, $content);
@@ -217,22 +203,11 @@ VALUES ('%s','%s','%s','%s')",
                // List ACLs
                $OUT = ''; $SW = 2;
                while ($content = SQL_FETCHARRAY($result_acls)) {
-                       // Prepare variables
-                       if (empty($content['action_menu'])) $content['action_menu'] = '---';
-                       if (empty($content['what_menu']))   $content['what_menu']   = '---';
-
-                       // Get mode
+                       // Generate mode string
                        $content['access_mode'] = '{--ADMINS_' . strtoupper($content['access_mode']) . '_MODE--}';
 
-                       // Prepare data for the row template
-                       $content = array(
-                               'sw'     => $SW,
-                               'id'     => $content['id'],
-                               'admin'  => generateAdminLink($content['admin_id']),
-                               'action' => $content['action_menu'],
-                               'what'   => $content['what_menu'],
-                               'mode'   => $content['access_mode'],
-                       );
+                       // Add color switch
+                       $content['sw'] = $SW;
 
                        // Load row template and switch colors
                        $OUT .= loadTemplate('admin_config_admins_row', true, $content);