/**
  * Renders the complete facet.
  *
  * @see	tx_solr_FacetRenderer::render()
  * @return	string	Rendered HTML representing the facet.
  */
 public function render()
 {
     $facetOptionLinks = array();
     $solrConfiguration = tx_solr_Util::getSolrConfiguration();
     $this->template->workOnSubpart('single_facet_option');
     $i = 0;
     foreach ($this->facetOptions as $facetOption => $facetOptionResultCount) {
         if ($facetOption == '_empty_') {
             // TODO - for now we don't handle facet missing.
             continue;
         }
         $facetText = $this->renderOption($facetOption);
         $facetLink = $this->buildAddFacetLink($facetText, $this->facetName . ':' . $facetOption);
         $facetLinkUrl = $this->buildAddFacetUrl($this->facetName . ':' . $facetOption);
         $facetHidden = '';
         if (++$i > $solrConfiguration['search.']['faceting.']['limit']) {
             $facetHidden = 'tx-solr-facet-hidden';
         }
         $facetSelected = $this->isSelectedFacetOption($facetOption);
         // negating the facet option links to remove a filter
         if ($this->facetConfiguration['selectingSelectedFacetOptionRemovesFilter'] && $facetSelected) {
             $facetLink = $this->buildRemoveFacetLink($facetText, $this->facetName . ':' . $facetOption);
             $facetLinkUrl = $this->buildRemoveFacetUrl($this->facetName . ':' . $facetOption);
         }
         if ($this->facetConfiguration['singleOptionMode']) {
             $facetLink = $this->buildReplaceFacetLink($facetText, $this->facetName . ':' . $facetOption);
             $facetLinkUrl = $this->buildReplaceFacetUrl($this->facetName . ':' . $facetOption);
         }
         $facetOptionLinks[] = array('hidden' => $facetHidden, 'link' => $facetLink, 'url' => $facetLinkUrl, 'text' => $facetText, 'value' => $facetOption, 'count' => $facetOptionResultCount, 'selected' => $facetSelected ? '1' : '0');
     }
     $this->template->addLoop('facet_links', 'facet_link', $facetOptionLinks);
     return $this->template->render();
 }
 /**
  * Renders a solr exception.
  *
  * @return	string	A representation of the exception that should be understandable for the user.
  */
 protected function renderException()
 {
     $this->template->workOnSubpart('solr_search_error');
     return $this->template->render();
 }