includes/functions.php
changeset 479 192db6ac195b
parent 473 518bc2b214f1
child 481 07bf15b066bc
equal deleted inserted replaced
478:376a01d8386d 479:192db6ac195b
   538  * Immediately brings the site to a halt with an error message. Unlike grinding_halt() this can only be called after the config has been
   538  * Immediately brings the site to a halt with an error message. Unlike grinding_halt() this can only be called after the config has been
   539  * fetched (plugin developers don't even need to worry since plugins are always loaded after the config) and shows the site name and
   539  * fetched (plugin developers don't even need to worry since plugins are always loaded after the config) and shows the site name and
   540  * description.
   540  * description.
   541  * @param string The title of the error message
   541  * @param string The title of the error message
   542  * @param string The body of the message, this can be HTML, and should be separated into paragraphs using the <p> tag
   542  * @param string The body of the message, this can be HTML, and should be separated into paragraphs using the <p> tag
   543  */
   543  * @param bool Added in 1.1.3. If true, only the error is output. Defaults to false.
   544 
   544  */
   545 function die_semicritical($t, $p)
   545 
       
   546 function die_semicritical($t, $p, $no_wrapper = false)
   546 {
   547 {
   547   global $db, $session, $paths, $template, $plugins; // Common objects
   548   global $db, $session, $paths, $template, $plugins; // Common objects
   548   $db->close();
   549   $db->close();
   549 
   550 
   550   if ( ob_get_status() )
   551   if ( ob_get_status() )
   551     ob_end_clean();
   552     ob_end_clean();
   552 
   553 
       
   554   if ( $no_wrapper )
       
   555   {
       
   556     echo '<h2>' . htmlspecialchars($t) . '</h2>';
       
   557     echo "<p>$p</p>";
       
   558     exit;
       
   559   }
       
   560   
   553   $tpl = new template_nodb();
   561   $tpl = new template_nodb();
   554   $tpl->load_theme('oxygen', 'bleu');
   562   $tpl->load_theme('oxygen', 'bleu');
   555   $tpl->tpl_strings['SITE_NAME'] = getConfig('site_name');
   563   $tpl->tpl_strings['SITE_NAME'] = getConfig('site_name');
   556   $tpl->tpl_strings['SITE_DESC'] = getConfig('site_desc');
   564   $tpl->tpl_strings['SITE_DESC'] = getConfig('site_desc');
   557   $tpl->tpl_strings['COPYRIGHT'] = getConfig('copyright_notice');
   565   $tpl->tpl_strings['COPYRIGHT'] = getConfig('copyright_notice');