Esempio n. 1
0
        $items = $playlist->get_items();
        foreach ($items as $item) {
            $GLOBALS['user']->playlist->add_object($item['object_id'], $item['object_type']);
        }
        $results['rightbar'] = UI::ajax_include('rightbar.inc.php');
        break;
    case 'advanced_random':
        $object_ids = Random::advanced('song', $_POST);
        // First add them to the active playlist
        if (is_array($object_ids)) {
            foreach ($object_ids as $object_id) {
                $GLOBALS['user']->playlist->add_object($object_id, 'song');
            }
        }
        $results['rightbar'] = UI::ajax_include('rightbar.inc.php');
        // Now setup the browse and show them below!
        $browse = new Browse();
        $browse->set_type('song');
        $browse->save_objects($object_ids);
        ob_start();
        $browse->show_objects();
        $results['browse'] = ob_get_contents();
        ob_end_clean();
        break;
    default:
        $results['rfc3514'] = '0x1';
        break;
}
// switch on action;
// We always do this
echo xoutput_from_array($results);
Esempio n. 2
0
require_once '../lib/init.php';
debug_event('refresh_reordered.server.php', 'Called for action: {' . $_REQUEST['action'] . '}', '5');
/* Switch on the action passed in */
switch ($_REQUEST['action']) {
    case 'refresh_playlist_medias':
        $playlist = new Playlist($_REQUEST['id']);
        $playlist->format();
        $object_ids = $playlist->get_items();
        $browse = new Browse();
        $browse->set_type('playlist_media');
        $browse->add_supplemental_object('playlist', $playlist->id);
        $browse->set_static_content(true);
        $browse->show_objects($object_ids);
        $browse->store();
        break;
    case 'refresh_album_songs':
        $browse = new Browse();
        $browse->set_show_header(true);
        $browse->set_type('song');
        $browse->set_simple_browse(true);
        $browse->set_filter('album', $_REQUEST['id']);
        $browse->set_sort('track', 'ASC');
        $browse->get_objects();
        echo "<div id='browse_content_song' class='browse_content'>";
        $browse->show_objects(null, true);
        // true argument is set to show the reorder column
        $browse->store();
        echo "</div>";
        break;
}
// switch on the action
Esempio n. 3
0
         $browse->set_filter($_REQUEST['key'], $_REQUEST['multi_alpha_filter']);
         $browse->set_catalog($_SESSION['catalog']);
     }
     if ($_REQUEST['sort']) {
         // Set the new sort value
         $browse->set_sort($_REQUEST['sort']);
     }
     if ($_REQUEST['catalog_key'] || $_SESSION['catalog'] != 0) {
         $browse->set_filter('catalog', $_REQUEST['catalog_key']);
         $_SESSION['catalog'] = $_REQUEST['catalog_key'];
     } elseif ($_REQUEST['catalog_key'] == 0) {
         $browse->set_filter('catalog', null);
         unset($_SESSION['catalog']);
     }
     ob_start();
     $browse->show_objects(null, $argument);
     $results[$browse->get_content_div()] = ob_get_clean();
     break;
 case 'set_sort':
     if ($_REQUEST['sort']) {
         $browse->set_sort($_REQUEST['sort']);
     }
     if (!$browse->get_use_pages()) {
         $browse->set_start(0);
     }
     ob_start();
     $browse->show_objects(null, $argument);
     $results[$browse->get_content_div()] = ob_get_clean();
     break;
 case 'toggle_tag':
     $type = $_SESSION['tagcloud_type'] ? $_SESSION['tagcloud_type'] : 'song';
Esempio n. 4
0
        if (isset($_POST['license_id'])) {
            $license = new License($_POST['license_id']);
            if ($license->id) {
                $license->update($_POST);
            }
            $text = T_('License Updated');
        } else {
            License::create($_POST);
            $text = T_('License Created');
        }
        show_confirmation($text, '', AmpConfig::get('web_path') . '/admin/license.php');
        break;
    case 'show_edit':
        $license = new License($_REQUEST['license_id']);
    case 'show_create':
        require_once AmpConfig::get('prefix') . '/templates/show_edit_license.inc.php';
        break;
    case 'delete':
        License::delete($_REQUEST['license_id']);
        show_confirmation(T_('License Deleted'), '', AmpConfig::get('web_path') . '/admin/license.php');
        break;
    default:
        $browse = new Browse();
        $browse->set_type('license');
        $browse->set_simple_browse(true);
        $license_ids = $browse->get_objects();
        $browse->show_objects($license_ids);
        $browse->store();
        break;
}
UI::show_footer();
Esempio n. 5
0
    ?>
            <li><a id="concerts_link" href="#concerts"><?php 
    echo T_('Events');
    ?>
</a></li>
<?php 
}
?>
            <!-- Needed to avoid the 'only one' bug -->
            <li></li>
        </ul>
    </div>
    <div id="tabs_content">
        <div id="albums" class="tab_content" style="display: block;">
<?php 
$browse->show_objects($object_ids, true);
// Passing 'true' means that we allow grouping albums by disks depending on the configuration
$browse->store();
?>
        </div>
<?php 
if (AmpConfig::get('wanted')) {
    echo Ajax::observe('missing_albums_link', 'click', Ajax::action('?page=index&action=wanted_missing_albums&artist=' . $artist->id, 'missing_albums'));
    ?>
        <div id="missing_albums" class="tab_content">
        <?php 
    UI::show_box_top(T_('Missing Albums'), 'info-box');
    echo T_('Loading...');
    UI::show_box_bottom();
    ?>
        </div>
Esempio n. 6
0
 * 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.
 *
 */
require_once '../lib/init.php';
if (!Access::check('interface', 100)) {
    UI::access_denied();
    exit;
}
UI::show_header();
switch ($_REQUEST['action']) {
    default:
        // Show Catalogs
        $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();
        break;
}
UI::show_footer();
Esempio n. 7
0
<?php

/* vim:set softtabstop=4 shiftwidth=4 expandtab: */
/**
 *
 * LICENSE: GNU General Public License, version 2 (GPLv2)
 * Copyright 2001 - 2015 Ampache.org
 *
 * 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.
 *
 */
$object_ids = Wanted::get_wanted_list();
$browse = new Browse();
$browse->set_type('wanted');
$browse->set_static_content(true);
$browse->save_objects($object_ids);
$browse->show_objects($object_ids);
$browse->store();
Esempio n. 8
0
    <li>
        <?php 
echo T_('Wanted actions');
?>
:
        <div id="wanted_action_<?php 
echo $walbum->mbid;
?>
">
        <?php 
$walbum->show_action_buttons();
?>
        </div>
    </li>
</ul>
</div>
<?php 
UI::show_box_bottom();
?>
<div id="additional_information">
&nbsp;
</div>
<div>
<?php 
$browse = new Browse();
$browse->set_type('song_preview');
$browse->set_static_content(true);
$browse->show_objects($walbum->songs);
?>
</div>
Esempio n. 9
0
     <?php 
 $following_ids = $client->get_following();
 $browse = new Browse();
 $browse->set_type('user');
 $browse->set_simple_browse(false);
 $browse->show_objects($following_ids);
 $browse->store();
 ?>
     </div>
     <div id="followers" class="tab_content">
     <?php 
 $follower_ids = $client->get_followers();
 $browse = new Browse();
 $browse->set_type('user');
 $browse->set_simple_browse(false);
 $browse->show_objects($follower_ids);
 $browse->store();
 ?>
     </div>
         <div id="timeline" class="tab_content">
             <?php 
 if (Preference::get_by_user($client->id, 'allow_personal_info_recent')) {
     $activities = Useractivity::get_activities($client->id);
     Useractivity::build_cache($activities);
     foreach ($activities as $aid) {
         $activity = new Useractivity($aid);
         $activity->show();
     }
 }
 ?>
         </div>
Esempio n. 10
0
            $history = $working_user->get_ip_history(0, 1);
        } else {
            $history = $working_user->get_ip_history();
        }
        require AmpConfig::get('prefix') . '/templates/show_ip_history.inc.php';
        break;
    case 'show_add_user':
        if (AmpConfig::get('demo_mode')) {
            break;
        }
        require_once AmpConfig::get('prefix') . '/templates/show_add_user.inc.php';
        break;
    case 'show_preferences':
        $client = new User($_REQUEST['user_id']);
        $preferences = Preference::get_all($client->id);
        require_once AmpConfig::get('prefix') . '/templates/show_user_preferences.inc.php';
        break;
    default:
        $browse = new Browse();
        $browse->reset_filters();
        $browse->set_type('user');
        $browse->set_simple_browse(true);
        $browse->set_sort('name', 'ASC');
        $user_ids = $browse->get_objects();
        $browse->show_objects($user_ids);
        $browse->store();
        break;
}
// end switch on action
/* Show the footer */
UI::show_footer();
Esempio n. 11
0
$browse = new Browse();
// We limit threshold for all items otherwise the counter will not be the same that the top_sql query.
// Example: Item '1234' => 3 counts during period with 'get_top_sql'. Without threshold, 'show_objects' would return the total which could be 24 during all time)
$browse->set_threshold($thresh_value);
$browse->set_type('song', $sql);
$browse->set_simple_browse(true);
$browse->show_objects();
$browse->store();
$sql = Stats::get_top_sql('album', $thresh_value);
$browse = new Browse();
$browse->set_threshold($thresh_value);
$browse->set_type('album', $sql);
$browse->set_simple_browse(true);
$browse->show_objects();
$browse->store();
$sql = Stats::get_top_sql('artist', $thresh_value);
$browse = new Browse();
$browse->set_threshold($thresh_value);
$browse->set_type('artist', $sql);
$browse->set_simple_browse(true);
$browse->show_objects();
$browse->store();
if (AmpConfig::get('allow_video')) {
    $sql = Stats::get_top_sql('video');
    $browse = new Browse();
    $browse->set_type('video', $sql);
    $browse->set_simple_browse(true);
    $browse->show_objects(null);
    $browse->store();
}
UI::show_box_bottom();
Esempio n. 12
0
switch ($_REQUEST['action']) {
    case 'edit_shout':
        $shout = new Shoutbox($_REQUEST['shout_id']);
        if ($shout->id) {
            $shout->update($_POST);
        }
        show_confirmation(T_('Shoutbox Post Updated'), '', AmpConfig::get('web_path') . '/admin/shout.php');
        break;
    case 'show_edit':
        $shout = new Shoutbox($_REQUEST['shout_id']);
        $object = Shoutbox::get_object($shout->object_type, $shout->object_id);
        $object->format();
        $client = new User($shout->user);
        $client->format();
        require_once AmpConfig::get('prefix') . '/templates/show_edit_shout.inc.php';
        break;
    case 'delete':
        Shoutbox::delete($_REQUEST['shout_id']);
        show_confirmation(T_('Shoutbox Post Deleted'), '', AmpConfig::get('web_path') . '/admin/shout.php');
        break;
    default:
        $browse = new Browse();
        $browse->set_type('shoutbox');
        $browse->set_simple_browse(true);
        $shoutbox_ids = $browse->get_objects();
        $browse->show_objects($shoutbox_ids);
        $browse->store();
        break;
}
// end switch on action
UI::show_footer();
Esempio n. 13
0
 *
 */
require_once 'lib/init.php';
UI::show_header();
/**
 * action switch
 */
switch ($_REQUEST['action']) {
    case 'search':
        if ($_REQUEST['rule_1'] != 'missing_artist') {
            $browse = new Browse();
            require_once AmpConfig::get('prefix') . '/templates/show_search_form.inc.php';
            require_once AmpConfig::get('prefix') . '/templates/show_search_options.inc.php';
            $results = Search::run($_REQUEST);
            $browse->set_type($_REQUEST['type']);
            $browse->show_objects($results);
            $browse->store();
        } else {
            $wartists = Wanted::search_missing_artists($_REQUEST['rule_1_input']);
            require_once AmpConfig::get('prefix') . '/templates/show_missing_artists.inc.php';
            echo '<a href="http://musicbrainz.org/search?query=' . rawurlencode($_REQUEST['rule_1_input']) . '&type=artist&method=indexed" target="_blank">' . T_('View on MusicBrainz') . '</a><br />';
        }
        break;
    case 'save_as_smartplaylist':
        if (!Access::check('interface', 25)) {
            UI::access_denied();
            exit;
        }
        $playlist = new Search();
        $playlist->parse_rules(Search::clean_request($_REQUEST));
        $playlist->save();
Esempio n. 14
0
        </ul>
    </div>
    <div id="tabs_content">
        <div id="albums" class="tab_content" style="display: block;">
<?php 
if (!isset($multi_object_ids)) {
    $multi_object_ids = array('' => $object_ids);
}
foreach ($multi_object_ids as $key => $object_ids) {
    $title = !empty($key) ? ucwords($key) : '';
    $browse = new Browse();
    $browse->set_type($object_type);
    if (!empty($key)) {
        $browse->set_content_div_ak($key);
    }
    $browse->show_objects($object_ids, array('group_disks' => true, 'title' => $title));
    $browse->store();
}
?>
        </div>
<?php 
if (AmpConfig::get('wanted')) {
    echo Ajax::observe('missing_albums_link', 'click', Ajax::action('?page=index&action=wanted_missing_albums&artist=' . $artist->id, 'missing_albums'));
    ?>
        <div id="missing_albums" class="tab_content">
        <?php 
    UI::show_box_top(T_('Missing Albums'), 'info-box');
    echo T_('Loading...');
    UI::show_box_bottom();
    ?>
        </div>