You are here

function apachesolr_confgen_message_new_config in Apache Solr Config Generator 6

Same name and namespace in other branches
  1. 7 apachesolr_confgen.module \apachesolr_confgen_message_new_config()

Shows a hint to the user to use the new configurations

1 call to apachesolr_confgen_message_new_config()
apachesolr_confgen_textfiles_variable_update in apachesolr_confgen_textfiles/apachesolr_confgen_textfiles.module
Implements hook_variable_update().

File

./apachesolr_confgen.module, line 115
Generator for Apache Solr Configuration Files.

Code

function apachesolr_confgen_message_new_config($name, $value, $old_value, $options) {
  static $msg_sent = FALSE;
  if (!$msg_sent) {
    if ($value != $old_value) {
      $info = variable_info($name);
      if (is_null($info)) {

        // ignore for now
        // drupal_set_message(t('Error: Unknown variable @varname.', array('@varname' => $name)), 'error');
      }
      else {
        drupal_set_message(t('Changing "%title" will require you to !link_download a new set of configuration files, update your Solr configuration, restart your Solr server and !link_delete the index.', array(
          '%title' => $info['title'] . (array_key_exists('key', $options) ? ' (' . $options['key'] . ')' : ''),
          '!link_download' => l(t('download'), 'admin/settings/apachesolr/confgen'),
          '!link_delete' => l(t('delete'), 'admin/config/search/apachesolr'),
        )), 'warning');
        $msg_sent = TRUE;
      }
    }
  }
}