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
     $browse->set_filter('catalog', $_SESSION['catalog']);
     if (AmpConfig::get('catalog_disable')) {
         $browse->set_filter('catalog_enabled', '1');
     }
     $browse->set_sort('name', 'ASC');
     $browse->update_browse_from_session();
     // Update current index depending on what is in session.
     $browse->show_objects();
     break;
 case 'tag':
     //FIXME: This whole thing is ugly, even though it works.
     $browse->set_sort('count', 'ASC');
     // This one's a doozy
     $browse_type = isset($_REQUEST['type']) ? $_REQUEST['type'] : 'artist';
     $browse->set_simple_browse(false);
     $browse->save_objects(Tag::get_tags($browse_type, 0, 'name'));
     // Should add a pager?
     $object_ids = $browse->get_saved();
     $keys = array_keys($object_ids);
     Tag::build_cache($keys);
     UI::show_box_top(T_('Tag Cloud'), 'box box_tag_cloud');
     $browse2 = new Browse();
     $browse2->set_type($browse_type);
     $browse2->store();
     require_once AmpConfig::get('prefix') . UI::find_template('show_tagcloud.inc.php');
     UI::show_box_bottom();
     $type = $browse2->get_type();
     require_once AmpConfig::get('prefix') . UI::find_template('browse_content.inc.php');
     break;
 case 'artist':
     $browse->set_filter('catalog', $_SESSION['catalog']);
Esempio n. 3
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. 4
0
 case 'file':
     break;
 case 'album':
     $browse->set_filter('catalog', $_SESSION['catalog']);
     if (AmpConfig::get('catalog_disable')) {
         $browse->set_filter('catalog_enabled', '1');
     }
     $browse->set_sort('name', 'ASC');
     $browse->show_objects();
     break;
 case 'tag':
     //FIXME: This whole thing is ugly, even though it works.
     $browse->set_sort('count', 'ASC');
     // This one's a doozy
     $browse->set_simple_browse(false);
     $browse->save_objects(Tag::get_tags());
     // Should add a pager?
     $object_ids = $browse->get_saved();
     $keys = array_keys($object_ids);
     Tag::build_cache($keys);
     UI::show_box_top(T_('Tag Cloud'), 'box box_tag_cloud');
     $browse2 = new Browse();
     $browse2->set_type('song');
     $browse2->store();
     require_once AmpConfig::get('prefix') . '/templates/show_tagcloud.inc.php';
     UI::show_box_bottom();
     $type = $browse2->get_type();
     require_once AmpConfig::get('prefix') . '/templates/browse_content.inc.php';
     break;
 case 'artist':
     $browse->set_filter('catalog', $_SESSION['catalog']);