You are here

apachesolr_confgen_textfiles.module in Apache Solr Config Generator 6

Same filename and directory in other branches
  1. 7 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/settings/apachesolr/confgen/textfiles'] = array(
    'title' => 'Text Files',
    'weight' => 0,
    'page callback' => 'drupal_get_form',
    // see https://drupal.org/node/1737126
    'page arguments' => array(
      'variable_module_form',
      'apachesolr_confgen_textfiles',
    ),
    '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;
  }
}