where("key", $permanent_key) ->find(); if (!$message->loaded) { $message->key = $permanent_key; } $message->severity = $severity; $message->value = $msg; $message->save(); } else { $session = Session::instance(); $status = $session->get("messages"); $status[] = array($msg, $severity); $session->set("messages", $status); } } /** * Remove any permanent message by key. * @param string $permanent_key */ public function clear_permanent($permanent_key) { $message = ORM::factory("message")->where("key", $permanent_key)->find(); if ($message->loaded) { $message->delete(); } } /** * 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 */ public function get() { $buf = array(); foreach (Session::instance()->get_once("messages", array()) as $msg) { $buf[] = "