+// Getter for userid or returns zero
+function getUserId () {
+ // Default userid
+ $userid = 0;
+
+ // Is the userid set?
+ if (isUserIdSet()) {
+ // Then use it
+ $userid = $GLOBALS['userid'];
+ } // END - if
+
+ // Return it
+ return $userid;
+}
+
+// Checks ether the userid is set
+function isUserIdSet () {
+ return (isset($GLOBALS['userid']));
+}
+
+// Handle message codes from URL
+function handleCodeMessage () {
+ if (REQUEST_ISSET_GET('msg')) {
+ // Default extension is "unknown"
+ $ext = 'unknown';
+
+ // Is extension given?
+ if (REQUEST_ISSET_GET('ext')) $ext = REQUEST_GET('ext');
+
+ // Convert the 'msg' parameter from URL to a human-readable message
+ $msg = convertCodeToMessage(REQUEST_GET('msg'));
+
+ // Load message template
+ LOAD_TEMPLATE('message', false, $msg);
+ } // END - if
+}
+
+// Setter for extra title
+function setExtraTitle ($extraTitle) {
+ $GLOBALS['extra_title'] = $extraTitle;
+}
+
+// Getter for extra title
+function getExtraTitle () {
+ // Is the extra title set?
+ if (!isExtraTitleSet()) {
+ // No, then abort here
+ debug_report_bug('extra_title is not set!');
+ } // END - if
+
+ // Return it
+ return $GLOBALS['extra_title'];
+}
+
+// Checks if the extra title is set
+function isExtraTitleSet () {
+ return ((isset($GLOBALS['extra_title'])) && (!empty($GLOBALS['extra_title'])));
+}
+
+// Generates a 'extension foo inactive' message
+function generateExtensionInactiveMessage ($ext) {
+ // Is the extension empty?
+ if (empty($ext)) {
+ // This should not happen
+ trigger_error(__FUNCTION__ . ': Parameter ext is empty. This should not happen.');
+ } // END - if
+
+ // Default message
+ $msg = sprintf(getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), $ext);
+
+ // Is an admin logged in?
+ if (IS_ADMIN()) {
+ // Then output admin message
+ $msg = sprintf(getMessage('ADMIN_EXTENSION_PROBLEM_EXT_INACTIVE'), $ext);
+ } // END - if
+
+ // Return prepared message
+ return $msg;