<?php

namespace Shared;

class Messages
{

    public static function Information($text)
    {
        if(!isset($_REQUEST["messages"]))
            $_REQUEST["messages"]=array();
        array_push($_REQUEST["messages"],array("type"=>"info","text"=>$text));
    }

    public static function Warning($text)
    {
        if(!isset($_REQUEST["messages"]))
            $_REQUEST["messages"]=array();
        array_push($_REQUEST["messages"],array("type"=>"warn","text"=>$text));
    }

    public static function Error($text)
    {
        if(!isset($_REQUEST["messages"]))
            $_REQUEST["messages"]=array();
        array_push($_REQUEST["messages"],array("type"=>"err","text"=>$text));
    }

    public static function GetAll()
    {
        if(isset($_REQUEST["messages"]))
            return $_REQUEST["messages"];
            return array();
    }



}