diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/aggregator/aggregator.pages.inc | 12 | ||||
-rw-r--r-- | modules/user/user.admin.inc | 39 |
2 files changed, 21 insertions, 30 deletions
diff --git a/modules/aggregator/aggregator.pages.inc b/modules/aggregator/aggregator.pages.inc index 3884f509f..850f013a2 100644 --- a/modules/aggregator/aggregator.pages.inc +++ b/modules/aggregator/aggregator.pages.inc @@ -238,14 +238,12 @@ function aggregator_categorize_items_submit($form, &$form_state) { function theme_aggregator_categorize_items($form) { $output = drupal_render($form['feed_source']); $rows = array(); - if ($form['items']) { + if (!empty($form['items'])) { foreach (element_children($form['items']) as $key) { - if (is_array($form['items'][$key])) { - $rows[] = array( - drupal_render($form['items'][$key]), - array('data' => drupal_render($form['categories'][$key]), 'class' => 'categorize-item'), - ); - } + $rows[] = array( + drupal_render($form['items'][$key]), + array('data' => drupal_render($form['categories'][$key]), 'class' => 'categorize-item'), + ); } } $output .= theme('table', array('', t('Categorize')), $rows); diff --git a/modules/user/user.admin.inc b/modules/user/user.admin.inc index 10cc2809d..144430298 100644 --- a/modules/user/user.admin.inc +++ b/modules/user/user.admin.inc @@ -678,33 +678,26 @@ function user_admin_perm_submit($form, &$form_state) { function theme_user_admin_perm($form) { $roles = user_roles(); foreach (element_children($form['permission']) as $key) { - // Don't take form control structures - if (is_array($form['permission'][$key])) { - $row = array(); - // Module name - if (is_numeric($key)) { - $row[] = array('data' => drupal_render($form['permission'][$key]), 'class' => 'module', 'id' => 'module-' . $form['permission'][$key]['#id'], 'colspan' => count($form['role_names']['#value']) + 1); - } - else { - // Permission row. - $row[] = array( - 'data' => drupal_render($form['permission'][$key]), - 'class' => 'permission', - ); - foreach (element_children($form['checkboxes']) as $rid) { - if (is_array($form['checkboxes'][$rid])) { - $row[] = array('data' => drupal_render($form['checkboxes'][$rid][$key]), 'class' => 'checkbox', 'title' => $roles[$rid] . ' : ' . t($key)); - } - } + $row = array(); + // Module name + if (is_numeric($key)) { + $row[] = array('data' => drupal_render($form['permission'][$key]), 'class' => 'module', 'id' => 'module-' . $form['permission'][$key]['#id'], 'colspan' => count($form['role_names']['#value']) + 1); + } + else { + // Permission row. + $row[] = array( + 'data' => drupal_render($form['permission'][$key]), + 'class' => 'permission', + ); + foreach (element_children($form['checkboxes']) as $rid) { + $row[] = array('data' => drupal_render($form['checkboxes'][$rid][$key]), 'class' => 'checkbox', 'title' => $roles[$rid] . ' : ' . t($key)); } - $rows[] = $row; } + $rows[] = $row; } $header[] = (t('Permission')); foreach (element_children($form['role_names']) as $rid) { - if (is_array($form['role_names'][$rid])) { - $header[] = array('data' => drupal_render($form['role_names'][$rid]), 'class' => 'checkbox'); - } + $header[] = array('data' => drupal_render($form['role_names'][$rid]), 'class' => 'checkbox'); } $output = theme('system_compact_link'); $output .= theme('table', $header, $rows, array('id' => 'permissions')); @@ -835,7 +828,7 @@ function theme_user_admin_account($form) { ); $output = drupal_render($form['options']); - if (isset($form['name']) && is_array($form['name'])) { + if (!empty($form['name'])) { foreach (element_children($form['name']) as $key) { $rows[] = array( drupal_render($form['accounts'][$key]), |