'Access forbidden'), JSON_FORCE_OBJECT)); } // END - if // "Generates" admin content by loading a message template function generateAdminContent () { // Return it return displayMessage('{--ADMIN_AJAX_MENU_IS_LOADING--}', TRUE); } // Processes AJAX requests for admin menu function doAjaxProcessAdmin () { // 'do' must always be set and isAdmin must be true if (!isAdmin()) { // This shall not happen reportBug(__FUNCTION__, __LINE__, 'This AJAX request handler was called outside the admin menu.'); } elseif (!isPostRequestElementSet('do')) { // This shall not happen reportBug(__FUNCTION__, __LINE__, 'The JavaScript did not send "do" which is fatal.'); } // END - if // Again we do a call-back, so generate a function name depending on 'do' $callbackName = 'doAjaxAdmin' . capitalizeUnderscoreString(postRequestElement('do')); $GLOBALS['ajax_callback_function'] = $callbackName; // Is the call-back function there? if (!function_exists($callbackName)) { // This shall not happen reportBug(__FUNCTION__, __LINE__, 'AJAX call-back ' . $callbackName . ' does not exist.'); } // END - if // Call the function call_user_func($callbackName); // Send AJAX content sendAjaxContent(); } // Processes admin AJAX calls for content-requests function doAjaxAdminRequestContent () { // 'tab' must be there if (!isPostRequestElementSet('tab')) { // This shall not happen reportBug(__FUNCTION__, __LINE__, 'The JavaScript did not send "tab" which is fatal.'); } // END - if // Construct call-back name for value-preset $callbackName = 'doAjaxPrepareAdmin' . capitalizeUnderscoreString(postRequestElement('tab')); // Is the function there? if (function_exists($callbackName)) { // Call it for setting values in session call_user_func($callbackName); } else { // Log missing functions logDebugMessage(__FUNCTION__, __LINE__, 'Call-back function ' . $callbackName . ' does not exist.'); } // Is the HTTP status still the same? (204 No Content) if (getHttpStatus() == '204 No Content') { // We use the current access level 'install' as prefix and construct a template name setAjaxReplyContent(loadTemplate('admin_area_' . trim(postRequestElement('tab')), TRUE)); // Has the template been loaded? if (isset($GLOBALS['template_content']['html']['admin_page_' . trim(postRequestElement('tab'))])) { // All okay if we reach this point setHttpStatus('200 OK'); } else { // Set 404 error setHttpStatus('404 Not Found'); } } // END - if } // [EOF] ?>