summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorPaul Arthur <flowerysong00@yahoo.com>2011-04-02 00:22:55 -0400
committerPaul Arthur <flowerysong00@yahoo.com>2011-04-02 00:48:58 -0400
commita9da6a6fa22325ba0dfecd4d46ae23305473796f (patch)
treeacef914ee602bfeb3eed98f5f06e79603a6eb74f /templates
parent91a6eb3a682667f49122fab5d807e8650c0d3959 (diff)
downloadampache-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 'templates')
-rw-r--r--templates/show_edit_smartplaylist_row.inc.php45
-rw-r--r--templates/show_edit_smartplaylist_title.inc.php43
-rw-r--r--templates/show_random.inc.php118
-rw-r--r--templates/show_random_rules.inc.php59
-rw-r--r--templates/show_rules.inc.php67
-rw-r--r--templates/show_search.inc.php145
-rw-r--r--templates/show_search_bar.inc.php17
-rw-r--r--templates/show_search_options.inc.php2
-rw-r--r--templates/show_smartplaylist.inc.php67
-rw-r--r--templates/show_smartplaylist_row.inc.php39
-rw-r--r--templates/show_smartplaylist_title.inc.php24
-rw-r--r--templates/show_smartplaylists.inc.php63
-rw-r--r--templates/sidebar_home.inc.php3
13 files changed, 444 insertions, 248 deletions
diff --git a/templates/show_edit_smartplaylist_row.inc.php b/templates/show_edit_smartplaylist_row.inc.php
new file mode 100644
index 00000000..fadd1bc7
--- /dev/null
+++ b/templates/show_edit_smartplaylist_row.inc.php
@@ -0,0 +1,45 @@
+<?php
+/* vim:set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab: */
+/*
+
+ Copyright (c) 2001 - 2007 Ampache.org
+ All rights reserved.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License v2
+ as published by the Free Software Foundation.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+*/
+?>
+<td colspan="6">
+<form method="post" id="edit_playlist_<?php echo $playlist->id; ?>" action="javascript:void(0);">
+<table cellpadding="0" cellspacing="0">
+<tr>
+ <td>
+ <input type="text" name="name" size="25" value="<?php echo scrub_out($playlist->name); ?>" />
+ </td>
+ <td>
+ <?php $name = 'select_' . $playlist->type; ${$name} = ' selected="selected"'; ?>
+ <select name="pl_type">
+ <option value="public"<?php echo $select_public; ?>><?php echo _('Public'); ?></option>
+ <option value="private"<?php echo $select_private; ?>><?php echo _('Private'); ?></option>
+ </select>
+ <td>
+ <input type="hidden" name="id" value="<?php echo $playlist->id; ?>" />
+ <input type="hidden" name="type" value="smartplaylist_row" />
+ <?php echo Ajax::button('?action=edit_object&id=' . $playlist->id . '&type=smartplaylist_row','download',_('Save Changes'),'save_playlist_' . $playlist->id,'edit_playlist_' . $playlist->id); ?>
+ </td>
+</tr>
+</table>
+</form>
+</td>
+
diff --git a/templates/show_edit_smartplaylist_title.inc.php b/templates/show_edit_smartplaylist_title.inc.php
new file mode 100644
index 00000000..e6451e66
--- /dev/null
+++ b/templates/show_edit_smartplaylist_title.inc.php
@@ -0,0 +1,43 @@
+<?php
+/* vim:set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab: */
+/*
+
+ Copyright (c) 2001 - 2007 Ampache.org
+ All rights reserved.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License v2
+ as published by the Free Software Foundation.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+*/
+?>
+<form method="post" id="edit_playlist_<?php echo $playlist->id; ?>" action="javascript:void(0);">
+<table cellpadding="0" cellspacing="0">
+<tr>
+ <td>
+ <input type="text" name="name" size="25" value="<?php echo scrub_out($playlist->name); ?>" />
+ </td>
+ <td>
+ <?php $name = 'select_' . $playlist->type; ${$name} = ' selected="selected"'; ?>
+ <select name="pl_type">
+ <option value="public"<?php echo $select_public; ?>><?php echo _('Public'); ?></option>
+ <option value="private"<?php echo $select_private; ?>><?php echo _('Private'); ?></option>
+ </select>
+ <td>
+ <input type="hidden" name="id" value="<?php echo $playlist->id; ?>" />
+ <input type="hidden" name="type" value="smartplaylist_title" />
+ <?php echo Ajax::button('?action=edit_object&id=' . $playlist->id . '&type=smartplaylist_title','download',_('Save Changes'),'save_playlist_' . $playlist->id,'edit_playlist_' . $playlist->id); ?>
+ </td>
+</tr>
+</table>
+</form>
+
diff --git a/templates/show_random.inc.php b/templates/show_random.inc.php
index 65815e5e..b1287ee8 100644
--- a/templates/show_random.inc.php
+++ b/templates/show_random.inc.php
@@ -33,80 +33,70 @@
?>
<?php show_box_top(_('Play Random Selection')); ?>
-<form id="random" method="post" enctype="multipart/form-data" action="<?php echo Config::get('web_path'); ?>/random.php?action=get_advanced">
-<table class="table-data" cellspacing="0" cellpadding="3">
+<form id="random" method="post" enctype="multipart/form-data" action="<?php echo Config::get('web_path'); ?>/random.php?action=get_advanced&type=<?php echo $_REQUEST['type'] ? scrub_out($_REQUEST['type']) : 'song'; ?>">
+<table class="tabledata" cellpadding="3" cellspacing="0">
<tr>
- <td><?php echo _('Item count'); ?></td>
- <td>
- <?php $name = 'random_' . scrub_in($_POST['random']); ${$name} = ' selected="selected"'; ?>
- <select name="random">
- <option value="1"<?php echo $random_1; ?>>1</option>
- <option value="5"<?php echo $random_5; ?>>5</option>
- <option value="10"<?php echo $random_10; ?>>10</option>
- <option value="20"<?php echo $random_20; ?>>20</option>
- <option value="30"<?php echo $random_30; ?>>30</option>
- <option value="50"<?php echo $random_50; ?>>50</option>
- <option value="100"<?php echo $random_100; ?>>100</option>
- <option value="500"<?php echo $random_500; ?>>500</option>
- <option value="1000"<?php echo $random_1000; ?>>1000</option>
- <option value="-1" ><?php echo _('All'); ?></option>
- </select>
- </td>
-</tr>
-<tr>
- <td><?php echo _('Length'); ?></td>
- <td>
- <?php $name = 'length_' . intval($_POST['length']); ${$name} = ' selected="selected"'; ?>
- <select name="length">
- <option value="0"<?php echo $length_0; ?>><?php echo _('Unlimited'); ?></option>
- <option value="15"<?php echo $length_15; ?>><?php printf(ngettext('%d minute','%d minutes',15), "15"); ?></option>
- <option value="30"<?php echo $length_30; ?>><?php printf(ngettext('%d minute','%d minutes',30), "30"); ?></option>
- <option value="60"<?php echo $length_60; ?>><?php printf(ngettext('%d hour','%d hours',1), "1"); ?></option>
- <option value="120"<?php echo $length_120; ?>><?php printf(ngettext('%d hour','%d hours',2), "2"); ?></option>
- <option value="240"<?php echo $length_240; ?>><?php printf(ngettext('%d hour','%d hours',4), "4"); ?></option>
- <option value="480"<?php echo $length_480; ?>><?php printf(ngettext('%d hour','%d hours',8), "8"); ?></option>
- <option value="960"<?php echo $length_960; ?>><?php printf(ngettext('%d hour','%d hours',16), "16"); ?></option>
- </select>
- </td>
+ <td><?php if ($_REQUEST['type'] != 'song') { ?><a href="<?php echo Config::get('web_path'); ?>/random.php?action=advanced&type=song"><?php echo _('Songs'); ?></a><?php } else { echo _('Songs'); } ?></td>
+ <td><?php if ($_REQUEST['type'] != 'album') { ?><a href="<?php echo Config::get('web_path'); ?>/random.php?action=advanced&type=album"><?php echo _('Albums'); ?></a><?php } else { echo _('Albums'); } ?></td>
+ <td><?php if ($_REQUEST['type'] != 'artist') { ?><a href="<?php echo Config::get('web_path'); ?>/random.php?action=advanced&type=artist"><?php echo _('Artists'); ?></a><?php } else { echo _('Artists'); } ?></td>
</tr>
+<tr><td>&nbsp;</td></tr>
+</table>
+<table class="tabledata" cellpadding="0" cellspacing="0">
<tr>
- <td><?php echo _('Type'); ?></td>
- <td>
- <?php $name = 'type_' . scrub_in($_POST['random_type']); ${$name} = ' selected="selected"'; ?>
- <select name="random_type">
- <option value="normal"<?php echo $type_normal; ?>><?php echo _('Standard'); ?></option>
- <option value="unplayed"<?php echo $type_unplayed; ?>><?php echo _('Less Played'); ?></option>
- <option value="full_album"<?php echo $type_full_album; ?>><?php echo _('Full Albums'); ?></option>
- <option value="full_artist"<?php echo $type_full_artist; ?>><?php echo _('Full Artist'); ?></option>
- <?php if (Config::get('ratings')) { ?>
- <option value="high_rating"<?php echo $type_high_rating; ?>><?php echo _('Highest Rated'); ?></option>
- <?php } ?>
- </select>
- </td>
+ <td><?php echo _('Item count'); ?></td>
+ <td>
+ <?php $name = 'random_' . scrub_in($_POST['random']); ${$name} = ' selected="selected"'; ?>
+ <select name="random">
+ <option value="1"<?php echo $random_1; ?>>1</option>
+ <option value="5"<?php echo $random_5; ?>>5</option>
+ <option value="10"<?php echo $random_10; ?>>10</option>
+ <option value="20"<?php echo $random_20; ?>>20</option>
+ <option value="30"<?php echo $random_30; ?>>30</option>
+ <option value="50"<?php echo $random_50; ?>>50</option>
+ <option value="100"<?php echo $random_100; ?>>100</option>
+ <option value="500"<?php echo $random_500; ?>>500</option>
+ <option value="1000"<?php echo $random_1000; ?>>1000</option>
+ <option value="-1" ><?php echo _('All'); ?></option>
+ </select>
+ </td>
</tr>
<tr>
- <td nowrap="nowrap"><?php echo _('From catalog'); ?></td>
- <td>
- <?php show_catalog_select('catalog','',$_POST['catalog']); ?>
- </td>
+ <td><?php echo _('Length'); ?></td>
+ <td>
+ <?php $name = 'length_' . intval($_POST['length']); ${$name} = ' selected="selected"'; ?>
+ <select name="length">
+ <option value="0"<?php echo $length_0; ?>><?php echo _('Unlimited'); ?></option>
+ <option value="15"<?php echo $length_15; ?>><?php printf(ngettext('%d minute','%d minutes',15), "15"); ?></option>
+ <option value="30"<?php echo $length_30; ?>><?php printf(ngettext('%d minute','%d minutes',30), "30"); ?></option>
+ <option value="60"<?php echo $length_60; ?>><?php printf(ngettext('%d hour','%d hours',1), "1"); ?></option>
+ <option value="120"<?php echo $length_120; ?>><?php printf(ngettext('%d hour','%d hours',2), "2"); ?></option>
+ <option value="240"<?php echo $length_240; ?>><?php printf(ngettext('%d hour','%d hours',4), "4"); ?></option>
+ <option value="480"<?php echo $length_480; ?>><?php printf(ngettext('%d hour','%d hours',8), "8"); ?></option>
+ <option value="960"<?php echo $length_960; ?>><?php printf(ngettext('%d hour','%d hours',16), "16"); ?></option>
+ </select>
+ </td>
</tr>
<tr>
- <td><?php echo _('Size Limit'); ?></td>
- <td>
- <?php $name = 'size_' . intval($_POST['size_limit']); ${$name} = ' selected="selected"'; ?>
- <select name="size_limit">
- <option value="0"<?php echo $size_0; ?>><?php echo _('Unlimited'); ?></option>
- <option value="64"<?php echo $size_64; ?>>64MB</option>
- <option value="128"<?php echo $size_128; ?>>128MB</option>
- <option value="256"<?php echo $size_256; ?>>256MB</option>
- <option value="512"<?php echo $size_512; ?>>512MB</option>
- <option value="1024"<?php echo $size_1024; ?>>1024MB</option>
- </select>
- </td>
+ <td><?php echo _('Size Limit'); ?></td>
+ <td>
+ <?php $name = 'size_' . intval($_POST['size_limit']); ${$name} = ' selected="selected"'; ?>
+ <select name="size_limit">
+ <option value="0"<?php echo $size_0; ?>><?php echo _('Unlimited'); ?></option>
+ <option value="64"<?php echo $size_64; ?>>64MB</option>
+ <option value="128"<?php echo $size_128; ?>>128MB</option>
+ <option value="256"<?php echo $size_256; ?>>256MB</option>
+ <option value="512"<?php echo $size_512; ?>>512MB</option>
+ <option value="1024"<?php echo $size_1024; ?>>1024MB</option>
+ </select>
+ </td>
</tr>
</table>
+
+<?php require Config::get('prefix') . '/templates/show_rules.inc.php'; ?>
+
<div class="formValidation">
- <input type="submit" value="<?php echo _('Enqueue'); ?>" />
+ <input type="submit" value="<?php echo _('Enqueue'); ?>" />
</div>
</form>
<?php show_box_bottom(); ?>
diff --git a/templates/show_random_rules.inc.php b/templates/show_random_rules.inc.php
deleted file mode 100644
index 45be357e..00000000
--- a/templates/show_random_rules.inc.php
+++ /dev/null
@@ -1,59 +0,0 @@
-<?php
-/* vim:set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab: */
-/**
- * Show Random Rules
- *
- * PHP version 5
- *
- * LICENSE: GNU General Public License, version 2 (GPLv2)
- * Copyright (c) 2001 - 2011 Ampache.org All Rights Reserved
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License v2
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * @category Template
- * @package Template
- * @author Karl Vollmer <vollmer@ampache.org>
- * @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
- */
-
-?>
-<?php show_box_top(_('Rules')); ?>
-<table class="tabledata" cellpadding="0" cellspacing="0">
-<colgroup>
- <col id="col_field" />
- <col id="col_operator" />
- <col id="col_value" />
- <col id="col_method" />
- <col id="col_action" />
-</colgroup>
-<tr class="th-top">
- <th class="col_field"><?php echo _('Field'); ?></th>
- <th class="col_operator"><?php echo _('Operator'); ?></th>
- <th class="col_value"><?php echo _('Value'); ?></th>
- <th class="col_method"><?php echo _('Method'); ?></th>
- <th class="col_action"><?php echo _('Action'); ?></th>
-</tr>
-<tr>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
-</tr>
-</table>
-<?php show_box_bottom(); ?>
diff --git a/templates/show_rules.inc.php b/templates/show_rules.inc.php
new file mode 100644
index 00000000..1f98e0ae
--- /dev/null
+++ b/templates/show_rules.inc.php
@@ -0,0 +1,67 @@
+<?php
+/* vim:set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab: */
+/*
+
+ Copyright (c) Ampache.org
+ All Rights Reserved
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License v2
+ as published by the Free Software Foundation.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+*/
+?>
+
+<script type="text/javascript" src="<?php echo Config::get('web_path'); ?>/lib/javascript/search.js"></script>
+<script type="text/javascript" src="<?php echo Config::get('web_path'); ?>/lib/javascript/search-data.php?type=<?php echo $_REQUEST['type'] ? scrub_out($_REQUEST['type']) : 'song'; ?>"></script>
+
+<?php show_box_top(_('Rules') . "..."); ?>
+<table class="tabledata" cellpadding="3" cellspacing="0">
+<tbody id="searchtable">
+ <tr>
+ <td><?php echo _('Match'); ?></td>
+ <td>
+ <select name="operator">
+ <option value="and" <?php if($_REQUEST['operator']=="and") echo "selected=\"selected\""?>><?php echo _('all rules'); ?></option>
+ <option value="or" <?php if($_REQUEST['operator']=="or") echo "selected=\"selected\""?>><?php echo _('any rule'); ?></option>
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <a id="addrowbutton" href="javascript:void(0)">
+ <?php echo get_user_icon('add'); ?>
+ <?php echo _('Add Another Rule'); ?>
+ </a>
+ <script type="text/javascript">Event.observe('addrowbutton', 'click', SearchRow.add);</script>
+ </td>
+ </tr>
+</tbody>
+</table>
+<?php show_box_bottom(); ?>
+
+<?php
+if ($playlist) {
+ $out = $playlist->to_js();
+}
+else {
+ $mysearch = new Search($_REQUEST['type']);
+ $mysearch->parse_rules(Search::clean_request($_REQUEST));
+ $out = $mysearch->to_js();
+}
+if ($out) {
+ echo $out;
+}
+else {
+ echo '<script type="text/javascript">SearchRow.add();</script>';
+}
+?>
diff --git a/templates/show_search.inc.php b/templates/show_search.inc.php
index 47c3085f..18992b16 100644
--- a/templates/show_search.inc.php
+++ b/templates/show_search.inc.php
@@ -37,130 +37,39 @@
*/
?>
<?php show_box_top(_('Search Ampache') . "..."); ?>
-<form name="search" method="post" action="<?php echo Config::get('web_path'); ?>/search.php" enctype="multipart/form-data" style="Display:inline">
+<form id="search" name="search" method="post" action="<?php echo Config::get('web_path'); ?>/search.php?type=<?php echo $_REQUEST['type'] ? scrub_out($_REQUEST['type']) : 'song'; ?>" enctype="multipart/form-data" style="Display:inline">
<table class="tabledata" cellpadding="3" cellspacing="0">
-<tr class="<?php echo flip_class(); ?>">
- <td><?php echo _('Keywords') ?></td>
+ <tr>
+ <td><?php if ($_REQUEST['type'] != 'song') { ?><a href="<?php echo Config::get('web_path'); ?>/search.php?type=song"><?php echo _('Songs'); ?></a><?php } else { echo _('Songs'); } ?></td>
+ <td><?php if ($_REQUEST['type'] != 'album') { ?><a href="<?php echo Config::get('web_path'); ?>/search.php?type=album"><?php echo _('Albums'); ?></a><?php } else { echo _('Albums'); } ?></td>
+ <td><?php if ($_REQUEST['type'] != 'artist') { ?><a href="<?php echo Config::get('web_path'); ?>/search.php?type=artist"><?php echo _('Artists'); ?></a><?php } else { echo _('Artists'); } ?></td>
+ <td><?php if ($_REQUEST['type'] != 'video') { ?><a href="<?php echo Config::get('web_path'); ?>/search.php?type=video"><?php echo _('Videos'); ?></a><?php } else { echo _('Videos'); } ?></td>
+ </tr>
+ <tr><td>&nbsp;</td></tr>
+</table>
+<table class="tabledata" cellpadding="3" cellspacing="0">
+ <tr>
+ <td><?php echo _('Maximum Results'); ?></td>
<td>
- <input type="text" id="s_all" name="s_all" value="<?php echo scrub_out($_REQUEST['s_all']); ?>"/>
+ <select name="limit">
+ <option value="0"><?php echo _('Unlimited'); ?></option>
+ <option value="25" <?php if($_REQUEST['limit']=="25") echo "selected=\"selected\""?>>25</option>
+ <option value="50" <?php if($_REQUEST['limit']=="50") echo "selected=\"selected\""?>>50</option>
+ <option value="100" <?php if($_REQUEST['limit']=="100") echo "selected=\"selected\""?>>100</option>
+ <option value="500" <?php if($_REQUEST['limit']=="500") echo "selected=\"selected\""?>>500</option>
+ </select>
</td>
- <td><?php echo _('Comment'); ?></td>
- <td>
- <input type="text" id="s_comment" name="s_comment" value="<?php echo scrub_out($_REQUEST['s_comment']); ?>" />
- </td>
-</tr>
-<tr class="<?php echo flip_class(); ?>">
- <td><?php echo _('Title'); ?></td>
- <td>
- <input type="text" id="s_title" name="s_title" value="<?php echo scrub_out($_REQUEST['s_title']); ?>" />
- </td>
- <td><?php echo _('Artist'); ?></td>
- <td>
- <input type="text" id="s_artist" name="s_artist" value="<?php echo scrub_out($_REQUEST['s_artist']); ?>" />
- </td>
-</tr>
-<tr class="<?php echo flip_class(); ?>">
- <td><?php echo _('Album'); ?></td>
- <td>
- <input type="text" id="s_album" name="s_album" value="<?php echo scrub_out($_REQUEST['s_album']); ?>" />
- </td>
- <td><?php echo _('Tag'); ?></td>
- <td>
- <input type="text" id="s_tag" name="s_tag" value="<?php echo scrub_out($_REQUEST['s_tag']); ?>" />
- </td>
-</tr>
-<tr class="<?php echo flip_class(); ?>">
- <td><?php echo _('Year'); ?></td>
- <td>
- <input type="text" id="s_year" name="s_year" size="5" value="<?php echo scrub_out($_REQUEST['s_year']); ?>" />
- -
- <input type="text" id="s_year2" name="s_year2" size="5" value="<?php echo scrub_out($_REQUEST['s_year2']); ?>" />
- </td>
- <td><?php echo _('Filename'); ?></td>
- <td>
- <input type="text" id="s_filename" name="s_filename" value="<?php echo scrub_out($_REQUEST['s_filename']); ?>" />
- </td>
-</tr>
-<tr class="<?php echo flip_class(); ?>">
- <td><?php echo _('Time'); ?></td>
- <td>
- <input type="text" id="s_time" name="s_time" size="3" value="<?php echo scrub_out($_REQUEST['s_time']); ?>" />
- -
- <input type="text" id="s_time2" name="s_time2" size="3" value="<?php echo scrub_out($_REQUEST['s_time2']); ?>" />
- <?php echo _('minutes'); ?>
- </td>
- <td><?php echo _('Codec'); ?></td>
- <td>
- <input type="text" id="s_codec" name="s_codec" size="5" value="<?php echo scrub_out($_REQUEST['s_codec']); ?>" />
- </td>
-</tr>
-<tr class="<?php echo flip_class(); ?>">
- <td><?php echo _('Played'); ?></td>
- <td>
- <select id="s_played" name="s_played" >
- <option value="">&nbsp;</option>
- <option value="1" <?php if($_REQUEST['s_played']=="1") echo "selected=\"selected\""?>><?php echo _('Yes'); ?></option>
- <option value="0" <?php if($_REQUEST['s_played']=="0") echo "selected=\"selected\""?>><?php echo _('No'); ?></option>
- </select>
- </td>
- <td><?php echo _('Min Bitrate'); ?></td>
- <td>
- <select id="s_minbitrate" name="s_minbitrate" >
- <option value="">&nbsp;</option>
- <?php foreach(array(32,40,48,56,64,80,96,112,128,160,192,224,256,320) as $val) { ?>
- <option value="<?php echo $val?>" <?php if($_REQUEST['s_minbitrate']==$val) echo "selected=\"selected\""?>><?php echo $val?></option>
- <?php } ?>
- </select>
- </td>
-</tr>
-<tr class="<?php echo flip_class(); ?>">
- <td><?php echo _('Rating'); ?></td>
- <td>
- <select id="s_rating_operator" name="s_rating_operator">
- <option value="0" <?php if($_REQUEST['s_rating_operator']=="0") echo "selected=\"selected\""?>><?php echo _('>='); ?></option>
- <option value="1" <?php if($_REQUEST['s_rating_operator']=="1") echo "selected=\"selected\""?>><?php echo _('<='); ?></option>
- <option value="2" <?php if($_REQUEST['s_rating_operator']=="2") echo "selected=\"selected\""?>><?php echo _('='); ?></option>
- </select>
- <select id="s_rating" name="s_rating">
- <option value="">&nbsp;</option>
- <option value="1" <?php if($_REQUEST['s_rating']=="1") echo "selected=\"selected\""?>><?php echo _('One Star'); ?></option>
- <option value="2" <?php if($_REQUEST['s_rating']=="2") echo "selected=\"selected\""?>><?php echo _('Two Stars'); ?></option>
- <option value="3" <?php if($_REQUEST['s_rating']=="3") echo "selected=\"selected\""?>><?php echo _('Three Stars'); ?></option>
- <option value="4" <?php if($_REQUEST['s_rating']=="4") echo "selected=\"selected\""?>><?php echo _('Four Stars'); ?></option>
- <option value="5" <?php if($_REQUEST['s_rating']=="5") echo "selected=\"selected\""?>><?php echo _('Five Stars'); ?></option>
- </select>
- </td>
- <td><?php echo _('Operator'); ?></td>
- <td>
- <select name="operator">
- <option value="and" <?php if($_REQUEST['operator']=="and") echo "selected=\"selected\""?>><?php echo _('AND'); ?></option>
- <option value="or" <?php if($_REQUEST['operator']=="or") echo "selected=\"selected\""?>><?php echo _('OR'); ?></option>
- </select>
- </td>
-</tr>
-<tr class="<?php echo flip_class(); ?>">
- <td><?php echo _('Method'); ?></td>
- <td>
- <select name="method">
- <option value="fuzzy" <?php if($_REQUEST['method']=="fuzzy") echo "selected=\"selected\""?>><?php echo _('Fuzzy'); ?></option>
- <option value="exact" <?php if($_REQUEST['method']=="exact") echo "selected=\"selected\""?>><?php echo _('Exact'); ?></option>
- </select>
- </td>
- <td><?php echo _('Maximum Results'); ?></td>
- <td>
- <select name="limit">
- <option value="0"><?php echo _('Unlimited'); ?></option>
- <option value="25" <?php if($_REQUEST['limit']=="25") echo "selected=\"selected\""?>>25</option>
- <option value="50" <?php if($_REQUEST['limit']=="50") echo "selected=\"selected\""?>>50</option>
- <option value="100" <?php if($_REQUEST['limit']=="100") echo "selected=\"selected\""?>>100</option>
- <option value="500" <?php if($_REQUEST['limit']=="500") echo "selected=\"selected\""?>>500</option>
- </select>
- </td>
-</tr>
+ </tr>
</table>
+
+<?php require Config::get('prefix') . '/templates/show_rules.inc.php'; ?>
+
<div class="formValidation">
<input class="button" type="submit" value="<?php echo _('Search'); ?>" />&nbsp;&nbsp;
- <input type="hidden" name="action" value="search" />
+<?php if ($_REQUEST['type'] == 'song' || ! $_REQUEST['type']) { ?>
+ <input id="savesearchbutton" class="button" type="submit" value="<?php echo _('Save as Smart Playlist'); ?>" onClick="$('hiddenaction').setValue('save_as_smartplaylist');" />&nbsp;&nbsp;
+<?php } ?>
+ <input type="hidden" id="hiddenaction" name="action" value="search" />
</div>
</form>
<?php show_box_bottom(); ?>
diff --git a/templates/show_search_bar.inc.php b/templates/show_search_bar.inc.php
index 486ad9fe..b5bb4f4f 100644
--- a/templates/show_search_bar.inc.php
+++ b/templates/show_search_bar.inc.php
@@ -33,13 +33,20 @@
?>
<div id="sb_Subsearch">
- <form name="search" method="post" action="<?php echo $web_path; ?>/search.php" enctype="multipart/form-data" style="Display:inline">
- <input type="text" name="search_string" id="searchString"/>
- <input type="hidden" name="action" value="quick_search" />
- <input type="hidden" name="method" value="fuzzy" />
+ <form name="search" method="post" action="<?php echo $web_path; ?>/search.php?type=song" enctype="multipart/form-data" style="Display:inline">
+ <input type="text" name="rule_1_input" id="searchString"/>
+ <input type="hidden" name="action" value="search" />
+ <input type="hidden" name="rule_1_operator" value="0" />
<input type="hidden" name="object_type" value="song" />
+ <select name="rule_1">
+ <option value="anywhere"><?php echo _('Anywhere')?></option>
+ <option value="title"><?php echo _('Title')?></option>
+ <option value="album"><?php echo _('Album')?></option>
+ <option value="artist"><?php echo _('Artist')?></option>
+ <option value="tag"><?php echo _('Tag')?></option>
+ </select>
<input class="button" type="submit" value="<?php echo _('Search'); ?>" id="searchBtn" />
- <a href="<?php echo $web_path; ?>/search.php" class="button" id="advSearchBtn"><?php echo _('Advanced Search'); ?></a>
+ <a href="<?php echo $web_path; ?>/search.php?type=song" class="button" id="advSearchBtn"><?php echo _('Advanced Search'); ?></a>
</form>
</div>
diff --git a/templates/show_search_options.inc.php b/templates/show_search_options.inc.php
index dad9d733..1d890767 100644
--- a/templates/show_search_options.inc.php
+++ b/templates/show_search_options.inc.php
@@ -40,7 +40,7 @@
</li>
<?php if (Access::check_function('batch_download')) { ?>
<li>
- <a href="<?php echo Config::get('web_path'); ?>/batch.php?action=browse&browse_id=<?php echo $browse->id; ?>"><?php echo get_user_icon('batch_download', _('Batch Download')); ?></a>
+ <a href="<?php echo Config::get('web_path'); ?>/batch.php?action=browse&amp;type=<?php echo scrub_out($_REQUEST['type']); ?>&amp;browse_id=<?php echo $browse->id; ?>"><?php echo get_user_icon('batch_download', _('Batch Download')); ?></a>
<?php echo _('Batch Download'); ?>
</li>
<?php } ?>
diff --git a/templates/show_smartplaylist.inc.php b/templates/show_smartplaylist.inc.php
new file mode 100644
index 00000000..4c276ffd
--- /dev/null
+++ b/templates/show_smartplaylist.inc.php
@@ -0,0 +1,67 @@
+<?php
+/* vim:set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab: */
+/*
+ Copyright (c) Ampache.org
+ All rights reserved.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License v2
+ as published by the Free Software Foundation.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+*/
+?>
+<?php
+ob_start();
+require Config::get('prefix') . '/templates/show_smartplaylist_title.inc.php';
+$title = ob_get_contents();
+ob_end_clean();
+show_box_top('<div id="playlist_row_' . $playlist->id . '">' . $title .
+ '</div>');
+?>
+<div id="information_actions">
+<ul>
+ <?php if (Access::check_function('batch_download')) { ?>
+ <li>
+ <a href="<?php echo Config::get('web_path'); ?>/batch.php?action=search&amp;id=<?php echo $playlist->id; ?>"><?php echo get_user_icon('batch_download', _('Batch Download')); ?></a>
+ <?php echo _('Batch Download'); ?>
+ </li>
+ <?php } ?>
+ <li>
+ <?php echo Ajax::button('?action=basket&type=smartplaylist&id=' . $playlist->id,'add',_('Add All'),'play_playlist'); ?>
+ <?php echo _('Add All'); ?>
+ </li>
+ <?php if ($playlist->has_access()) { ?>
+ <li>
+ <?php echo Ajax::button('?action=show_edit_object&type=smartplaylist_title&id=' . $playlist->id,'edit',_('Edit'),'edit_playlist_' . $playlist->id); ?>
+ <?php echo _('Edit'); ?>
+ </li>
+ <li>
+ <a href="<?php echo Config::get('web_path'); ?>/smartplaylist.php?action=delete_playlist&playlist_id=<?php echo $playlist->id; ?>">
+ <?php echo get_user_icon('delete'); ?>
+ </a>
+ <?php echo _('Delete'); ?>
+ </li>
+ <?php } ?>
+</ul>
+</div>
+
+<form id="editplaylist" name="editplaylist" method="post" action="<?php echo Config::get('web_path'); ?>/smartplaylist.php?action=update_playlist&playlist_id=<?php echo $playlist->id; ?>" enctype="multipart/form-data" style="Display:inline">
+
+<?php require Config::get('prefix') . '/templates/show_rules.inc.php'; ?>
+
+<div class="formValidation">
+ <input class="button" type="submit" value="<?php echo _('Save Changes'); ?>" />
+</div>
+
+</form>
+
+<?php show_box_bottom(); ?>
diff --git a/templates/show_smartplaylist_row.inc.php b/templates/show_smartplaylist_row.inc.php
new file mode 100644
index 00000000..bf1f43f0
--- /dev/null
+++ b/templates/show_smartplaylist_row.inc.php
@@ -0,0 +1,39 @@
+<?php
+/* vim:set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab: */
+/*
+
+ Copyright (c) 2001 - 2007 Ampache.org
+ All rights reserved.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License v2
+ as published by the Free Software Foundation.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+*/
+?>
+<td class="cel_add">
+ <?php echo Ajax::button('?action=basket&type=smartplaylist&id=' . $playlist->id,'add',_('Add'),'add_playlist_' . $playlist->id); ?>
+</td>
+<td class="cel_playlist"><?php echo $playlist->f_link; ?></td>
+<td class="cel_type"><?php echo $playlist->f_type; ?></td>
+<td class="cel_owner"><?php echo scrub_out($playlist->f_user); ?></td>
+<td class="cel_action">
+ <?php if (Access::check_function('batch_download')) { ?>
+ <a href="<?php echo Config::get('web_path'); ?>/batch.php?action=smartplaylist&amp;id=<?php echo $playlist->id; ?>">
+ <?php echo get_user_icon('batch_download',_('Batch Download')); ?>
+ </a>
+ <?php } ?>
+ <?php if ($playlist->has_access()) { ?>
+ <?php echo Ajax::button('?action=show_edit_object&type=smartplaylist_row&id=' . $playlist->id,'edit',_('Edit'),'edit_playlist_' . $playlist->id); ?>
+ <?php echo Ajax::button('?page=browse&action=delete_object&type=smartplaylist&id=' . $playlist->id,'delete',_('Delete'),'delete_playlist_' . $playlist->id); ?>
+ <?php } ?>
+</td>
diff --git a/templates/show_smartplaylist_title.inc.php b/templates/show_smartplaylist_title.inc.php
new file mode 100644
index 00000000..8691ac98
--- /dev/null
+++ b/templates/show_smartplaylist_title.inc.php
@@ -0,0 +1,24 @@
+<?php
+/* vim:set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab: */
+/*
+
+ Copyright (c) 2001 - 2007 Ampache.org
+ All rights reserved.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License v2
+ as published by the Free Software Foundation.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+*/
+?>
+
+<?php echo sprintf(_('%s %s (Smart Playlist)'), $playlist->f_type, $playlist->name); ?>
diff --git a/templates/show_smartplaylists.inc.php b/templates/show_smartplaylists.inc.php
new file mode 100644
index 00000000..2c891884
--- /dev/null
+++ b/templates/show_smartplaylists.inc.php
@@ -0,0 +1,63 @@
+<?php
+/* vim:set tabstop=8 softtabstop=8 shiftwidth=8 noexpandtab: */
+/*
+
+ Copyright (c) Ampache.org
+ All rights reserved.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License
+ as published by the Free Software Foundation; either version 2
+ of the License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+*/
+?>
+<?php require Config::get('prefix') . '/templates/list_header.inc.php' ?>
+<table class="tabledata" cellpadding="0" cellspacing="0">
+<colgroup>
+ <col id="col_add" />
+ <col id="col_playlist" />
+ <col id="col_type" />
+ <col id="col_songs" />
+ <col id="col_owner" />
+ <col id="col_action" />
+</colgroup>
+<tr class="th-top">
+ <th class="cel_add"><?php echo _('Add'); ?></th>
+ <th class="cel_playlist"><?php echo Ajax::text('?page=browse&action=set_sort&type=smartplaylist&sort=name',_('Playlist Name'),'playlist_sort_name'); ?></th>
+ <th class="cel_type">&nbsp;</th>
+ <th class="cel_owner"><?php echo Ajax::text('?page=browse&action=set_sort&type=smartplaylist&sort=user',_('Owner'),'playlist_sort_owner'); ?></th>
+ <th class="cel_action"><?php echo _('Actions'); ?></th>
+</tr>
+<?php
+foreach ($object_ids as $playlist_id) {
+ $playlist = new Search('song', $playlist_id);
+ $playlist->format();
+?>
+<tr class="<?php echo flip_class(); ?>" id="playlist_row_<?php echo $playlist->id; ?>">
+ <?php require Config::get('prefix') . '/templates/show_smartplaylist_row.inc.php'; ?>
+</tr>
+<?php } // end foreach ($playlists as $playlist) ?>
+<?php if (!count($object_ids)) { ?>
+<tr class="<?php echo flip_class(); ?>">
+ <td colspan="6"><span class="fatalerror"><?php echo _('Not Enough Data'); ?></span></td>
+</tr>
+<?php } ?>
+<tr class="th-bottom">
+ <th class="cel_add"><?php echo _('Add'); ?></th>
+ <th class="cel_playlist"><?php echo Ajax::text('?page=browse&action=set_sort&type=playlist&sort=name',_('Playlist Name'),'playlist_sort_name_bottom'); ?></th>
+ <th class="cel_type">&nbsp;</th>
+ <th class="cel_owner"><?php echo Ajax::text('?page=browse&action=set_sort&type=playlist&sort=user',_('Owner'),'playlist_sort_owner_bottom'); ?></th>
+ <th class="cel_action"><?php echo _('Actions'); ?></th>
+</tr>
+</table>
+<?php require Config::get('prefix') . '/templates/list_header.inc.php' ?>
diff --git a/templates/sidebar_home.inc.php b/templates/sidebar_home.inc.php
index b0fb642a..4b97abd5 100644
--- a/templates/sidebar_home.inc.php
+++ b/templates/sidebar_home.inc.php
@@ -48,6 +48,7 @@ $ajax_info = Config::get('ajax_url'); $web_path = Config::get('web_path');
<li id="sb_browse_bb_Artist"><a href="<?php echo $web_path; ?>/browse.php?action=artist"><?php echo _('Artists'); ?></a></li>
<li id="sb_browse_bb_Tags"><a href="<?php echo $web_path; ?>/browse.php?action=tag"><?php echo _('Tag Cloud'); ?></a></li>
<li id="sb_browse_bb_Playlist"><a href="<?php echo $web_path; ?>/browse.php?action=playlist"><?php echo _('Playlists'); ?></a></li>
+ <li id="sb_browse_bb_SmartPlaylist"><a href="<?php echo $web_path; ?>/browse.php?action=smartplaylist"><?php echo _('Smart Playlists'); ?></a></li>
<li id="sb_browse_bb_RadioStation"><a href="<?php echo $web_path; ?>/browse.php?action=live_stream"><?php echo _('Radio Stations'); ?></a></li>
<li id="sb_browse_bb_Video"><a href="<?php echo $web_path; ?>/browse.php?action=video"><?php echo _('Videos'); ?></a></li>
</ul>
@@ -77,7 +78,7 @@ $ajax_info = Config::get('ajax_url'); $web_path = Config::get('web_path');
<li id="sb_home_random_album"><?php echo Ajax::text('?page=random&action=album',_('Album'),'home_random_album'); ?></li>
<li id="sb_home_random_artist"><?php echo Ajax::text('?page=random&action=artist',_('Artist'),'home_random_artist'); ?></li>
<li id="sb_home_random_playlist"><?php echo Ajax::text('?page=random&action=playlist',_('Playlist'),'home_random_playlist'); ?></li>
- <li id="sb_home_random_advanced"><a href="<?php echo $web_path; ?>/random.php?action=advanced"><?php echo _('Advanced'); ?></a></li>
+ <li id="sb_home_random_advanced"><a href="<?php echo $web_path; ?>/random.php?action=advanced&type=song"><?php echo _('Advanced'); ?></a></li>
</ul>
</li>
<li><h4><?php echo _('Information'); ?></h4>