summaryrefslogtreecommitdiff
path: root/includes/controller/angeltypes_controller.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/controller/angeltypes_controller.php')
-rw-r--r--includes/controller/angeltypes_controller.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/includes/controller/angeltypes_controller.php b/includes/controller/angeltypes_controller.php
index 5607ea7c..cb2bb2fb 100644
--- a/includes/controller/angeltypes_controller.php
+++ b/includes/controller/angeltypes_controller.php
@@ -101,6 +101,7 @@ function angeltype_delete_controller() {
function angeltype_edit_controller() {
global $privileges, $user;
+ $angeltype = null;
$name = "";
$restricted = false;
$description = "";
@@ -266,4 +267,24 @@ function angeltypes_list_controller() {
AngelTypes_list_view($angeltypes, in_array('admin_angel_types', $privileges))
];
}
+
+/**
+ * Loads an angeltype from given angeltype_id request param.
+ */
+function load_angeltype() {
+ if (! isset($_REQUEST['angeltype_id'])) {
+ redirect(page_link_to('angeltypes'));
+ }
+
+ $angeltype = AngelType($_REQUEST['angeltype_id']);
+ if ($angeltype === false) {
+ engelsystem_error("Unable to load angeltype.");
+ }
+ if ($angeltype == null) {
+ error(_("Angeltype doesn't exist."));
+ redirect(page_link_to('angeltypes'));
+ }
+
+ return $angeltype;
+}
?>