Changeset 46 for trunk/lib/App.inc.php


Ignore:
Timestamp:
Dec 21, 2005 9:35:34 PM (18 years ago)
Author:
scdev
Message:

${1}

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/App.inc.php

    r45 r46  
    379379            $this->logMsg(sprintf('Invalid MSG_* type: %s', $type), LOG_DEBUG, __FILE__, __LINE__);
    380380        }
     381    }
     382   
     383    /**
     384     * Returns an array of the raised messages.
     385     *
     386     * @access  public
     387     * @return  array   List of messags in FIFO order.
     388     * @author  Quinn Comendant <quinn@strangecode.com>
     389     * @since   21 Dec 2005 13:09:20
     390     */
     391    function getRaisedMessages()
     392    {
     393        if (!isset($this) || !is_a($this, 'App')) {
     394            $this =& App::getInstance();
     395        }
     396
     397        if (!$this->running) {
     398            return false;
     399        }
     400       
     401        $output = array();
     402        while (isset($_SESSION[$this->app]['messages']) && $message = array_shift($_SESSION[$this->app]['messages'])) {
     403            $output[] = $message;
     404        }
     405        return $output;
     406    }
     407   
     408    /**
     409     * Resets the message list.
     410     *
     411     * @access  public
     412     * @author  Quinn Comendant <quinn@strangecode.com>
     413     * @since   21 Dec 2005 13:21:54
     414     */
     415    function clearRaisedMessages()
     416    {
     417        if (!isset($this) || !is_a($this, 'App')) {
     418            $this =& App::getInstance();
     419        }
     420
     421        if (!$this->running) {
     422            return false;
     423        }
     424       
     425        $_SESSION[$this->app]['messages'] = array();
    381426    }
    382427
Note: See TracChangeset for help on using the changeset viewer.