Beispiel #1
0
 * action switch
 */
switch ($_REQUEST['action']) {
    case 'basket':
        // Pull in our items (multiple types)
        $media_ids = $GLOBALS['user']->playlist->get_items();
        // Check to see if 'clear' was passed if it was then we need to reset the basket
        if ($_REQUEST['playlist_method'] == 'clear' || AmpConfig::get('playlist_method') == 'clear') {
            $GLOBALS['user']->playlist->clear();
        }
        break;
        /* This is run if we need to gather info based on a tmp playlist */
    /* This is run if we need to gather info based on a tmp playlist */
    case 'tmp_playlist':
        $tmp_playlist = new Tmp_Playlist($_REQUEST['tmpplaylist_id']);
        $media_ids = $tmp_playlist->get_items();
        break;
    case 'play_favorite':
        $data = $GLOBALS['user']->get_favorites($_REQUEST['type']);
        $media_ids = array();
        switch ($_REQUEST['type']) {
            case 'artist':
            case 'album':
                foreach ($data as $value) {
                    $songs = $value->get_songs();
                    $media_ids = array_merge($media_ids, $songs);
                }
                break;
            case 'song':
                foreach ($data as $value) {
                    $media_ids[] = $value->id;
Beispiel #2
0
</i>
    <?php 
}
?>
    </dd>
</dl><br />
<?php 
UI::show_box_bottom();
UI::show_box_top(T_('Active Playlist'));
?>
<table cellspacing="0">
    <tr>
        <td valign="top">
            <?php 
$tmp_playlist = new Tmp_Playlist(Tmp_Playlist::get_from_userid($client->id));
$object_ids = $tmp_playlist->get_items();
foreach ($object_ids as $object_data) {
    $type = array_shift($object_data);
    $object = new $type(array_shift($object_data));
    $object->format();
    echo $object->f_link;
    ?>
                <br />
            <?php 
}
?>
        </td>
    </tr>
</table><br />
<?php 
UI::show_box_bottom();