You are here

function custom_search_update_6103 in Custom Search 6

File

./custom_search.install, line 109
Install, update, and uninstall functions for the custom search module.

Code

function custom_search_update_6103() {
  $ret = array();
  if (variable_get('custom_search_results_advanced_override', FALSE)) {
    variable_set('custom_search_advanced_or_display', variable_get('custom_search_criteria_or_display', FALSE));
    variable_set('custom_search_advanced_phrase_display', variable_get('custom_search_criteria_phrase_display', FALSE));
    variable_set('custom_search_advanced_negative_display', variable_get('custom_search_criteria_negative_display', FALSE));
    $types = array_keys(array_filter(variable_get('custom_search_node_types', array())));
    if (count($types)) {
      $names = array_keys(node_get_types('names'));
      foreach ($names as $name) {
        if (!in_array($name, $types)) {
          variable_set('custom_search_advanced_type_' . $name . '_display', FALSE);
        }
      }
    }
    $vocabularies = taxonomy_get_vocabularies();
    foreach ($vocabularies as $voc) {
      if (variable_get('custom_search_voc' . $voc->vid . '_selector', 'disabled') == 'disabled') {
        variable_set('custom_search_advanced_voc' . $voc->vid . '_display', FALSE);
      }
    }
  }
  variable_del('custom_search_results_advanced_override');
  return $ret;
}