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() {
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
);
}
/**

View File

@ -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
);
}
?>