X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fajax-functions.php;h=d3736e0f03043caddaca465a74056c03c9cc6915;hp=59ad97d18115e41998485789ffaadd02ced519ba;hb=175b3f506e193d8d791ec6523db42276e296dd0b;hpb=74b7fbc5030bb2938a9859020876da63e6d15c0b diff --git a/inc/ajax-functions.php b/inc/ajax-functions.php index 59ad97d181..d3736e0f03 100644 --- a/inc/ajax-functions.php +++ b/inc/ajax-functions.php @@ -16,7 +16,7 @@ * $Author:: $ * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009 - 2012 by Mailer Developer Team * + * Copyright (c) 2009 - 2013 by Mailer Developer Team * * For more information visit: http://mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -48,6 +48,9 @@ function initAjax () { 'reply_content' => NULL, ); + // Init call-back debug information + $GLOBALS['ajax_callback_function'] = NULL; + // Set content type (mostly JSON) setContentType('application/json'); @@ -58,7 +61,7 @@ function initAjax () { setUsername('{--USERNAME_AJAX--}'); // In installation phase load ajax_installer.php - if (isInstallationPhase()) { + if (isInstaller()) { // Load it loadIncludeOnce('inc/ajax/ajax_installer.php'); } // END - if @@ -77,7 +80,7 @@ function setAjaxReplyContent ($content) { * Checks whether the AJAX access level was valid. This function doesn't need * caching in $GLOBALS[__FUNCTION__] because it will be called only once. */ -function isAjaxRequestLevelValid () { +function isValidAjaxRequestLevel () { // By default nothing is valid $isValid = FALSE; @@ -85,7 +88,7 @@ function isAjaxRequestLevelValid () { switch (postRequestElement('level')) { case 'install': // Installation phase level // Simply check for it - $isValid = isInstallationPhase(); + $isValid = isInstaller(); break; case 'admin': // Admin area @@ -128,9 +131,9 @@ function processAjaxRequest () { } // Send AJAX content -function sendAjaxContent () { +function sendAjaxContent ($forceOutput = FALSE) { // Is the status fine or template not found (404)? - if (isAjaxHttpStatusAccepted()) { + if ((isAjaxHttpStatusAccepted()) || ($forceOutput === TRUE)) { // Then output the JSON outputHtml(encodeJson($GLOBALS['ajax_reply'])); } // END - if