router simplification

This commit is contained in:
Philip Häusler 2014-05-13 11:20:48 +02:00
parent 3401c6f8b6
commit a33fc5e21d
2 changed files with 12 additions and 32 deletions

View File

@ -13,29 +13,20 @@ function angeltypes_title() {
function angeltypes_controller() { function angeltypes_controller() {
if (! isset($_REQUEST['action'])) if (! isset($_REQUEST['action']))
$_REQUEST['action'] = 'list'; $_REQUEST['action'] = 'list';
switch ($_REQUEST['action']) { switch ($_REQUEST['action']) {
default: default:
case 'list': case 'list':
list($title, $content) = angeltypes_list_controller(); return angeltypes_list_controller();
break;
case 'view': case 'view':
list($title, $content) = angeltype_controller(); return angeltype_controller();
break;
case 'edit': case 'edit':
list($title, $content) = angeltype_edit_controller(); return angeltype_edit_controller();
break;
case 'delete': case 'delete':
list($title, $content) = angeltype_delete_controller(); return angeltype_delete_controller();
break;
case 'about': case 'about':
list($title, $content) = angeltypes_about_controller(); return angeltypes_about_controller();
break;
} }
return array(
$title,
$content
);
} }
/** /**

View File

@ -263,31 +263,20 @@ function user_angeltypes_controller() {
switch ($_REQUEST['action']) { switch ($_REQUEST['action']) {
case 'delete_all': case 'delete_all':
list($title, $content) = user_angeltypes_delete_all_controller(); return user_angeltypes_delete_all_controller();
break;
case 'confirm_all': case 'confirm_all':
list($title, $content) = user_angeltypes_confirm_all_controller(); return user_angeltypes_confirm_all_controller();
break;
case 'confirm': case 'confirm':
list($title, $content) = user_angeltype_confirm_controller(); return user_angeltype_confirm_controller();
break;
case 'delete': case 'delete':
list($title, $content) = user_angeltype_delete_controller(); return user_angeltype_delete_controller();
break;
case 'update': case 'update':
list($title, $content) = user_angeltype_update_controller(); return user_angeltype_update_controller();
break;
case 'add': case 'add':
list($title, $content) = user_angeltype_add_controller(); return user_angeltype_add_controller();
break;
default: default:
redirect(page_link_to('angeltypes')); redirect(page_link_to('angeltypes'));
} }
return array(
$title,
$content
);
} }
?> ?>