Esempio n. 1
0
?>
" /></td>
            </tr>
          </span>
          <?php 
foreach ($indexed as $facet_name) {
    ?>
              <?php 
    $free_facet_name = preg_replace('/_s_admin$/i', '_t_admin', $facet_name);
    ?>
              <?php 
    $free_facet_name = preg_replace('/_s$/i', '_t', $free_facet_name);
    ?>
              <tr>
                  <?php 
    $label = __(SolrSearch_Helpers_Facet::keyToLabel($facet_name));
    ?>
                  <td style="vertical-align: top;" width="100px"><strong><?php 
    echo $label;
    ?>
</strong></td>
                  <td style="vertical-align: top;" width="40px"><button type="button" class="add_search"><?php 
    echo "+";
    ?>
</button></td>
                  <td>
                  <?php 
    if (array_key_exists($free_facet_name, $ordered_applied_facets)) {
        ?>
                      <?php 
        foreach ($ordered_applied_facets[$free_facet_name] as $facet_search_value) {
Esempio n. 2
0
            $url = SolrSearch_Helpers_Facet::addFacet("tag", $value);
            $taglist[] = '<a href="' . $url . '" class="facet-value">' . $value . '</a>';
            ?>
        <?php 
        }
        ?>
        <?php 
        echo join(", ", $taglist);
        ?>
        </div>
    <?php 
    }
    ?>
    <?php 
    if (!is_array($doc->tag)) {
        $url = SolrSearch_Helpers_Facet::addFacet("tag", $doc->tag);
        ?>
        <div class="tags"><p><strong><?php 
        echo __('Tags');
        ?>
:</strong>
        <a href="<?php 
        echo $url;
        ?>
" class="facet-value"><?php 
        echo $doc->tag;
        ?>
</a>
    <?php 
    }
    ?>
 public function testMakeUrlEncode()
 {
     $facets = array(array('49_s', 'Buildings, Cities & towns, Streets'));
     $this->assertEquals('/solr-search?q=&amp;facet=' . '49_s%3A%22Buildings%2C+Cities+%26+towns%2C+Streets%22', SolrSearch_Helpers_Facet::makeUrl($facets));
 }
 /**
  * Get a facet URL for use in XPath queries.
  *
  * @param string $field The field name.
  * @param string $value The facet value.
  * @param string The XPath-compliant URL.
  */
 protected function _getFacetLink($field, $value)
 {
     return htmlspecialchars_decode(SolrSearch_Helpers_Facet::addFacet($field, $value));
 }
Esempio n. 5
0
        ?>
</strong>

      <ul>
        <!-- Facets. -->
        <?php 
        foreach ($facets as $value => $count) {
            ?>
          <li class="<?php 
            echo $value;
            ?>
">

            <!-- Facet URL. -->
            <?php 
            $url = SolrSearch_Helpers_Facet::addFacet($name, $value);
            ?>

            <!-- Facet link. -->
            <a href="<?php 
            echo $url;
            ?>
" class="facet-value">
              <?php 
            echo $value;
            ?>
            </a>

            <!-- Facet count. -->
            (<span class="facet-count"><?php 
            echo $count;