You are here

function node_block_view in Drupal 7

Implements hook_block_view().

File

modules/node/node.module, line 2252
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;
}