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

Diff of /contributions/modules/luceneapi/luceneapi.module

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

revision 1.62, Sun Nov 15 19:22:13 2009 UTC revision 1.63, Mon Nov 16 03:14:34 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: luceneapi.module,v 1.61.2.113 2009/11/15 18:21:13 cpliakas Exp $  // $Id: luceneapi.module,v 1.62 2009/11/15 19:22:13 cpliakas Exp $
3    
4  /**  /**
5   * @defgroup luceneapi Search Lucene API   * @defgroup luceneapi Search Lucene API
# Line 123  function luceneapi_init() { Line 123  function luceneapi_init() {
123          luceneapi_permissions_get()          luceneapi_permissions_get()
124        );        );
125        $analyzer = luceneapi_setting_get('analyzer');        $analyzer = luceneapi_setting_get('analyzer');
   
       // @todo Remove from the 3.0 branch.  
       if (!class_exists($analyzer)) {  
         $analyzer = 'LuceneAPI_Search_Lucene_Analysis_Analyzer_Drupal';  
         drupal_set_message(t('Analyzer no longer valid, changing setting to default analyzer.'), 'warning');  
         variable_set('luceneapi:analyzer', $analyzer);  
       }  
   
126        Zend_Search_Lucene_Analysis_Analyzer::setDefault(new $analyzer());        Zend_Search_Lucene_Analysis_Analyzer::setDefault(new $analyzer());
127        Zend_Search_Lucene_Search_Query_Wildcard::setMinPrefixLength(0);        Zend_Search_Lucene_Search_Query_Wildcard::setMinPrefixLength(0);
128      }      }
# Line 235  function luceneapi_menu() { Line 227  function luceneapi_menu() {
227    );    );
228    
229    // builds menu items for each Search Lucene API module    // builds menu items for each Search Lucene API module
230    $files = module_rebuild_cache();    $files = system_rebuild_module_data();
231    foreach (luceneapi_module_list() as $module) {    foreach (luceneapi_module_list() as $module) {
232      $items['admin/settings/'. $module] = array(      $items['admin/settings/'. $module] = array(
233        'title' => '!name',        'title' => '!name',
# Line 405  function luceneapi_variable_get($module, Line 397  function luceneapi_variable_get($module,
397        case 'update_limit':        case 'update_limit':
398          $value = variable_get('search_cron_limit', 100);          $value = variable_get('search_cron_limit', 100);
399          break;          break;
   
       // NOTE: this is left over from when setting was a dropbox, and the value  
       // could be -1.  Although it is no longer needed, it doesn't hurt to keep  
       // it in because is could break someone's installation.  
       // @todo remove from the 3.0 branch  
       case 'resultset_limit':  
         $value = 0;  
         break;  
400      }      }
401    }    }
402    
# Line 1245  function luceneapi_form_alter(&$form, &$ Line 1229  function luceneapi_form_alter(&$form, &$
1229        $form['indexing_throttle']['search_cron_limit']['#options'][0] = t('Do not index');        $form['indexing_throttle']['search_cron_limit']['#options'][0] = t('Do not index');
1230      }      }
1231    }    }
   
   // hides the luceneapi_test module from the system modules form  
   // NOTE: simpletest hides it do to the "hidden" directive in the .info file  
   // @todo remove from D7 implementation, as this will not be necessary  
   if ('system_modules' == $form_id && !module_exists('simpletest')) {  
     foreach ($form['validation_modules']['#value'] as $filename => $file) {  
       if ('luceneapi_test' == $file->name) {  
         unset($form['name'][$filename]);  
         unset($form['version'][$filename]);  
         unset($form['description'][$filename]);  
         unset($form['status']['#options'][$filename]);  
         unset($form['throttle']['#options'][$filename]);  
         unset($form['validation_modules']['#value'][$filename]);  
       }  
     }  
   }  
1232  }  }
1233    
1234  /**  /**

Legend:
Removed from v.1.62  
changed lines
  Added in v.1.63

  ViewVC Help
Powered by ViewVC 1.1.2