You are here

function top_searches_block_view in Top Searches 7

File

./top_searches.module, line 48

Code

function top_searches_block_view($delta = 0) {
  switch ($delta) {
    case 0:
      $block['subject'] = "";
      $top_searches = top_searches_collect_results();
      if (count($top_searches)) {
        $variable = array();
        $block['subject'] = t("Top Searches");
        foreach ($top_searches as $searchq) {
          $variable['top_searches'][] = array(
            'ts_q' => $searchq->q,
            'ts_counter' => $searchq->counter,
          );
        }
        $block['content'] = theme('top_searches_block', $variable);
      }
      break;
  }
  return $block;
}