Esempio n. 1
0
    ?>
</a></li>
                <li id="sb_home_browse_video_tagsVideo"><a href="<?php 
    echo $web_path;
    ?>
/browse.php?action=tag&type=video"><?php 
    echo T_('Tag Cloud');
    ?>
</a></li>
            </ul>
        </li>
    <?php 
}
?>
    <?php 
Ajax::start_container('browse_filters');
?>
    <?php 
Ajax::end_container();
?>
    <?php 
if (Access::check('interface', '25')) {
    ?>
    <li>
        <h4 class="header"><span class="sidebar-header-title" title="<?php 
    echo T_('Playlist');
    ?>
"><?php 
    echo T_('Playlist');
    ?>
</span><img src="<?php 
Esempio n. 2
0
 /**
  * show_objects
  * This takes an array of objects
  * and requires the correct template based on the
  * type that we are currently browsing
  *
  * @param int[] $object_ids
  */
 public function show_objects($object_ids = null, $argument = null)
 {
     if ($this->is_simple() || !is_array($object_ids)) {
         $object_ids = $this->get_saved();
     } else {
         $this->save_objects($object_ids);
     }
     // Limit is based on the user's preferences if this is not a
     // simple browse because we've got too much here
     if ($this->get_start() >= 0 && count($object_ids) > $this->get_start() && !$this->is_simple()) {
         $object_ids = array_slice($object_ids, $this->get_start(), $this->get_offset(), true);
     } else {
         if (!count($object_ids)) {
             $this->set_total(0);
         }
     }
     // Load any additional object we need for this
     $extra_objects = $this->get_supplemental_objects();
     $browse = $this;
     foreach ($extra_objects as $class_name => $id) {
         ${$class_name} = new $class_name($id);
     }
     $match = '';
     // Format any matches we have so we can show them to the masses
     if ($filter_value = $this->get_filter('alpha_match')) {
         $match = ' (' . $filter_value . ')';
     } elseif ($filter_value = $this->get_filter('starts_with')) {
         $match = ' (' . $filter_value . ')';
         /*} elseif ($filter_value = $this->get_filter('regex_match')) {
               $match = ' (' . $filter_value . ')';
           } elseif ($filter_value = $this->get_filter('regex_not_match')) {
               $match = ' (' . $filter_value . ')';*/
     } elseif ($filter_value = $this->get_filter('catalog')) {
         // Get the catalog title
         $catalog = Catalog::create_from_id(intval($filter_value));
         $match = ' (' . $catalog->name . ')';
     }
     $type = $this->get_type();
     // Update the session value only if it's allowed on the current browser
     if ($this->get_update_session()) {
         $_SESSION['browse_current_' . $type]['start'] = $browse->get_start();
     }
     // Set the correct classes based on type
     $class = "box browse_" . $type;
     $argument_param = $argument ? '&argument=' . scrub_in($argument) : '';
     debug_event('browse', 'Show objects called for type {' . $type . '}', '5');
     $limit_threshold = $this->get_threshold();
     // Switch on the type of browsing we're doing
     switch ($type) {
         case 'song':
             $box_title = T_('Songs') . $match;
             Song::build_cache($object_ids, $limit_threshold);
             $box_req = AmpConfig::get('prefix') . '/templates/show_songs.inc.php';
             break;
         case 'album':
             Album::build_cache($object_ids);
             $box_title = T_('Albums') . $match;
             if (is_array($argument)) {
                 $allow_group_disks = $argument['group_disks'];
                 if ($argument['title']) {
                     $box_title = $argument['title'];
                 }
             } else {
                 $allow_group_disks = false;
             }
             $box_req = AmpConfig::get('prefix') . '/templates/show_albums.inc.php';
             break;
         case 'user':
             $box_title = T_('Users') . $match;
             $box_req = AmpConfig::get('prefix') . '/templates/show_users.inc.php';
             break;
         case 'artist':
             $box_title = T_('Artists') . $match;
             Artist::build_cache($object_ids, true, $limit_threshold);
             $box_req = AmpConfig::get('prefix') . '/templates/show_artists.inc.php';
             break;
         case 'live_stream':
             require_once AmpConfig::get('prefix') . '/templates/show_live_stream.inc.php';
             $box_title = T_('Radio Stations') . $match;
             $box_req = AmpConfig::get('prefix') . '/templates/show_live_streams.inc.php';
             break;
         case 'playlist':
             Playlist::build_cache($object_ids);
             $box_title = T_('Playlists') . $match;
             $box_req = AmpConfig::get('prefix') . '/templates/show_playlists.inc.php';
             break;
         case 'playlist_song':
             $box_title = T_('Playlist Songs') . $match;
             $box_req = AmpConfig::get('prefix') . '/templates/show_playlist_songs.inc.php';
             break;
         case 'playlist_localplay':
             $box_title = T_('Current Playlist');
             $box_req = AmpConfig::get('prefix') . '/templates/show_localplay_playlist.inc.php';
             UI::show_box_bottom();
             break;
         case 'smartplaylist':
             $box_title = T_('Smart Playlists') . $match;
             $box_req = AmpConfig::get('prefix') . '/templates/show_searches.inc.php';
             break;
         case 'catalog':
             $box_title = T_('Catalogs');
             $box_req = AmpConfig::get('prefix') . '/templates/show_catalogs.inc.php';
             break;
         case 'shoutbox':
             $box_title = T_('Shoutbox Records');
             $box_req = AmpConfig::get('prefix') . '/templates/show_manage_shoutbox.inc.php';
             break;
         case 'tag':
             Tag::build_cache($object_ids);
             $box_title = T_('Tag Cloud');
             $box_req = AmpConfig::get('prefix') . '/templates/show_tagcloud.inc.php';
             break;
         case 'video':
             Video::build_cache($object_ids);
             $video_type = 'video';
             $box_title = T_('Videos');
             $box_req = AmpConfig::get('prefix') . '/templates/show_videos.inc.php';
             break;
         case 'democratic':
             $box_title = T_('Democratic Playlist');
             $box_req = AmpConfig::get('prefix') . '/templates/show_democratic_playlist.inc.php';
             break;
         case 'wanted':
             $box_title = T_('Wanted Albums');
             $box_req = AmpConfig::get('prefix') . '/templates/show_wanted_albums.inc.php';
             break;
         case 'share':
             $box_title = T_('Shared Objects');
             $box_req = AmpConfig::get('prefix') . '/templates/show_shared_objects.inc.php';
             break;
         case 'song_preview':
             $box_title = T_('Songs');
             $box_req = AmpConfig::get('prefix') . '/templates/show_song_previews.inc.php';
             break;
         case 'channel':
             $box_title = T_('Channels');
             $box_req = AmpConfig::get('prefix') . '/templates/show_channels.inc.php';
             break;
         case 'broadcast':
             $box_title = T_('Broadcasts');
             $box_req = AmpConfig::get('prefix') . '/templates/show_broadcasts.inc.php';
             break;
         case 'license':
             $box_title = T_('Media Licenses');
             $box_req = AmpConfig::get('prefix') . '/templates/show_manage_license.inc.php';
             break;
         case 'tvshow':
             $box_title = T_('TV Shows');
             $box_req = AmpConfig::get('prefix') . '/templates/show_tvshows.inc.php';
             break;
         case 'tvshow_season':
             $box_title = T_('Seasons');
             $box_req = AmpConfig::get('prefix') . '/templates/show_tvshow_seasons.inc.php';
             break;
         case 'tvshow_episode':
             $box_title = T_('Episodes');
             $video_type = $type;
             $box_req = AmpConfig::get('prefix') . '/templates/show_videos.inc.php';
             break;
         case 'movie':
             $box_title = T_('Movies');
             $video_type = $type;
             $box_req = AmpConfig::get('prefix') . '/templates/show_videos.inc.php';
             break;
         case 'clip':
             $box_title = T_('Clips');
             $video_type = $type;
             $box_req = AmpConfig::get('prefix') . '/templates/show_videos.inc.php';
             break;
         case 'personal_video':
             $box_title = T_('Personal Videos');
             $video_type = $type;
             $box_req = AmpConfig::get('prefix') . '/templates/show_videos.inc.php';
             break;
         case 'label':
             $box_title = T_('Labels');
             $box_req = AmpConfig::get('prefix') . '/templates/show_labels.inc.php';
             break;
         case 'pvmsg':
             $box_title = T_('Private Messages');
             $box_req = AmpConfig::get('prefix') . '/templates/show_pvmsgs.inc.php';
             break;
         default:
             // Rien a faire
             break;
     }
     // end switch on type
     Ajax::start_container($this->get_content_div(), 'browse_content');
     if ($this->get_show_header()) {
         if (isset($box_req) && isset($box_title)) {
             UI::show_box_top($box_title, $class);
         }
     }
     if (isset($box_req)) {
         require $box_req;
     }
     if ($this->get_show_header()) {
         if (isset($box_req)) {
             UI::show_box_bottom();
         }
         echo '<script type="text/javascript">';
         echo Ajax::action('?page=browse&action=get_filters&browse_id=' . $this->id . $argument_param, '');
         echo ';</script>';
     } else {
         if (!$this->get_use_pages()) {
             $this->show_next_link($argument);
         }
     }
     Ajax::end_container();
 }
Esempio n. 3
0
</a>
    <li>
        <a class="option-list" href="<?php 
echo AmpConfig::get('web_path');
?>
/admin/access.php?action=show_add_advanced"><?php 
echo UI::get_icon('add_key', T_('Advanced Add')) . ' ' . T_('Advanced Add');
?>
</a>
    </li>
</ul>
</div>
<?php 
UI::show_box_bottom();
UI::show_box_top(T_('Access Control Entries'), 'box box_access_entries');
Ajax::start_container('browse_content', 'browse_content');
if (count($list)) {
    ?>
<table cellspacing="1" cellpadding="3" class="tabledata">
<thead>
    <tr class="th-top">
        <th><?php 
    echo T_('Name');
    ?>
</th>
        <th><?php 
    echo T_('Start Address');
    ?>
</th>
        <th><?php 
    echo T_('End Address');
Esempio n. 4
0
<?php

/* vim:set softtabstop=4 shiftwidth=4 expandtab: */
/**
 *
 * LICENSE: GNU Affero General Public License, version 3 (AGPLv3)
 * Copyright 2001 - 2015 Ampache.org
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 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 Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
// Because sometimes you just need a container
Ajax::start_container('browse_content_' . $type, 'browse_content');
?>

<?php 
Ajax::end_container();
Esempio n. 5
0
 /**
  * show_objects
  * This takes an array of objects
  * and requires the correct template based on the
  * type that we are currently browsing
  */
 public function show_objects($object_ids = null, $argument = null)
 {
     if ($this->is_simple() || !is_array($object_ids)) {
         $object_ids = $this->get_saved();
     } else {
         $this->save_objects($object_ids);
     }
     // Limit is based on the user's preferences if this is not a
     // simple browse because we've got too much here
     if (count($object_ids) > $this->get_start() && !$this->is_simple() && !$this->is_static_content()) {
         $object_ids = array_slice($object_ids, $this->get_start(), $this->get_offset(), true);
     } else {
         if (!count($object_ids)) {
             $this->set_total(0);
         }
     }
     // Load any additional object we need for this
     $extra_objects = $this->get_supplemental_objects();
     $browse = $this;
     foreach ($extra_objects as $class_name => $id) {
         ${$class_name} = new $class_name($id);
     }
     $match = '';
     // Format any matches we have so we can show them to the masses
     if ($filter_value = $this->get_filter('alpha_match')) {
         $match = ' (' . $filter_value . ')';
     } elseif ($filter_value = $this->get_filter('starts_with')) {
         $match = ' (' . $filter_value . ')';
         /*} elseif ($filter_value = $this->get_filter('regex_match')) {
               $match = ' (' . $filter_value . ')';
           } elseif ($filter_value = $this->get_filter('regex_not_match')) {
               $match = ' (' . $filter_value . ')';*/
     } elseif ($filter_value = $this->get_filter('catalog')) {
         // Get the catalog title
         $catalog = Catalog::create_from_id($filter_value);
         $match = ' (' . $catalog->name . ')';
     }
     $type = $this->get_type();
     // Set the correct classes based on type
     $class = "box browse_" . $type;
     debug_event('browse', 'Called for type {' . $type . '}', '5');
     // Switch on the type of browsing we're doing
     switch ($type) {
         case 'song':
             $box_title = T_('Songs') . $match;
             Song::build_cache($object_ids);
             $box_req = AmpConfig::get('prefix') . '/templates/show_songs.inc.php';
             break;
         case 'album':
             $box_title = T_('Albums') . $match;
             Album::build_cache($object_ids);
             $allow_group_disks = $argument;
             $box_req = AmpConfig::get('prefix') . '/templates/show_albums.inc.php';
             break;
         case 'user':
             $box_title = T_('Manage Users') . $match;
             $box_req = AmpConfig::get('prefix') . '/templates/show_users.inc.php';
             break;
         case 'artist':
             $box_title = T_('Artists') . $match;
             Artist::build_cache($object_ids, 'extra');
             $box_req = AmpConfig::get('prefix') . '/templates/show_artists.inc.php';
             break;
         case 'live_stream':
             require_once AmpConfig::get('prefix') . '/templates/show_live_stream.inc.php';
             $box_title = T_('Radio Stations') . $match;
             $box_req = AmpConfig::get('prefix') . '/templates/show_live_streams.inc.php';
             break;
         case 'playlist':
             Playlist::build_cache($object_ids);
             $box_title = T_('Playlists') . $match;
             $box_req = AmpConfig::get('prefix') . '/templates/show_playlists.inc.php';
             break;
         case 'playlist_song':
             $box_title = T_('Playlist Songs') . $match;
             $box_req = AmpConfig::get('prefix') . '/templates/show_playlist_songs.inc.php';
             break;
         case 'playlist_localplay':
             $box_title = T_('Current Playlist');
             $box_req = AmpConfig::get('prefix') . '/templates/show_localplay_playlist.inc.php';
             UI::show_box_bottom();
             break;
         case 'smartplaylist':
             $box_title = T_('Smart Playlists') . $match;
             $box_req = AmpConfig::get('prefix') . '/templates/show_smartplaylists.inc.php';
             break;
         case 'catalog':
             $box_title = T_('Catalogs');
             $box_req = AmpConfig::get('prefix') . '/templates/show_catalogs.inc.php';
             break;
         case 'shoutbox':
             $box_title = T_('Shoutbox Records');
             $box_req = AmpConfig::get('prefix') . '/templates/show_manage_shoutbox.inc.php';
             break;
         case 'tag':
             Tag::build_cache($object_ids);
             $box_title = T_('Tag Cloud');
             $box_req = AmpConfig::get('prefix') . '/templates/show_tagcloud.inc.php';
             break;
         case 'video':
             Video::build_cache($object_ids);
             $box_title = T_('Videos');
             $box_req = AmpConfig::get('prefix') . '/templates/show_videos.inc.php';
             break;
         case 'democratic':
             $box_title = T_('Democratic Playlist');
             $box_req = AmpConfig::get('prefix') . '/templates/show_democratic_playlist.inc.php';
             break;
         case 'wanted':
             $box_title = T_('Wanted Albums');
             $box_req = AmpConfig::get('prefix') . '/templates/show_wanted_albums.inc.php';
             break;
         case 'share':
             $box_title = T_('Shared Objects');
             $box_req = AmpConfig::get('prefix') . '/templates/show_shared_objects.inc.php';
             break;
         case 'song_preview':
             $box_title = T_('Songs');
             $box_req = AmpConfig::get('prefix') . '/templates/show_song_previews.inc.php';
             break;
         case 'channel':
             $box_title = T_('Channels');
             $box_req = AmpConfig::get('prefix') . '/templates/show_channels.inc.php';
             break;
         case 'broadcast':
             $box_title = T_('Broadcasts');
             $box_req = AmpConfig::get('prefix') . '/templates/show_broadcasts.inc.php';
             break;
         default:
             // Rien a faire
             break;
     }
     // end switch on type
     Ajax::start_container('browse_content_' . $type, 'browse_content');
     if ($this->get_show_header()) {
         if (isset($box_req) && isset($box_title)) {
             UI::show_box_top($box_title, $class);
         }
     }
     if (isset($box_req)) {
         require $box_req;
     }
     if ($this->get_show_header()) {
         if (isset($box_req)) {
             UI::show_box_bottom();
         }
         echo '<script type="text/javascript">';
         echo Ajax::action('?page=browse&action=get_filters&browse_id=' . $this->id, '');
         echo ';</script>';
     } else {
         if (!$this->get_use_pages()) {
             $this->show_next_link();
         }
     }
     Ajax::end_container();
 }
Esempio n. 6
0
 * 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.
 *
 */
$tag_types = array('song' => T_('Song'), 'album' => T_('Album'), 'artist' => T_('Artist'), 'video' => T_('Video'));
Ajax::start_container('tag_filter');
?>

<form action="<?php 
echo AmpConfig::get('web_path');
?>
/browse.php?action=tag" method="POST">
    <?php 
echo T_('View');
?>
:
    <select name="type">
        <?php 
foreach ($tag_types as $tag_type => $tag_name) {
    echo "<option value='" . $tag_type . "'";
    if ($tag_type == $_REQUEST['type']) {
 *
 * 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 Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
$status = $localplay->status();
$now_playing = $status['track_title'];
if (!empty($status['track_album'])) {
    $now_playing .= ' - ' . $status['track_album'] . ' - ' . $status['track_artist'];
}
Ajax::start_container('localplay_status');
UI::show_box_top(T_('Localplay Control') . ' - ' . strtoupper($localplay->type), 'box box_localplay_status');
echo T_('Now Playing');
?>
:&nbsp;<i><?php 
echo $now_playing;
?>
</i>
<div id="information_actions">
    <ul>
        <li>
        <?php 
echo Ajax::button('?page=localplay&action=command&command=volume_mute', 'volumemute', T_('Mute'), 'localplay_mute');
?>
        <?php 
echo Ajax::button('?page=localplay&action=command&command=volume_down', 'volumedn', T_('Decrease Volume'), 'localplay_volume_dn');