@ -113,11 +113,11 @@ class Locations extends AbstractController
$request->request->get("loc_tags") == ""
) {
$notice = "All fields are required, champ.";
return $this->render("back/locations.twig", [
"title" => "Bad Space | Locations | Add" ,
"notice" => $notice ,
"mode" => "add "
] );
return $render->page(
["mode" => "add", "notice" => $notice] ,
"Bad Space | Locations | Add" ,
"back/locations.twig "
);
}
//once everything clears, upload images and process request
@ -132,29 +132,26 @@ class Locations extends AbstractController
}
$response = $locations->modifyLocation($request, $result["id"], $mode, $request->request->get("uuid"));
if ($response["status"]) {
$options = [];
if ($mode == 'add') {
$options = [
"title" => "Bad Space | Locations | Add" ,
"notice" => $response["message"] ,
"mode" => $mode
] ;
return $render->page(
["mode" => $mode, "notice" => $response["message"]] ,
"Bad Space | Locations | Add" ,
"back/locations.twig"
) ;
} else {
$location = $locations->getLocationbyUUID($request->request->get("uuid"));
$options = [
"title" => "Bad Space | Locations | Edit",
"mode" => $mode,
"notice" => $response["message"],
"location" => $location[0]
];
return $render->page(
["mode" => $mode, "notice" => $response["message"], "location" => $location[0]],
"Bad Space | Locations | Edit",
"back/locations.twig"
);
}
return $this->render("back/locations.twig", $options);
} else {
return $this->render("back/locations.twig", [
"title" => "Bad Space | Locations | Error" ,
"notice" => $response["message"] ,
"mode" => $mode
] );
return $render->page(
["mode" => $mode, "notice" => $response["message"]] ,
"Bad Space | Locations | Error" ,
"back/locations.twig"
);
}
}
} else {
@ -227,17 +224,17 @@ class Locations extends AbstractController
$response = $locations->addMultipleLocations($file, $result["id"]);
if ($response["status"]) {
$notice = "New locations added! Take a break.";
return $this->render("back/locations.twig", [
"title" => "Bad Space | Locations | Add" ,
"notice" => $response["message"] ,
"mode" => "bulk-add "
] );
return $render->page(
["mode" => "bulk-add", "notice" => $response["message"], ] ,
"Bad Space | Locations | Bulk Add" ,
"back/locations.twig "
);
} else {
return $this->render("back/locations.twig", [
"title" => "Bad Space | Locations | Add" ,
"notice" => $response["message"] ,
"mode" => "bulk-add "
] );
return $render->page(
["mode" => "bulk-add", "notice" => $response["message"], ] ,
"Bad Space | Locations | Bulk Add" ,
"back/locations.twig "
);
}
}
} else {