$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);
// 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);