summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorChris Slamar <chris@slamar.org>2011-01-24 19:25:01 -0600
committerChris Slamar <chris@slamar.org>2011-01-24 19:25:01 -0600
commit4910d13fa4623246db810347def57106dd85c9a9 (patch)
tree7b57a3c13f70572cde82bd343967dff33b331ae2 /templates
parentfc355baf6764ffb87b74002b3a4419a63dab34b1 (diff)
downloadampache-4910d13fa4623246db810347def57106dd85c9a9.tar.gz
ampache-4910d13fa4623246db810347def57106dd85c9a9.tar.bz2
ampache-4910d13fa4623246db810347def57106dd85c9a9.zip
Catalog Filtering Added Bug#60
Diffstat (limited to 'templates')
-rw-r--r--templates/browse_filters.inc.php29
-rw-r--r--templates/show_artists.inc.php3
-rw-r--r--templates/show_now_playing.inc.php3
3 files changed, 31 insertions, 4 deletions
diff --git a/templates/browse_filters.inc.php b/templates/browse_filters.inc.php
index c902cd1b..1c3b8e15 100644
--- a/templates/browse_filters.inc.php
+++ b/templates/browse_filters.inc.php
@@ -19,6 +19,7 @@
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+session_start();
$ajax_info = Config::get('ajax_url'); $web_path = Config::get('web_path');
?>
<?php $allowed_filters = Browse::get_allowed_filters($browse->get_type()); ?>
@@ -27,7 +28,7 @@ $ajax_info = Config::get('ajax_url'); $web_path = Config::get('web_path');
<?php if (in_array('starts_with',$allowed_filters)) { ?>
<form id="multi_alpha_filter_form" method="post" action="javascript:void(0);">
<label id="multi_alpha_filterLabel" for="multi_alpha_filter"><?php echo _('Starts With'); ?></label>
- <input type="text" id="multi_alpha_filter" name="multi_alpha_filter" value="<?php echo scrub_out($browse->get_filter('starts_with')); ?>" onKeyUp="delayRun(this, '400', 'ajaxState', '<?php echo $ajax_info; ?>?page=browse&action=browse&browse_id=<?php echo $browse->id; ?>&key=starts_with', 'multi_alpha_filter');">
+ <input type="text" id="multi_alpha_filter" name="multi_alpha_filter" value="<?php $browse->set_catalog($_SESSION['catalog']); echo scrub_out($browse->get_filter('starts_with'));?>" onKeyUp="delayRun(this, '400', 'ajaxState', '<?php echo $ajax_info; ?>?page=browse&action=browse&browse_id=<?php echo $browse->id; ?>&key=starts_with', 'multi_alpha_filter');">
</form>
<?php } // end if alpha_match ?>
<?php if (in_array('minimum_count',$allowed_filters)) { ?>
@@ -66,5 +67,31 @@ $ajax_info = Config::get('ajax_url'); $web_path = Config::get('web_path');
<label id="typeArtistLabel" for="typeArtistRadio"><?php echo _('Artist'); ?></label><br />
<?php echo Ajax::observe('typeArtistRadio','click',Ajax::action('?page=tag&action=browse_type&browse_id=' . $browse->id . '&type=artist','')); ?>
<?php } ?>
+
+<?php if(in_array('catalog',$allowed_filters)) { ?>
+<form method="post" id="catalog_choice" action="javascript.void(0);">
+ <label id="catalogLabel" for="catalog_select"><?php echo _('Catalog'); ?></label><br />
+ <select id="catalog_select" name="catalog_key">
+ <option value="0">All</option>
+ <?php
+ $sql = 'SELECT `id`,`name` FROM `catalog`';
+ $db_results = Dba::read($sql);
+ while( $data = Dba::fetch_assoc($db_results) ) {
+ $results[] = $data;
+ }
+
+ foreach( $results as $entries ) {
+ echo '<option value="' . $entries['id'];
+ if( $_SESSION['catalog'] == $entries['id'] ) {
+ echo ' selected="selected" ';
+ }
+ echo '">' . $entries['name'] . '</options>';
+ }
+ ?>
+
+ </select>
+<?php echo Ajax::observe('catalog_select','click',Ajax::action('?page=browse&action=browse&browse_id=' . $browse->id,'catalog_select','catalog_choice'),'1'); ?>
+</form>
+<?php } ?>
</div>
</li>
diff --git a/templates/show_artists.inc.php b/templates/show_artists.inc.php
index 85c079b8..9b197ba6 100644
--- a/templates/show_artists.inc.php
+++ b/templates/show_artists.inc.php
@@ -18,6 +18,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
+session_start();
$web_path = Config::get('web_path');
@@ -49,7 +50,7 @@ if (Config::get('ratings')) { Rating::build_cache('artist',$object_ids); }
/* Foreach through every artist that has been passed to us */
foreach ($object_ids as $artist_id) {
- $artist = new Artist($artist_id);
+ $artist = new Artist($artist_id, $_SESSION['catalog']);
$artist->format();
?>
<tr id="artist_<?php echo $artist->id; ?>" class="<?php echo flip_class(); ?>">
diff --git a/templates/show_now_playing.inc.php b/templates/show_now_playing.inc.php
index ef5d7d96..05b3f828 100644
--- a/templates/show_now_playing.inc.php
+++ b/templates/show_now_playing.inc.php
@@ -30,9 +30,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
if (count($results)) {
$link = Config::get('use_rss') ? ' ' . AmpacheRSS::get_display('nowplaying') : '';
-$twitter = Config::get('twitter') ? ' ' . '<a href="' . Config::get('web_path') . '/modules/twitter/twitter_login.php"><img src="' . Config::get('web_path') . '/modules/twitter/Twitter-Icon.png" alt="Tweet Your Now Playing!" width="18" height="18"></a>' : '';
?>
-<?php show_box_top(_('Now Playing') . $link . $twitter ); ?>
+<?php show_box_top(_('Now Playing') . $link); ?>
<?php
foreach ($results as $item) {
$media = $item['media'];