/** 
 * Handle admin tasks for cart66
 */
function cc_task_dispatcher()
{
    $task = cc_get('cc-task', 'key');
    // CC_Log::write( "Task dispatcher found: $task" );
    if ($task) {
        switch ($task) {
            case 'dismiss_notification_theme_support':
                CC_Admin_Notifications::dismiss('cart66_theme_support');
                break;
            case 'dismiss_notification_permalinks':
                CC_Admin_Notifications::dismiss('cart66_permalinks');
                break;
            case 'dismiss_notification_migration':
                CC_Admin_Notifications::dismiss('cart66_migration');
                break;
            case 'download_log':
                CC_Log::download();
                break;
            case 'reset_log':
                CC_Log::reset();
                break;
            case 'test_remote_calls':
                $tests = new CC_Cloud_Remote_Check();
                $tests->run();
                break;
            case 'create_slurp_page':
                CC_Page_Slurp::create_slurp_page();
                break;
            case 'migrate_settings':
                $migration = new CC_Migration();
                $migration->run();
                break;
        }
    }
}