class Dashboard (View source)
The Dashboard class loads the required dashboard elements for the requested context.
|$output||The GUI's buffered HTML.|
at line 118
Load the site's global data and include modules according to the current context.
When a the GUI gets initialized, at first it gets verified, if an user is logged in or not. That has the highest priority. If no user is logged in, the existance of "config/accounts.txt" gets checked and either the login or the install module gets loaded. In case an ajax request is sent while a user got already logged out (in another browser tab or window), the response will be a 'redirect' to the GUI login page, to log in there.
If an user is logged in, the Automad object gets created and the current "context" gets determined from the GET parameters. According to that context, the matching module gets loaded after verifying its exsistence. When there is no context passed via get, it gets checked for "ajax", to possibly call a matching ajax module. If both is negative, the dashboard module gets included.
Example Context: http://domain.com/gui?context=edit_page will include automad/gui/context/edit_page.php Example Ajax: http://domain.com/gui?ajax=page_data will include automad/gui/ajax/page_data.php
Since every request for the gui (pages and ajax) gets still routed over "/index.php" > "/automad/init.php" > new GUI\Dashboard(), all the session/login checking needs only to be done here once, simply because all modules get includede here.