summaryrefslogtreecommitdiffstats
path: root/search.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2005-09-08 18:02:12 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2005-09-08 18:02:12 +0000
commitbacb5b9a62c475d6583dd3cec87b169859a27335 (patch)
treec689672b42bd18d3ff344b1321158ed547fb563e /search.php
parent23fdc1659cf38e895e76a4f0b4767221db464bfa (diff)
downloadampache-bacb5b9a62c475d6583dd3cec87b169859a27335.tar.gz
ampache-bacb5b9a62c475d6583dd3cec87b169859a27335.tar.bz2
ampache-bacb5b9a62c475d6583dd3cec87b169859a27335.zip
new search mojo, only song object type current works...
Diffstat (limited to 'search.php')
-rw-r--r--search.php32
1 files changed, 30 insertions, 2 deletions
diff --git a/search.php b/search.php
index d3008248..a0bcd8f1 100644
--- a/search.php
+++ b/search.php
@@ -30,11 +30,39 @@ require_once("modules/init.php");
show_template('header');
show_menu_items('Search');
show_clear();
-show_template('show_search');
+
+/* Import/Clean vars */
+$action = scrub_in($_REQUEST['action']);
+
+switch ($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
+ */
+ $string_name = $_REQUEST['search_object'][0] . '_string';
+ $_REQUEST[$string_name] = $_REQUEST['search_string'];
+ unset($string_name);
+ case 'search':
+ show_template('show_search');
+ $results = run_search($_REQUEST);
+ show_search($_REQUEST['object_type'],$results);
+ break;
+ case 'save_as_track':
+ $playlist_id = save_search($_REQUEST);
+ $playlist = new Playlist($playlist_id);
+ show_confirmation("Search Saved","Your Search has been saved as a track in $playlist->name",conf('web_path') . "/search.php");
+ break;
+ default:
+ show_template('show_search');
+ break;
+}
if ($_REQUEST['action'] === 'search') {
run_search($_REQUEST['search_string'], $_REQUEST['search_field'], $_REQUEST['search_type']);
}
-echo "<br /><br />";
+
+
+show_clear();
show_page_footer ('Search', '',$user->prefs['display_menu']);
?>