theme_admin_block

Versions
5 – 6
theme_admin_block($block)
7
theme_admin_block($variables)

This function formats an administrative block for display.

Parameters

$variables An associative array containing:

  • block: An array containing information about the block. It should include a 'title', a 'description' and a formatted 'content'.

Related topics

Code

modules/system/system.admin.inc, line 2190

<?php
function theme_admin_block($variables) {
  $block = $variables['block'];

  // Don't display the block if it has no content to display.
  if (empty($block['show'])) {
    return '';
  }

  if (empty($block['content'])) {
    $output = <<< EOT
    <div class="admin-panel">
      <h3>
        $block[title]
      </h3>
      <div class="description">
        $block[description]
      </div>
    </div>
EOT;
  }
  else {
    $output = <<< EOT
    <div class="admin-panel">
      <h3>
        $block[title]
      </h3>
     <div class="body">
       $block[content]
      </div>
    </div>
EOT;
  }
  return $output;
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.