/** * Used to load the requested page from POST or GET * @global type $input */ function load_page() { global $input; $action = $input['action']; $redraw = false; // // Actions // // Controller goes here switch ($action) { // The user clicked on an album, we display its content to them // Display the help page case 'view_help': view_help(); break; case 'view_settings': view_settings(); break; // In case we want to log out // In case we want to log out case 'logout': user_logout(); break; // The only case when we could possibly arrive here with a session created // and a "login" action is when the user refreshed the page. In that case, // we redraw the page with the last information saved in the session variables. // The only case when we could possibly arrive here with a session created // and a "login" action is when the user refreshed the page. In that case, // we redraw the page with the last information saved in the session variables. case 'login': redraw_page(); break; case 'anonymous_login': anonymous_login(); break; case 'admin_mode_update': admin_mode_update(); break; case 'view_album_assets': view_album_assets(); break; case 'view_asset_details': view_asset_details(); break; case 'view_asset_bookmark': view_asset_bookmark(); break; case 'search_bookmark': bookmarks_search(); break; case 'sort_asset_bookmark': bookmarks_sort(); break; case 'add_asset_bookmark': bookmark_add(); break; case 'add_asset_thread': thread_add(); break; case 'add_thread_comment': comment_add(); break; case 'add_thread_comment_answer': comment_add_reply(); break; case 'update_thread_comment': comment_edit(); break; case 'update_asset_thread': thread_edit(); break; case 'thread_details_view': thread_details_update(); break; case 'delete_asset_thread': thread_delete(); break; case 'delete_thread_comment': comment_delete(); break; case 'edit_settings': preferences_update(); break; case 'edit_asset_meta': asset_edit_meta(); break; case 'vote': vote_add(); break; case 'approve': comment_edit_approval(); break; case 'threads_list_view': threads_list_update(); break; case 'copy_bookmark': bookmark_copy(); break; case 'share_popup': share_popup(); break; case 'bookmark_popup': bookmark_popup(); break; case 'bookmarks_popup': bookmarks_popup(); break; case 'remove_asset_bookmark': bookmark_delete(); break; case 'remove_asset_bookmarks': bookmarks_delete_all(); break; case 'view_import': view_import(); break; case 'upload_bookmarks': bookmarks_upload(); break; case 'import_bookmarks': bookmarks_import(); break; case 'export_bookmarks': bookmarks_export(); break; case 'export_album_bookmarks': bookmarks_export_all(); break; case 'export_asset_bookmarks': bookmarks_export_all(true); break; case 'delete_bookmarks': bookmarks_delete(); break; case 'move_album_token': album_token_move(); break; case 'delete_album_token': album_token_delete(); break; case 'client_trace': client_trace(); break; // No action selected: we choose to display the homepage again // No action selected: we choose to display the homepage again default: // TODO: check session var here view_main(); } }
$at = isset($_GET['at']) ? $_GET['at'] : 0; switch ($_GET['do']) { case 'view': post_view($to); break; case 'edit': post_edit($to); break; case 'delete': post_delete($to); break; case 'reply': comment_add($to, TRUE); break; case 'comment': comment_edit($to); break; case 'clear': comment_delete($to); break; case 'post': post_add($at); break; case 'board': board_view($at); break; case 'join': member_join(); break; case 'modify': member_modify();