finder_block

Versions
6--1
finder_block($op = 'list', $delta = 0, $edit = array())

Implementation of hook_block().

See also

hook_block()

Code

./finder.module, line 731

<?php
function finder_block($op = 'list', $delta = 0, $edit = array()) {
  if ($op == 'list') {
    $finders = finder_load_multiple(NULL, array('block' => 1));
    $blocks = array();
    foreach ($finders as $finder) {
      $blocks['finder_'. $finder->finder_id] = array(
        'info' => t('Finder') .': '. $finder->title,
        'cache' => BLOCK_NO_CACHE,
      );
    }
    return $blocks;
  }
  else if ($op == 'view' && user_access('use finder')) {
    $finder_id = str_replace('finder_', '', $delta);
    $finder = finder_load($finder_id);
    if ($finder) {
      finder_invoke_finderapi($finder, 'finder_block');
      $block = array(
        'subject' => $finder->title,
        'content' => theme('finder_block', $finder),
      );
      return $block;
    }
  }
}
?>

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

Mollom CAPTCHA (play audio CAPTCHA)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.