|
|
|
|
File: [Development] / old-advokit-installer / Context.class.php
(download)
/
(as text)
Revision: 1.1.1.1 (vendor branch), Sat Jun 5 04:22:13 2004 UTC (6 years, 3 months ago) by travislow Branch: advokit-installer, MAIN CVS Tags: start, HEAD Changes since 1.1: +0 -0 lines Initial import of AdvoKit into voter2voter cvs ... I hope you committed your changes. :-) |
<?
#======================================================================
# Context class. A wrapper around some other classes, plus
# a way for actions to convey information to displays.
#
# (c) 2003, Dawnstar - http://dawnstar.com - info@dawnstar.com
#======================================================================
class Context
{
# Configuration information
var $config;
# Logger for writing messages to log files
var $logger;
# Wrapper around HTTP request
var $request;
# DB access object
var $db;
# Template Engine, if configured
var $te;
# Session handler (for login sessions)
var $sesshandler;
# Current user object, possibly anonymous user
var $user;
# User state object.
var $ustate;
# Information that may be displayed to the end user.
var $displayinfo;
# Display to render, if non-NULL.
var $displayname;
# Message that should be rendered prominently in the
# display. Typically set by the action.
var $message;
# TRUE => The last action was denied
var $actiondenied = false;
# TRUE => Don't display anything, the action is
# handling the output.
var $nodisplay = false;
#.................................................. Context
#
# Constructor. Pass in all needed info.
#
function Context( &$config, &$logger, &$db, &$request, &$te, &$sesshandler, &$user, &$ustate )
{
$this->config =& $config;
$this->logger =& $logger;
$this->request =& $request;
$this->db =& $db;
$this->te =& $te;
$this->sesshandler =& $sesshandler;
$this->user =& $user;
$this->ustate =& $ustate;
$logger->debug( __FILE__, "Context object created." );
}
#.................................................. set
#
# Set the value within the displayinfo, if $key has
# an interesting value.
#
function set( $key, $value )
{
if( $key )
{
$this->displayinfo[$key] = $value;
}
}
#.................................................. get
#
# Get the value from the displayinfo, if it exists.
#
function get( $key )
{
return $this->displayinfo[$key];
}
}
?>
| cvsadmin@voter2voter.org | CVS Snapshots (updated daily) |