diff options
author | Paul Arthur <flowerysong00@yahoo.com> | 2011-04-02 00:22:55 -0400 |
---|---|---|
committer | Paul Arthur <flowerysong00@yahoo.com> | 2011-04-02 00:48:58 -0400 |
commit | a9da6a6fa22325ba0dfecd4d46ae23305473796f (patch) | |
tree | acef914ee602bfeb3eed98f5f06e79603a6eb74f /search.php | |
parent | 91a6eb3a682667f49122fab5d807e8650c0d3959 (diff) | |
download | ampache-a9da6a6fa22325ba0dfecd4d46ae23305473796f.tar.gz ampache-a9da6a6fa22325ba0dfecd4d46ae23305473796f.tar.bz2 ampache-a9da6a6fa22325ba0dfecd4d46ae23305473796f.zip |
Reworked search
Still has tentacles and should have been integrated into the existing
API/Browse implementation better, but it's functional.
Diffstat (limited to 'search.php')
-rw-r--r-- | search.php | 20 |
1 files changed, 6 insertions, 14 deletions
@@ -39,24 +39,12 @@ 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'); + $results = Search::run($_REQUEST); + $browse->set_type($_REQUEST['type']); $browse->show_objects($results); $browse->store(); break; @@ -65,6 +53,10 @@ switch ($_REQUEST['action']) { $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; + case 'save_as_smartplaylist': + $playlist = new Search(); + $playlist->parse_rules(Search::clean_request($_REQUEST)); + $playlist->save(); default: require_once Config::get('prefix') . '/templates/show_search.inc.php'; break; |