*/ // Protection to avoid direct call of template if (empty($context) || !is_object($context)) { print "Error, template page can't be called as URL"; exit(1); } '@phan-var-force Context $context'; global $langs; // load messages $html = ''; $htmlSuccess = ''; $htmlWarning = ''; $htmlError = ''; $jsOut = ''; $jsSuccess = ''; $jsWarning = ''; $jsError = ''; //$useJNotify = false; //if (!empty($conf->use_javascript_ajax) && empty($conf->global->MAIN_DISABLE_JQUERY_JNOTIFY)) { //$useJNotify = true; //} $useJNotify = true; $context->loadEventMessages(); // alert success if (!empty($context->eventMessages['mesgs'])) { $htmlSuccess = $useJNotify ? '' : ''; if ($useJNotify) { $jsSuccess = ' jQuery.jnotify("' . dol_escape_js($htmlSuccess) . '", "success", 3000 );'; } } // alert warning if (!empty($context->eventMessages['warnings'])) { $htmlWarning = $useJNotify ? '' : ''; if ($useJNotify) { $jsWarning .= 'jQuery.jnotify("' . dol_escape_js($htmlWarning) . '", "warning", true);'; } } // alert error if (!empty($context->eventMessages['errors'])) { $htmlError = $useJNotify ? '' : ''; if ($useJNotify) { $jsError .= 'jQuery.jnotify("' . dol_escape_js($htmlError) . '", "error", true );'; } } $html .= $htmlError . $htmlWarning . $htmlSuccess; if ($html) { $jsOut = $jsSuccess . $jsWarning . $jsError; if ($jsOut == '') { print $html; } } $context->clearEventMessages(); if ($context->getErrors()) { include __DIR__ . '/errors.tpl.php'; } if ($jsOut) { $js = ''; print $js; } print ''; ?>