$heading = format_string($heading); // Fix for MDL-8582
- if (defined('CLI_UPGRADE') && CLI_UPGRADE ) {
+ if (defined('CLI_SCRIPT')) {
$output = $heading;
if ($return) {
return $output;
if ($id) {
$id = ' id="'.$id.'"';
}
- if (!defined('CLI_UPGRADE') || !CLI_UPGRADE ) {
- $output = "<h$size $align $class $id>".$text."</h$size>";
- } else if ( CLI_UPGRADE ) {
+ if (!defined('CLI_SCRIPT')) {
+ $output = "<h$size $align $class $id>".$text."</h$size>";
+ } else {
$output = $text;
if ($size == 1) {
$output = '=>'.$output;
if ($return) {
return $output;
} else {
- if (!defined('CLI_UPGRADE') || !CLI_UPGRADE ) {
- echo $output;
- } else if (CLI_UPGRADE && ($verbose > CLI_NO) ) {
+ if (!defined('CLI_SCRIPT')) {
+ echo $output;
+ } else {
console_write(STDOUT,$output,'',false);
print_newline();
}
}
$message = clean_text($message);
- if(!defined('CLI_UPGRADE')||!CLI_UPGRADE) {
- $output = '<div class="'.$style.'" style="text-align:'. $align .'">'. $message .'</div>'."\n";
- } else if (CLI_UPGRADE && $DB->get_debug()) {
- $output = '++'.$message.'++';
- return ;
+ if (!defined('CLI_SCRIPT')) {
+ $output = '<div class="'.$style.'" style="text-align:'. $align .'">'. $message .'</div>'."\n";
+ } else {
+ if ($style === 'notifysuccess') {
+ $output = '++'.$message.'++';
+ } else {
+ $output = '!!'.$message.'!!';
+ }
}
if ($return) {
return $output;
}
- echo $output;
+
+ if (!defined('CLI_SCRIPT')) {
+ echo $output;
+ } else {
+ console_write(STDOUT,$output,'',false);
+ print_newline();
+ }
}