Skip to content

Commit

Permalink
Add icons to messages to give the vibe quicker
Browse files Browse the repository at this point in the history
  • Loading branch information
tbar0970 committed Jul 7, 2021
1 parent 0579e84 commit 9f224a7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion include/general.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,15 @@ function print_message($msg, $class='success', $html=FALSE)
echo strtoupper($class).': '.$msg."\n";
} else {
if ($class == 'failure') $class='error';
$chars = Array(
'success' => '<i class="icon-ok"></i> ',
'warning' => '<i class="icon-info-sign"></i> ',
'error' => '<i class="icon-exclamation-sign"></i> ',
);
$char = '';
if (!$html) $char = array_get($chars, $class);
?>
<div class="alert alert-<?php echo $class; ?>"><?php echo $html ? $msg : ents($msg); ?></div>
<div class="alert alert-<?php echo $class; ?>"><?php echo $char; echo $html ? $msg : ents($msg); ?></div>
<?php
}
}
Expand Down

0 comments on commit 9f224a7

Please sign in to comment.