bhengh

SB translation fix: sb_print_filter_line

Jan 25th, 2013
41
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function sb_print_filter_line ($id, $results, $filter, $display, $max_num = 7, $translate_book = FALSE) {
  2.     global $sermon_domain, $more_applied;
  3.    
  4.     if ($id != 'book') { $translate_book = FALSE; }
  5.     if ($translate_book) {
  6.         $translated_books = array_combine(sb_get_default('eng_bible_books'), sb_get_default('bible_books'));
  7.     }
  8.    
  9.     echo "<div id = \"{$id}\" class=\"filter\">\r<span class=\"filter-heading\">".ucwords($id).":</span> \r";
  10.     $i = 1;
  11.     $more = FALSE;
  12.     foreach ($results as $result) {
  13.         if ($i == $max_num) {
  14.             echo "<span id=\"{$id}-more\">";
  15.             $more = TRUE;
  16.             $more_applied[] = $id;
  17.         }
  18.         if ($i != 1)
  19.             echo ", \r";
  20.             if ($translate_book) {
  21.                 echo '<a href="'.sb_build_url(array($id => $result->$filter)).'">'.$translated_books[stripslashes($result->$display)].'</a>&nbsp;('.$result->count.')';
  22.             }
  23.             else {
  24.                 echo '<a href="'.sb_build_url(array($id => $result->$filter)).'">'.stripslashes($result->$display).'</a>&nbsp;('.$result->count.')';
  25.             }
  26.         $i++;
  27.     }
  28.     echo ".";
  29.     if ($more)
  30.         echo "</span>\r<span id=\"{$id}-more-link\" style=\"display:none\">&hellip; (<a  id=\"{$id}-toggle\" href=\"#\"><strong>".($i-$max_num).' '.__('more', $sermon_domain).'</strong></a>)</span>';
  31.     echo '</div>';
  32. }
RAW Paste Data