~ubuntu-branches/ubuntu/karmic/ampache/karmic

« back to all changes in this revision

Viewing changes to templates/sidebar_localplay.inc.php

  • Committer: Bazaar Package Importer
  • Author(s): Charlie Smotherman
  • Date: 2008-05-15 18:44:23 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20080515184423-n47i81yk2s99iuci
Tags: 3.4-2
Included some upstream gather album art fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
/*
 
3
 
 
4
 Copyright (c) Ampache.org
 
5
 All rights reserved.
 
6
 
 
7
 This program is free software; you can redistribute it and/or
 
8
 modify it under the terms of the GNU General Public License v2
 
9
 as published by the Free Software Foundation.
 
10
 
 
11
 This program is distributed in the hope that it will be useful,
 
12
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 GNU General Public License for more details.
 
15
 
 
16
 You should have received a copy of the GNU General Public License
 
17
 along with this program; if not, write to the Free Software
 
18
 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
19
 
 
20
*/
 
21
?>
 
22
 
 
23
<ul class="sb2" id="sb_localplay">
 
24
<?php if ($server_allow = Config::get('allow_localplay_playback') AND $controller = Config::get('localplay_controller') AND $access_check = Access::check('localplay','5')) { ?>
 
25
<?php
 
26
        // Little bit of work to be done here
 
27
        $localplay = new Localplay(Config::get('localplay_controller')); 
 
28
        $current_instance = $localplay->current_instance(); 
 
29
        $class = $current_instance ? '' : ' class="active_instance"';
 
30
?>
 
31
<?php if (Access::check('localplay','25')) { ?>
 
32
  <li><h4><?php echo _('Localplay'); ?></h4>
 
33
    <ul class="sb3" id="sb_localplay_info">
 
34
<?php if (Access::check('localplay','75')) { ?>
 
35
        <li id="sb_localplay_info_add_instance"><a href="<?php echo $web_path; ?>/localplay.php?action=show_add_instance"><?php echo _('Add Instance'); ?></a></li>
 
36
        <li id="sb_localplay_info_show_instances"><a href="<?php echo $web_path; ?>/localplay.php?action=show_instances"><?php echo _('Show instances'); ?></a></li>
 
37
<?php } ?>
 
38
        <li id="sb_localplay_info_show"><a href="<?php echo $web_path; ?>/localplay.php?action=show_playlist"><?php echo _('Show Playlist'); ?></a></li>
 
39
    </ul>
 
40
  </li>
 
41
<?php } ?>
 
42
  <li><h4><?php echo _('Active Instance'); ?></h4>
 
43
    <ul class="sb3" id="sb_localplay_instances">
 
44
        <li id="sb_localplay_instances_none"<?php echo $class; ?>><?php echo Ajax::text('?page=localplay&action=set_instance&instance=0',_('None'),'localplay_instance_none');  ?></li>
 
45
        <?php 
 
46
                // Requires a little work.. :(
 
47
                $instances = $localplay->get_instances(); 
 
48
                foreach ($instances as $uid=>$name) { 
 
49
                        $name = scrub_out($name); 
 
50
                        $class = '';
 
51
                        if ($uid == $current_instance) { 
 
52
                                $class = ' class="active_instance"'; 
 
53
                        } 
 
54
        ?>
 
55
        <li id="sb_localplay_instances_<?php echo $uid; ?>"<?php echo $class; ?>><?php echo Ajax::text('?page=localplay&action=set_instance&instance=' . $uid,$name,'localplay_instance_' . $uid); ?></li>
 
56
        <?php } ?>
 
57
    </ul>
 
58
  </li>
 
59
<?php } else { ?>
 
60
  <li><h4><?php echo _('Localplay Disabled'); ?></h4></li>
 
61
  <?php if (!$server_allow) { ?>
 
62
        <li><?php echo _('Allow Localplay set to False'); ?></li>
 
63
  <?php } elseif (!$controller) { ?>
 
64
        <li><?php echo _('Localplay Controller Not Defined'); ?></li>
 
65
  <?php } elseif (!$access_check) { ?>
 
66
        <li><?php echo _('Access Denied'); ?></li>
 
67
  <?php } ?>
 
68
<?php } ?>
 
69
</ul>