MRF
[ class tree: MRF ] [ index: MRF ] [ all elements ]

Class: MRF

Source Location: /mrf/libs/mrf.lib.php

Class Overview


MRF application library


Author(s):

Variables

Methods



Class Details

[line 37]
MRF application library

The main Application Library for the MRF project. This is where all of the tools will be assembled to be used by the Multi-Rater Feedback.




Tags:

license:  GNU Public License


[ Top ]


Class Variables

$administratorLevel =  0

[line 87]

Administrator Level



Tags:

var:  level of administration
access:  public

Type:   int


[ Top ]

$auth =  null

[line 58]

Authentication Object



Tags:

var:  to Authentication object.
access:  public

Type:   object Reference


[ Top ]

$isAdministrator =  false

[line 80]

Public Administrator Flag



Tags:

var:  denotes whether or not the user is an MRF administrator
access:  public

Type:   boolean


[ Top ]

$pathVars = array()

[line 101]

Path Var Container



Tags:

var:  contains extra path variables
access:  public

Type:   array


[ Top ]

$pathVarsExist =  false

[line 94]

Path Var Flag

*




Tags:

var:  denotes whether or not there are extra path variables
access:  public

Type:   boolean


[ Top ]

$sql =  null

[line 43]

Database Object



Tags:

var:  to SQL object
access:  public

Type:   object Reference


[ Top ]



Class Methods


constructor MRF [line 111]

MRF MRF( )

MRF Class Constructor

The Constructor will instantiate the $sql Database object, the $tpl Template object, and the $auth Authentication object.




[ Top ]

method addStyleSheet [line 187]

void addStyleSheet( string $style, [string $media = "screen"])

Add a Style Sheet

Used to add a style sheet to the MRF template. If you have a file named add.screen.css, you would call:

  1. $mrf->addStyleSheet("add", "screen");
  2. //or simply
  3. $mrf->addStyleSheet("add");




Tags:

access:  public


Parameters:

string   $style   Name of the style
string   $media   Screen or Print version of the style sheet

[ Top ]

method checkGet [line 224]

void checkGet( )

Check the GET variable for data

This will primarily be used to determine if the user is trying to log in or log out, and will call the appropriate authentication method.




Tags:

access:  public


[ Top ]

method displayPage [line 150]

void displayPage( string $section, [string $subsection = "home"])

Display a Page using the Templating Engine

This will cause Smarty to display a page based on the paramaters sent to the function. This will be a public funtion but in the future we hope to use this as a way of calling pages from other methods, possibly rendering this private, but we'll see.

NOTE: Once the template is loaded, this will kill the script, so nothing else can run afterwards.




Parameters:

string   $section   Section of the site to display
string   $subsection   optional Subsection of area to display

[ Top ]

method displayProgress [line 203]

void displayProgress( array $progress)

Display the Progress Page

Takes an array of progress data and turns it into the progress page.




Tags:

access:  public


Parameters:

array   $progress  

[ Top ]

method forceAdminLevel [line 386]

null forceAdminLevel( int $adminLevel, [boolean $exactLevelOnly = false])

Require a Specific Admin Level

This will allow us to control what level of user is required to access a certain page, so people can't just browse the history of a browser and find a page.

If the optional variable, $exactLevelOnly is set to true, then only the level of administrator chosen can view the page. Otherwise that level or higher will be able to view the page.

This will either load an access denied page and stop the loading of the page, or do nothing.




Tags:

access:  public


Parameters:

int   $adminLevel   level of administrator to be required
boolean   $exactLevelOnly   optional flag of whether or not the user must be the exact level

[ Top ]

method generateMenu [line 418]

array generateMenu( )

Generate the top navigation Menu

generateMenu() will check whether or not the user is logged in, and if the user is an administrator or not, then will display a menu accordingly.




Tags:

return:  multi-dimensional array of the menu with details
access:  public


[ Top ]

method getAdminStatus [line 330]

int getAdminStatus( )

Get the Admin status of the current user

If the current user is not logged in, or if the current user is not an administrator, they will be assigned a zero. Otherwise, they will be assigned the level as it recorded in the database.




Tags:

return:  AdministratorLevel
access:  public


[ Top ]

method getPathVars [line 246]

null getPathVars( )

Get the Path Variables

The default implementation of this requires the use of apache's mod rewrite to change complicated URL strings into an easy to read one. This function simply takes the GET variable "path" and strips it out into an array for ease of use.

This sets the pathVars array with information received from $_GET['path']




Tags:

access:  public


[ Top ]

method getProgress [line 488]

array|false getProgress( )

Gather the progress report for the coding

This is used for tracking the progress of the development of this project. It is a very simple and elementary way of doing things, but that's good because more time should be spent on developing the application anyway.




Tags:

access:  public


[ Top ]

method pre [line 509]

void pre( array $data)

Simple page for printing out an array dump on a web page



Tags:

access:  public


Parameters:

array   $data   Array to be displayed

[ Top ]

method processRequestSubmission [line 312]

true|false; processRequestSubmission( array $data)

Process MRF Request Submission

Must be passed an array of data in the following format: [code] $foo=array( "sub_user_username01" => "username01::username01@example.com", "sub_user_username02" => "username02::username02@example.com", "peer_user_username03" => "username03::username03@example.com", "sup_user_usernaem04" => "username04::username04@example.com" ); [/code] The reason for this is ease of submitting via a form. they keys are comprised of the type of user, the constant string "_user_" and the username (with no spaces). The following groups are acceptable:

  • sub: Suboordinate
  • peer: Peer or Co-Worker
  • sup: Supervisor
The value is the username and the user's email address separated by double colons (::).

This function will validate the data and then insert it into a database. These functions may be separated later, but for now, we're on a limited timetable.




Tags:

access:  public


Parameters:

array   $data   data of array to be parsed, usually $_POST

[ Top ]

method requestMRF [line 541]

true|false requestMRF( array $participants)

Request an MRF

Primary function for requesting an MRF. This will simply add the data to the proper tables and place the requested MRF in a list awaiting approval from MRF admins.

The Participants array must be formatted where the 1st key is the user's netid (username), the value of that key is an array, and that array contains email, name, and type




Tags:

access:  public


Parameters:

array   $participants   MultiDimensional Array of MRF Participants

[ Top ]


Documentation generated on Fri, 27 Jan 2006 16:25:36 -0700 by phpDocumentor 1.3.0RC3