You are here

function theme_admin_settings_form in Admin 7.2

Same name and namespace in other branches
  1. 6.2 admin.admin.inc \theme_admin_settings_form()

Theme function for the admin settings form.

1 theme call to theme_admin_settings_form()
admin_settings_form in ./admin.admin.inc
System settings form for admin toolbar.

File

./admin.admin.inc, line 140

Code

function theme_admin_settings_form($variables) {
  $form = $variables['element'];
  $rows = array();

  // Admin blocks
  $header = array(
    array(
      'data' => t('Administrative blocks'),
      'colspan' => 2,
    ),
  );
  foreach (array_keys(admin_get_default_blocks(TRUE)) as $block) {
    $rows[] = array(
      array(
        'data' => drupal_render($form['blocks'][$block]),
        'colspan' => 2,
      ),
    );
  }

  // "Custom" blocks
  $rows[] = array(
    array(
      'data' => t('Other blocks'),
      'colspan' => 2,
      'header' => TRUE,
    ),
  );
  foreach (element_children($form['blocks']) as $block) {
    if (empty($form['blocks'][$block]['#printed'])) {
      $rows[] = array(
        array(
          'data' => drupal_render($form['blocks'][$block]),
          'colspan' => 2,
        ),
      );
    }
  }
  $rows[] = array(
    drupal_render($form['custom']),
    drupal_render($form['add']),
  );
  $form['blocks']['#children'] = theme('table', array(
    'header' => $header,
    'rows' => $rows,
  ));
  return drupal_render_children($form);
}