function _theme_revisions_pending_block in Revisioning 6.3
Same name and namespace in other branches
- 6.4 revisioning_theme.inc \_theme_revisions_pending_block()
1 call to _theme_revisions_pending_block()
- revisioning_block in ./
revisioning.module - Implementation of hook_block().
File
- ./
revisioning_theme.inc, line 249 - Include file for revisioning.module; deals with all theming aspects.
Code
function _theme_revisions_pending_block($nodes) {
$max_num_shown = variable_get('revisioning_block_num_pending', 5);
$nodes_to_display = array_slice($nodes, 0, $max_num_shown);
$links = array();
foreach ($nodes_to_display as $node) {
$vid = revisioning_get_latest_revision_id($node->nid);
$links[] = l($node->title, "node/{$node->nid}/revisions/{$vid}/view");
}
$css_path = drupal_get_path('module', 'revisioning') . '/revisioning.css';
drupal_add_css($css_path, 'module', 'all', FALSE);
// also loads /revisioning-rtl.css
$block = array();
$title_link = trim(variable_get('revisioning_content_summary_page', ''));
if (empty($title_link)) {
if (module_exists('module_grants_monitor') && user_tools_user_any_access(module_grants_monitor_perm())) {
$title_link = 'accessible-content';
}
else {
$title_link = 'admin/content/node';
}
}
$block['subject'] = l(t('!num_revisions pending', array(
'!num_revisions' => format_plural(count($nodes), '1 revision', '@count revisions'),
)), $title_link);
$block['content'] = theme('item_list', $links);
return $block;
}