From a33fc5e21d55326fcff69c48a53f6a661a7cbf04 Mon Sep 17 00:00:00 2001 From: Philip Häusler Date: Tue, 13 May 2014 11:20:48 +0200 Subject: router simplification --- includes/controller/angeltypes_controller.php | 21 ++++++-------------- includes/controller/user_angeltypes_controller.php | 23 ++++++---------------- 2 files changed, 12 insertions(+), 32 deletions(-) (limited to 'includes/controller') diff --git a/includes/controller/angeltypes_controller.php b/includes/controller/angeltypes_controller.php index 474540d6..bcd7696e 100644 --- a/includes/controller/angeltypes_controller.php +++ b/includes/controller/angeltypes_controller.php @@ -13,29 +13,20 @@ function angeltypes_title() { function angeltypes_controller() { if (! isset($_REQUEST['action'])) $_REQUEST['action'] = 'list'; + switch ($_REQUEST['action']) { default: case 'list': - list($title, $content) = angeltypes_list_controller(); - break; + return angeltypes_list_controller(); case 'view': - list($title, $content) = angeltype_controller(); - break; + return angeltype_controller(); case 'edit': - list($title, $content) = angeltype_edit_controller(); - break; + return angeltype_edit_controller(); case 'delete': - list($title, $content) = angeltype_delete_controller(); - break; + return angeltype_delete_controller(); case 'about': - list($title, $content) = angeltypes_about_controller(); - break; + return angeltypes_about_controller(); } - - return array( - $title, - $content - ); } /** diff --git a/includes/controller/user_angeltypes_controller.php b/includes/controller/user_angeltypes_controller.php index 62987c78..b955fe6d 100644 --- a/includes/controller/user_angeltypes_controller.php +++ b/includes/controller/user_angeltypes_controller.php @@ -263,31 +263,20 @@ function user_angeltypes_controller() { switch ($_REQUEST['action']) { case 'delete_all': - list($title, $content) = user_angeltypes_delete_all_controller(); - break; + return user_angeltypes_delete_all_controller(); case 'confirm_all': - list($title, $content) = user_angeltypes_confirm_all_controller(); - break; + return user_angeltypes_confirm_all_controller(); case 'confirm': - list($title, $content) = user_angeltype_confirm_controller(); - break; + return user_angeltype_confirm_controller(); case 'delete': - list($title, $content) = user_angeltype_delete_controller(); - break; + return user_angeltype_delete_controller(); case 'update': - list($title, $content) = user_angeltype_update_controller(); - break; + return user_angeltype_update_controller(); case 'add': - list($title, $content) = user_angeltype_add_controller(); - break; + return user_angeltype_add_controller(); default: redirect(page_link_to('angeltypes')); } - - return array( - $title, - $content - ); } ?> \ No newline at end of file -- cgit v1.2.3-70-g09d2