You are here

function opening_hours_block in Opening hours 6

Implements hook_block().

File

./opening_hours.module, line 76
Opening hours module.

Code

function opening_hours_block($op = 'list', $delta = 0, $edit = array()) {
  switch ($op) {
    case 'list':
      return array(
        'week' => array(
          'info' => t('Opening hours for node by week'),
          'cache' => BLOCK_NO_CACHE,
        ),
      );
      break;
    case 'view':
      $block = new stdClass();
      if ($node = menu_get_object()) {
        $block->title = t('Opening hours');
        $block->content = theme('opening_hours_' . $delta, $node);
      }
      return $block;
  }
}