username . ' attempted to change the state of a song','1'); exit; } $song = new Song($_REQUEST['song_id']); $new_enabled = $song->enabled ? false : true; $song->update_enabled($new_enabled,$song->id); $song->enabled = $new_enabled; $song->format(); //Return the new Ajax::button $id = 'button_flip_state_' . $song->id; $button = $song->enabled ? 'disable' : 'enable'; $results[$id] = Ajax::button('?page=song&action=flip_state&song_id=' . $song->id,$button, T_(ucfirst($button)),'flip_state_' . $song->id); break; case 'shouts': ob_start(); $type = $_REQUEST['object_type']; $id = $_REQUEST['object_id']; if ($type == "song") { $media = new Song($id); $shouts = Shoutbox::get_shouts($type, $id); echo "\r\n"; } $results['shouts_data'] = ob_get_clean(); break; default: $results['rfc3514'] = '0x1'; break; } // switch on action; // We always do this echo xoutput_from_array($results);