You are here

function theme_admin_page in Drupal 5

Same name and namespace in other branches
  1. 6 modules/system/system.admin.inc \theme_admin_page()
  2. 7 modules/system/system.admin.inc \theme_admin_page()

This function formats an administrative page for viewing.

@themeable

Parameters

$blocks: An array of blocks to display. Each array should include a 'title', a 'description', a formatted 'content' and a 'position' which will control which container it will be in. This is usually 'left' or 'right'.

1 theme call to theme_admin_page()
system_main_admin_page in modules/system/system.module
Provide the administration overview page.

File

modules/system/system.module, line 2195
Configuration system that lets administrators modify the workings of the site.

Code

function theme_admin_page($blocks) {
  $stripe = 0;
  $container = array();
  foreach ($blocks as $block) {
    if ($block_output = theme('admin_block', $block)) {
      if (!$block['position']) {

        // perform automatic striping.
        $block['position'] = $stripe++ % 2 ? 'left' : 'right';
      }
      $container[$block['position']] .= $block_output;
    }
  }
  $output = '<div class="admin clear-block">';
  $output .= '<div class="compact-link">';
  if (system_admin_compact_mode()) {
    $output .= l(t('Show descriptions'), 'admin/compact/off', array(
      'title' => t('Produce a less compact layout that includes descriptions.'),
    ));
  }
  else {
    $output .= l(t('Hide descriptions'), 'admin/compact/on', array(
      'title' => t("Produce a more compact layout that doesn't include descriptions."),
    ));
  }
  $output .= '</div>';
  foreach ($container as $id => $data) {
    $output .= '<div class="' . $id . ' clear-block">';
    $output .= $data;
    $output .= '</div>';
  }
  $output .= '</div>';
  return $output;
}