The attached module adds Language Sections title support for http://drupal.org/project/boxes module. This works the same as for blocks created by the core block module.

Development of this module was sponsored by Opsview.

CommentFileSizeAuthor
ls_box_titles.tgz634 byteslongwave

Comments

kenorb’s picture

kenorb’s picture

Pasting code from tgz file:

// $Id$

/**
 * Implementation of hook_theme_registry_alter().
 */
function ls_box_titles_theme_registry_alter(&$theme_registry) {
  $theme_registry['block']['preprocess functions'][] = 'ls_box_titles_process';
}

/**
 * Process a box to set its title.
 */
function ls_box_titles_process(&$variables) {
  // Only process blocks created by the boxes module.
  $block =& $variables['block'];
  if ($block->module != 'boxes') {
    return;
  }

  // Load the box content and find an alternative title, if available.
  $box = boxes_load($block->delta);
  $title = ls_titles_process('get', $box->options['body'], $box->options['format']);
  if ($title != '!') {
    $block->subject = $title;
  }
}
kenorb’s picture

Status: Needs review » Closed (works as designed)