You are here

function book_helper_block in Book helper 6

Implementation of hook_block().

File

./book_helper.module, line 142
Improves Drupal's core book module's functionality.

Code

function book_helper_block($op = 'list', $delta = 0, $edit = array()) {
  switch ($op) {
    case 'list':
      $blocks['book-helper-inline-navigation'] = array(
        'info' => t('Book (inline) navigation'),
      );
      return $blocks;
    case 'view':
      $node = menu_get_object();
      if (!$node || !isset($node->book['bid'])) {
        return NULL;
      }
      else {
        return array(
          'content' => theme('book_navigation', $node->book),
        );
      }
    default:
      return;
  }
}