$sql="SELECT t.tid FROM {vocabulary} v, {term_data} t LEFT JOIN {og_vocab} ov ON v.vid = ov.vid WHERE (v.module = 'og_vocab' AND ov.nid != %d) AND t.vid=v.vid";
$result=db_query($sql,$groupnode->nid);
while($row=db_fetch_object($result)){
$terms[$row->tid]=$row->tid;
}
}
// Rebuild form item -- copied from node.module
if(count($types)==1){
$type_keys=array_keys($types);
$form['advanced']['type']=array(
'#type'=>'hidden',
'#default_value'=>$type_keys[0],
);
}
else{
$form['advanced']['type']=array(
'#type'=>'checkboxes',
'#title'=>t('Only of the type(s)'),
'#prefix'=>'<div class="criterion">',
'#suffix'=>'</div>',
'#options'=>$types,
);
// FIXME: What about multiple hierarchy categories?
// FIXME: What about multiple hierarchy categories?
foreach($taxonomyas$vocab=>$term){
foreach($termas$k=>$v){
if(in_array($k,$terms)){
unset($taxonomy[$vocab][$k]);
}
}
}
// Taxonomy box:
$form['advanced']['category']=array(
'#type'=>'select',
...
...
@@ -122,11 +136,10 @@ function search_config_form_alter($form_id, &$form) {
'#options'=>$taxonomy,
'#multiple'=>TRUE,
);
}
}
}
break;
}
}
}
...
...
@@ -138,18 +151,33 @@ function search_config_search($op) {
case'admin':
$form['search_config']=array(
'#type'=>'fieldset',
'#title'=>t('Advanced search form configuration'),
'#title'=>t('Advanced search configuration'),
'#collapsible'=>TRUE,
'#collapsed'=>TRUE,
);
// Search results default tab
$description=t('Which tab on the search results will be presented by default. The standard Drupal installation defaults to node_search ("Content" tab). This option allows you to default to the "User" tab or any other tab from contributed search modules, e.g. Apachesolr which implements a tab called "Search" to display its results');
'#description'=>t('Node types that should not be index by the search module. Any node type set to not be indexed will also be removed from the search form. If you select all available node types to not be index then the search module will be rendered unusable as no nodes will be indexed.')
);
// If all node types are disabled then the search module is useless.
form_set_error('search_config_disable_index_type',t('You can not set all node types to be not indexed by the search module. Disable the search module if that is what you want.'));
form_set_error('search_config_disable_type',t('Search index node types do not match form node types. Please check the setting for %nodes.',array('%nodes'=>implode(', ',$node_errors))));
}
}
}
/**
* Implementation of hook_update_index()
*/
functionsearch_config_update_index(){
// This hook is only called when the search module is enabled
// The function_exists check can be removed, but there is no harm in leaving it in