/** * Dispatch get actions * * @param array $segments Method segments indicate action and resource * * @return void */ public function restGet($segments) { $action_id = $segments[0]; switch ($action_id) { case 'get-song-audio-td': $validate_song_id = LMValidateHelper::validateNoEmpty($_GET['song_id']); if (!$validate_song_id) { $type = 'not_exist_value'; $parameter = array("none" => "none"); $error_messanger = new LMErrorMessenger($type, $parameter); $error_messanger->printErrorJSON(); unset($error_messanger); } else { $song_id = $_GET['song_id']; require SITE_ROOT . "/ajax-action/SongActionView/song-audio-td.php"; } break; case 'song-list': $offset = $_GET['offset']; if (!LMValidateHelper::validateNoEmpty($offset)) { $offset = 0; } $length = $_GET['length']; if (!LMValidateHelper::validateNoEmpty($length)) { $length = 33; } switch ($_GET['song_list_type']) { case 'audio': $song_list_type = 'audio'; break; case 'no-audio': $song_list_type = 'no-audio'; break; case 'all': default: $song_list_type = 'all'; break; } $song_god_obj = new LMSongGod(); $song_list = $song_god_obj->getList($song_list_type, $offset, $length); require SITE_ROOT . "/ajax-action/SongActionView/song-list.php"; unset($song_god_obj); break; default: $type = 'page_not_found'; $parameter = array("none" => "none"); $error_messanger = new LMErrorMessenger($type, $parameter); $error_messanger->printErrorJSON(); unset($error_messanger); break; } }
/** * Dispatch get actions * * @param array $segments Method segments indicate action and resource * * @return void */ public function restGet($segments) { $action_id = $segments[0]; switch ($action_id) { case 'login-form': include SITE_ROOT . '/ajax-action/BoxActionView/login-form.php'; break; case 'edit-lyric-form': $song_id = $_GET['song_id']; $size = $_GET['size']; if (empty($size)) { $size = "500px"; } $song_obj = new LMSong($song_id); include SITE_ROOT . '/ajax-action/BoxActionView/edit-lyric-form.php'; unset($song_obj); break; case 'upload-audio-form': $song_id = $_GET['song_id']; $size = $_GET['size']; if (empty($size)) { $size = "500px"; } include SITE_ROOT . '/ajax-action/BoxActionView/upload-audio-form.php'; break; case 'upload-midi-form': $song_id = $_GET['song_id']; $size = $_GET['size']; if (empty($size)) { $size = "500px"; } include SITE_ROOT . '/ajax-action/BoxActionView/upload-midi-form.php'; break; case 'alert-no-licence': $size = $_GET['size']; if (empty($size)) { $size = "500px"; } include SITE_ROOT . '/ajax-action/BoxActionView/alert-no-licence.php'; break; case 'r-song-box': $size = $_GET['size']; if (empty($size)) { $size = "500px"; } $song_id = $_GET['song_id']; $song_id_array = explode('_', $song_id); $original_song_id = $song_id_array[0]; //$song_o_obj = new LMSong($song_id_array[0]); if ($song_id_array[1] == 'a') { $r_title = "靜夜思"; $r_lyric = "床前明月光<br/>疑是地上霜<br/>舉頭望明月<br/>低頭思故鄉"; } else { $song_r_obj = new LMSong($song_id_array[1]); $r_title = $song_r_obj->title; $r_lyric = $song_r_obj->lyric; } include SITE_ROOT . '/ajax-action/BoxActionView/r-song-box.php'; //unset($song_o_obj); unset($song_r_obj); break; case 'send-sms-box': $size = $_GET['size']; if (empty($size)) { $size = "500px"; } $url = $_GET['url']; include SITE_ROOT . '/ajax-action/BoxActionView/send-sms-box.php'; unset($song_obj); break; default: $type = 'page_not_found'; $parameter = array("none" => "none"); $error_messanger = new LMErrorMessenger($type, $parameter); $error_messanger->printErrorJSON(); unset($error_messanger); break; } }
/** * Dispatch get actions * * @param array $segments Method segments indicate action and resource * * @return void */ public function restGet($segments) { $action_id = $segments[0]; switch ($action_id) { default: $type = 'page_not_found'; $parameter = array("none" => "none"); $error_messanger = new LMErrorMessenger($type, $parameter); $error_messanger->printErrorJSON(); unset($error_messanger); break; } }