Ways to show an alternate view:
configs:
sitemanagerView: name of the view to be shown
sitemanagerViewType: “local” or otherwise, where local looks for files locally in client folder.
Session vars:
sitemanagerView: same as above
sitemanagerViewType: same as above
These currently pull from “extra_data” in user’s account and are set as properties directly in the session
To create an alternate view:
Create a local/master version of CLS . sitemanager/sitemanagerInjector_{view}.php where {view} is view name.
Create a local version of sitemanager/js/nav/nav_{view}.js
Create local/master version of sitemanager/js/widgets/dashboard-notifications_{view}.js
SitemanagerInjector Class:
This class defines functions that are used to inject the sitemanager header bar and side nav bar. It is overridden by using a naming convention sitemanagerInjector_{viewname}.php, with a class name inside sitemanagerInjector_{viewname}. The view is specified by the session for the user, or by the config for the whole client.
These replace the original printHeader and printNav functions in sitemanager/html/nav/main and sitemanager/html/header/main. They are called from html/header/main.php, html/footer/main.php, and global/classes/adminPageAssembler::printHeader()
SiteManager View Class:
This class simply provides some utility functions for loading and identifying injector view classes
Troubleshooting:
Here are some issues that can cause complications showing the right view.
Caching:
When a config such as sitemanagerView is loaded, it is cached – even if it is a local config, specified in $client/global/localConfigs.php. Clearing the cache will help, after the config is set to the desired value. It is best to do this while the user is logged out.
Session Storage:
sitemanagerView and sitemanagerViewType are stored in the session for the user, so that they don’t have to be continually looked up in various places. Even after configs change, the user will still have these session variables set until they are logged out.