Phpfox_Module

Description

Module Handler This class is used to call and interact with all the modules. Modules are used to power all the pages and blocks found on those pages.

  • author: Raymond Benc
  • version: $Id: module.class.php 1696 2010-07-22 13:53:48Z Raymond_Benc $
  • copyright: [PHPFOX_COPYRIGHT]

Located in /include/library/phpfox/module/module.class.php (line 18)


	
			
Method Summary
 Phpfox_Module __construct ()
 void addModuleBlock (string $sController, int $iId)
 bool blockIsHidden (string $sBlockId)
 mixed callback (string $sCall, [array $aParams = array()])
 mixed getBlockLocation (string $sBlock)
 mixed getCachedBlocks (string $sType)
 mixed getComponent (string $sClass, [array $aParams = array()], [string $sType = 'block'])
 mixed getComponentSetting (int $iUserId, string $sVarName, mixed $mDefaultValue)
 void getController ()
 string getControllerName ()
 array getModuleBlocks (int $iId, [bool $bForce = false])
 array getModuleFiles ()
 string getModuleId (string $sName)
 string getModuleName ()
 array getModules ()
 array getModuleTables (string $sPrefix)
 mixed getService (string $sClass, [array $aParams = array()])
 bool hasCallback (string $sModule, string $sMethod)
 mixed init (string $sModule, string $sProperty)
 mixed initMethod (string $sModule, string $sMethod)
 bool isModule (string $sModule)
 array massCallback (string $sMethod, [array $aParams = array()])
 void setCacheBlockData (array $aCacheBlockData)
 void setController ([string $sController = ''])
 void setNoTemplate ()
 void _cacheModules ()
Variables
array $_aBlockLocations = array() (line 120)

List of all the block locations on the site.

  • access: private
array $_aBlockWithSource = array() (line 169)

ARRAY of blocks that has source code in the database, instead of PHP files.

  • access: private
mixed $_aCacheBlockData = null (line 134)

If a user has dragged/dropped blocks this variable will store such information in an ARRAY.

  • access: private
array $_aCacheBlockId = array() (line 176)

List of cached block IDs.

  • access: private
array $_aCachedData = array() (line 99)

Holds all the HTML output of a controller so it can later be displayed in a specific position on the site.

This allows the ability to drag/drop blocks.

  • access: private
mixed $_aCachedItemData = null (line 141)

If a user has dragged/dropped blocks this variable will store such information of the position ID (INT).

  • access: private
mixed $_aCachedItemDataBlock = null (line 148)

If a user has dragged/dropped blocks this variable will store such information of the block ID (INT).

  • access: private
array $_aCallbackBlock = array() (line 127)

ARRAY can add extra blocks that are not loaded by normal means (via AdminCP).

  • access: private
array $_aComponent = array() (line 60)

List of all the active components part of active modules.

  • access: private
array $_aComponents = array() (line 106)

Cached array of all the components. Only stored during debug mode.

  • access: private
array $_aFrames = array(
'attachment-frame',
'photo-frame'
)
(line 74)

List of controllers that are within iframes and require special rules to be loaded.

  • access: private
array $_aItemDataCache = array() (line 155)

If a user has dragged/dropped blocks this variable will store the blocks information in an ARRAY.

  • access: private
unknown_type $_aModuleBlocks = array() (line 39)

List of all the active blocks part of active modules.

  • access: private
array $_aModules = array() (line 25)

List of all the active modules.

  • access: private
array $_aMoveBlocks = array() (line 162)

Holds an ARRAY of all the blocks that were moved by the end user.

  • access: private
unknown_type $_aPages = array() (line 113)

Cache ARRAY of all the custom pages the site has, which are created by admins.

  • access: private
array $_aReturn = array() (line 91)

Cache and store all the return values from components being loaded.

  • access: private
array $_aServices = array() (line 32)

List of all the active services part of active modules.

  • access: private
bool $_bNoTemplate = false (line 84)

Defines if a template should not be loaded when calling a controller.

  • access: private
object $_oController = null (line 67)

Object of the class loaded by the current controller being used.

  • access: private
string $_sController = 'index' (line 46)

Holds the value of the default controller to execute.

  • access: private
string $_sModule = PHPFOX_MODULE_CORE (line 53)

Holds the value of the default module to execute.

  • access: private
Methods
Constructor __construct (line 182)

Class constructor that caches all the modules, components (blocks/controllers) and drag/drop information.

  • access: public
Phpfox_Module __construct ()
addModuleBlock (line 416)

Module blocks are loaded via the AdminCP, however it can manually be loaded with this method.

  • access: public
void addModuleBlock (string $sController, int $iId)
  • string $sController: Controller this block belongs to.
  • int $iId: Position of where the block must be located by default.
blockIsHidden (line 1408)

Checks if a block is hidden.

  • return: TRUE is hidden, FALSE is not hiddne.
  • access: public
bool blockIsHidden (string $sBlockId)
  • string $sBlockId: Block name.
callback (line 1167)

Execute a callback on a specific module based on the 1st argument.

  • return: Returns the value the callback itself returns. FALSE if not callback was found.
  • access: public
mixed callback (string $sCall, [array $aParams = array()])
  • string $sCall: Module and callback method to execute.
  • array $aParams: ARRAY of params you can pass to the callback.
getBlockLocation (line 1397)

Gets a blocks location.

  • return: FALSE if it is not valid or STRING if it is valid.
  • access: public
mixed getBlockLocation (string $sBlock)
  • string $sBlock: Block name.
getCachedBlocks (line 991)

Get all the cached blocks and display them in the correct order.

  • return: If the block does not exist we return an empty string, otherwise we return NULL and just echo the block.
  • access: public
mixed getCachedBlocks (string $sType)
  • string $sType: Controller name.
getComponent (line 754)

Loads a module component. Components are the building blocks of the site and include controllers which build up the pages we see and blocks that build up the controllers.

  • return: Return the component object if it exists, otherwise FALSE.
  • access: public
mixed getComponent (string $sClass, [array $aParams = array()], [string $sType = 'block'])
  • string $sClass: Name of the component to load.
  • array $aParams: (Optional) Custom params you can pass to the component.
  • string $sType: (Optional) Identify if this component is a block or a controller.
getComponentSetting (line 1421)

Gets any custom component settings for a specific user.

  • return: Setting value or default value is returned.
  • access: public
mixed getComponentSetting (int $iUserId, string $sVarName, mixed $mDefaultValue)
  • int $iUserId: User ID
  • string $sVarName: Var name for the setting.
  • mixed $mDefaultValue: Default value in case the setting is not found.
getController (line 367)

Loads and outputs the current page based on the controller we loaded with the method setController().

  • see: self::setController()
  • access: public
void getController ()
getControllerName (line 655)

Get the name of the current controller we are using.

  • access: public
string getControllerName ()
getControllerTemplate (line 389)

Gets the controllers template. We do this automatically since each controller has a specific template that it loads to output data to the site.

  • return: NULL if we were able to load a template and FALSE if such a template does not exist.
  • access: public
mixed getControllerTemplate ()
getFullControllerName (line 378)

Gets the full name of the controller we are using including the module prefix.

  • access: public
string getFullControllerName ()
getModuleBlocks (line 428)

Gets all the blocks for a specific location on a specific page.

  • return: Returns a list of blocks for that page and in a specific order.
  • access: public
array getModuleBlocks (int $iId, [bool $bForce = false])
  • int $iId: Position on the template.
  • bool $bForce: (Optional) If blocks are already loaded set this to TRUE to reload them anyway.
getModuleFiles (line 1108)

Get all the modules found within the module folder.

  • return: ARRAY of modules.
  • access: public
array getModuleFiles ()
getModuleId (line 225)

Returns the module ID. Since Alpha versions of phpFox we changed modules to have unique string IDs so this function basically returns the same ID you are passing with the first argument.

  • return: Returns the unique module ID.
  • deprecated: 2.0.0beta1
  • access: public
string getModuleId (string $sName)
  • string $sName: Module name.
getModuleName (line 645)

Get the module name of the current controller we are using.

  • access: public
string getModuleName ()
getModules (line 1057)

Get all the active modules.

  • access: public
array getModules ()
getModuleTables (line 1075)

Get all the tables part of each of the active modules.

  • return: ARRAY of all the tables.
  • access: public
array getModuleTables (string $sPrefix)
  • string $sPrefix: Prefix of the database table name.
getService (line 668)

Loads a service class. Service classes are module based class that interact with the database and runs general PHP logic that is not needed to be found with components.

  • return: On success we return the class object, on failure we return FALSE.
  • access: public
mixed getService (string $sClass, [array $aParams = array()])
  • string $sClass: Name of the service class to load.
  • array $aParams: (Optional) ARRAY of params to pass to that class.
hasCallback (line 1290)

Checks if a specific module has a specific callback method.

  • return: TRUE if callback exists, otherwise FALSE if not.
  • access: public
bool hasCallback (string $sModule, string $sMethod)
  • string $sModule: Module name/ID.
  • string $sMethod: Callback method.
init (line 1329)

Loads a init class file that each module has and returns a specified property which has information about the module.

  • return: FALSE if property value or module is not valid or the property value which can differ. Usually it is a STRING or ARRAY.
  • access: public
mixed init (string $sModule, string $sProperty)
  • string $sModule: Module name/ID.
  • string $sProperty: Property name to return.
initMethod (line 1370)

Loads a init class file that each module has and executes a specific method.

  • return: NULL if property value or module is not valid or the property value which can differ.
  • access: public
mixed initMethod (string $sModule, string $sMethod)
  • string $sModule: Module name/ID.
  • string $sMethod: Method name.
isModule (line 207)

Checks if a module is valid or not (IF EXISTS OR IF EXISTS AND IS VALUE)

  • return: TRUE if it exists, FALSE if it does not.
  • access: public
bool isModule (string $sModule)
  • string $sModule: Module name.
massCallback (line 1228)

Performs a callback on all the modules that have the method being executed.

  • return: Array of return values with the module ID as the unique key.
  • access: public
array massCallback (string $sMethod, [array $aParams = array()])
  • string $sMethod: Method to execute on all modules.
  • array $aParams: Params you can pass to your callback.
setCacheBlockData (line 980)

Sets the cache blocks data.

  • access: public
void setCacheBlockData (array $aCacheBlockData)
  • array $aCacheBlockData: ARRAY of information to cache.
setController (line 241)

Sets the controller for the page we are on. This method controlls what component to load, which will be used to display the content on that page.

  • access: public
void setController ([string $sController = ''])
  • string $sController: (Optional) We find the controller by default, however you can override our default findings by passing the name of the controller with this argument.
setNoTemplate (line 1047)

Identify that the controller we are loading is not to load its template.

  • access: public
void setNoTemplate ()
_cacheModuleBlocks (line 1499)

Cache all module blocks.

  • access: private
void _cacheModuleBlocks ()
_cacheModules (line 1446)

Cache all the active modules based on the package the client is using.

  • access: private
void _cacheModules ()
_getItemCacheData (line 1559)

Get all the drag/drop information from a specific table for a specific user.

  • access: private
void _getItemCacheData ()

Documentation generated on Tue, 28 Sep 2010 10:36:41 +0200 by phpDocumentor 1.4.0a2