fivestar_block

Versions
5 – 6
fivestar_block($op = 'list', $delta = 0, $edit = array())

Code

contrib/fivestar/fivestar.module, line 978

<?php
function fivestar_block($op = 'list', $delta = 0, $edit = array()) {
  switch ($op) {
    case 'list':
      $blocks[0]['info'] = t('Fivestar: Rate this node');
      return $blocks;

    case 'view':
      if (user_access('access content') && user_access('rate content')) {
        if (arg(0) == 'node' && is_numeric(arg(1)) && (arg(2) == '' || arg(2) == 'view')) {
          $node = node_load(arg(1));
          if (fivestar_validate_target('node', $node->nid)) {
            $block['subject'] = t('Rate This');
            $block['content'] = fivestar_widget_form($node);
            return $block;
          }
        }
      }
      break;
  }
}
?>