93c93
<       if (module_exists('taxonomy')) {
---
>     if ($taxonomy = module_invoke('taxonomy', 'form_all', 1)) {
95c95
<         if (!user_access('search by category')) {
---
>       if (variable_get('search_config_disable_category_all', 0) || !user_access('search by category')) {
99,100c99
<           
< 		  $terms = variable_get('search_config_setting_category', array());
---
>         $terms = variable_get('search_config_disable_category', array());
112,113d111
< 	      if (variable_get('search_config_setting_category_all', "exclude") == "exclude") { 
< 		      $taxonomy = module_invoke('taxonomy', 'form_all', 1);
125,132d122
< 	      } else {
< 	      	$taxonomy = array();	
<             foreach ($terms as $k => $v) {
< 	          $term = taxonomy_get_term($v);
< 	          $vocab = taxonomy_vocabulary_load($term->vid);
< 	     	  $taxonomy[$vocab->name][$term->tid] = $term->name;
<             }
< 	      }
231,236c221,224
<         $form['search_config']['category']['search_config_setting_category_all'] = array(
<           '#type' => 'radios',
<           '#options' => array('include'=>t('Include'),'exclude'=>t('Exclude')),
<           '#title' => t('Use inclusion or exclusion mode'),
<           '#default_value' => variable_get('search_config_setting_category_all', "exclude"),
<           '#description' => t('Choose the way of disabling/enabling search on selected categories (see below). Use Exclude to disable search on selected categories. Use Include if you want to use search only on selected categories.')
---
>         $form['search_config']['category']['search_config_disable_category_all'] = array(
>           '#type' => 'checkbox',
>           '#title' => t('Disable category search'),
>           '#default_value' => variable_get('search_config_disable_category_all', 0)
239c227
<         $form['search_config']['category']['search_config_setting_category'] = array(
---
>         $form['search_config']['category']['search_config_disable_category'] = array(
245,246c233,234
<           '#default_value' => variable_get('search_config_setting_category', array()),
<           '#description' => t('Enable or disable searching by the selected categories')
---
>           '#default_value' => variable_get('search_config_disable_category', array()),
>           '#description' => t('Disable searching by the selected categories')
