You are here

function recipe_block_view in Recipe 7.2

Same name and namespace in other branches
  1. 7 recipe.module \recipe_block_view()

Implements hook_block_view().

File

./recipe.module, line 293
Contains functions for Recipe node CRUD and display.

Code

function recipe_block_view($delta = '') {
  $block = array();
  switch ($delta) {
    case 'summary':
      if (user_access('access content')) {
        if (arg(0) == 'node' && is_numeric(arg(1)) && (arg(2) == '' || arg(2) == 'view')) {
          $node = node_load(arg(1));
          if ($node->type == 'recipe') {
            $block['subject'] = variable_get('recipe_summary_title', t('Summary'));
            $block['content'] = theme('recipe_summary', array(
              'node' => $node,
              'show_title' => FALSE,
              'show_yield_form' => TRUE,
            ));
            return $block;
          }
        }
      }
      break;
  }
}