diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/show_localplay_control.inc.php | 19 | ||||
-rw-r--r-- | templates/show_localplay_status.inc.php | 27 | ||||
-rw-r--r-- | templates/sidebar.inc.php | 8 |
3 files changed, 33 insertions, 21 deletions
diff --git a/templates/show_localplay_control.inc.php b/templates/show_localplay_control.inc.php index b45cd887..a0177603 100644 --- a/templates/show_localplay_control.inc.php +++ b/templates/show_localplay_control.inc.php @@ -23,29 +23,36 @@ $web_path = conf('web_path'); $localplay = init_localplay(); -$required_info = "&user_id=" . $GLOBALS['user']->id . "&sessid=" . session_id(); +$required_info = "&user_id=" . $GLOBALS['user']->id . "&sessid=" . session_id(); $ajax_url = $web_path . '/server/ajax.server.php'; ?> +<script language="javascript" type="text/javascript"> +<!-- +var lp_control = new Array(2); +lp_control[0] = "lp_state"; +lp_control[1] = "lp_playing"; +--> +</script> <div class="localplaycontrol" style="display:table-cell;cursor:pointer;padding:2px;"> <?php if ($localplay->has_function('prev')) { ?> -<span class="prev_button" onclick="ajaxPut('<?php echo $ajax_url; ?>?action=localplay&cmd=prev<?php echo $required_info; ?>','localplay_state');return true;"> +<span class="prev_button" onclick="ajaxPut('<?php echo $ajax_url; ?>?action=localplay&cmd=prev<?php echo $required_info; ?>',lp_control);return true;"> <img src="<?php echo $web_path; ?>/images/localplay/prev.gif" alt="prev" /> </span> <?php } ?> -<span class="stop_button" onclick="ajaxPut('<?php echo $ajax_url; ?>?action=localplay&cmd=stop<?php echo $required_info; ?>','localplay_state');return true;"> +<span class="stop_button" onclick="ajaxPut('<?php echo $ajax_url; ?>?action=localplay&cmd=stop<?php echo $required_info; ?>',lp_control);return true;"> <img src="<?php echo $web_path; ?>/images/localplay/stop.gif" alt="stop" /> </span> <?php if ($localplay->has_function('pause')) { ?> -<span class="pause_button" onclick="ajaxPut('<?php echo $ajax_url; ?>?action=localplay&cmd=pause<?php echo $required_info; ?>','localplay_state');return true;"> +<span class="pause_button" onclick="ajaxPut('<?php echo $ajax_url; ?>?action=localplay&cmd=pause<?php echo $required_info; ?>',lp_control);return true;"> <img src="<?php echo $web_path; ?>/images/localplay/pause.gif" alt="pause" /> </span> <?php } ?> -<span class="play_button" onclick="ajaxPut('<?php echo $ajax_url; ?>?action=localplay&cmd=play<?php echo $required_info; ?>','localplay_state');return true;"> +<span class="play_button" onclick="ajaxPut('<?php echo $ajax_url; ?>?action=localplay&cmd=play<?php echo $required_info; ?>',lp_control);return true;"> <img src="<?php echo $web_path; ?>/images/localplay/play.gif" alt="play" /> </span> <?php if ($localplay->has_function('next')) { ?> -<span class="next_button" onclick="ajaxPut('<?php echo $ajax_url; ?>?action=localplay&cmd=next<?php echo $required_info; ?>','localplay_state');return true;"> +<span class="next_button" onclick="ajaxPut('<?php echo $ajax_url; ?>?action=localplay&cmd=next<?php echo $required_info; ?>',lp_control);return true;"> <img src="<?php echo $web_path; ?>/images/localplay/next.gif" alt="next" /> </span> <?php } ?> diff --git a/templates/show_localplay_status.inc.php b/templates/show_localplay_status.inc.php index 2fab62de..0e250923 100644 --- a/templates/show_localplay_status.inc.php +++ b/templates/show_localplay_status.inc.php @@ -23,40 +23,39 @@ $web_path = conf('web_path'); $localplay = init_localplay(); -$required_info = "&user_id=" . $GLOBALS['user']->id . "&sessid=" . session_id(); +$required_info = "&user_id=" . $GLOBALS['user']->id . "&sessid=" . session_id(); $ajax_url = $web_path . '/server/ajax.server.php'; $status = $localplay->status(); -/* Format the track name */ -$track_name = $status['track_artist'] . ' - ' . $status['track_album'] . ' - ' . $status['track_title']; - -/* This is a cheezball fix for when we were unable to find a - * artist/album (or one wasn't provided) - */ -$track_name = ltrim(ltrim($track_name,' - ')); ?> -<strong><?php echo $localplay->get_user_state($status['state']) ?></strong><br /> - <?php echo '[' . $status['track'] . '] - ' . $track_name . '<br />'; ?> +<span style="font-weight:bold;" id="lp_state"><?php echo $localplay->get_user_state($status['state']) ?></span><br /> + <span id="lp_playing"><?php echo $localplay->get_user_playing(); ?></span><br /> <div align="center"><?php require (conf('prefix') . '/templates/show_localplay_control.inc.php'); ?></div> <div align="center"> + <script type="text/javascript" language="javascript"> + <!-- + var lp_v = new Array(1); + lp_v[0] = "lp_volume"; + --> + </script> <?php if ($localplay->has_function('volume_up')) { ?> - <span class="up_button" onclick="ajaxPut('<?php echo $ajax_url; ?>?action=localplay&cmd=volume_up<?php echo $required_info; ?>','localplay_state');return true;"> + <span class="up_button" onclick="ajaxPut('<?php echo $ajax_url; ?>?action=localplay&cmd=volume_up<?php echo $required_info; ?>','lp_v');return true;"> <img src="<?php echo $web_path; ?>/images/localplay/volup.gif" alt="volume up" /> </span> <?php } ?> <?php if ($localplay->has_function('volume_down')) { ?> - <span class="down_button" onclick="ajaxPut('<?php echo $ajax_url; ?>?action=localplay&cmd=volume_down<?php echo $required_info; ?>','localplay_state');return true;"> + <span class="down_button" onclick="ajaxPut('<?php echo $ajax_url; ?>?action=localplay&cmd=volume_down<?php echo $required_info; ?>','lp_v');return true;"> <img src="<?php echo $web_path; ?>/images/localplay/voldn.gif" alt="volume down" /> </span> <?php } ?> <?php if ($localplay->has_function('volume_mute')) { ?> - <span class="mute_button" onclick="ajaxPut('<?php echo $ajax_url; ?>?action=localplay&cmd=volume_mute<?php echo $required_info; ?>','localplay_state');return true;"> + <span class="mute_button" onclick="ajaxPut('<?php echo $ajax_url; ?>?action=localplay&cmd=volume_mute<?php echo $required_info; ?>','lp_v');return true;"> <img src="<?php echo $web_path; ?>/images/localplay/volmute.gif" alt="volume mute" /> </span> <?php } ?> <br /> - <?php echo _('Volume') . ":" . $status['volume']; ?> + <?php echo _('Volume'); ?>:<span id="lp_volume"><?php echo $status['volume']; ?></span> </div> <br /> <?php if ($localplay->has_function('repeat')) { ?> diff --git a/templates/sidebar.inc.php b/templates/sidebar.inc.php index d4b5960a..38fef93d 100644 --- a/templates/sidebar.inc.php +++ b/templates/sidebar.inc.php @@ -184,9 +184,15 @@ $web_path = conf('web_path'); <br /> <?php $type = conf('play_type'); ${$type} = 'id="pt_active"'; ?> <?php - $required_info = "&user_id=" . $GLOBALS['user']->id . "&sessid=" . session_id(); + $required_info = "&user_id=" . $GLOBALS['user']->id . "&sessid=" . session_id(); $ajax_url = $web_path . '/server/ajax.server.php'; ?> + <script type="text/javascript" language="javascript"> + <!-- + var lp_switch = new Array(2); + lp_switch[0] = "play_type"; + --> + </script> <span class="text-action" style="cursor:pointer;" id="play_type"> <?php require_once(conf('prefix') . '/templates/show_localplay_switch.inc.php'); ?> </span> |