* @copyright 2001 - 2011 Ampache.org * @license http://opensource.org/licenses/gpl-2.0 GPLv2 * @version PHP 5.2 * @link http://www.ampache.org/ * @since File available since Release 1.0 */ require_once 'lib/init.php'; show_header(); /** * action switch */ switch ($_REQUEST['action']) { case 'quick_search': /* This needs to be done because we don't know what thing * they used the quick search to search on until after they've * submited it */ $_REQUEST['s_all'] = $_REQUEST['search_string']; if (strlen($_REQUEST['search_string']) < 1) { Error::add('keyword',_('Error: No Keyword Entered')); require_once Config::get('prefix') . '/templates/show_search.inc.php'; break; } case 'search': $browse = new Browse(); require_once Config::get('prefix') . '/templates/show_search.inc.php'; require_once Config::get('prefix') . '/templates/show_search_options.inc.php'; $results = run_search($_REQUEST); $browse->set_type('song'); $browse->show_objects($results); $browse->store(); break; case 'save_as_track': $playlist_id = save_search($_REQUEST); $playlist = new Playlist($playlist_id); show_confirmation(_('Search Saved'),sprintf(_('Your Search has been saved as a track in %s'), $playlist->name),conf('web_path') . "/search.php"); break; default: require_once Config::get('prefix') . '/templates/show_search.inc.php'; break; case 'descriptor': // This is a little special we don't want header/footers so trash what we've got in the OB ob_clean(); require_once Config::get('prefix') . '/templates/show_search_descriptor.inc.php'; exit; break; } /* Show the Footer */ show_footer(); ?>