Class CMS_module

Description

Class CMS_module

represent a module. Abstract class.

Located in /automne/classes/modules/module.php (line 32)

CMS_grandFather
   |
   --CMS_module
Direct descendents
Class Description
 class CMS_modulePolymodValidation Class CMS_modulePolymodValidation
 class CMS_module_standard Class CMS_module_standard
 class CMS_moduleValidation Class CMS_moduleValidation
Class Constant Summary
Method Summary
 static array(CMS_moduleCategory) getModuleCategories ( $attrs, array $attrs,)
 static boolean moduleUsage (integer $pageID, [string $module = ''], [ $setUseage = false], [ $reset = false], boolean $setUseage,, boolean $reset:)
 void CMS_module ([ $datas = ''], string $codename)
 array asArray ([array $params = array()],  &$files, array $files)
 boolean createModuleFiles ()
 void destroy ()
 boolean fromArray (array $data, array $params, CMS_language $cms_language,  &$idsRelation,  &$infos, array $idsRelation, string $infos)
 string getAdminFrontendPath (integer $relativeTo)
 string getCodename ()
 array getCSSFiles ([ $pageId = ''], [ $allFiles = false])
 integer getID ()
 array getJSFiles ([ $pageId = ''], [ $allFiles = false])
 string getLabel (CMS_language $language)
 integer getLabelID ()
 string getModuleCode (mixed $modulesCode, integer $treatmentMode, integer $visualizationMode,  &$treatedObject, array $treatmentParameters, object $treatedObject)
 array(string=>string) getParameters ([string $onlyOne = false], [ $withType = false], [ $reset = false])
 CMS_resource getResourceByID (integer $resourceID)
 object The getTagRepresentation (string $tagName, array(string=>string) $tagAttributes, [ $args = false])
 array(CMS_resourceValidation) getValidations (CMS_user $user)
 array getWantedTags (integer $treatmentMode, integer $visualizationMode)
 boolean hasAdmin ()
 boolean hasParameters ()
 Boolean isCategoryUsed (CMS_moduleCategory $category)
 boolean isDestroyable ()
 boolean isPolymod (string $codename)
 boolean processValidation (CMS_resourceValidation $resourceValidation, integer $result, [boolean $lastValidation = true])
 string scriptInfo (array $parameters)
 Boolean scriptTask (array $parameters)
 boolean setAdminFrontend (string $adminFrontend)
 boolean setAndWriteParameters (array(string=>string) $parameters)
 boolean setCodename (string $codename)
 boolean setLabel ( $labelMessageID, string $label)
 boolean setPolymod (boolean $isPolymod)
 string treatWantedTag ( &$tag, string $tagContent, integer $treatmentMode, integer $visualizationMode,  &$treatedObject, array $treatmentParameters, string $tag, object $treatedObject)
 boolean useCategories ()
 boolean writeToPersistence ()
 void _changeDataLocation (CMS_page $resource, string $locationFrom, string $locationTo, [boolean $copyOnly = false])
Methods
static getModuleCategories (line 628)

Get array of categories this module can use to archive its datas

  • access: public
static array(CMS_moduleCategory) getModuleCategories ( $attrs, array $attrs,)
  • array $attrs,: array of attributes to determine which level of categoryies wanted, etc. format : array(language => CMS_language, level => integer, root => integer, attrs => array())
  • $attrs
static moduleUsage (line 1199)

Set or get the module useage for a given page id

  • return: : for setUseage = false (get mode) : the module useage for given page ID else for setUseage = true (set mode) true on success, false on failure
  • access: public
static boolean moduleUsage (integer $pageID, [string $module = ''], [ $setUseage = false], [ $reset = false], boolean $setUseage,, boolean $reset:)
  • integer $pageID: page ID to get or set useage
  • string $module: module codename to set or get useage (default = polymod for generic polymod useage).
  • boolean $setUseage,: if false (get mode : default), return the useage of the module for the given page ID, else (set mode), set the useage of the module for the given page ID
  • boolean $reset:: reset all usage for given module and page ID
  • $setUseage
  • $reset
Constructor CMS_module (line 93)

Constructor.

initializes the module if the codename is given

  • access: public
void CMS_module ([ $datas = ''], string $codename)
  • string $codename: The module codename
  • $datas
asArray (line 1261)

Get object as an array structure used for export

  • return: : the object array structure
  • access: public
array asArray ([array $params = array()],  &$files, array $files)
  • array $params: The export parameters. array( categories => false|true : export module categories (default : true) rows => false|true : export module rows (default : true) css => false|true : export module JS (default : true) js => false|true : export module CSS (default : true) )
  • array $files: The reference to the founded files used by object
  • &$files

Redefined in descendants as:
createModuleFiles (line 1422)

Create modules files directories for current module

  • access: public
boolean createModuleFiles ()
destroy (line 690)

Remove the module from database

  • access: public
void destroy ()

Redefined in descendants as:
fromArray (line 1340)

Import module from given array datas

  • return: : true on success, false on failure
  • access: public
boolean fromArray (array $data, array $params, CMS_language $cms_language,  &$idsRelation,  &$infos, array $idsRelation, string $infos)
  • array $data: The module datas to import
  • array $params: The import parameters. array( create => false|true : create missing objects (default : true) update => false|true : update existing objects (default : true) files => false|true : use files from PATH_TMP_FS (default : true) )
  • CMS_language $cms_language: The CMS_langage to use
  • array $idsRelation: : Reference : The relations between import datas ids and real imported ids
  • string $infos: : Reference : The import infos returned
  • &$idsRelation
  • &$infos

Redefined in descendants as:
getAdminFrontendPath (line 377)

Gets the administration frontend path.

  • return: The administration frontend path
  • access: public
string getAdminFrontendPath (integer $relativeTo)
  • integer $relativeTo: Can be to webroot or filesystem. See constants.

Redefined in descendants as:
getCodename (line 347)

Gets the codename.

  • return: The codename
  • access: public
string getCodename ()
getCSSFiles (line 1090)

Return the module CSS files

  • return: : the module css file in /css/modules/codename
  • access: public
array getCSSFiles ([ $pageId = ''], [ $allFiles = false])
  • $pageId
  • $allFiles
getDefaultLanguageCodename (line 242)

Get the default language code for this module Comes from parameters or Constant Upgrades constant with parameter founded

  • return: the language codename
  • access: public
String getDefaultLanguageCodename ()

Redefined in descendants as:
getID (line 150)

Gets the DB ID of the instance.

  • return: the DB id
  • access: public
integer getID ()
getJSFiles (line 1046)

Return the module JS files

  • return: : the module js file in /js/modules/codename
  • access: public
array getJSFiles ([ $pageId = ''], [ $allFiles = false])
  • $pageId
  • $allFiles
getLabel (line 162)

Gets the label.

  • return: The label
  • access: public
string getLabel (CMS_language $language)
getLabelID (line 177)

Gets the label id.

  • return: The label id
  • access: public
integer getLabelID ()
getModuleCode (line 1168)

Return the module code for the specified treatment mode, visualization mode and object.

  • return: : the module code to add
  • access: public
string getModuleCode (mixed $modulesCode, integer $treatmentMode, integer $visualizationMode,  &$treatedObject, array $treatmentParameters, object $treatedObject)
  • mixed $modulesCode: the previous modules codes (usually string)
  • integer $treatmentMode: The current treatment mode (see constants on top of this file for accepted values).
  • integer $visualizationMode: The current visualization mode (see constants on top of cms_page class for accepted values).
  • object $treatedObject: The reference object to treat.
  • array $treatmentParameters: : optionnal parameters used for the treatment. Usually an array of objects.
  • &$treatedObject

Redefined in descendants as:
getModuleReplacements (line 1036)

Module replacements vars

  • return: of replacements values (pattern to replace => replacement)
  • access: public
array getModuleReplacements ()

Redefined in descendants as:
getParameters (line 259)

Get the module parameters. Search for a file name "CODENAME_rc.xml" in PATH_MODULES_FS

  • return: The parameters from the file, or false if no file found
  • access: public
array(string=>string) getParameters ([string $onlyOne = false], [ $withType = false], [ $reset = false])
  • string $onlyOne: The name of a single parameter wanted
  • $withType
  • $reset
getResourceByID (line 439)

Gets resource by its internal ID (not the resource table DB ID)

  • return: The CMS_resource subclassed object
  • access: public
CMS_resource getResourceByID (integer $resourceID)
  • integer $resourceID: The DB ID of the resource in the module table(s)

Redefined in descendants as:
getTagRepresentation (line 455)

Gets a tag representation instance

  • return: module tag representation instance
  • access: public
object The getTagRepresentation (string $tagName, array(string=>string) $tagAttributes, [ $args = false])
  • string $tagName: The name of the tag
  • array(string=>string) $tagAttributes: The tag attributes
  • $args

Redefined in descendants as:
getValidations (line 466)

Gets the module validations

  • return: The resourceValidations objects, false if none found
  • access: public
array(CMS_resourceValidation) getValidations (CMS_user $user)
  • CMS_user $user: The user we want the validations for

Redefined in descendants as:
getWantedTags (line 765)

Get the tags to be treated by this module for the specified treatment mode, visualization mode and object.

  • return: of tags to be treated.
  • access: public
array getWantedTags (integer $treatmentMode, integer $visualizationMode)
  • integer $treatmentMode: The current treatment mode (see constants on top of CMS_modulesTags class for accepted values).
  • integer $visualizationMode: The current visualization mode (see constants on top of cms_page class for accepted values).

Redefined in descendants as:
hasAdmin (line 404)

Does the current module has an admin backend

  • access: public
boolean hasAdmin ()
hasParameters (line 206)

Does the module have parameters ?

  • access: public
boolean hasParameters ()
isCategoryUsed (line 1181)

If module use CMS_moduleCategory, does it use it

  • return: true/false
  • access: public
Boolean isCategoryUsed (CMS_moduleCategory $category)

Redefined in descendants as:
isDestroyable (line 679)

Does this module is destroyable ?

  • access: public
boolean isDestroyable ()

Redefined in descendants as:
isPolymod (line 218)

Is given module is a poly module ?

  • return: true if yes, false otherwise
  • access: public
boolean isPolymod (string $codename)
  • string $codename: the codename of the module to check
processDailyRoutine (line 590)

Process the daily routine, which typically put out of userspace resources which have a past publication date

  • access: public
void processDailyRoutine ()

Redefined in descendants as:
processValidation (line 479)

Process the module validations. Note that the EMails sent to either the transferred validator or the editors were sent before.

  • return: true on success, false on failure to process
  • access: public
boolean processValidation (CMS_resourceValidation $resourceValidation, integer $result, [boolean $lastValidation = true])
  • CMS_resourceValidation $resourceValidation: The resource validation to process
  • integer $result: The result of the validation process. See VALIDATION_OPTION constants
  • boolean $lastValidation: Is this the last validation done in a load of multiple validations (or the only one) ?

Redefined in descendants as:
scriptInfo (line 1243)

Module script info : get infos for a given script parameters

  • return: : scripts infos
  • access: public
string scriptInfo (array $parameters)
  • array $parameters: the task parameters

Redefined in descendants as:
scriptTask (line 1232)

Module script task : default function, return true

  • return: true/false
  • access: public
Boolean scriptTask (array $parameters)
  • array $parameters: the task parameters

Redefined in descendants as:
setAdminFrontend (line 420)

Sets the administration frontend filename. It must exists of course.

  • return: true on success, false on failure.
  • access: public
boolean setAdminFrontend (string $adminFrontend)
  • string $adminFrontend: The new administration frontend filename to set
setAndWriteParameters (line 307)

Set and write to disc the module parameters file

  • return: true on success, false on failure
  • access: public
boolean setAndWriteParameters (array(string=>string) $parameters)
  • array(string=>string) $parameters: The parameters array indexed by label
setCodename (line 359)

Sets the codename.

  • return: true on success, false on failure.
  • access: public
boolean setCodename (string $codename)
  • string $codename: The new codename to set
setLabel (line 189)

Sets the label.

  • return: true on success, false on failure.
  • access: public
boolean setLabel ( $labelMessageID, string $label)
  • string $label: The new label to set
  • $labelMessageID
setPolymod (line 229)

Sets the polymod status of the module

  • return: true on success, false on failure.
  • access: public
boolean setPolymod (boolean $isPolymod)
  • boolean $isPolymod: The polymod status to set
treatWantedTag (line 801)

Treat given content tag by this module for the specified treatment mode, visualization mode and object.

  • return: the tag content treated.
  • access: public
string treatWantedTag ( &$tag, string $tagContent, integer $treatmentMode, integer $visualizationMode,  &$treatedObject, array $treatmentParameters, string $tag, object $treatedObject)
  • string $tag: The CMS_XMLTag.
  • string $tagContent: previous tag content.
  • integer $treatmentMode: The current treatment mode (see constants on top of CMS_modulesTags class for accepted values).
  • integer $visualizationMode: The current visualization mode (see constants on top of cms_page class for accepted values).
  • object $treatedObject: The reference object to treat.
  • array $treatmentParameters: : optionnal parameters used for the treatment. Usually an array of objects.
  • &$tag
  • &$treatedObject

Redefined in descendants as:
useCategories (line 659)

Get module categories usage

  • access: public
boolean useCategories ()
writeToPersistence (line 722)

Writes the module into persistence (MySQL for now).

  • return: true on success, false on failure
  • access: public
boolean writeToPersistence ()

Redefined in descendants as:
_changeDataLocation (line 604)

Changes The page data (in the DB) from one location to another.

  • access: private
void _changeDataLocation (CMS_page $resource, string $locationFrom, string $locationTo, [boolean $copyOnly = false])
  • CMS_page $resource: The resource concerned by the data location change
  • string $locationFrom: The starting location among the available RESOURCE_DATA_LOCATION
  • string $locationTo: The ending location among the available RESOURCE_DATA_LOCATION
  • boolean $copyOnly: If true, data is not deleted from the original location

Redefined in descendants as:

Inherited Methods

Inherited From CMS_grandFather

 CMS_grandFather::autoload()
 CMS_grandFather::hasError()
 CMS_grandFather::log()
 CMS_grandFather::PHPErrorHandler()
 CMS_grandFather::raiseError()
 CMS_grandFather::setDebug()
 CMS_grandFather::setLog()
 CMS_grandFather::_raiseError()
 CMS_grandFather::__call()
Class Constants
MESSAGE_PAGE_ADMIN_CATEGORIES = 1206 (line 37)

Standard Messages

MESSAGE_PAGE_CATEGORIES = 636 (line 39)
MESSAGE_PAGE_CATEGORIES_USED = 637 (line 41)
MESSAGE_PAGE_CHOOSE = 1132 (line 38)
MESSAGE_PAGE_MANAGE_OBJECTS = 635 (line 40)

Inherited Constants

Inherited from CMS_grandFather

CMS_grandFather::ERROR_LOG
CMS_grandFather::SYSTEM_LABEL

Documentation generated on Wed, 15 Feb 2012 15:32:12 +0100 by phpDocumentor 1.4.3