Skip to content

Instantly share code, notes, and snippets.

@dominikwilkowski
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dominikwilkowski/8968459 to your computer and use it in GitHub Desktop.
Save dominikwilkowski/8968459 to your computer and use it in GitHub Desktop.
TINY SYSTEM MESSAGE GATHERER
<?php
/*****************************| SYSTEM MESSAGE FUNCTION |*****************************/
/**
* TINY SYSTEM MESSAGE GATHERER
*
* addMsg($msg,$o)
* @param string $msg Message to be added
* @param int $o Urgency [0](default)=normal [1]=warning [2]=error [3]=no HTML wrapper
*
* getMsg()
* @return string All messages in HTML wrappers (unless $o=3)
*/
class sysMsg {
var $msg;
var $o;
public function addMsg($msg,$o=0) {
if($o==3) $this->msg.=$msg;
else $this->msg.='<h5 class="'.($o==1 ? 'w' : ($o==2 ? 'e' : 'd')).'">'.$msg.'</h5>';
}
public function getMsg() {
return $this->msg;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment