Mercurial > hg > rr-repo
diff sites/all/themes/omega/theme/admin-block.theme.inc @ 0:ff03f76ab3fe
initial version
author | danieleb <danielebarchiesi@me.com> |
---|---|
date | Wed, 21 Aug 2013 18:51:11 +0100 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sites/all/themes/omega/theme/admin-block.theme.inc Wed Aug 21 18:51:11 2013 +0100 @@ -0,0 +1,39 @@ +<?php + +/** + * Returns HTML for an administrative block for display. + * + * @param $variables + * An associative array containing: + * - block: An array containing information about the block: + * - show: A Boolean whether to output the block. Defaults to FALSE. + * - title: The block's title. + * - content: (optional) Formatted content for the block. + * - description: (optional) Description of the block. Only output if + * 'content' is not set. + * + * @ingroup themeable + */ +function omega_admin_block($variables) { + $block = $variables['block']; + $output = ''; + + // Don't display the block if it has no content to display. + if (empty($block['show'])) { + return $output; + } + + $output .= '<div class="admin-panel">'; + if (!empty($block['title'])) { + $output .= '<h3>' . $block['title'] . '</h3>'; + } + if (!empty($block['content'])) { + $output .= '<div class="admin-panel__body">' . $block['content'] . '</div>'; + } + else { + $output .= '<div class="admin-panel__body">' . $block['description'] . '</div>'; + } + $output .= '</div>'; + + return $output; +}