From 032607b6ca13b7c0a7088a6b52c5fd4492df4bde Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Sat, 12 Jan 2019 19:04:05 -0500 Subject: Bump version number Signed-off-by: Malf Furious --- app/class/globals.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/class/globals.php') diff --git a/app/class/globals.php b/app/class/globals.php index 8a6efd7..e71ebc6 100644 --- a/app/class/globals.php +++ b/app/class/globals.php @@ -19,7 +19,7 @@ require_once "class/obj.class.php"; * These are utility functions and constants for the Scrott application. */ -define("__VERSION__", "v0.2"); +define("__VERSION__", "v0.3"); /* * These global variables are arrays of strings logged by Scrott business -- cgit v1.2.3 From 9d8613d827dd6e99e36a24c4b37012b93b5e316c Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Sat, 12 Jan 2019 21:19:46 -0500 Subject: Add rudimentary system for launching a modal on page load If the $_SCROTT['AUTO_MODAL'] global is defined, it will refer to a modal's DOM ID to be shown once the page loads. Currently, an error state will supersede this and display the notice modal instead. Signed-off-by: Malf Furious --- app/class/globals.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'app/class/globals.php') diff --git a/app/class/globals.php b/app/class/globals.php index e71ebc6..468ad6d 100644 --- a/app/class/globals.php +++ b/app/class/globals.php @@ -49,6 +49,12 @@ $_SCROTT['PAGE_OBJECT'] = NULL; */ $_SCROTT['PAGE_NAME'] = ""; +/* + * The auto modal variable holds the name (DOM ID) of a modal to automatically + * open on page load. The `stdpage` footer will reference this. + */ +$_SCROTT['AUTO_MODAL'] = ""; + /* * Get the application root path. This is an absolute path on the server. */ @@ -181,6 +187,24 @@ function getPageName() : string return $_SCROTT['PAGE_NAME']; } +/* + * Set the auto modal. + */ +function setAutoModal(string $autoModal) : void +{ + global $_SCROTT; + $_SCROTT['AUTO_MODAL'] = $autoModal; +} + +/* + * Get the auto modal. + */ +function getAutoModal() : string +{ + global $_SCROTT; + return $_SCROTT['AUTO_MODAL']; +} + /* * Produce a string, but only once. This function is useful * when dealing with some variable collection of markup and -- cgit v1.2.3