User management for the world wide web

Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

GenieGate_Controller Class Reference

Base Controller class. More...

Inheritance diagram for GenieGate_Controller:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 GenieGate_Controller (&$conf)
 Constructor, classes extending this class must call parent::GenieGate_Controller($conf) if they implement their own constructors.

 addPlugins ()
 Add all the plugins.

 addListener (&$listener)
 Adds a listener object.

 getView ($view_id, $params=FALSE)
 Get a view object.

 run ($method=FALSE)
 Run the controller.

 finish ()
 Finish the application, call this after the display() routine.

 fireDispatchStart ($trigger, $method)
 Fire off the dispatchStart() trigger.

 fireDispatchEnd ($method, &$view)
 Fire off the dispatchEnd() method.


Public Attributes

 $CFG
 Configuration associative array.

 $DBH
 MySQL resource link.

 $DISPATCH = array()
 Dispatch table, you need to assign the KEY => method_calls to this so it knows what to run.

 $APP_NAME = "Controller"
 Application name.

 $API_VERSION = "1.0"
 API_VERSION - The Version number for Plugins to use.


Detailed Description

Base Controller class.

The "heart" of the application is a Model-View-Controller design pattern, the Controller looks at the request and figures out what "Model" to run. The Model returns a view. (in our case the model is a method in the dispatch table, rather than a whole class.)

It is up to the caller to execute the display() method of the returned object.

Definition at line 15 of file Controller.php.


Constructor & Destructor Documentation

GenieGate_Controller &$  conf  ) 
 

Constructor, classes extending this class must call parent::GenieGate_Controller($conf) if they implement their own constructors.

Parameters:
$conf - The Configuration array.

Definition at line 51 of file Controller.php.


Member Function Documentation

addListener &$  listener  ) 
 

Adds a listener object.

This should be extended so that objects (such as UserAccount and Properties are also populated)

Parameters:
$listener - The Plugin object.

Reimplemented in GenieGate_Controller_Admin, and GenieGate_Controller_User.

Definition at line 99 of file Controller.php.

addPlugins  ) 
 

Add all the plugins.

(provided here for subclasses to use)

Subclasses should call this after they've initialized themselves for any plugins to use.

Definition at line 81 of file Controller.php.

Referenced by GenieGate_Controller_Admin::GenieGate_Controller_Admin(), and GenieGate_Controller_User::GenieGate_Controller_User().

finish  ) 
 

Finish the application, call this after the display() routine.

Definition at line 154 of file Controller.php.

fireDispatchEnd method,
&$  view
 

Fire off the dispatchEnd() method.

Parameters:
$method - the method that was just run.
$view - the view that is about to be displayed.

Definition at line 175 of file Controller.php.

Referenced by run().

fireDispatchStart trigger,
method
 

Fire off the dispatchStart() trigger.

Parameters:
$trigger - Form variable that invoked the method.
$method - The method to be run.

Definition at line 164 of file Controller.php.

Referenced by run().

getView view_id,
params = FALSE
 

Get a view object.

The configuration [Views][$APP_NAME] is used to figure out what directory to look in.

Parameters:
$view_id - The View ID to use.
$params - parameter(s) to use.
Returns:
A View object for displaying result.

Definition at line 112 of file Controller.php.

Referenced by GenieGate_Controller_Admin::do_alter_property(), GenieGate_Controller_User::do_change_password(), GenieGate_Controller_User::do_confirm_account(), GenieGate_Controller_Admin::do_create_group(), GenieGate_Controller_Admin::do_create_user(), GenieGate_Controller_Admin::do_delete_group(), GenieGate_Controller_Admin::do_delete_user(), GenieGate_Controller_Admin::do_export_main(), GenieGate_Controller_Admin::do_expunge(), GenieGate_Controller_Admin::do_general_search(), GenieGate_Controller_User::do_logout(), GenieGate_Controller_Admin::do_logout(), GenieGate_Controller_Admin::do_lookup_uid(), GenieGate_Controller_Admin::do_main(), GenieGate_Controller_User::do_main_page(), GenieGate_Controller_User::do_process_signup(), GenieGate_Controller_Admin::do_property_main(), GenieGate_Controller_User::do_resend_confirm(), GenieGate_Controller_User::do_send_password(), GenieGate_Controller_Admin::do_show_create_screen(), GenieGate_Controller_Admin::do_show_edit_prop(), GenieGate_Controller_User::do_show_forgot_password(), GenieGate_Controller_Admin::do_show_group(), GenieGate_Controller_User::do_show_password_change(), GenieGate_Controller_User::do_show_properties(), GenieGate_Controller_User::do_show_remind_form(), GenieGate_Controller_User::do_show_signup_form(), GenieGate_Controller_Admin::do_update_group(), GenieGate_Controller_User::do_update_settings(), GenieGate_Controller_Admin::do_update_user(), GenieGate_Controller_Admin::do_user_main(), and GenieGate_Controller_Admin::do_user_search().

run method = FALSE  ) 
 

Run the controller.

It does this by looping through the keys in the request looking for DISPATCH keys.

Parameters:
$method - OPTIONAL, used to force a given method.
Returns:
A View object for displaying the results, or FALSE if there were no methods found.

Reimplemented in GenieGate_Controller_Admin.

Definition at line 131 of file Controller.php.

References fireDispatchEnd(), and fireDispatchStart().


Member Data Documentation

$API_VERSION = "1.0"
 

API_VERSION - The Version number for Plugins to use.

(optional, recommend inheriting from GenieGate_Api_Plugin)

Definition at line 41 of file Controller.php.


The documentation for this class was generated from the following file:
DoxyGen Documentation generated by DoxyGen