summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2005-12-18 09:30:39 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2005-12-18 09:30:39 +0000
commit64df5b62139b5bb247c9e902b3838985b3ab4c1d (patch)
tree7681db7f02e698a8c6bfa5a1587aa77e1d83c7ba /templates
parent0154f3736070c0847c5912dca88954b6bebe6001 (diff)
downloadampache-64df5b62139b5bb247c9e902b3838985b3ab4c1d.tar.gz
ampache-64df5b62139b5bb247c9e902b3838985b3ab4c1d.tar.bz2
ampache-64df5b62139b5bb247c9e902b3838985b3ab4c1d.zip
added keyword search and fixes up search a bunch thx rubin
Diffstat (limited to 'templates')
-rw-r--r--templates/header.inc5
-rw-r--r--templates/show_search.inc17
-rw-r--r--templates/show_search_bar.inc10
3 files changed, 23 insertions, 9 deletions
diff --git a/templates/header.inc b/templates/header.inc
index 996a17f9..d5b64b45 100644
--- a/templates/header.inc
+++ b/templates/header.inc
@@ -55,6 +55,11 @@ function flipField(element) {
element_id.disabled=false;
}
}
+function selectField(element)
+{
+ var element_id = document.getElementById(element);
+ element_id.focus();
+}
var checkflag_song = "false";
function check_songs() {
diff --git a/templates/show_search.inc b/templates/show_search.inc
index 2cdd9488..8d254fac 100644
--- a/templates/show_search.inc
+++ b/templates/show_search.inc
@@ -22,11 +22,20 @@
/* Setup the needed variables that check the correct boxes */
$final_javascript = "<script type=\"text/javascript\" language=\"javascript\">\n<!-- Begin \n";
+$i = 0;
foreach ($_REQUEST['search_object'] as $key) {
$name = "check_" . $key;
$field_name = $key . "_string";
${$name} = "checked=\"checked\"";
$final_javascript .= "flipField('$field_name'); \n";
+ if($i++ == 0) /* Focus the first checked field */
+ $final_javascript .= "selectField('$field_name'); \n";
+}
+if($i == 0) /* Select the artist/title/album one by default */
+{
+ $final_javascript .= "flipField('all_string'); \n";
+ $final_javascript .= "selectField('all_string'); \n";
+ $check_all = "checked=\"checked\"";
}
$final_javascript .= " // END-->\n </script>";
@@ -45,6 +54,14 @@ $final_javascript .= " // END-->\n </script>";
<th colspan="4"><?php echo _("Search Ampache"); ?>...</th>
</tr>
<tr class="<?php echo flip_class(); ?>">
+ <td><?php echo _("Keywords") ?></td>
+ <td>
+ <input type="checkbox" name="search_object[]" value="all" onclick="flipField('all_string');" <?php echo $check_all; ?> />
+ <input type="text" id="all_string" name="all_string" value="<?php echo scrub_out($_REQUEST['all_string']); ?>" disabled="disabled" />
+ <td></td>
+ <td></td>
+</tr>
+<tr class="<?php echo flip_class(); ?>">
<td><?php echo _("Title"); ?></td>
<td>
<input type="checkbox" name="search_object[]" value="title" onclick="flipField('title_string');" <?php echo $check_title; ?> />
diff --git a/templates/show_search_bar.inc b/templates/show_search_bar.inc
index 24a4473c..a1d0c92a 100644
--- a/templates/show_search_bar.inc
+++ b/templates/show_search_bar.inc
@@ -38,19 +38,11 @@
<tr class="<?php echo flip_class(); ?>">
<td><input type="text" name="search_string" value="<?php echo $_REQUEST['search_string']; ?>" /></td>
<td>
- <select name="search_object[]">
- <option value="title"><?php echo _("Song Title"); ?></option>
- <option value="artist"><?php echo _("Artist"); ?></option>
- <option value="album"><?php echo _("Album"); ?></option>
- <option value="genre"><?php echo _("Song Genre"); ?></option>
- <option value="year"><?php echo _("Song Year"); ?></option>
- <option value="minbitrate"><?php echo _("Minimum Bitrate"); ?></option>
- <option value="filename"><?php echo _("Filename"); ?></option>
- </select>
<input class="button" type="submit" value="<?php echo _("Search"); ; ?>" />&nbsp;&nbsp;
<input type="hidden" name="action" value="quick_search" />
<input type="hidden" name="method" value="fuzzy" />
<input type="hidden" name="object_type" value="song" />
+ <input type="hidden" name="search_object[]" value="all" />
</td>
</tr>
</table>