Where Inclusion System Explained
Purpose
The purpose of this document is to explain how the current "where inclusion" system currently works as it is at the core of the phpESP system and thus currently the VULab system.
This "Where Inclusion" system is one of the biggest bottlenecks currently in the VULab system.
Explanations
How it works
-
- The admin/user system runs entirely through manage.php which takes in all user access information and then displays the page based on a $where variable.
- $where is the variable that controls what page is included into manage.php
- The $where variable can be passed via $_GET[where] or $_POST[where]
- If the $_POST[where] variable is used then an input[type=hidden] variable is set with php to save the $where
- There is a simple check to see if the logged in user is a "researcher" aka an admin, or is a "tester" aka a simple user.
- This simple check includes a $interface variable to the end of the $where, ex. $where = "home"."_tester";
Where it works
-
- manage.php grabs the $where variable and includes the file with the exact name from /admin/includes/where/<$where>.inc
- manage.php is located in /admin/manage.php
- after the main login happens the user is redirected to manage.php
Why it Doesn't Work
-
- As stated in the "How it Works" section, the $where variable is designed to be passed via $_POST or $_GET and this can get confusing in using the variable in various logic locations as well as the views.
- Because the $where variable is saved from page to page via an input[type=hidden] variable, we need to dynamically change the DOM whenever we want to control the workflow.
- Because currently the system uses a DOM/POST/GET controlled single variable workflow system, it is difficult to control "steps" within a $where context. ex. $where = Survey, $step = '1';
, multiple selections available,