You are here

apachesolr_confgen_textfiles.module in Apache Solr Config Generator 7

Same filename and directory in other branches
  1. 6 apachesolr_confgen_textfiles/apachesolr_confgen_textfiles.module

@author Markus Kalkbrenner (mkalkbrenner) | bio.logis GmbH

File

apachesolr_confgen_textfiles/apachesolr_confgen_textfiles.module
View source
<?php

/**
 * @file
 *
 * @see apachesolr.module
 *
 * @author Markus Kalkbrenner (mkalkbrenner) | bio.logis GmbH
 *   @see http://drupal.org/user/124705
 */

/**
 * Implements hook_menu().
 */
function apachesolr_confgen_textfiles_menu() {
  $items = array();
  $items['admin/config/search/apachesolr/confgen/textfiles'] = array(
    'title' => 'Text Files',
    'weight' => 0,
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'apachesolr_confgen_textfile_settings_form',
    ),
    'file' => 'apachesolr_confgen_textfiles.admin.inc',
    'access arguments' => array(
      'administer search',
    ),
    'type' => MENU_LOCAL_TASK,
  );
  return $items;
}

/**
 * Implements hook_apachesolr_confgen_zip_file_alter().
 */
function apachesolr_confgen_textfiles_apachesolr_confgen_zip_file_alter(&$files, $solr_version) {
  $files['admin-extra.html'] = apachesolr_confgen_variable_get('apachesolr_confgen_textfiles_admin_extra_html');
  $files['compoundwords.txt'] = apachesolr_confgen_variable_get('apachesolr_confgen_textfiles_compoundwords_txt');
  $files['mapping-ISOLatin1Accent.txt'] = apachesolr_confgen_variable_get('apachesolr_confgen_textfiles_mapping_isolatin1accent_txt');
  $files['protwords.txt'] = apachesolr_confgen_variable_get('apachesolr_confgen_textfiles_protwords_txt');
  $files['stopwords.txt'] = apachesolr_confgen_variable_get('apachesolr_confgen_textfiles_stopwords_txt');
  $files['synonyms.txt'] = apachesolr_confgen_variable_get('apachesolr_confgen_textfiles_synonyms_txt');
}

/**
 * Implements hook_variable_update().
 */
function apachesolr_confgen_textfiles_variable_update($name, $value, $old_value, $options) {
  switch ($name) {
    case 'apachesolr_confgen_textfiles_admin_extra_html':
    case 'apachesolr_confgen_textfiles_mapping_isolatin1accent_txt':
    case 'apachesolr_confgen_textfiles_compoundwords_txt':
    case 'apachesolr_confgen_textfiles_protwords_txt':
    case 'apachesolr_confgen_textfiles_stopwords_txt':
    case 'apachesolr_confgen_textfiles_synonyms_txt':
      apachesolr_confgen_message_new_config($name, $value, $old_value, $options);
      break;
  }
}