get_catalog_ids(); case 'add_to_catalog': toggle_visible('ajax-loading'); ob_end_flush(); if (Config::get('demo_mode')) { break; } if ($_REQUEST['catalogs'] ) { foreach ($_REQUEST['catalogs'] as $catalog_id) { $catalog = new Catalog($catalog_id); $catalog->add_to_catalog(); } } $url = Config::get('web_path') . '/admin/index.php'; $title = _('Catalog Updated'); $body = ''; show_confirmation($title,$body,$url); toggle_visible('ajax-loading'); break; case 'update_all_catalogs': $_REQUEST['catalogs'] = Catalog::get_catalog_ids(); case 'update_catalog': toggle_visible('ajax-loading'); ob_end_flush(); /* If they are in demo mode stop here */ if (Config::get('demo_mode')) { break; } if (isset($_REQUEST['catalogs'])) { foreach ($_REQUEST['catalogs'] as $catalog_id) { $catalog = new Catalog($catalog_id); $catalog->verify_catalog($catalog_id); } } $url = Config::get('web_path') . '/admin/index.php'; $title = _('Catalog Updated'); $body = ''; show_confirmation($title,$body,$url); toggle_visible('ajax-loading'); break; case 'full_service': toggle_visible('ajax-loading'); ob_end_flush(); /* Make sure they aren't in demo mode */ if (Config::get('demo_mode')) { access_denied(); break; } if (!$_REQUEST['catalogs']) { $_REQUEST['catalogs'] = Catalog::get_catalog_ids(); } /* This runs the clean/verify/add in that order */ foreach ($_REQUEST['catalogs'] as $catalog_id) { $catalog = new Catalog($catalog_id); $catalog->clean_catalog($catalog_id); $catalog->count = 0; $catalog->verify_catalog($catalog_id); $catalog->count = 0; $catalog->add_to_catalog($catalog_id); } $url = Config::get('web_path') . '/admin/index.php'; $title = _('Catalog Updated'); $body = ''; show_confirmation($title,$body,$url); toggle_visible('ajax-loading'); break; case 'delete_catalog': /* Make sure they aren't in demo mode */ if (Config::get('demo_mode')) { break; } if (!Core::form_verify('delete_catalog')) { access_denied(); exit; } /* Delete the sucker, we don't need to check perms as thats done above */ Catalog::delete($_GET['catalog_id']); $next_url = Config::get('web_path') . '/admin/index.php'; show_confirmation(_('Catalog Deleted'),_('The Catalog and all associated records have been deleted'),$nexturl); break; case 'show_delete_catalog': $catalog_id = scrub_in($_GET['catalog_id']); $next_url = Config::get('web_path') . '/admin/catalog.php?action=delete_catalog&catalog_id=' . scrub_out($catalog_id); show_confirmation(_('Catalog Delete'),_('Confirm Deletion Request'),$next_url,1,'delete_catalog'); break; case 'remove_disabled': if (conf('demo_mode')) { break; } $song = $_REQUEST['song']; if (count($song)) { $catalog->remove_songs($song); $body = _('Songs Removed'); } else { $body = _('No Songs Removed'); } $url = conf('web_path') . '/admin/index.php'; $title = _('Disabled Songs Processed'); show_confirmation($title,$body,$url); break; case 'clean_all_catalogs': $catalog = new Catalog(); $_REQUEST['catalogs'] = Catalog::get_catalog_ids(); case 'clean_catalog': toggle_visible('ajax-loading'); ob_end_flush(); /* If they are in demo mode stop them here */ if (Config::get('demo_mode')) { break; } // Make sure they checked something if (isset($_REQUEST['catalogs'])) { foreach($_REQUEST['catalogs'] as $catalog_id) { $catalog = new Catalog($catalog_id); $catalog->clean_catalog(0,1); } // end foreach catalogs } $url = Config::get('web_path') . '/admin/index.php'; $title = _('Catalog Cleaned'); $body = ''; show_confirmation($title,$body,$url); toggle_visible('ajax-loading'); break; case 'update_catalog_settings': /* No Demo Here! */ if (Config::get('demo_mode')) { break; } /* Update the catalog */ Catalog::update_settings($_REQUEST); $url = Config::get('web_path') . '/admin/index.php'; $title = _('Catalog Updated'); $body = ''; show_confirmation($title,$body,$url); break; case 'add_catalog': /* Wah Demo! */ if (Config::get('demo_mode')) { break; } ob_end_flush(); if (!strlen($_REQUEST['path']) || !strlen($_REQUEST['name'])) { Error::add('general','Error Name and path not specified'); } if (substr($_REQUEST['path'],0,7) != 'http://' && $_REQUEST['type'] == 'remote') { Error::add('general','Error Remote selected, but path is not a URL'); } if ($_REQUEST['type'] == 'remote' && !strlen($_REQUEST['key'])) { Error::add('general','Error Remote Catalog specified, but no key provided'); } // If an error hasn't occured if (!Error::occurred()) { $catalog_id = Catalog::Create($_REQUEST); if (!$catalog_id) { require Config::get('prefix') . '/templates/show_add_catalog.inc.php'; break; } $catalog = new Catalog($catalog_id); // Run our initial add $catalog->run_add($_REQUEST); show_box_top(); echo "