Fix for Code

  1. /**
  2.  * Implementation of hook_theme_registry_alter().
  3.  *
  4.  * Make simpleblocks' block preprocess function run *after* everything else's,
  5.  * so that we can alter zen's links.  This method was nicked from jquery_update.
  6.  */
  7. function simpleblocks_theme_registry_alter(&$theme_registry) {
  8.   if (isset($theme_registry['block'])) {
  9.     // If simpleblocks' preprocess function is there already, remove it.
  10.     if ($key = array_search('simpleblocks_preprocess_block', $theme_registry['block']['preprocess functions'])) {
  11.       unset($theme_registry['block']['preprocess functions'][$key]);
  12.     }
  13.     // Now tack it on at the end so it runs after everything else.
  14.     $theme_registry['block']['preprocess functions'][] = 'simpleblocks_preprocess_block';
  15.   }
  16. }
  17.  
  18. /**
  19.  * Override or insert variables into the block templates.
  20.  *
  21.  * @param $vars
  22.  *   An array of variables to pass to the theme template.
  23.  * @param $hook
  24.  *   The name of the template being rendered ("block" in this case.)
  25.  */
  26. function simpleblocks_preprocess_block($vars, $hook) {
  27.   $block = $vars['block'];
  28.   if (simpleblocks_user_access($block->module, $block->delta)) {
  29.     if (theme_get_setting('zen_block_editing') && user_access('administer blocks')) {
  30.       // we'll do something here.
  31.     }
  32.   }
  33. }

Submit Fix

Any tags you'd like to associate with your code, delimitered by commas (example: Views, CCK, Module, etc).
Select the syntax highlighting mode to use.