Class MethodFactory

MethodFactory

public class MethodFactory

Method Factory The base method factory parent contains basic method commands which can be executed within an interface. Each local interface initializes the command factory by calling on its PluginMethodFactory which is a child of the parent below. This allows the Plugins to override the parent if needed and also allows universal commands to be defined for all plugins. Only methods which are used in multiple plugins should be defined in the parent.


Field Summary
private  unknown $language
          Contains the language translation object.
 
Constructor Summary
MethodFactory()
          MethodFactory Constructor Only called by the plugin method constructor.
 
Method Summary
 unknown censorContent(var $content)
          Deprecated.  
 unknown dateArray(var $date)
          Date Array Using an internal portal date format, the system will return an array variable containing the values for the date.
 unknown db_quote(var $text, var $flag)
          Database Quote Parser Parses text for entry into a database field.
 unknown formatDBTimestamp(var $time)
          Format Database Timestamp Dark Portal forces all timestamps to be set in the database as VARCHAR fields rather than database date or time formats.
 unknown formatUNIXTimestamp(var $time)
          Format UNIX/System Timestamp Extracts a UNIX level timestamp (seconds since 1970) and converts the value to an internal timestamp format (YYYYMMDDHHMISS).
 unknown getInterfaceData(var $search, var $transpose)
          Get Interface Data Loads the data from the searched database table into an array which is used in many global interface operations.
 unknown getUserEmail(var $id)
          Get User Email Based on the user id number, this method will return the displayable email of the user.
 unknown getUserName(var $id)
          Get User Name Based on a userid number, this method will return the displayable name of the user to the calling method.
 unknown loadFormData()
          Load Form Data Dark Portal uses a standard method for determining names of variables used in an HTML form.
 unknown loadSearch()
          Load Search Using the global search parameters, the method will create a private array of search parameters for generating an interface data query.
 unknown loadUserPrefs()
          Load User Preferences Based on the global userinfo variable, we will load the user preferences for the user from the database.
 unknown monthArray()
          Month Array Returns an array which contains a list of month names.
 unknown parseContent(var $theme, var $data)
          Parse Content Some named fields may require special parsing for display in the interfaces.
 unknown sendEmail(var $addr, var $message)
          Send Email Message
 unknown translate(var $arg)
          Deprecated.  
 unknown transposeData(var $data)
          Transpose Data Data in the form of ID NAME VALUE 1 name1 val1 2 name2 val2 3 name3 val3 Will be transposed into name1 name2 name3 val1 val2 val3
 unknown ultramode()
          RSS UltraMode - Not Implemented
 

Field Detail

$language

private unknown $language
Contains the language translation object.
Constructor Detail

MethodFactory

public MethodFactory()
MethodFactory Constructor Only called by the plugin method constructor. This constructor creates a new language translation object for the factory. This object will eventually be replaced by language elements in the database.
Method Detail

db_quote

public unknown db_quote(var $text,
                        var $flag)
Database Quote Parser Parses text for entry into a database field.
Parameters:
String - $text The text to quote for database entry.
boolean - $flag The flag determines if Magic Quotes should be considered when quoting the text.
Returns:
String The quoted text with proper special character parsing.** @param $flag Default Value: true

loadUserPrefs

public unknown loadUserPrefs()
Load User Preferences Based on the global userinfo variable, we will load the user preferences for the user from the database. These preferences can be used to customize look and feel of individual plugin interfaces or overall display of any interface.
Returns:
VOID

loadSearch

public unknown loadSearch()
Load Search Using the global search parameters, the method will create a private array of search parameters for generating an interface data query.
Parameters:
global - Array $interface_cols The column names used for extracting data. Set by the interface.
global - String $searchby Table name to search for data.
global - String $searchcols Table columns for data, set by interface/CGI query.
global - String $searchname Name of the ID column to search by.
global - String $searchid Value of the ID to search for data.
global - String $searchrange Can be used to search for a range in the ID column rather than an exact value.
global - String $searchorder Redefines the order column that the search will use.
global - String $searchpattern A search expression pattern which uses %.% to search for data, where % is a wildcard marker and . is the replacement marker for the search ID.
global - String $searchone Will restrict the search using a distinct mapping.
global - String $searchextra Uses standard SQL format to add additional search parameters.
Returns:
Array Returns an an array of the search parameters in a format used by the data loader.

loadFormData

public unknown loadFormData()
Load Form Data Dark Portal uses a standard method for determining names of variables used in an HTML form. All form variables can be used in the form templates to gather previously used data, or for validation of form information. These variables are also used to persist data to the database as needed. Form data variables should have identical names to those columns for which they are destined. Special form variables exist using double underscores "__" to indicate that they are informational only, and are not intended for database persistence.
Parameters:
global - Array $SYSTEM_VARS The method reads all system variables since some interfaces may wish to override the form variable from the CGI entry.
Returns:
Array An array of the form data keyed by the field name.

getInterfaceData

public unknown getInterfaceData(var $search,
                                var $transpose)
Get Interface Data Loads the data from the searched database table into an array which is used in many global interface operations. By default, this array is also loaded directly into the interface template and used for variable replacement in the various template blocks and elements.
Parameters:
Array - $search An array of the search variables, generated by Load Search Data
boolean - $transpose A flag which will force the data to be transposed from a vertical to horizontal format. Used for loading preferences and other similar data into singular arrays.
Returns:
Array Returns either a single row or a multidimensional array of many rows of data.
See Also:

parseContent

public unknown parseContent(var $theme,
                            var $data)
Parse Content Some named fields may require special parsing for display in the interfaces. Specifically, the admin interfaces require that the content of the blocks and elements be specially parsed to display the tags without parsing those tags into their respective data elements. This is done by mystically converting the internally used tags into an external representation. TODO: This method only handles a single row of data.
Parameters:
Object - $theme A reference to the current theme object, used to get a list of current theme tags.
Array - $data An array of data to be parsed against.** @param $theme is passed by reference

transposeData

public unknown transposeData(var $data)
Transpose Data Data in the form of ID NAME VALUE 1 name1 val1 2 name2 val2 3 name3 val3 Will be transposed into name1 name2 name3 val1 val2 val3
Parameters:
Array - $data An array of the data to be transposed.
Returns:
Array An array of the transposed data.

formatDBTimestamp

public unknown formatDBTimestamp(var $time)
Format Database Timestamp Dark Portal forces all timestamps to be set in the database as VARCHAR fields rather than database date or time formats. This allows ultimate control for the portal in how dates can be interpretted and stored. This also prevents problems in handling system level timestamps. The database timestamp is always formatted as YYYYMMDDHHMISS.
Parameters:
String - $time The database formatted timestamp (YYYYMMDDHHMISS).
Returns:
String Returns a LOCALE specific timestamp as determined by the language object.

formatUNIXTimestamp

public unknown formatUNIXTimestamp(var $time)
Format UNIX/System Timestamp Extracts a UNIX level timestamp (seconds since 1970) and converts the value to an internal timestamp format (YYYYMMDDHHMISS).
Parameters:
String - $time A UNIX/System timestamp value or blank. Blank will extract the current timestamp from the system time() call.
Returns:
String A portal specific timestamp format.** @param $time Default Value: ''

dateArray

public unknown dateArray(var $date)
Date Array Using an internal portal date format, the system will return an array variable containing the values for the date. The form generation code uses this method to create a value object for date dropdown box formats.
Parameters:
String - $date An internal portal date string/timestamp. If blank, the method returns a dummy set of neutral blank data.
Returns:
Array An array containing the date information, separated by named key.** @param $date Default Value: ''

monthArray

public unknown monthArray()
Month Array Returns an array which contains a list of month names. Used primarily by date display functions which rely on month names instead of value.
Returns:
Array An array of month names ordered at zero.

getUserName

public unknown getUserName(var $id)
Get User Name Based on a userid number, this method will return the displayable name of the user to the calling method. This name may be either the real or alias name.

getUserEmail

public unknown getUserEmail(var $id)
Get User Email Based on the user id number, this method will return the displayable email of the user. This email may be either the real or fake email.

ultramode

public unknown ultramode()
RSS UltraMode - Not Implemented

translate

public unknown translate(var $arg)
Deprecated.  

Translation Filter

censorContent

public unknown censorContent(var $content)
Deprecated.  

Censor Content Filter

sendEmail

public unknown sendEmail(var $addr,
                         var $message)
Send Email Message