Add support to load templates from json files
Our config.inc.php was getting a bit long and unreadable, so i added support for loading templates from .json files.
For existing installs this changes nothing as templates loaded from files are appended to the existing $templates before the "is this user allowed to use this template" check.
If an error is encountered loading a template a message is logged and the template is skipped.
Cool, thanks. How do 'we' feel about including json-files that are not checked on sanity at all?
I can see two ways of reasoning here myself.
The first one would be that this is already slightly more sanity checked than templates in config.inc.php. Because a failed file_get_contents or json_decode will only result in an error in the log and a correctly functioning nsedit (but without the template that failed to load).
The second way of thinking would be that if someone touches this anyway they should do full sanity checking on the content of the template as well. I obviously did not do that as i wasn't sure the functionality would be welcome in nsedit at all, but if you want i can try to find the time to add full sanity checking to the loaded templates.
@tuxis-ie Is it possible to merge this, or are there still unresolved objections?