function mv_helpers_auto_complete($val = null) { global $mvMetaDataHelpers, $wgRequest; $property = $wgRequest->getVal('prop_name'); switch ($property) { case 'smw_speech_by': return MV_SpecialMediaSearch::auto_complete_person($val); break; case 'smw_bill': return MV_SpecialMediaSearch::auto_complete_category('Bill', $val); break; case 'category': return MV_SpecialMediaSearch::auto_complete_search_categories($val); break; } }
function auto_complete_all($val) { global $wgContLang; // everything is db key based so swap space for underscore: $val = str_replace(' ', '_', $val); $catNStxt = $wgContLang->getNsText(NS_CATEGORY); // make sure people know they can "search" too (formated by $out = 'do_search|' . wfMsg('mv_search_transcripts_for', '<B>$1</B>') . '|no_image' . "\n"; // get keywords $category_out = MV_SpecialMediaSearch::auto_complete_search_categories($val, 3); if ($category_out != '') { $out .= $catNStxt . ':Categories|<h6>' . wfMsg('mv_category_matches') . '</h6>|no_image' . "\n"; $out .= $category_out; } // get people $person_out = MV_SpecialMediaSearch::auto_complete_person($val, 3); if ($person_out != '') { $out .= $catNStxt . ':Person|<h6>' . wfMsg('mv_people_matches') . '</h6>|no_image' . "\n"; $out .= $person_out; } // get bills $bill_out = MV_SpecialMediaSearch::auto_complete_category('Bill', $val, 3); if ($bill_out != '') { $out .= $catNStxt . ':Bill|<h6>' . wfMsg('mv_bill_matches') . '</h6>|no_image' . "\n"; $out .= $bill_out; } // get interests $intrest_out = MV_SpecialMediaSearch::auto_complete_category('Interest_Group', $val, 3); if ($intrest_out != '') { $out .= $catNStxt . ':Interest Group|<h6>' . wfMsg('mv_interest_group_matches') . '</h6>|no_image' . "\n"; $out .= $intrest_out; } return $out; }