function node_block_view

7.x node.module node_block_view($delta = '')

Implements hook_block_view().

File

drupal-7.x/modules/node/node.module, line 2258
The core that allows content to be submitted to the site. Modules and scripts may programmatically submit nodes using the usual form API pattern.

Code

function node_block_view($delta = '') {
  $block = array();

  switch ($delta) {
    case 'syndicate':
      $block['subject'] = t('Syndicate');
      $block['content'] = theme('feed_icon', array('url' => 'rss.xml', 'title' => t('Syndicate')));
      break;

    case 'recent':
      if (user_access('access content')) {
        $block['subject'] = t('Recent content');
        if ($nodes = node_get_recent(variable_get('node_recent_block_count', 10))) {
          $block['content'] = theme('node_recent_block', array(
            'nodes' => $nodes,
          ));
        }
        else {
          $block['content'] = t('No content available.');
        }
      }
      break;
  }
  return $block;
}