diff options
Diffstat (limited to 'app/class/globals.php')
-rw-r--r-- | app/class/globals.php | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/app/class/globals.php b/app/class/globals.php index c81c9a2..7120aaa 100644 --- a/app/class/globals.php +++ b/app/class/globals.php @@ -43,6 +43,13 @@ $_SCROTT[NOTICE] = array(); $_SCROTT['PAGE_OBJECT'] = NULL; /* + * The page name variable is what displays in the pad select dropdown and + * is typically set to the "group / pad" of the current page or, "Dashboard", + * "Groups", "Pads", etc. on special pages. + */ +$_SCROTT['PAGE_NAME'] = ""; + +/* * Get the application root path. This is an absolute path on the server. */ function ar() : string @@ -162,6 +169,29 @@ function getPageObj() : ?obj } /* + * Set the page name string. This can only be called once per + * runtime. + */ +function setPageName(string $name) : void +{ + global $_SCROTT; + + if ($_SCROTT['PAGE_NAME'] !== "") + throw new Exception("Tried to configure page name twice"); + + $_SCROTT['PAGE_NAME'] = $name; +} + +/* + * Get the page name string. + */ +function getPageName() : string +{ + global $_SCROTT; + return $_SCROTT['PAGE_NAME']; +} + +/* * Save an uploaded file and impose some constraints on supplied * data. Caller can optionally pass some strings by reference to * be given the supplied file's original name and mime-type. |