/[drupal]/contributions/modules/apachesolr/apachesolr.module
ViewVC logotype

Diff of /contributions/modules/apachesolr/apachesolr.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1.2.12.2.155.2.39 by robertDouglass, Fri Nov 20 17:13:51 2009 UTC revision 1.1.2.12.2.155.2.40 by robertDouglass, Fri Nov 20 18:50:50 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: apachesolr.module,v 1.1.2.12.2.155.2.38 2009/11/20 14:27:08 robertDouglass Exp $  // $Id: apachesolr.module,v 1.1.2.12.2.155.2.39 2009/11/20 17:13:51 robertDouglass Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 843  function apachesolr_facet_block($respons Line 843  function apachesolr_facet_block($respons
843          $facet_text = $facet_callback($facet, $options);          $facet_text = $facet_callback($facet, $options);
844        }        }
845        // If this block is to be alphabetically sorted, change $sortpre.        // If this block is to be alphabetically sorted, change $sortpre.
846        if (isset($facet_query_sorts[$module][$delta]) && ($facet_query_sorts[$module][$delta] == 'index')) {        if (isset($facet_query_sorts[$module][$delta]) && ($facet_query_sorts[$module][$delta] != 'count')) {
847          $sortpre = $facet_text;          $sortpre = $facet_text;
848        }        }
849        $unclick_link = '';        $unclick_link = '';
# Line 868  function apachesolr_facet_block($respons Line 868  function apachesolr_facet_block($respons
868      }      }
869      // Unless a facet is active only display 2 or more.      // Unless a facet is active only display 2 or more.
870      if ($items && ($response->response->numFound > 1 || $contains_active)) {      if ($items && ($response->response->numFound > 1 || $contains_active)) {
871        ksort($items, SORT_STRING);        if (!isset($facet_query_sorts[$module][$delta]) || ($facet_query_sorts[$module][$delta] == 'index asc')) {
872            ksort($items, SORT_STRING);
873          }
874          else if ($facet_query_sorts[$module][$delta] == 'index desc') {
875            krsort($items, SORT_STRING);
876          }
877        // Get information needed by the rest of the blocks about limits.        // Get information needed by the rest of the blocks about limits.
878        $initial_limits = variable_get('apachesolr_facet_query_initial_limits', array());        $initial_limits = variable_get('apachesolr_facet_query_initial_limits', array());
879        $limit = isset($initial_limits[$module][$delta]) ? $initial_limits[$module][$delta] : variable_get('apachesolr_facet_query_initial_limit_default', 10);        $limit = isset($initial_limits[$module][$delta]) ? $initial_limits[$module][$delta] : variable_get('apachesolr_facet_query_initial_limit_default', 10);
# Line 1133  function apachesolr_facetcount_form($mod Line 1138  function apachesolr_facetcount_form($mod
1138      $form['apachesolr_facet_query_sort'] = array(      $form['apachesolr_facet_query_sort'] = array(
1139        '#type' => 'radios',        '#type' => 'radios',
1140        '#title' => t('Sort order of facet links'),        '#title' => t('Sort order of facet links'),
1141        '#options' => array('count' => t('Count'), 'index' => t('Alphanumeric')),        '#options' => array('count' => t('Count'), 'index asc' => t('Alphanumeric, ascending'), 'index desc' => t('Alphanumeric, descending')),
1142        '#description' => t('The sort order of facet links in this block. %Count, which is the default, will show facets with the most results first. %Alphanumeric will sort alphabetically, ascending.', array('%Count' => t('Count'), '%Alphanumeric' => t('Alphanumeric'))),        '#description' => t('The sort order of facet links in this block. %Count, which is the default, will show facets with the most results first. %Alphanumeric will sort alphabetically, either ascending or descending.', array('%Count' => t('Count'), '%Alphanumeric' => t('Alphanumeric'))),
1143        '#default_value' => isset($sorts[$module][$delta]) ? $sorts[$module][$delta] : 'count',        '#default_value' => isset($sorts[$module][$delta]) ? $sorts[$module][$delta] : 'count',
1144      );      );
1145    }    }

Legend:
Removed from v.1.1.2.12.2.155.2.39  
changed lines
  Added in v.1.1.2.12.2.155.2.40

  ViewVC Help
Powered by ViewVC 1.1.3