get("messages"); $status[] = array($msg, $severity); $session->set("messages", $status); } /** * Get any pending messages. There are two types of messages, transient and permanent. * Permanent messages are used to let the admin know that there are pending administrative * issues that need to be resolved. Transient ones are only displayed once. * @return html text */ static function get() { $buf = array(); $messages = Session::instance()->get_once("messages", array()); foreach ($messages as $msg) { $msg[0] = str_replace("__CSRF__", access::csrf_token(), $msg[0]); $buf[] = "
  • $msg[0]
  • "; } if ($buf) { return ""; } } /** * Convert a message severity to a CSS class * @param integer $severity * @return string */ static function severity_class($severity) { switch($severity) { case message::SUCCESS: return "g-success"; case message::INFO: return "g-info"; case message::WARNING: return "g-warning"; case message::ERROR: return "g-error"; } } }