diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2005-09-08 18:02:12 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2005-09-08 18:02:12 +0000 |
commit | bacb5b9a62c475d6583dd3cec87b169859a27335 (patch) | |
tree | c689672b42bd18d3ff344b1321158ed547fb563e /templates | |
parent | 23fdc1659cf38e895e76a4f0b4767221db464bfa (diff) | |
download | ampache-bacb5b9a62c475d6583dd3cec87b169859a27335.tar.gz ampache-bacb5b9a62c475d6583dd3cec87b169859a27335.tar.bz2 ampache-bacb5b9a62c475d6583dd3cec87b169859a27335.zip |
new search mojo, only song object type current works...
Diffstat (limited to 'templates')
-rw-r--r-- | templates/show_search.inc | 113 | ||||
-rw-r--r-- | templates/show_search_bar.inc | 42 | ||||
-rw-r--r-- | templates/show_songs.inc | 20 |
3 files changed, 133 insertions, 42 deletions
diff --git a/templates/show_search.inc b/templates/show_search.inc index 26d202bc..5b783668 100644 --- a/templates/show_search.inc +++ b/templates/show_search.inc @@ -21,13 +21,115 @@ */ -/*! - @header search template - @discussion This is the template for the searches... amazing! +/** + * search template + * This is the template for the searches... amazing! + * @package Search + * @catagory Display + */ +?> -*/ +<form name="search" method="post" action="<?php echo conf('web_path'); ?>/search.php" enctype="multipart/form-data" style="Display:inline"> +<table class="tabledata" cellspacing="0" cellpadding="3" border="0"> +<tr class="table-header"> + <th colspan="4"><?php echo _("Search Ampache"); ?>...</th +</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');" /> + <input type="textbox" id="title_string" name="title_string" value="<?php echo scrub_out($_REQUEST['title_string']); ?>" disabled="disabled" /> + </td> + <td><?php echo _("Artist"); ?></td> + <td> + <input type="checkbox" name="search_object[]" value="artist" onclick="flipField('artist_string');" /> + <input type="textbox" id="artist_string" name="artist_string" value="<?Php echo scrub_out($_REQUEST['artist_string']); ?>" disabled="disabled" /> + </td> +</tr> +<tr class="<?php echo flip_class(); ?>"> + <td><?php echo _("Album"); ?></td> + <td> + <input type="checkbox" name="search_object[]" value="album" onclick="flipField('album_string');" /> + <input type="textbox" id="album_string" name="album_string" value="<?php echo scrub_out($_REQUEST['album_string']); ?>" disabled="disabled" /> + </td> + <td><?php echo _("Genre"); ?></td> + <td> + <input type="checkbox" name="search_object[]" value="genre" onclick="flipField('genre_string');" /> + <input type="textbox" id="genre_string" name="genre_string" value="<?php echo scrub_out($_REQUEST['genre_string']); ?>" disabled="disabled" /> + </td> +</tr> +<tr class="<?php echo flip_class(); ?>"> + <td><?php echo _("Year"); ?></td> + <td> + <input type="checkbox" name="search_object[]" value="year" onclick="flipField('year_string');" /> + <input type="textbox" id="year_string" name="year_string" value="<?php echo scrub_out($_REQUEST['year_string']); ?>" disabled="disabled" /> + </td> + <td><?php echo _("Filename"); ?></td> + <td> + <input type="checkbox" name="search_object[]" value="filename" onclick="flipField('filename_string');" /> + <input type="textbox" id="filename_string" name="filename_string" value="<?php echo scrub_out($_REQUEST['filename_string']); ?>" disabled="disabled" /> + </td> +</tr> +<tr class="<?php echo flip_class(); ?>"> + <td><?php echo _("Played"); ?></td> + <td> + <input type="checkbox" name="search_object[]" value="played" onclick="flipField('played_string');" /> + <select id="played_string" name="played_string" disabled="disabled"> + <option value="1"><?php echo _("Yes"); ?></option> + <option value="0"><?php echo _("No"); ?></option> + </select> + </td> + <td><?php echo _("Min Bitrate"); ?></td> + <td> + <input type="checkbox" name="search_object[]" value="minbitrate" onclick="flipField('minbitrate_string');" /> + <select id="minbitrate_string" name="minbitrate_string" disabled="disabled"> + <option value="32">32</option> + <option value="40">40</option> + <option value="48">48</option> + <option value="56">56</option> + <option value="64">64</option> + <option value="80">80</option> + <option value="96">96</option> + <option value="112">112</option> + <option value="128">128</option> + <option value="160">160</option> + <option value="192">192</option> + <option value="224">224</option> + <option value="256">256</option> + <option value="320">320</option> + </select> + </td> +</tr> +<tr class="<?php echo flip_class(); ?>"> + <td><?php echo _("Object Type"); ?>:</td> + <td> + <select name="object_type"> + <option value="song"><?php echo _("Songs"); ?></option> + <option value="album"><?php echo _("Albums"); ?></option> + <option value="artist"><?php echo _("Artists"); ?></option> + <option value="genre"><?php echo _("Genres"); ?></option> + </select> + </td> + <td><?php echo _("Method"); ?>:</td> + <td> + <select name="method"> + <option value="fuzzy"><?php echo _("Fuzzy"); ?></option> + <option value="exact"><?php echo _("Exact"); ?></option> + </select> + </td> +</tr> +<tr class="<?php echo flip_class(); ?>"> + <td> </td> + <td> + <input type="submit" value="<?php echo _("Search"); ; ?>" /> + <input type="reset" value="Reset Form" /> + <input type="hidden" name="action" value="search" /> + </td> + <td colspan="2"> </td> +</tr> +</table> -?> +<!-- OLD SKOOL <form name="search" method="post" action="<?php echo conf('web_path'); ?>/search.php" enctype="multipart/form-data" style="Display:inline"> <table class="tabledata" cellspacing="0" cellpadding="3" border="0" width="450" style="clear:both;"> <tr class="table-header"> @@ -87,3 +189,4 @@ </tr> </table> </form> +--> diff --git a/templates/show_search_bar.inc b/templates/show_search_bar.inc index 9b2e61f6..3429e0a0 100644 --- a/templates/show_search_bar.inc +++ b/templates/show_search_bar.inc @@ -30,7 +30,7 @@ */ ?> -<form name="search" method="post" action="<?php echo conf('web_path'); ?>/search.php" enctype="multipart/form-data" style="Display:inline"> +<form name="search" method="post" action="<?php echo conf('web_path'); ?>/search.php" enctype="multipart/form-data" style="Display:inline"> <table class="tabledata" cellspacing="0" cellpadding="3" border="0" style="clear:both;" width="100%"> <tr class="table-header"> <td colspan="4"><b><?php echo _("Search Ampache"); ?>...</b></td> @@ -38,39 +38,21 @@ <tr class="<?php echo flip_class(); ?>"> <td><input type="text" name="search_string" value="<?php echo $_REQUEST['search_string']; ?>" /></td> <td> - <?php - $search_type = $_REQUEST['search_field']; - if (isset($_REQUEST['search_field'])) { - $search_field = $_REQUEST['search_field']; - ${$search_field} = 1; - } else { - $search_field = conf('search_field'); - ${$search_field} = 1; - } - - if (isset($_REQUEST['search_type'])) { - $search_type = $_REQUEST['search_type']; - ${$search_type} = 1; - } else { - $search_type = conf('search_type'); - ${$search_type} = 1; - } - ?> - <select name="search_field"> - <option value="artist" <?php if ($artist) { echo 'selected="selected"'; } ?>>Artist</option> - <option value="album" <?php if ($album) { echo 'selected="selected"'; } ?>>Album</option> - <option value="song_title" <?php if ($song_title) { echo 'selected="selected"'; } ?>>Song Title</option> - <option value="song_genre" <?php if ($song_genre) { echo 'selected="selected"'; } ?>>Song Genre</option> - <option value="song_year" <?php if ($song_year) { echo 'selected="selected"'; } ?>>Song Year</option> - <option value="song_bitrate" <?php if ($song_bitrate) { echo 'selected="selected"'; } ?>>Song Bitrate</option> - <option value="song_min_bitrate" <?php if ($song_min_bitrate) { echo 'selected="selected"'; } ?>>Minimum Bitrate</option> - <option value="song_filename" <?php if ($song_filename) { echo 'selected="selected"'; } ?>>Song Filename</option> + <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> </td> <td> <input class="button" type="submit" value="<?php echo _("Search"); ; ?>" /> - <input type="hidden" name="action" value="search" /> - <input type="hidden" name="search_type" value="fuzzy" /> + <input type="hidden" name="action" value="quick_search" /> + <input type="hidden" name="method" value="fuzzy" /> + <input type="hidden" name="object_type" value="song" /> </td> </tr> </table> diff --git a/templates/show_songs.inc b/templates/show_songs.inc index 0702a157..127b8cde 100644 --- a/templates/show_songs.inc +++ b/templates/show_songs.inc @@ -20,9 +20,9 @@ */ $web_path = conf('web_path'); -?> - +show_clear(); +?> <form name="songs" method="post" enctype="multipart/form-data" action="#"> <table border="0"> <tr><td colspan="2"> @@ -42,12 +42,18 @@ $web_path = conf('web_path'); <th><?php echo _("Action"); ?></th> </tr> <?php - foreach ($song_ids as $song_id) { - - unset($text_class); - $song = new Song($song_id); - $song->format_song(); + /* FIXME: don't even get me started with how many things are wrong with this code */ + foreach ($song_ids as $song_id) { + + if (!is_object($song_id)) { + unset($text_class); + $song = new Song($song_id); + } + else { + $song = $song_id; + } + $song->format_song(); // Still needed crap $totalsize += $song->size; $totaltime += $song->time; |