diff options
author | Paul 'flowerysong' Arthur <flowerysong00@yahoo.com> | 2010-06-10 05:33:57 +0000 |
---|---|---|
committer | Paul 'flowerysong' Arthur <flowerysong00@yahoo.com> | 2010-06-10 05:33:57 +0000 |
commit | 7f3669335313adf9108119df4186a51a5f94e292 (patch) | |
tree | f8b488a09df2198723de5661b050bc31e112b7ab /templates | |
parent | c1ed41a16dcbf1a632ad2ac99b40174628bf072e (diff) | |
download | ampache-7f3669335313adf9108119df4186a51a5f94e292.tar.gz ampache-7f3669335313adf9108119df4186a51a5f94e292.tar.bz2 ampache-7f3669335313adf9108119df4186a51a5f94e292.zip |
Change Browse from static to instantiable. Among other things, fixes FS#13;
probably also breaks things. Most things appear to still work, but I may have
missed some cases.
Diffstat (limited to 'templates')
-rw-r--r-- | templates/browse_filters.inc.php | 70 | ||||
-rw-r--r-- | templates/list_header.inc.php | 15 | ||||
-rw-r--r-- | templates/show_album.inc.php | 14 | ||||
-rw-r--r-- | templates/show_album_row.inc.php | 2 | ||||
-rw-r--r-- | templates/show_albums.inc.php | 16 | ||||
-rw-r--r-- | templates/show_artist.inc.php | 11 | ||||
-rw-r--r-- | templates/show_index.inc.php | 2 | ||||
-rw-r--r-- | templates/show_manage_catalogs.inc.php | 11 | ||||
-rw-r--r-- | templates/show_now_playing_row.inc.php | 2 | ||||
-rw-r--r-- | templates/show_playlist.inc.php | 10 | ||||
-rw-r--r-- | templates/show_random.inc.php | 9 | ||||
-rw-r--r-- | templates/show_random_albums.inc.php | 2 | ||||
-rw-r--r-- | templates/show_search_options.inc.php | 4 | ||||
-rw-r--r-- | templates/show_songs.inc.php | 10 | ||||
-rw-r--r-- | templates/sidebar_home.inc.php | 49 |
15 files changed, 130 insertions, 97 deletions
diff --git a/templates/browse_filters.inc.php b/templates/browse_filters.inc.php new file mode 100644 index 00000000..c8c65a14 --- /dev/null +++ b/templates/browse_filters.inc.php @@ -0,0 +1,70 @@ +<?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. + +*/ +$ajax_info = Config::get('ajax_url'); $web_path = Config::get('web_path'); +?> +<?php $allowed_filters = Browse::get_allowed_filters($browse->get_type()); ?> +<li><h4><?php echo _('Filters'); ?></h4> +<div class="sb3"> +<?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');"> +</form> +<?php } // end if alpha_match ?> +<?php if (in_array('minimum_count',$allowed_filters)) { ?> + <input id="mincountCB" type="checkbox" value="1" /> + <label id="mincountLabel" for="mincountCB"><?php echo _('Minimum Count'); ?></label><br /> + <?php echo Ajax::observe('mincountCB', 'click', Ajax::action('?page=browse&action=browse&browse_id=' . $browse->id . '&key=min_count&value=1', '')); ?> +<?php } ?> +<?php if (in_array('rated',$allowed_filters)) { ?> + <input id="ratedCB" type="checkbox" value="1" /> + <label id="ratedLabel" for="ratedCB"><?php echo _('Rated'); ?></label><br /> + <?php echo Ajax::observe('ratedCB', 'click', Ajax::action('?page=browse&action=browse&browse_id=' . $browse->id . '&key=rated&value=1', '')); ?> +<?php } ?> +<?php if (in_array('unplayed',$allowed_filters)) { ?> + <input id="unplayedCB" type="checkbox" <?php echo $string = $browse->get_filter('unplayed') ? 'checked="checked"' : ''; ?>/> + <label id="unplayedLabel" for="unplayedCB"><?php echo _('Unplayed'); ?></label><br /> +<?php } ?> +<?php if (in_array('show_art',$allowed_filters)) { ?> + <input id="show_artCB" type="checkbox" <?php echo $string = $browse->get_filter('show_art') ? 'checked="checked"' : ''; ?>/> + <label id="show_artLabel" for="show_artCB"><?php echo _('Show Art'); ?></label><br /> + <?php echo Ajax::observe('show_artCB','click',Ajax::action('?page=browse&action=show_art&browse_id=' . $browse->id, '')); ?> +<?php } // if show_art ?> +<?php if (in_array('playlist_type',$allowed_filters)) { ?> + <input id="show_allplCB" type="checkbox" <?php echo $string = $browse->get_filter('playlist_type') ? 'checked="checked"' : ''; ?>/> + <label id="show_allplLabel" for="showallplCB"><?php echo _('All Playlists'); ?></label><br /> + <?php echo Ajax::observe('show_allplCB','click',Ajax::action('?page=browse&action=browse&browse_id=' . $browse->id . '&key=playlist_type&value=1','')); ?> +<?php } // if playlist_type ?> +<?php if (in_array('object_type',$allowed_filters)) { ?> + <?php $string = 'otype_' . $browse->get_filter('object_type'); ${$string} = 'selected="selected"'; ?> + <input id="typeSongRadio" type="radio" name="object_type" value="1" <?php echo $otype_song; ?>/> + <label id="typeSongLabel" for="typeSongRadio"><?php echo _('Song Title'); ?></label><br /> + <?php echo Ajax::observe('typeSongRadio','click',Ajax::action('?page=tag&action=browse_type&browse_id=' . $browse->id . '&type=song','')); ?> + <input id="typeAlbumRadio" type="radio" name="object_type" value="1" /> + <label id="typeAlbumLabel" for="typeAlbumRadio"><?php echo _('Albums'); ?></label><br /> + <?php echo Ajax::observe('typeAlbumRadio','click',Ajax::action('?page=tag&action=browse_type&browse_id=' . $browse->id . '&type=album','')); ?> + <input id="typeArtistRadio" type="radio" name="object_type" value="1" /> + <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 } ?> +</div> +</li> diff --git a/templates/list_header.inc.php b/templates/list_header.inc.php index f9ddb842..b4e36dcd 100644 --- a/templates/list_header.inc.php +++ b/templates/list_header.inc.php @@ -28,9 +28,9 @@ */ // Pull these variables out to allow shorthand (easier for lazy programmers) -$limit = Config::get('offset_limit') ? Config::get('offset_limit') : '25'; -$start = Browse::get_start(); -$total = Browse::$total_objects; +$limit = $browse->get_offset(); +$start = $browse->get_start(); +$total = $browse->get_total(); $uid = Config::get('list_header_uid'); $sides = 5; @@ -91,15 +91,14 @@ while ($page <= $pages) { // Sort These Arrays of Hotness ksort($page_data['up']); ksort($page_data['down']); -$browse_type = Browse::get_type(); // are there enough items to even need this view? if ($pages > 1) { ?> <div class="list-header"> - <?php echo Ajax::text('?page=browse&action=page&type=' . $browse_type . '&start=' . $prev_offset,_('Prev'),'browse_' . $uid . 'prev','','prev'); ?> - <?php echo Ajax::text('?page=browse&action=page&type=' . $browse_type . '&start=' . $next_offset,_('Next'),'browse_' . $uid . 'next','','next'); ?> + <?php echo Ajax::text('?page=browse&action=page&browse_id=' . $browse->id . '&start=' . $prev_offset,_('Prev'),'browse_' . $uid . 'prev','','prev'); ?> + <?php echo Ajax::text('?page=browse&action=page&browse_id=' . $browse->id . '&start=' . $next_offset,_('Next'),'browse_' . $uid . 'next','','next'); ?> <?php /* Echo Everything below us */ foreach ($page_data['down'] as $page => $offset) { @@ -107,7 +106,7 @@ if ($pages > 1) { else { // Hack Alert $page++; - echo Ajax::text('?page=browse&action=page&type=' . $browse_type .'&start=' . $offset,$page,'browse_' . $uid . 'page_' . $page,'','page-nb'); + echo Ajax::text('?page=browse&action=page&browse_id=' . $browse->id . '&start=' . $offset,$page,'browse_' . $uid . 'page_' . $page,'','page-nb'); } } // end foreach down @@ -121,7 +120,7 @@ if ($pages > 1) { foreach ($page_data['up'] as $page=>$offset) { if ($offset === '...') { echo '... '; } else { - echo Ajax::text('?page=browse&action=page&type=' . $browse_type . '&start=' . $offset,$page,'browse_' . $uid . 'page_' . $page,'','page-nb'); + echo Ajax::text('?page=browse&action=page&browse_id=' . $browse->id . '&start=' . $offset,$page,'browse_' . $uid . 'page_' . $page,'','page-nb'); } // end else } // end foreach up ?> diff --git a/templates/show_album.inc.php b/templates/show_album.inc.php index b3774bc9..928ffbb3 100644 --- a/templates/show_album.inc.php +++ b/templates/show_album.inc.php @@ -85,10 +85,12 @@ $title = scrub_out($album->name) . ' (' . $album->year . ')' . $disk .'&nb </div> <?php - Browse::set_type('song'); - Browse::set_simple_browse(1); - Browse::set_filter('album', $album->id); - Browse::set_sort('track','ASC'); - Browse::get_objects(); - Browse::show_objects(); + $browse = new Browse(); + $browse->set_type('song'); + $browse->set_simple_browse(true); + $browse->set_filter('album', $album->id); + $browse->set_sort('track', 'ASC'); + $browse->get_objects(); + $browse->show_objects(); + $browse->store(); ?> diff --git a/templates/show_album_row.inc.php b/templates/show_album_row.inc.php index a413b6ae..efbcba09 100644 --- a/templates/show_album_row.inc.php +++ b/templates/show_album_row.inc.php @@ -25,7 +25,7 @@ <?php echo Ajax::button('?action=basket&type=album_random&id=' . $album->id,'random',_('Random'),'random_album_' . $album->id); ?> </td> <?php -if (Browse::is_enabled('show_art')) { +if (Art::is_enabled()) { $name = '[' . $album->f_artist . '] ' . scrub_out($album->full_name); ?> <td class="cel_cover"> diff --git a/templates/show_albums.inc.php b/templates/show_albums.inc.php index 2496c11e..a99e2793 100644 --- a/templates/show_albums.inc.php +++ b/templates/show_albums.inc.php @@ -26,7 +26,7 @@ $ajax_url = Config::get('ajax_url'); <table class="tabledata" cellpadding="0" cellspacing="0"> <colgroup> <col id="col_add" /> -<?php if (Browse::is_enabled('show_art')) { ?> +<?php if (Art::is_enabled()) { ?> <col id="col_cover" /> <?php } ?> <col id="col_album" /> @@ -39,13 +39,13 @@ $ajax_url = Config::get('ajax_url'); </colgroup> <tr class="th-top"> <th class="cel_add"><?php echo _('Add'); ?></th> - <?php if (Browse::is_enabled('show_art')) { ?> + <?php if (Art::is_enabled()) { ?> <th class="cel_cover"><?php echo _('Cover'); ?></th> <?php } ?> - <th class="cel_album"><?php echo Ajax::text('?page=browse&action=set_sort&type=album&sort=name',_('Album'),'album_sort_name'); ?></th> - <th class="cel_artist"><?php echo Ajax::text('?page=browse&action=set_sort&type=album&sort=artist',_('Artist'),'album_sort_artist'); ?></th> + <th class="cel_album"><?php echo Ajax::text('?page=browse&action=set_sort&browse_id=' . $browse->id . '&sort=name',_('Album'),'album_sort_name'); ?></th> + <th class="cel_artist"><?php echo Ajax::text('?page=browse&action=set_sort&browse_id=' . $browse->id . '&sort=artist',_('Artist'),'album_sort_artist'); ?></th> <th class="cel_songs"><?php echo _('Songs'); ?></th> - <th class="cel_year"><?php echo Ajax::text('?page=browse&action=set_sort&type=album&sort=year',_('Year'),'album_sort_year'); ?></th> + <th class="cel_year"><?php echo Ajax::text('?page=browse&action=set_sort&browse_id=' . $browse->id . '&sort=year',_('Year'),'album_sort_year'); ?></th> <th class="cel_tags"><?php echo _('Tags'); ?></th> <th class="col_rating"><?php echo _('Rating'); ?></th> <th class="cel_action"><?php echo _('Actions'); ?></th> @@ -70,13 +70,13 @@ $ajax_url = Config::get('ajax_url'); <?php } ?> <tr class="th-bottom"> <th class="cel_add"><?php echo _('Add'); ?></th> - <?php if (Browse::is_enabled('show_art')) { ?> + <?php if (Art::is_enabled()) { ?> <th class="cel_cover"><?php echo _('Cover'); ?></th> <?php } ?> - <th class="cel_album"><?php echo Ajax::text('?page=browse&action=set_sort&type=album&sort=name',_('Album'),'album_sort_name_bottom'); ?></th> + <th class="cel_album"><?php echo Ajax::text('?page=browse&action=set_sort&browse_id=' . $browse->id . '&sort=name',_('Album'),'album_sort_name_bottom'); ?></th> <th class="cel_artist"><?php echo _('Artist'); ?></th> <th class="cel_songs"><?php echo _('Songs'); ?></th> - <th class="cel_year"><?php echo Ajax::text('?page=browse&action=set_sort&type=album&sort=year',_('Year'),'album_sort_year_bottom'); ?></th> + <th class="cel_year"><?php echo Ajax::text('?page=browse&action=set_sort&browse_id=' . $browse->id . '&sort=year',_('Year'),'album_sort_year_bottom'); ?></th> <th class="cel_tags"><?php echo _('Tags'); ?></th> <th class="col_rating"><?php echo _('Rating'); ?></th> <th class="cel_action"><?php echo _('Actions'); ?></th> diff --git a/templates/show_artist.inc.php b/templates/show_artist.inc.php index 5c5e51b6..408e6b5e 100644 --- a/templates/show_artist.inc.php +++ b/templates/show_artist.inc.php @@ -22,6 +22,8 @@ $web_path = Config::get('web_path'); ?> <?php +$browse = new Browse(); +$browse->set_type($object_type); show_box_top($artist->f_name, 'info-box'); if (Config::get('ratings')) { ?> @@ -65,13 +67,12 @@ if (Config::get('ratings')) { </li> <?php } ?> <li> - <input type="checkbox" id="show_artist_artCB" <?php echo $string = Browse::get_filter('show_art') ? 'checked="checked"' : ''; ?>/> <?php echo _('Show Art'); ?> - <?php echo Ajax::observe('show_artist_artCB','click',Ajax::action('?page=browse&action=browse&key=show_art&value=1&type=album','')); ?> + <input type="checkbox" id="show_artist_artCB" <?php echo $string = Art::is_enabled() ? 'checked="checked"' : ''; ?>/> <?php echo _('Show Art'); ?> + <?php echo Ajax::observe('show_artist_artCB', 'click', Ajax::action('?page=browse&action=show_art&browse_id=' . $browse->id,'')); ?> </ul> </div> <?php show_box_bottom(); ?> <?php - Browse::set_type($object_type); - Browse::reset(); - Browse::show_objects($object_ids); + $browse->show_objects($object_ids); + $browse->store(); ?> diff --git a/templates/show_index.inc.php b/templates/show_index.inc.php index dce60143..703e5c54 100644 --- a/templates/show_index.inc.php +++ b/templates/show_index.inc.php @@ -25,7 +25,7 @@ </div> <!-- Close Now Playing Div --> <!-- Randomly selected albums of the moment --> <?php -if (Browse::is_enabled('show_art')) { +if (Art::is_enabled()) { echo Ajax::observe('window','load',Ajax::action('?page=index&action=random_albums','random_albums')); ?> <div id="random_selection"> diff --git a/templates/show_manage_catalogs.inc.php b/templates/show_manage_catalogs.inc.php index 8ea5f460..86d32f32 100644 --- a/templates/show_manage_catalogs.inc.php +++ b/templates/show_manage_catalogs.inc.php @@ -48,9 +48,12 @@ </div> <?php show_box_bottom(); ?> <?php - $catalog_ids = Catalog::get_catalogs(); - Browse::set_type('catalog'); - Browse::set_static_content(1); - Browse::show_objects($catalog_ids); + $catalog_ids = Catalog::get_catalogs(); + $browse = new Browse(); + $browse->set_type('catalog'); + $browse->set_static_content(true); + $browse->save_objects($catalog_ids); + $browse->show_objects($catalog_ids); + $browse->store(); ?> diff --git a/templates/show_now_playing_row.inc.php b/templates/show_now_playing_row.inc.php index ca4bc14a..a5f291e8 100644 --- a/templates/show_now_playing_row.inc.php +++ b/templates/show_now_playing_row.inc.php @@ -73,7 +73,7 @@ $artist = scrub_out(truncate_with_ellipsis($media->f_artist_full)); </div> </div> -<?php if (Browse::is_enabled('show_art')) { ?> +<?php if (Art::is_enabled()) { ?> <div class="np_group"> <div class="np_cell cel_albumart"> <a target="_blank" href="<?php echo $web_path; ?>/image.php?id=<?php echo $media->album; ?>&type=popup" onclick="popup_art('<?php echo $web_path; ?>/image.php?id=<?php echo $media->album; ?>&type=popup'); return false;"> diff --git a/templates/show_playlist.inc.php b/templates/show_playlist.inc.php index a38fdee1..ddc227ea 100644 --- a/templates/show_playlist.inc.php +++ b/templates/show_playlist.inc.php @@ -68,8 +68,10 @@ show_box_top('<div id="playlist_row_' . $playlist->id . '">' . $title . </div> <?php show_box_bottom(); ?> <?php - Browse::set_type('playlist_song'); - Browse::add_supplemental_object('playlist',$playlist->id); - Browse::set_static_content(1); - Browse::show_objects($object_ids); + $browse = new Browse(); + $browse->set_type('playlist_song'); + $browse->add_supplemental_object('playlist', $playlist->id); + $browse->set_static_content(true); + $browse->show_objects($object_ids); + $browse->store(); ?> diff --git a/templates/show_random.inc.php b/templates/show_random.inc.php index e1a73b21..2e573566 100644 --- a/templates/show_random.inc.php +++ b/templates/show_random.inc.php @@ -101,10 +101,11 @@ <div id="browse"> <?php if (is_array($object_ids)) { - Browse::reset_filters(); - Browse::set_type('song'); - Browse::save_objects($object_ids); - Browse::show_objects(); + $browse = new Browse(); + $browse->set_type('song'); + $browse->save_objects($object_ids); + $browse->show_objects(); + $browse->store(); echo Ajax::observe('window','load',Ajax::action('?action=refresh_rightbar','playlist_refresh_load')); } ?> diff --git a/templates/show_random_albums.inc.php b/templates/show_random_albums.inc.php index 0b1f0dc8..2b91dae2 100644 --- a/templates/show_random_albums.inc.php +++ b/templates/show_random_albums.inc.php @@ -33,7 +33,7 @@ $button = Ajax::button('?page=index&action=random_albums','random',_('Refresh'), ?> <div class="random_album"> <a href="<?php echo $web_path; ?>/albums.php?action=show&album=<?php echo $album_id; ?>"> - <?php if (Browse::is_enabled('show_art')) { ?> + <?php if (Art::is_enabled()) { ?> <img src="<?php echo $web_path; ?>/image.php?thumb=3&id=<?php echo $album_id; ?>" width="80" height="80" alt="<?php echo $name; ?>" title="<?php echo $name; ?>" /> <?php } else { ?> <?php echo '[' . $album->f_artist . '] ' . $album->f_name; ?> diff --git a/templates/show_search_options.inc.php b/templates/show_search_options.inc.php index 7a8ce87f..fb1b8155 100644 --- a/templates/show_search_options.inc.php +++ b/templates/show_search_options.inc.php @@ -25,12 +25,12 @@ <div id="information_actions"> <ul> <li> - <?php echo Ajax::button('?action=basket&type=browse_set&object_type=song','add',_('Add Search Results'),'add_search_results'); ?> + <?php echo Ajax::button('?action=basket&type=browse_set&browse_id=' . $browse->id,'add',_('Add Search Results'),'add_search_results'); ?> <?php echo _('Add Search Results'); ?> </li> <?php if (Access::check_function('batch_download')) { ?> <li> - <a href="<?php echo Config::get('web_path'); ?>/batch.php?action=browse"><?php echo get_user_icon('batch_download', _('Batch Download')); ?></a> + <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> <?php echo _('Batch Download'); ?> </li> <?php } ?> diff --git a/templates/show_songs.inc.php b/templates/show_songs.inc.php index 0a40b8ad..7eec665b 100644 --- a/templates/show_songs.inc.php +++ b/templates/show_songs.inc.php @@ -38,12 +38,12 @@ $ajax_url = Config::get('ajax_url'); </colgroup> <tr class="th-top"> <th class="cel_add"><?php echo _('Add'); ?></th> - <th class="cel_song"><?php echo Ajax::text('?page=browse&action=set_sort&type=song&sort=title',_('Song Title'),'sort_song_title'); ?></th> - <th class="cel_artist"><?php echo Ajax::text('?page=browse&action=set_sort&type=song&sort=artist',_('Artist'),'sort_song_artist'); ?></th> - <th class="cel_album"><?php echo Ajax::text('?page=browse&action=set_sort&type=song&sort=album',_('Album'),'sort_song_album'); ?></th> + <th class="cel_song"><?php echo Ajax::text('?page=browse&action=set_sort&browse_id=' . $browse->id . '&sort=title', _('Song Title'), 'sort_song_title'); ?></th> + <th class="cel_artist"><?php echo Ajax::text('?page=browse&action=set_sort&browse_id=' . $browse->id . '&sort=artist', _('Artist'), 'sort_song_artist'); ?></th> + <th class="cel_album"><?php echo Ajax::text('?page=browse&action=set_sort&browse_id=' . $browse->id . '&sort=album', _('Album'), 'sort_song_album'); ?></th> <th class="cel_tags"><?php echo _('Tags'); ?></th> - <th class="cel_track"><?php echo Ajax::text('?page=browse&action=set_sort&type=song&sort=track',_('Track'),'sort_song_track'); ?></th> - <th class="cel_time"><?php echo Ajax::text('?page=browse&action=set_sort&type=song&sort=time',_('Time'),'sort_song_time'); ?></th> + <th class="cel_track"><?php echo Ajax::text('?page=browse&action=set_sort&browse_id=' . $browse->id . '&sort=track', _('Track'), 'sort_song_track'); ?></th> + <th class="cel_time"><?php echo Ajax::text('?page=browse&action=set_sort&browse_id=' . $browse->id . '&sort=time', _('Time'), 'sort_song_time'); ?></th> <?php if (Config::get('ratings')) { Rating::build_cache('song', $object_ids); ?> diff --git a/templates/sidebar_home.inc.php b/templates/sidebar_home.inc.php index 41e74256..3593fb50 100644 --- a/templates/sidebar_home.inc.php +++ b/templates/sidebar_home.inc.php @@ -24,7 +24,6 @@ $ajax_info = Config::get('ajax_url'); $web_path = Config::get('web_path'); <ul class="sb2" id="sb_home"> <li><h4><?php echo _('Browse'); ?></h4> <?php - $allowed_filters = Browse::get_allowed_filters(); // Build the selected dealie $text = scrub_in($_REQUEST['action']) . '_ac'; ${$text} = ' selected="selected"'; @@ -39,52 +38,8 @@ $ajax_info = Config::get('ajax_url'); $web_path = Config::get('web_path'); <li id="sb_browse_bb_Video"><a href="<?php echo $web_path; ?>/browse.php?action=video"><?php echo _('Videos'); ?></a></li> </ul> </li> -<?php if (count($allowed_filters)) { ?> - <li><h4><?php echo _('Filters'); ?></h4> - <div class="sb3"> - <?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 Config::get('ajax_url'); ?>?page=browse&action=browse&type=<?php echo Browse::get_type(); ?>&key=starts_with','multi_alpha_filter');"> - </form> - <?php } // end if alpha_match ?> - <?php if (in_array('minimum_count',$allowed_filters)) { ?> - <input id="mincountCB" type="checkbox" onclick="ajaxPut('<?php echo $ajax_info; ?>?action=browse&key=min_count&type=<?php echo Browse::get_type(); ?>&value=1');return true;" value="1" /> - <label id="mincountLabel" for="mincountCB"><?php echo _('Minimum Count'); ?></label><br /> - <?php } ?> - <?php if (in_array('rated',$allowed_filters)) { ?> - <input id="ratedCB" type="checkbox" onclick="ajaxPut('<?php echo $ajax_info; ?>?action=browse&type=<?php echo Browse::get_type(); ?>&key=rated&value=1');return true;" value="1" /> - <label id="ratedLabel" for="ratedCB"><?php echo _('Rated'); ?></label><br /> - <?php } ?> - <?php if (in_array('unplayed',$allowed_filters)) { ?> - <input id="unplayedCB" type="checkbox" <?php echo $string = Browse::get_filter('unplayed') ? 'checked="checked"' : ''; ?>/> - <label id="unplayedLabel" for="unplayedCB"><?php echo _('Unplayed'); ?></label><br /> - <?php } ?> - <?php if (in_array('show_art',$allowed_filters)) { ?> - <input id="show_artCB" type="checkbox" <?php echo $string = Browse::get_filter('show_art') ? 'checked="checked"' : ''; ?>/> - <label id="show_artLabel" for="show_artCB"><?php echo _('Show Art'); ?></label><br /> - <?php echo Ajax::observe('show_artCB','click',Ajax::action('?page=browse&action=browse&type=' . Browse::get_type() . '&key=show_art&value=1','')); ?> - <?php } // if show_art ?> - <?php if (in_array('playlist_type',$allowed_filters)) { ?> - <input id="show_allplCB" type="checkbox" <?php echo $string = Browse::get_filter('playlist_type') ? 'checked="checked"' : ''; ?>/> - <label id="show_allplLabel" for="showallplCB"><?php echo _('All Playlists'); ?></label><br /> - <?php echo Ajax::observe('show_allplCB','click',Ajax::action('?page=browse&action=browse&type=' . Browse::get_type() . '&key=playlist_type&value=1','')); ?> - <?php } // if playlist_type ?> - <?php if (in_array('object_type',$allowed_filters)) { ?> - <?php $string = 'otype_' . Browse::get_filter('object_type'); ${$string} = 'selected="selected"'; ?> - <input id="typeSongRadio" type="radio" name="object_type" value="1" <?php echo $otype_song; ?>/> - <label id="typeSongLabel" for="typeSongRadio"><?php echo _('Song Title'); ?></label><br /> - <?php echo Ajax::observe('typeSongRadio','click',Ajax::action('?page=tag&action=browse_type&type=song','')); ?> - <input id="typeAlbumRadio" type="radio" name="object_type" value="1" /> - <label id="typeAlbumLabel" for="typeAlbumRadio"><?php echo _('Albums'); ?></label><br /> - <?php echo Ajax::observe('typeAlbumRadio','click',Ajax::action('?page=tag&action=browse_type&type=album','')); ?> - <input id="typeArtistRadio" type="radio" name="object_type" value="1" /> - <label id="typeArtistLabel" for="typeArtistRadio"><?php echo _('Artist'); ?></label><br /> - <?php echo Ajax::observe('typeArtistRadio','click',Ajax::action('?page=tag&action=browse_type&type=artist','')); ?> - <?php } ?> - </div> - </li> -<?php } ?> +<?php Ajax::start_container('browse_filters'); ?> +<?php Ajax::end_container(); ?> <li><h4><?php echo _('Playlist'); ?></h4> <ul class="sb3" id="sb_home_info"> <li id="sb_home_info_CurrentlyPlaying"><a href="<?php echo $web_path; ?>/index.php"><?php echo _('Currently Playing'); ?></a></li> |