diff --git includes/common.inc includes/common.inc index 01c0899..0a22f7c 100644 --- includes/common.inc +++ includes/common.inc @@ -3631,10 +3631,6 @@ function drupal_common_theme() { 'arguments' => array('title' => NULL, 'content' => NULL, 'region' => 'main'), 'template' => 'box', ), - 'block' => array( - 'arguments' => array('block' => NULL), - 'template' => 'block', - ), 'mark' => array( 'arguments' => array('type' => MARK_NEW), ), diff --git includes/theme.inc includes/theme.inc index 029383e..0586ce4 100644 --- includes/theme.inc +++ includes/theme.inc @@ -2027,35 +2027,3 @@ function template_preprocess_node(&$variables) { $variables += field_attach_preprocess('node', $node); } -/** - * Process variables for block.tpl.php - * - * Prepare the values passed to the theme_block function to be passed - * into a pluggable template engine. Uses block properties to generate a - * series of template file suggestions. If none are found, the default - * block.tpl.php is used. - * - * Most themes utilize their own copy of block.tpl.php. The default is located - * inside "modules/system/block.tpl.php". Look in there for the full list of - * variables. - * - * The $variables array contains the following arguments: - * - $block - * - * @see block.tpl.php - */ -function template_preprocess_block(&$variables) { - static $block_counter = array(); - $variables['block'] = $variables['block']['#block']; - // All blocks get an independent counter for each region. - if (!isset($block_counter[$variables['block']->region])) { - $block_counter[$variables['block']->region] = 1; - } - // Same with zebra striping. - $variables['block_zebra'] = ($block_counter[$variables['block']->region] % 2) ? 'odd' : 'even'; - $variables['block_id'] = $block_counter[$variables['block']->region]++; - - $variables['template_files'][] = 'block-' . $variables['block']->region; - $variables['template_files'][] = 'block-' . $variables['block']->module; - $variables['template_files'][] = 'block-' . $variables['block']->module . '-' . $variables['block']->delta; -} diff --git modules/block/block.module modules/block/block.module index d7f8a85..5467807 100644 --- modules/block/block.module +++ modules/block/block.module @@ -92,6 +92,10 @@ function block_help($path, $arg) { */ function block_theme() { return array( + 'block' => array( + 'arguments' => array('block' => NULL), + 'template' => 'block', + ), 'block_admin_display_form' => array( 'template' => 'block-admin-display-form', 'file' => 'block.admin.inc', @@ -728,3 +732,36 @@ function _block_get_cache_id($block) { function block_flush_caches() { return array('cache_block'); } + +/** + * Process variables for block.tpl.php + * + * Prepare the values passed to the theme_block function to be passed + * into a pluggable template engine. Uses block properties to generate a + * series of template file suggestions. If none are found, the default + * block.tpl.php is used. + * + * Most themes utilize their own copy of block.tpl.php. The default is located + * inside "modules/block/block.tpl.php". Look in there for the full list of + * variables. + * + * The $variables array contains the following arguments: + * - $block + * + * @see block.tpl.php + */ +function template_preprocess_block(&$variables) { + static $block_counter = array(); + $variables['block'] = $variables['block']['#block']; + // All blocks get an independent counter for each region. + if (!isset($block_counter[$variables['block']->region])) { + $block_counter[$variables['block']->region] = 1; + } + // Same with zebra striping. + $variables['block_zebra'] = ($block_counter[$variables['block']->region] % 2) ? 'odd' : 'even'; + $variables['block_id'] = $block_counter[$variables['block']->region]++; + + $variables['template_files'][] = 'block-' . $variables['block']->region; + $variables['template_files'][] = 'block-' . $variables['block']->module; + $variables['template_files'][] = 'block-' . $variables['block']->module . '-' . $variables['block']->delta; +} \ No newline at end of file diff --git modules/system/block.tpl.php modules/system/block.tpl.php deleted file mode 100644 index 97b5a65..0000000 --- modules/system/block.tpl.php +++ /dev/null @@ -1,36 +0,0 @@ -subject: Block title. - * - $block->content: Block content. - * - $block->module: Module that generated the block. - * - $block->delta: An ID for the block, unique within each module. - * - $block->region: The block region embedding the current block. - * - * Helper variables: - * - $block_zebra: Outputs 'odd' and 'even' dependent on each block region. - * - $zebra: Same output as $block_zebra but independent of any block region. - * - $block_id: Counter dependent on each block region. - * - $id: Same output as $block_id but independent of any block region. - * - $is_front: Flags true when presented in the front page. - * - $logged_in: Flags true when the current user is a logged-in member. - * - $is_admin: Flags true when the current user is an administrator. - * - * @see template_preprocess() - * @see template_preprocess_block() - */ -?> -
-subject): ?> -

subject ?>

- - -
- content ?> -
-