Changeset 1318


Ignore:
Timestamp:
Sep 5, 2010, 1:38:17 AM (10 years ago)
Author:
teymour
Message:

Un peu plus de présentation

Location:
cpc/trunk/project/apps/frontend/modules/solr
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpc/trunk/project/apps/frontend/modules/solr/actions/actions.class.php

    r1317 r1318  
    9797    $params = array('hl'=>'true', 'fl' => 'id,object_id,object_name', 'hl.fragsize'=>500, "facet"=>"true", "facet.field"=>array("object_name","tag"), "facet.date" => "date", "facet.date.start"=>"2007-05-01T00:00:00Z", "facet.date.end"=>"NOW", "facet.date.gap"=>"+1MONTH", 'fq' => $fq);
    9898    $this->sort_type = 'pertinence';
    99     if ($request->getParameter('sort')) {
     99    if ($this->sort = $request->getParameter('sort')) {
    100100      $params['sort'] = "date desc";
    101101      $this->sort_type = 'date';
  • cpc/trunk/project/apps/frontend/modules/solr/templates/searchSuccess.php

    r1317 r1318  
    66  $url = "solr/search?query=".$query;
    77  foreach($args as $k => $v) {
    8     if (count($v))
    9       $extra .= '&'.$k.'='.implode(',', array_keys($v));
     8    if (is_array($v)) {
     9      if (count($v))
     10        $extra .= '&'.$k.'='.implode(',', array_keys($v));
     11    }    else
     12      $extra .= '&'.$k.'='.$v;
    1013  }
    1114  return link_to($text, $url.$extra);
     
    2427<div class="facets">
    2528<div class="tri">
    26 Tier par <a href="">date</a>
     29    <?php
     30    $newargs = $selected;
     31    if ($sort)
     32      echo link_search('Tier par pertinence', $query, $newargs);
     33    else {
     34      $newargs['sort'] = 1;
     35      echo link_search('Tier par date', $query, $newargs);
     36    }
     37?>
    2738</div>
    2839<?php   foreach(array_keys($facet) as $k) { if (isset($facet[$k]['values']) && count($facet[$k]['values'])) : ?>
Note: See TracChangeset for help on using the changeset viewer.