/** * Constructor. * @param array &$Configuration * @return void */ function Context(&$Configuration) { $this->Configuration =& $Configuration; $this->BodyAttributes = ''; $this->StyleUrl = ''; $this->PageTitle = ''; $this->Dictionary = array(); $this->DelegateCollection = array(); $this->PassThruVars = array(); $this->CommentFormats = array(); $this->CommentFormats[] = 'Text'; // Create an object factory $this->ObjectFactory = new ObjectFactory($Configuration); // Current Mode $this->Mode = ForceIncomingCookieString('Mode', ''); // Url of the current page (this should be hard-coded by each page since php server vars are unreliable) $this->SelfUrl = ForceString($Configuration['SELF_URL'], 'index.php'); // Instantiate a SqlCollector (for debugging) $this->SqlCollector = new MessageCollector(); $this->SqlCollector->CssClass = 'Sql'; // Instantiate a Warning collector (for user errors) $this->WarningCollector = new MessageCollector(); // Instantiate an Error manager (for fatal errors) $this->ErrorManager = new ErrorManager(); // Instantiate a Database object (for performing database actions) $this->Database = new $Configuration['DATABASE_SERVER']($this); // Instantiate the string manipulation object $this->StringManipulator = new StringManipulator($this->Configuration); // Add the plain text manipulator $TextFormatter = new TextFormatter(); $this->StringManipulator->AddManipulator($Configuration['DEFAULT_FORMAT_TYPE'], $TextFormatter); }