function theme_node_recent_block

Returns HTML for a list of recent content.

Parameters

$variables: An associative array containing:

  • nodes: An array of recent node entities.

Related topics

2 theme calls to theme_node_recent_block()
hook_block_view in drupal/core/modules/block/block.api.php
Return a rendered or renderable view of a block.
node_block_view in drupal/core/modules/node/node.module
Implements hook_block_view().

File

drupal/core/modules/node/node.module, line 1991
The core module that allows content to be submitted to the site.

Code

function theme_node_recent_block($variables) {
  $rows = array();
  $output = '';
  $l_options = array(
    'query' => drupal_get_destination(),
  );
  foreach ($variables['nodes'] as $node) {
    $row = array();
    $row[] = array(
      'data' => theme('node_recent_content', array(
        'node' => $node,
      )),
      'class' => 'title-author',
    );
    if (node_access('update', $node)) {
      $row[] = array(
        'data' => l(t('edit'), 'node/' . $node->nid . '/edit', $l_options),
        'class' => 'edit',
      );
    }
    if (node_access('delete', $node)) {
      $row[] = array(
        'data' => l(t('delete'), 'node/' . $node->nid . '/delete', $l_options),
        'class' => 'delete',
      );
    }
    $rows[] = $row;
  }
  if ($rows) {
    $output = theme('table', array(
      'rows' => $rows,
    ));
    if (user_access('access content overview')) {
      $output .= theme('more_link', array(
        'url' => 'admin/content',
        'title' => t('Show more content'),
      ));
    }
  }
  return $output;
}