CMS Made Simple API

CMSModule
in package

AbstractYes

Base module class.

All modules should inherit and extend this class with their functionality.

Tags
since
0.9
version
2.0

Table of Contents

Properties

$cms  : CmsApp
$config  : cms_config
$db  : Connection
$smarty  : Smarty_CMS

Methods

__construct()  : mixed
Constructor
AddEventHandler()  : mixed
Add an event handler for an existing eg event.
AdminStyle()  : mixed
Called in the admin theme for every installed module, this method allows the module to output style information for use in the admin theme.
AllowSmartyCaching()  : bool
Callback to determine if the output from a call to the module can be cached by smarty.
AllowUninstallCleanup()  : bool
Function that gets called upon module uninstall, and returns a bool to indicate whether or not the core should remove all module events, event handlers, module templates, and preferences.
Audit()  : mixed
Put an event into the audit (admin) log. This should be done on most admin events for consistency.
CallUserTag()  : array<string|int, mixed>
Call a specific user defined tag
can_cache_output()  : bool
Callback to determine if the output from a call to the module can be cached by smarty.
CheckPermission()  : bool
Checks a permission against the currently logged in user.
create_url()  : mixed
Returns a URL to a module action This method is called by the CreateLink methods when creating a link to a module action.
CreateContentLink()  : string
Returns the xhtml equivalent of an href link for content links. This is basically a nice little wrapper to make sure that we go back to where we want and that it's xhtml complient
CreateEvent()  : mixed
Inform the system about a new event that can be generated
CreateFieldsetEnd()  : string
Returns the end of the fieldset in a form. This is basically just a wrapper around </form>, but could be extended later on down the road. It's here mainly for consistency.
CreateFieldsetStart()  : string
Returns the xhtml equivalent of an fieldset and legend. This is basically a nice little wrapper to make sure that id's are placed in names and also that it's xhtml compliant.
CreateFileUploadInput()  : string
Returns the xhtml equivalent of a file upload input. This is basically a nice little wrapper to make sure that id's are placed in names and also that it's xhtml compliant.
CreateFormEnd()  : string
Returns the end of the a module form. This is basically just a wrapper around </form>, but could be extended later on down the road. It's here mainly for consistency.
CreateFormStart()  : string
Returns the start of a module form
CreateFrontendFormStart()  : string
Returns the start of a module form, optimized for frontend use
CreateFrontendLink()  : string
Returns the xhtml equivalent of an href link This is basically a nice little wrapper to make sure that id's are placed in names and also that it's xhtml compliant.
CreateInputCheckbox()  : string
Returns the xhtml equivalent of a checkbox. This is basically a nice little wrapper to make sure that id's are placed in names and also that it's xhtml compliant.
CreateInputColor()  : string
Returns the html5 equivalent of an input of type color. This is basically a nice little wrapper to make sure that id's are placed in names and also that it's html5 compliant.
CreateInputDataList()  : string
Returns the html5 equivalent input field with datalist options. This is basically a nice little wrapper to make sure that id's are placed in names and also that it's html5 compliant.
CreateInputDate()  : string
Returns the html5 equivalent of an input of type date. This is basically a nice little wrapper to make sure that id's are placed in names and also that it's html5 compliant.
CreateInputDatetime()  : string
Returns the html5 equivalent of an input of type datetime. This is basically a nice little wrapper to make sure that id's are placed in names and also that it's html5 compliant.
CreateInputDatetimeLocal()  : string
Returns the html5 equivalent of an input of type datetime-local. This is basically a nice little wrapper to make sure that id's are placed in names and also that it's html5 compliant.
CreateInputDropdown()  : string
Returns the xhtml equivalent of a dropdown list. This is basically a nice little wrapper to make sure that id's are placed in names and also that it is xhtml compliant.
CreateInputEmail()  : string
Returns the html5 equivalent of an input textbox of type email. This is basically a nice little wrapper to make sure that id's are placed in names and also that it's html5 compliant.
CreateInputFile()  : string
Returns the xhtml equivalent of a file-selector field. This is basically a nice little wrapper to make sure that id's are placed in names and also that it's xhtml compliant.
CreateInputHidden()  : string
Returns the xhtml equivalent of a hidden field. This is basically a nice little wrapper to make sure that id's are placed in names and also that it's xhtml compliant.
CreateInputMonth()  : string
Returns the html5 equivalent of an input of type month. This is basically a nice little wrapper to make sure that id's are placed in names and also that it's html5 compliant.
CreateInputNumber()  : string
Returns the html5 equivalent of an input of type number. This is basically a nice little wrapper to make sure that id's are placed in names and also that it's html5 compliant.
CreateInputPassword()  : string
Returns the xhtml equivalent of an input password-box. This is basically a nice little wrapper to make sure that id's are placed in names and also that it's xhtml compliant.
CreateInputRadioGroup()  : string
Returns the xhtml equivalent of a set of radio buttons. This is basically a nice little wrapper to make sure that id's are placed in names and also that it is xhtml compliant.
CreateInputRange()  : string
Returns the html5 equivalent of an input of type range. This is basically a nice little wrapper to make sure that id's are placed in names and also that it's html5 compliant.
CreateInputReset()  : string
Returns the xhtml equivalent of a reset button. This is basically a nice little wrapper to make sure that id's are placed in names and also that it's xhtml compliant.
CreateInputSearch()  : string
Returns the html5 equivalent of an input of type search. This is basically a nice little wrapper to make sure that id's are placed in names and also that it's html5 compliant.
CreateInputSelectList()  : string
Returns the xhtml equivalent of a multi-select list. This is basically a nice little wrapper to make sure that id's are placed in names and also that it is xhtml compliant.
CreateInputSubmit()  : string
Returns the xhtml equivalent of a submit button. This is basically a nice little wrapper to make sure that id's are placed in names and also that it's xhtml compliant.
CreateInputTel()  : string
Returns the html5 equivalent of an input textbox of type tel. This is basically a nice little wrapper to make sure that id's are placed in names and also that it's html5 compliant.
CreateInputText()  : string
Returns the xhtml equivalent of an input textbox. This is basically a nice little wrapper to make sure that id's are placed in names and also that it's xhtml compliant.
CreateInputTextWithLabel()  : string
Returns the xhtml equivalent of an input textbox with label. This is basically a nice little wrapper to make sure that id's are placed in names and also that it's xhtml compliant.
CreateInputTime()  : string
Returns the html5 equivalent of an input of type time. This is basically a nice little wrapper to make sure that id's are placed in names and also that it's html5 compliant.
CreateInputUrl()  : string
Returns the html5 equivalent of an input of type url. This is basically a nice little wrapper to make sure that id's are placed in names and also that it's xhtml compliant.
CreateInputWeek()  : string
Returns the html5 equivalent of an input of type week. This is basically a nice little wrapper to make sure that id's are placed in names and also that it's html5 compliant.
CreateLabelForInput()  : string
Returns the xhtml equivalent of an label for input field. This is basically a nice little wrapper to make sure that id's are placed in names and also that it's xhtml compliant.
CreateLink()  : string
Returns the xhtml equivalent of an href link This is basically a nice little wrapper to make sure that id's are placed in names and also that it's xhtml compliant.
CreateParameter()  : mixed
Create a parameter and it's documentation for display in the module help.
CreatePermission()  : mixed
Create's a new permission for use by the module.
CreateReturnLink()  : string
Returns the xhtml equivalent of an href link for Content links. This is basically a nice little wrapper to make sure that we go back to where we want to and that it's xhtml compliant.
CreateStaticRoutes()  : mixed
Register all static routes for this module.
CreateSyntaxArea()  : string
Returns the xhtml equivalent of a textarea. Also takes Syntax hilighter preference into consideration if it's called from the admin side.
CreateTextArea()  : string
Returns the xhtml equivalent of a textarea. Also takes WYSIWYG preference into consideration if it's called from the admin side.
CreateTooltip()  : string
Returns the xhtml equivalent of a tooltip help link.
CreateTooltipLink()  : string
Returns the xhtml equivalent of a tooltip-enabled href link This is basically a nice little wrapper to make sure that id's are placed in names and also that it's xhtml compliant.
CreateXMLPackage()  : string
Creates an xml data package from the module directory.
DeleteTemplate()  : bool
Delete a module template from the database
DoAction()  : string
Used for navigation between "pages" of a module. Forms and links should pass an action with them so that the module will know what to do next.
DoEvent()  : bool
An event that this module is listening to has occurred, and should be handled.
EndTab()  : string
Output a string to indicate the end of the output for a specific tab.
EndTabContent()  : string
Output a string to indicate the end of XHTML areas for tabs.
EndTabHeaders()  : string
Output a string to stop the output of headers and close the necessary XHTML div.
get_pretty_url()  : string
Return a pretty url string for a module action This method is called by the create_url and the CreateLink methods if the pretty url argument is not specified in order to attempt automating a pretty url for an action.
get_tasks()  : array<string|int, mixed>
Returns a list of the tasks that this module manages
GetAbout()  : string
Returns a sufficient about page for a module
GetActionTemplateObject()  : Smarty_Internal_Template
Get a reference to the smarty template object that was passed in to the the action.
GetAdminDescription()  : string
Returns a description of what the admin link does.
GetAdminMenuItems()  : array<string|int, mixed>
Return a array of CmsAdminMenuItem objects representing menu items for the admin nav for this module.
GetAdminSection()  : string
Returns which admin section this module belongs to.
GetAuthor()  : string
Returns the name of the author
GetAuthorEmail()  : string
Returns the email address of the author
GetChangeLog()  : string
Returns the changelog for the module
GetConfig()  : cms_config
Returns the cms->config object as a reference
GetContentBlockFieldInput()  : mixed
Get an input field for a module generated content block type.
GetContentBlockFieldValue()  : mixed|false
Return a value for a module generated content block type.
GetDatabaseResource()  : string
Build a resource string for an old module templates resource.
GetDb()  : Connection
Returns the cms->db object as a reference
GetDependencies()  : array<string|int, mixed>
Returns a list of dependencies and minimum versions that this module requires. It should return an hash, eg.
GetDescription()  : string
Returns a short description of the module
GetEventDescription()  : string
Get a (langified) description for an event this module created.
GetEventHelp()  : string
Get a (langified) descriptionof the details about when an event is created, and the parameters that are attached with it.
GetFileResource()  : string
A function to return a resource identifier to a module specific file template
GetFriendlyName()  : string
Returns a translatable name of the module. For modulues who's names can probably be translated into another language (like News)
GetHeaderHTML()  : string
Returns XHTML that needs to go between the <head> tags when this module is called from an admin side action.
GetHelp()  : string
Returns the help for the module
GetHelpPage()  : string
Returns a sufficient help page for a module this function should not be overridden
GetModuleInstance()  : CMSModule
Get a reference to another module object
GetModulePath()  : string
Returns the full path to the module directory.
GetModulesWithCapability()  : array<string|int, mixed>
Returns an array of modulenames with the specified capability and which are installed and enabled, of course
GetModuleURLPath()  : string
Returns the URL path to the module directory.
GetName()  : string
Returns the name of the module
GetPreference()  : string
Returns a module preference if it exists.
GetTemplate()  : string
Returns a database saved template. This should be used for admin functions only, as it doesn't follow any smarty caching rules.
GetTemplateFromFile()  : string
Returns contents of the template that resides in modules/ModuleName/templates/{template_name}.tpl Code adapted from the Guestbook module
GetTemplateResource()  : string
A function to return a resource identifier to a module specific template if the template specified ends in .tpl then a file template is assumed.
GetVersion()  : string
Returns the version of the module
HandlesEvents()  : bool
A callback indicating if this module has a DoEvent method to handle incoming events.
HasAdmin()  : bool
Return true if there is an admin for the module. Returns false by default.
HasCapability()  : bool
Returns true if the modules thinks it has the capability specified
Install()  : string|false
Function that will get called as module is installed. This function should do any initialization functions including creating database tables. It should return a string message if there is a failure. Returning nothing (FALSE) will allow the install procedure to proceed.
InstallPostMessage()  : XHTML
Display a message after a successful installation of the module.
IsAdminOnly()  : bool
Returns whether this module should only be loaded from the admin
IsPluginModule()  : bool
Returns true if the module should be treated as a plugin module (like {cms_module module='name'}. Returns false by default.
Lang()  : string
Returns the corresponding translated string for the id given.
LazyLoadAdmin()  : bool
Returns true if the module may support lazy loading in the admin interface.
LazyLoadFrontend()  : bool
Returns true if the module may support lazy loading in the front end
ListPreferencesByPrefix()  : array<string|int, string>|null
List all preferences for a specific module by prefix.
ListTemplates()  : array<string|int, mixed>
List Templates associated with a module
ListUserTags()  : array<string|int, mixed>
Return a list of user defined tags
MinimumCMSVersion()  : string
Returns the minimum version necessary to run this version of the module.
ProcessTemplate()  : string
Process A File template through smarty
ProcessTemplateFromData()  : string
Given a template in a variable, this method processes it through smarty note, there is no caching involved.
ProcessTemplateFromDatabase()  : string
Process a smarty template associated with a module through smarty and return the results
Redirect()  : mixed
Redirects the user to another action of the module.
RedirectContent()  : mixed
Redirects the user to a content page outside of the module. The passed around returnid is frequently used for this so that the user will return back to the page from which they first entered the module.
RedirectForFrontEnd()  : mixed
Redirects the user to another action of the module.
RedirectToAdmin()  : mixed
Redirects to an admin page
RedirectToAdminTab()  : mixed
Redirect to the specified tab.
RegisterBulkContentFunction()  : mixed
Register a bulk content action
RegisterModulePlugin()  : mixed
Register a plugin to smarty with the name of the module. This method should be called from the module constructor, or from the SetParameters method.
RegisterRoute()  : mixed
Register a dynamic route to use for pretty url parsing
RegisterSmartyPlugin()  : mixed
Register a smarty plugin and attach it to this module.
RemoveEvent()  : mixed
Remove an event from the CMS system This function removes all handlers to the event, and completely removes all references to this event from the database
RemoveEventHandler()  : mixed
Remove an event handler from the CMS system This function removes all handlers to the event, and completely removes all references to this event from the database
RemovePermission()  : mixed
Removes a permission from the system. If recreated, the permission would have to be set to all groups again.
RemovePreference()  : bool
Removes a module preference. If no preference name is specified, removes all module preferences.
RemoveSmartyPlugin()  : mixed
Unregister a smarty plugin from the system.
RenderContentBlockField()  : string
Render the value of a module content block on the frontend of the website.
RestrictUnknownParams()  : mixed
A method to indicate that the system should drop and optionally generate an error about unknown parameters on frontend actions.
SendEvent()  : mixed
Trigger an event.
SetContentType()  : mixed
Set the content-type header.
SetCurrentTab()  : mixed
Set the current tab for the action.
SetError()  : mixed
Set an error message.
SetMessage()  : mixed
Set a display message.
SetParameters()  : mixed
This method can be used to perform initialization functions that should be done both for frontend and admin requests but not necessarily for lighweight module load requests (such as needed by ModuleManager).
SetParameterType()  : mixed
Indicate the name of, and type of a parameter that is acceptable for frontend actions.
SetPreference()  : mixed
Sets a module preference.
SetTabHeader()  : string
Set a specific tab header.
SetTemplate()  : bool
Sets a smarty template into the database and associates it with a module.
ShowErrors()  : string
ShowErrors Outputs errors in a nice error box with a troubleshooting link to the wiki
ShowMessage()  : string
ShowMessage Returns a formatted page status message
StartTab()  : string
Output a string to indicate the start of the output for a specific tab
StartTabContent()  : string
Output a string to indicate the start of XHTML areas for tabs.
StartTabHeaders()  : string
Output a string suitable for staring tab headers.
SuppressAdminOutput()  : bool
Use this method to prevent the admin interface from outputting header, footer, theme, etc, so your module can output files directly to the administrator.
SyntaxGenerateHeader()  : string
Returns header code specific to this SyntaxHighlighter
Uninstall()  : string|false
Function that will get called as module is uninstalled. This function should remove any database tables that it uses and perform any other cleanup duties.
UninstallPostMessage()  : XHTML
Display a message after a successful uninstall of the module.
UninstallPreMessage()  : XHTML
Display a message and a Yes/No dialog before doing an uninstall. Returning noting (FALSE) will go right to the uninstall.
Upgrade()  : bool
Function to perform any upgrade procedures. This is mostly used to for updating databsae tables, but can do other duties as well. It should return a string message if there is a failure. Returning nothing (FALSE) will allow the upgrade procedure to proceed. Upgrades should have a path so that they can be upgraded from more than one version back. While not a requirement, it makes life easy for your users.
ValidateContentBlockFieldValue()  : string
Validate the value for a module generated content block type.
VisibleToAdminUser()  : bool
Returns true or false, depending on whether the user has the right permissions to see the module in their Admin menus.
WYSIWYGGenerateHeader()  : string
Returns header code specific to this WYSIWYG
InitializeAdmin()  : mixed
Called from within the constructor, ONLY for admin module actions. This method should be overridden to create routes, and set handled parameters, and perform other initialization tasks that need to be setup for all frontend actions.
InitializeFrontend()  : mixed
Called from within the constructor, ONLY for frontend module actions. This method should be overridden to create routes, and set handled parameters, and perform other initialization tasks that need to be setup for all frontend actions.

Properties

$smarty

public Smarty_CMS $smarty

A reference to the global smarty object (deprecated)

Methods

AddEventHandler()

Add an event handler for an existing eg event.

public final AddEventHandler(string $modulename, string $eventname[, bool $removable = true ]) : mixed
Parameters
$modulename : string

The name of the module sending the event, or 'Core'

$eventname : string

The name of the event

$removable : bool = true

Can this event be removed from the list?

Tags
final
returns

bool

AdminStyle()

Called in the admin theme for every installed module, this method allows the module to output style information for use in the admin theme.

public AdminStyle() : mixed
Tags
abstract
returns

string css text.

AllowSmartyCaching()

Callback to determine if the output from a call to the module can be cached by smarty.

public AllowSmartyCaching() : bool
Tags
since
1.11
author

Robert Campbell

Return values
bool

AllowUninstallCleanup()

Function that gets called upon module uninstall, and returns a bool to indicate whether or not the core should remove all module events, event handlers, module templates, and preferences.

public AllowUninstallCleanup() : bool

The module must still remove its own database tables and permissions

Tags
abstract
Return values
bool

Whether the core may remove all module events, event handles, module templates, and preferences on uninstall (defaults to true)

Audit()

Put an event into the audit (admin) log. This should be done on most admin events for consistency.

public final Audit([string $itemid = '' ][, string $itemname = '' ][, string $action = '' ]) : mixed
Parameters
$itemid : string = ''

useful for working on a specific record (i.e article or user)

$itemname : string = ''

item name

$action : string = ''

action name

Tags
final

CallUserTag()

Call a specific user defined tag

public final CallUserTag(string $name[, array<string|int, mixed> $params = array() ]) : array<string|int, mixed>
Parameters
$name : string

Name of the user defined tag

$params : array<string|int, mixed> = array()

Parameters for the user defined tag.

Tags
final
Return values
array<string|int, mixed>

can_cache_output()

Callback to determine if the output from a call to the module can be cached by smarty.

public final can_cache_output() : bool
Tags
since
1.11
author

Robert Campbell

Return values
bool

CheckPermission()

Checks a permission against the currently logged in user.

public final CheckPermission(string $permission_name) : bool
Parameters
$permission_name : string

The name of the permission to check against the current user

Tags
final
Return values
bool

create_url()

Returns a URL to a module action This method is called by the CreateLink methods when creating a link to a module action.

public create_url(string $id, string $action[, int $returnid = '' ][, hash $params = array() ][, bool $inline = false ][, bool $targetcontentonly = false ][, string $prettyurl = '' ]) : mixed
Parameters
$id : string

The module action id (cntnt01 indicates that the defaul content block of the destination page should be used).

$action : string

The module action name

$returnid : int = ''

The destination page.

$params : hash = array()

Areay of parameters for the URL. These will be ignored if the prettyurl argument is specified.

$inline : bool = false

Wether the target of the output link is the same tag on the same page.

$targetcontentonly : bool = false

Wether the target of the output link targets the content area of the destination page.

$prettyurl : string = ''

An optional url segment related to the root of the page for pretty url purposes.

Tags
since
1.10
@return

string.

Returns the xhtml equivalent of an href link for content links. This is basically a nice little wrapper to make sure that we go back to where we want and that it's xhtml complient

public CreateContentLink(int $pageid[, string $contents = '' ]) : string
Parameters
$pageid : int

the page id of the page we want to direct to

$contents : string = ''

The optional text or XHTML contents of the generated link

Return values
string

CreateEvent()

Inform the system about a new event that can be generated

public final CreateEvent(string $eventname) : mixed
Parameters
$eventname : string

The name of the event

Tags
final
returns

nothing

CreateFieldsetEnd()

Returns the end of the fieldset in a form. This is basically just a wrapper around </form>, but could be extended later on down the road. It's here mainly for consistency.

public final CreateFieldsetEnd() : string
Tags
final
Return values
string

CreateFieldsetStart()

Returns the xhtml equivalent of an fieldset and legend. This is basically a nice little wrapper to make sure that id's are placed in names and also that it's xhtml compliant.

public final CreateFieldsetStart(string $id, string $name[, string $legend_text = '' ][, string $addtext = '' ][, string $addtext_legend = '' ]) : string
Parameters
$id : string

The id given to the module on execution (not really used yet, but might be later)

$name : string

The html name of the textbox (not really used yet, but might be later on)

$legend_text : string = ''

The legend_text for this fieldset, if applicaple

$addtext : string = ''

Any additional text that should be added into the tag when rendered

$addtext_legend : string = ''

Any additional text that should be added into the legend tag when rendered

Tags
final
Return values
string

CreateFileUploadInput()

Returns the xhtml equivalent of a file upload input. This is basically a nice little wrapper to make sure that id's are placed in names and also that it's xhtml compliant.

public CreateFileUploadInput(string $id, string $name[, string $addttext = '' ][, int $size = '10' ][, int $maxlength = '255' ]) : string
Parameters
$id : string

The id given to the module on execution

$name : string

The html name of the input

$addttext : string = ''

Any additional text that should be added into the tag when rendered

$size : int = '10'

The size of the text field associated with the file upload field. Some browsers may not respect this value.

$maxlength : int = '255'

The maximim length of the content of the text field associated with the file upload field. Some browsers may not respect this value.

Return values
string

CreateFormEnd()

Returns the end of the a module form. This is basically just a wrapper around </form>, but could be extended later on down the road. It's here mainly for consistency.

public CreateFormEnd() : string
Return values
string

CreateFormStart()

Returns the start of a module form

public CreateFormStart(string $id[, string $action = 'default' ][, string $returnid = '' ][, string $method = 'post' ][, string $enctype = '' ][, bool $inline = false ][, string $idsuffix = '' ][, array<string|int, mixed> $params = array() ][, string $extra = '' ]) : string
Parameters
$id : string

The id given to the module on execution

$action : string = 'default'

The action that this form should do when the form is submitted

$returnid : string = ''

The page id to eventually return to when the module is finished it's task

$method : string = 'post'

Method to use for the form tag. Defaults to 'post'

$enctype : string = ''

Optional enctype to use, Good for situations where files are being uploaded

$inline : bool = false

A flag to determine if actions should be handled inline (no moduleinterface.php -- only works for frontend)

$idsuffix : string = ''

Text to append to the end of the id and name of the form

$params : array<string|int, mixed> = array()

Extra parameters to pass along when the form is submitted

$extra : string = ''

Text to append to the

-statement, for instanse for javascript-validation code

Return values
string

CreateFrontendFormStart()

Returns the start of a module form, optimized for frontend use

public CreateFrontendFormStart(string $id, string $returnid[, string $action = 'default' ][, string $method = 'post' ][, string $enctype = '' ][, bool $inline = true ][, string $idsuffix = '' ][, array<string|int, mixed> $params = array() ]) : string
Parameters
$id : string

The id given to the module on execution

$returnid : string

The page id to eventually return to when the module is finished it's task

$action : string = 'default'

The name of the action that this form should do when the form is submitted

$method : string = 'post'

Method to use for the form tag. Defaults to 'post'

$enctype : string = ''

Optional enctype to use, Good for situations where files are being uploaded

$inline : bool = true

A flag to determine if actions should be handled inline (no moduleinterface.php -- only works for frontend)

$idsuffix : string = ''

Text to append to the end of the id and name of the form

$params : array<string|int, mixed> = array()

Extra parameters to pass along when the form is submitted

Return values
string

Returns the xhtml equivalent of an href link This is basically a nice little wrapper to make sure that id's are placed in names and also that it's xhtml compliant.

public CreateFrontendLink(string $id, string $returnid, string $action[, string $contents = '' ][, string $params = array() ][, string $warn_message = '' ][, bool $onlyhref = false ][, bool $inline = true ][, string $addtext = '' ][, bool $targetcontentonly = false ][, string $prettyurl = '' ]) : string
Parameters
$id : string

The id given to the module on execution

$returnid : string

The id to eventually return to when the module is finished it's task

$action : string

The action that this form should do when the link is clicked

$contents : string = ''

The text that will have to be clicked to follow the link

$params : string = array()

An array of params that should be inlucded in the URL of the link. These should be in a $key=>$value format.

$warn_message : string = ''

Text to display in a javascript warning box. If they click no, the link is not followed by the browser.

$onlyhref : bool = false

A flag to determine if only the href section should be returned

$inline : bool = true

A flag to determine if actions should be handled inline (no moduleinterface.php -- only works for frontend)

$addtext : string = ''

Any additional text that should be added into the tag when rendered

$targetcontentonly : bool = false

A flag indicating that the output of this link should target the content area of the destination page.

$prettyurl : string = ''

An optional pretty url segment (relative to the root of the site) to use when generating the link.

Return values
string

CreateInputCheckbox()

Returns the xhtml equivalent of a checkbox. This is basically a nice little wrapper to make sure that id's are placed in names and also that it's xhtml compliant.

public CreateInputCheckbox(string $id, string $name[, string $value = '' ][, string $selectedvalue = '' ][, string $addttext = '' ]) : string
Parameters
$id : string

The id given to the module on execution

$name : string

The html name of the checkbox

$value : string = ''

The value returned from the input if selected

$selectedvalue : string = ''

The current value. If equal to $value the checkbox is selected

$addttext : string = ''

Any additional text that should be added into the tag when rendered

Return values
string

CreateInputColor()

Returns the html5 equivalent of an input of type color. This is basically a nice little wrapper to make sure that id's are placed in names and also that it's html5 compliant.

public CreateInputColor(string $id, string $name[, string $value = '' ][, string $addttext = '' ]) : string
Parameters
$id : string

The id given to the module on execution

$name : string

The html name of the input field

$value : string = ''

The predefined value of the textbox, if any

$addttext : string = ''

Any additional text that should be added into the tag when rendered

Return values
string

CreateInputDataList()

Returns the html5 equivalent input field with datalist options. This is basically a nice little wrapper to make sure that id's are placed in names and also that it's html5 compliant.

public CreateInputDataList(string $id, string $name[, string $value = '' ][, string $items = NULL ][, string $size = '10' ][, string $maxlength = '255' ][, string $addttext = '' ]) : string
Parameters
$id : string

The id given to the module on execution

$name : string

The html name of the textbox

$value : string = ''

The predefined value of the textbox, if any

$items : string = NULL

An array of items to put into the list... they should be $key=>$value pairs

$size : string = '10'

The number of columns wide the textbox should be displayed

$maxlength : string = '255'

The maximum number of characters that should be allowed to be entered

$addttext : string = ''

Any additional text that should be added into the tag when rendered

Return values
string

CreateInputDate()

Returns the html5 equivalent of an input of type date. This is basically a nice little wrapper to make sure that id's are placed in names and also that it's html5 compliant.

public CreateInputDate(string $id, string $name[, string $value = '' ][, string $addttext = '' ]) : string
Parameters
$id : string

The id given to the module on execution

$name : string

The html name of the input field

$value : string = ''

The predefined value of the textbox, if any

$addttext : string = ''

Any additional text that should be added into the tag when rendered

Return values
string

CreateInputDatetime()

Returns the html5 equivalent of an input of type datetime. This is basically a nice little wrapper to make sure that id's are placed in names and also that it's html5 compliant.

public CreateInputDatetime(string $id, string $name[, string $value = '' ][, string $addttext = '' ]) : string
Parameters
$id : string

The id given to the module on execution

$name : string

The html name of the input field

$value : string = ''

The predefined value of the textbox, if any

$addttext : string = ''

Any additional text that should be added into the tag when rendered

Return values
string

CreateInputDatetimeLocal()

Returns the html5 equivalent of an input of type datetime-local. This is basically a nice little wrapper to make sure that id's are placed in names and also that it's html5 compliant.

public CreateInputDatetimeLocal(string $id, string $name[, string $value = '' ][, string $addttext = '' ]) : string
Parameters
$id : string

The id given to the module on execution

$name : string

The html name of the input field

$value : string = ''

The predefined value of the textbox, if any

$addttext : string = ''

Any additional text that should be added into the tag when rendered

Return values
string

CreateInputDropdown()

Returns the xhtml equivalent of a dropdown list. This is basically a nice little wrapper to make sure that id's are placed in names and also that it is xhtml compliant.

public CreateInputDropdown(string $id, string $name, string $items[, string $selectedindex = -1 ][, string $selectedvalue = '' ][, string $addttext = '' ]) : string
Parameters
$id : string

The id given to the module on execution

$name : string

The html name of the dropdown list

$items : string

An array of items to put into the dropdown list... they should be $key=>$value pairs

$selectedindex : string = -1

The default selected index of the dropdown list. Setting to -1 will result in the first choice being selected

$selectedvalue : string = ''

The default selected value of the dropdown list. Setting to '' will result in the first choice being selected

$addttext : string = ''

Any additional text that should be added into the tag when rendered

Return values
string

CreateInputEmail()

Returns the html5 equivalent of an input textbox of type email. This is basically a nice little wrapper to make sure that id's are placed in names and also that it's html5 compliant.

public CreateInputEmail(string $id, string $name[, string $value = '' ][, string $size = '10' ][, string $maxlength = '255' ][, string $addttext = '' ]) : string
Parameters
$id : string

The id given to the module on execution

$name : string

The html name of the textbox

$value : string = ''

The predefined value of the textbox, if any

$size : string = '10'

The number of columns wide the textbox should be displayed

$maxlength : string = '255'

The maximum number of characters that should be allowed to be entered

$addttext : string = ''

Any additional text that should be added into the tag when rendered

Return values
string

CreateInputFile()

Returns the xhtml equivalent of a file-selector field. This is basically a nice little wrapper to make sure that id's are placed in names and also that it's xhtml compliant.

public CreateInputFile(string $id, string $name[, string $accept = '' ][, string $size = '10' ][, string $addttext = '' ]) : string
Parameters
$id : string

The id given to the module on execution

$name : string

The html name of the textbox

$accept : string = ''

The MIME-type to be accepted, default is all

$size : string = '10'

The number of columns wide the textbox should be displayed

$addttext : string = ''

Any additional text that should be added into the tag when rendered

Return values
string

CreateInputHidden()

Returns the xhtml equivalent of a hidden field. This is basically a nice little wrapper to make sure that id's are placed in names and also that it's xhtml compliant.

public CreateInputHidden(string $id, string $name[, string $value = '' ][, string $addttext = '' ]) : string
Parameters
$id : string

The id given to the module on execution

$name : string

The html name of the hidden field

$value : string = ''

The predefined value of the field, if any

$addttext : string = ''

Any additional text that should be added into the tag when rendered

Return values
string

CreateInputMonth()

Returns the html5 equivalent of an input of type month. This is basically a nice little wrapper to make sure that id's are placed in names and also that it's html5 compliant.

public CreateInputMonth(string $id, string $name[, string $value = '' ][, string $addttext = '' ]) : string
Parameters
$id : string

The id given to the module on execution

$name : string

The html name of the input field

$value : string = ''

The predefined value of the textbox, if any

$addttext : string = ''

Any additional text that should be added into the tag when rendered

Return values
string

CreateInputNumber()

Returns the html5 equivalent of an input of type number. This is basically a nice little wrapper to make sure that id's are placed in names and also that it's html5 compliant.

public CreateInputNumber(string $id, string $name[, string $value = '' ][, string $addttext = '' ]) : string
Parameters
$id : string

The id given to the module on execution

$name : string

The html name of the input field

$value : string = ''

The predefined value of the textbox, if any

$addttext : string = ''

Any additional text that should be added into the tag when rendered

Return values
string

CreateInputPassword()

Returns the xhtml equivalent of an input password-box. This is basically a nice little wrapper to make sure that id's are placed in names and also that it's xhtml compliant.

public CreateInputPassword(string $id, string $name[, string $value = '' ][, string $size = '10' ][, string $maxlength = '255' ][, string $addttext = '' ]) : string
Parameters
$id : string

The id given to the module on execution

$name : string

The html name of the textbox

$value : string = ''

The predefined value of the textbox, if any

$size : string = '10'

The number of columns wide the textbox should be displayed

$maxlength : string = '255'

The maximum number of characters that should be allowed to be entered

$addttext : string = ''

Any additional text that should be added into the tag when rendered

Return values
string

CreateInputRadioGroup()

Returns the xhtml equivalent of a set of radio buttons. This is basically a nice little wrapper to make sure that id's are placed in names and also that it is xhtml compliant.

public CreateInputRadioGroup(string $id, string $name, string $items[, string $selectedvalue = '' ][, string $addttext = '' ][, string $delimiter = '' ]) : string
Parameters
$id : string

The id given to the module on execution

$name : string

The html name of the radio group

$items : string

An array of items to create as radio buttons... they should be $key=>$value pairs

$selectedvalue : string = ''

The default selected index of the radio group. Setting to -1 will result in the first choice being selected

$addttext : string = ''

Any additional text that should be added into the tag when rendered

$delimiter : string = ''

A delimiter to throw between each radio button, e.g., a
tag or something for formatting

Return values
string

CreateInputRange()

Returns the html5 equivalent of an input of type range. This is basically a nice little wrapper to make sure that id's are placed in names and also that it's html5 compliant.

public CreateInputRange(string $id, string $name[, string $value = '' ][, string $addttext = '' ]) : string
Parameters
$id : string

The id given to the module on execution

$name : string

The html name of the input field

$value : string = ''

The predefined value of the textbox, if any

$addttext : string = ''

Any additional text that should be added into the tag when rendered

Return values
string

CreateInputReset()

Returns the xhtml equivalent of a reset button. This is basically a nice little wrapper to make sure that id's are placed in names and also that it's xhtml compliant.

public CreateInputReset(string $id, string $name[, string $value = 'Reset' ][, string $addttext = '' ]) : string
Parameters
$id : string

The id given to the module on execution

$name : string

The html name of the button

$value : string = 'Reset'

The predefined value of the button, if any

$addttext : string = ''

Any additional text that should be added into the tag when rendered

Return values
string

CreateInputSearch()

Returns the html5 equivalent of an input of type search. This is basically a nice little wrapper to make sure that id's are placed in names and also that it's html5 compliant.

public CreateInputSearch(string $id, string $name[, string $value = '' ][, string $size = '10' ][, string $maxlength = '255' ][, string $addttext = '' ]) : string
Parameters
$id : string

The id given to the module on execution

$name : string

The html name of the textbox

$value : string = ''

The predefined value of the textbox, if any

$size : string = '10'

The number of columns wide the textbox should be displayed

$maxlength : string = '255'

The maximum number of characters that should be allowed to be entered

$addttext : string = ''

Any additional text that should be added into the tag when rendered

Return values
string

CreateInputSelectList()

Returns the xhtml equivalent of a multi-select list. This is basically a nice little wrapper to make sure that id's are placed in names and also that it is xhtml compliant.

public CreateInputSelectList(string $id, string $name, string $items[, string $selecteditems = array() ][, string $size = 3 ][, string $addttext = '' ][, bool $multiple = true ]) : string
Parameters
$id : string

The id given to the module on execution

$name : string

The html name of the select list

$items : string

An array of items to put into the list... they should be $key=>$value pairs

$selecteditems : string = array()

An array of items in the list that should default to selected.

$size : string = 3

The number of rows to be visible in the list (before scrolling).

$addttext : string = ''

Any additional text that should be added into the tag when rendered

$multiple : bool = true

indicates wether multiple selections are allowed (defaults to true)

Return values
string

CreateInputSubmit()

Returns the xhtml equivalent of a submit button. This is basically a nice little wrapper to make sure that id's are placed in names and also that it's xhtml compliant.

public CreateInputSubmit(string $id, string $name[, string $value = '' ][, string $addttext = '' ][, string $image = '' ][, string $confirmtext = '' ]) : string
Parameters
$id : string

The id given to the module on execution

$name : string

The html name of the button

$value : string = ''

The predefined value of the button, if any

$addttext : string = ''

Any additional text that should be added into the tag when rendered

$image : string = ''

Use an image instead of a regular button

$confirmtext : string = ''

Optional text to display in a confirmation message.

Return values
string

CreateInputTel()

Returns the html5 equivalent of an input textbox of type tel. This is basically a nice little wrapper to make sure that id's are placed in names and also that it's html5 compliant.

public CreateInputTel(string $id, string $name[, string $value = '' ][, string $size = '10' ][, string $maxlength = '255' ][, string $addttext = '' ]) : string
Parameters
$id : string

The id given to the module on execution

$name : string

The html name of the textbox

$value : string = ''

The predefined value of the textbox, if any

$size : string = '10'

The number of columns wide the textbox should be displayed

$maxlength : string = '255'

The maximum number of characters that should be allowed to be entered

$addttext : string = ''

Any additional text that should be added into the tag when rendered

Return values
string

CreateInputText()

Returns the xhtml equivalent of an input textbox. This is basically a nice little wrapper to make sure that id's are placed in names and also that it's xhtml compliant.

public CreateInputText(string $id, string $name[, string $value = '' ][, string $size = '10' ][, string $maxlength = '255' ][, string $addttext = '' ]) : string
Parameters
$id : string

The id given to the module on execution

$name : string

The html name of the textbox

$value : string = ''

The predefined value of the textbox, if any

$size : string = '10'

The number of columns wide the textbox should be displayed

$maxlength : string = '255'

The maximum number of characters that should be allowed to be entered

$addttext : string = ''

Any additional text that should be added into the tag when rendered

Return values
string

CreateInputTextWithLabel()

Returns the xhtml equivalent of an input textbox with label. This is basically a nice little wrapper to make sure that id's are placed in names and also that it's xhtml compliant.

public CreateInputTextWithLabel(string $id, string $name[, string $value = '' ][, string $size = '10' ][, string $maxlength = '255' ][, string $addttext = '' ][, string $label = '' ][, string $labeladdtext = '' ]) : string
Parameters
$id : string

The id given to the module on execution

$name : string

The html name of the textbox

$value : string = ''

The predefined value of the textbox, if any

$size : string = '10'

The number of columns wide the textbox should be displayed

$maxlength : string = '255'

The maximum number of characters that should be allowed to be entered

$addttext : string = ''

Any additional text that should be added into the tag when rendered

$label : string = ''

The text for label

$labeladdtext : string = ''

Any additional text that should be added into the tag when rendered

Return values
string

CreateInputTime()

Returns the html5 equivalent of an input of type time. This is basically a nice little wrapper to make sure that id's are placed in names and also that it's html5 compliant.

public CreateInputTime(string $id, string $name[, string $value = '' ][, string $addttext = '' ]) : string
Parameters
$id : string

The id given to the module on execution

$name : string

The html name of the input field

$value : string = ''

The predefined value of the textbox, if any

$addttext : string = ''

Any additional text that should be added into the tag when rendered

Return values
string

CreateInputUrl()

Returns the html5 equivalent of an input of type url. This is basically a nice little wrapper to make sure that id's are placed in names and also that it's xhtml compliant.

public CreateInputUrl(string $id, string $name[, string $value = '' ][, string $size = '10' ][, string $maxlength = '255' ][, string $addttext = '' ]) : string
Parameters
$id : string

The id given to the module on execution

$name : string

The html name of the textbox

$value : string = ''

The predefined value of the textbox, if any

$size : string = '10'

The number of columns wide the textbox should be displayed

$maxlength : string = '255'

The maximum number of characters that should be allowed to be entered

$addttext : string = ''

Any additional text that should be added into the tag when rendered

Return values
string

CreateInputWeek()

Returns the html5 equivalent of an input of type week. This is basically a nice little wrapper to make sure that id's are placed in names and also that it's html5 compliant.

public CreateInputWeek(string $id, string $name[, string $value = '' ][, string $addttext = '' ]) : string
Parameters
$id : string

The id given to the module on execution

$name : string

The html name of the input field

$value : string = ''

The predefined value of the textbox, if any

$addttext : string = ''

Any additional text that should be added into the tag when rendered

Return values
string

CreateLabelForInput()

Returns the xhtml equivalent of an label for input field. This is basically a nice little wrapper to make sure that id's are placed in names and also that it's xhtml compliant.

public CreateLabelForInput(string $id, string $name[, string $labeltext = '' ][, string $addttext = '' ]) : string
Parameters
$id : string

The id given to the module on execution

$name : string

The html name of the input field this label is associated to

$labeltext : string = ''

The text in the label

$addttext : string = ''

Any additional text that should be added into the tag when rendered

Return values
string

Returns the xhtml equivalent of an href link This is basically a nice little wrapper to make sure that id's are placed in names and also that it's xhtml compliant.

public CreateLink(string $id, string $action[, string $returnid = '' ][, string $contents = '' ][, string $params = array() ][, string $warn_message = '' ][, bool $onlyhref = false ][, bool $inline = false ][, string $addttext = '' ][, bool $targetcontentonly = false ][, string $prettyurl = '' ]) : string
Parameters
$id : string

The id given to the module on execution

$action : string

The action that this form should do when the link is clicked

$returnid : string = ''

The id to eventually return to when the module is finished it's task

$contents : string = ''

The text that will have to be clicked to follow the link

$params : string = array()

An array of params that should be inlucded in the URL of the link. These should be in a $key=>$value format.

$warn_message : string = ''

Text to display in a javascript warning box. If they click no, the link is not followed by the browser.

$onlyhref : bool = false

A flag to determine if only the href section should be returned

$inline : bool = false

A flag to determine if actions should be handled inline (no moduleinterface.php -- only works for frontend)

$addttext : string = ''

Any additional text that should be added into the tag when rendered

$targetcontentonly : bool = false

A flag to determine if the link should target the default content are of the destination page.

$prettyurl : string = ''

An optional pretty url segment (related to the root of the website) for a pretty url.

Return values
string

CreateParameter()

Create a parameter and it's documentation for display in the module help.

public final CreateParameter(string $param[, string $defaultval = '' ][, string $helpstring = '' ][, bool $optional = true ]) : mixed

i.e: $this->CreateParameter('numarticles',100000,$this->Lang('help_numarticles'),true);

Parameters
$param : string

Parameter name;

$defaultval : string = ''

Default parameter value

$helpstring : string = ''

Help String

$optional : bool = true

Flag indicating wether this parameter is optional or required.

Tags
see
SetParameters
see
SetParameterType
final

CreatePermission()

Create's a new permission for use by the module.

public final CreatePermission(string $permission_name[, string $permission_text = null ]) : mixed
Parameters
$permission_name : string

Name of the permission to create

$permission_text : string = null

Description of the permission

Tags
final

Returns the xhtml equivalent of an href link for Content links. This is basically a nice little wrapper to make sure that we go back to where we want to and that it's xhtml compliant.

public CreateReturnLink(string $id, string $returnid[, string $contents = '' ][, string $params = array() ][, bool $onlyhref = false ]) : string
Parameters
$id : string

The id given to the module on execution

$returnid : string

The id to return to when the module is finished it's task

$contents : string = ''

The text that will have to be clicked to follow the link

$params : string = array()

An array of params that should be inlucded in the URL of the link. These should be in a $key=>$value format.

$onlyhref : bool = false

A flag to determine if only the href section should be returned

Return values
string

CreateStaticRoutes()

Register all static routes for this module.

public CreateStaticRoutes() : mixed
Tags
abstract
since
1.11
author

Robert Campbell

CreateSyntaxArea()

Returns the xhtml equivalent of a textarea. Also takes Syntax hilighter preference into consideration if it's called from the admin side.

public CreateSyntaxArea(string $id, string $text, string $name[, string $classname = '' ][, string $htmlid = '' ][, string $encoding = '' ][, string $stylesheet = '' ][, string $cols = '80' ][, string $rows = '15' ][, string $addtext = '' ]) : string
Parameters
$id : string

The id given to the module on execution

$text : string

The text to display in the textarea's content

$name : string

The html name of the textarea

$classname : string = ''

The CSS class to associate this textarea to

$htmlid : string = ''

The html id to give to this textarea

$encoding : string = ''

The encoding to use for the content

$stylesheet : string = ''

The text of the stylesheet associated to this content. Only used for certain WYSIWYGs

$cols : string = '80'

The number of characters wide (columns) the resulting textarea should be

$rows : string = '15'

The number of characters high (rows) the resulting textarea should be

$addtext : string = ''

Additional text for the text area tag.

Return values
string

CreateTextArea()

Returns the xhtml equivalent of a textarea. Also takes WYSIWYG preference into consideration if it's called from the admin side.

public CreateTextArea(bool $enablewysiwyg, string $id, string $text, string $name[, string $classname = '' ][, string $htmlid = '' ][, string $encoding = '' ][, string $stylesheet = '' ][, string $cols = '' ][, string $rows = '' ][, string $forcewysiwyg = '' ][, string $wantedsyntax = '' ][, string $addtext = '' ]) : string
Parameters
$enablewysiwyg : bool

Should we try to create a WYSIWYG for this textarea?

$id : string

The id given to the module on execution

$text : string

The text to display in the textarea's content

$name : string

The html name of the textarea

$classname : string = ''

The CSS class to associate this textarea to

$htmlid : string = ''

The html id to give to this textarea

$encoding : string = ''

The encoding to use for the content

$stylesheet : string = ''

The text of the stylesheet associated to this content. Only used for certain WYSIWYGs

$cols : string = ''

The number of characters wide (columns) the resulting textarea should be

$rows : string = ''

The number of characters high (rows) the resulting textarea should be

$forcewysiwyg : string = ''

The wysiwyg-system to be forced even if the user has chosen another one

$wantedsyntax : string = ''

The language the content should be syntaxhightlighted as

$addtext : string = ''

Any additional text to include with the textarea field.

Tags
see
CmsFormUtils::create_textarea
Return values
string

CreateTooltip()

Returns the xhtml equivalent of a tooltip help link.

public final CreateTooltip(string $helptext[, string $linktext = "?" ][, string $forcewidth = "" ][, string $classname = "admin-tooltip admin-tooltip-box" ][, string $href = "" ]) : string
Parameters
$helptext : string

The help text to be shown on mouse over

$linktext : string = "?"

The text to be shown as the link, default to a simple question mark

$forcewidth : string = ""

Forces another width of the popupbox than the one set in admin css

$classname : string = "admin-tooltip admin-tooltip-box"

An alternative classname for the a-link of the tooltip

$href : string = ""

The URL or url portion to use in the href portion of the generated link.

Tags
final
Return values
string

Returns the xhtml equivalent of a tooltip-enabled href link This is basically a nice little wrapper to make sure that id's are placed in names and also that it's xhtml compliant.

public final CreateTooltipLink(string $id, string $action, string $returnid, string $contents, string $tooltiptext[, string $params = array() ]) : string
Parameters
$id : string

The id given to the module on execution

$action : string

The action that this form should do when the link is clicked

$returnid : string

The id to eventually return to when the module is finished it's task

$contents : string

The text that will have to be clicked to follow the link

$tooltiptext : string

The helptext to be shown as tooltip-popup

$params : string = array()

An array of params that should be inlucded in the URL of the link. These should be in a $key=>$value format.

Tags
final
Return values
string

CreateXMLPackage()

Creates an xml data package from the module directory.

public final CreateXMLPackage(string &$message, int &$filecount) : string
Parameters
$message : string

reference to returned message.

$filecount : int

reference to returned file count.

Tags
final
Return values
string

XML Text

DeleteTemplate()

Delete a module template from the database

public final DeleteTemplate([string $tpl_name = '' ][, string $modulename = '' ]) : bool
Parameters
$tpl_name : string = ''

The Template name, if empty all templates associated with the module are deleted.

$modulename : string = ''

The module name, if empty the current module name is used.

Tags
final
Return values
bool

DoAction()

Used for navigation between "pages" of a module. Forms and links should pass an action with them so that the module will know what to do next.

public DoAction(string $name, string $id, array<string|int, mixed> $params[, int $returnid = '' ]) : string

By default, DoAction will be passed 'default' and 'defaultadmin', depending on where the module was called from. If being used as a module or content type, 'default' will be passed. If the module was selected from the list on the admin menu, then 'defaultadmin' will be passed.

In order to allow splitting up functionality into multiple PHP files the default behaviour of this method is to look for a file named action..php in the modules directory, and if it exists include it.

Parameters
$name : string

The Name of the action to perform

$id : string

The ID of the module

$params : array<string|int, mixed>

The parameters targeted for this module

$returnid : int = ''

The current page id that is being displayed.

Tags
abstract
Return values
string

output XHTML.

DoEvent()

An event that this module is listening to has occurred, and should be handled.

public DoEvent(string $originator, string $eventname, array<string|int, mixed> &$params) : bool

This method must be over-ridden if this module is capable of handling events. of any type.

The default behavior of this method is to check for a function called event...php in the module directory, and if this file exists it, include it to handle the event.

Parameters
$originator : string

The name of the originating module

$eventname : string

The name of the event

$params : array<string|int, mixed>

Array of parameters provided with the event.

Tags
abstract
Return values
bool

EndTab()

Output a string to indicate the end of the output for a specific tab.

public EndTab() : string
Tags
final
Return values
string

EndTabContent()

Output a string to indicate the end of XHTML areas for tabs.

public EndTabContent() : string
Tags
final
Return values
string

EndTabHeaders()

Output a string to stop the output of headers and close the necessary XHTML div.

public EndTabHeaders() : string
Tags
final
Return values
string

get_pretty_url()

Return a pretty url string for a module action This method is called by the create_url and the CreateLink methods if the pretty url argument is not specified in order to attempt automating a pretty url for an action.

public get_pretty_url(string $id, string $action[, int $returnid = '' ][, array<string|int, mixed> $params = array() ][, bool $inline = false ]) : string
Parameters
$id : string

The module action id (cntnt01 indicates that the defaul content block of the destination page should be used).

$action : string

The module action name

$returnid : int = ''

The destination page.

$params : array<string|int, mixed> = array()

Areay of parameters for the URL. These will be ignored if the prettyurl argument is specified.

$inline : bool = false

Wether the target of the output link is the same tag on the same page.

Tags
since
1.10
abstract
Return values
string

get_tasks()

Returns a list of the tasks that this module manages

public get_tasks() : array<string|int, mixed>
Tags
since
1.8
abstract
Return values
array<string|int, mixed>

of CmsRegularTask objects, or one object. NULL if not handled.

GetAbout()

Returns a sufficient about page for a module

public GetAbout() : string
Tags
abstract
Return values
string

The about page HTML text.

GetActionTemplateObject()

Get a reference to the smarty template object that was passed in to the the action.

public final GetActionTemplateObject() : Smarty_Internal_Template

This method is only valid within a module action.

Tags
final
since
2.0.1
author

calguy1000

Return values
Smarty_Internal_Template

GetAdminDescription()

Returns a description of what the admin link does.

public GetAdminDescription() : string
Tags
abstract
Return values
string

GetAdminMenuItems()

Return a array of CmsAdminMenuItem objects representing menu items for the admin nav for this module.

public GetAdminMenuItems() : array<string|int, mixed>

This method should do all permissions checking when building the array of objects.

Tags
since
2.0
abstract
Return values
array<string|int, mixed>

of CmsAdminMenuItem objects

GetAdminSection()

Returns which admin section this module belongs to.

public GetAdminSection() : string

this is used to place the module in the appropriate admin navigation section. Valid options are currently:

main, content, layout, files, usersgroups, extensions, preferences, siteadmin, myprefs, ecommerce

Tags
abstract
Return values
string

GetAuthor()

Returns the name of the author

public GetAuthor() : string
Tags
abstract
Return values
string

The name of the author.

GetAuthorEmail()

Returns the email address of the author

public GetAuthorEmail() : string
Tags
abstract
Return values
string

The email address of the author.

GetChangeLog()

Returns the changelog for the module

public GetChangeLog() : string
Return values
string

HTML text of the changelog.

GetContentBlockFieldInput()

Get an input field for a module generated content block type.

public GetContentBlockFieldInput(string $blockName, mixed $value, array<string|int, mixed> $params, bool $adding, ContentBase $content_obj) : mixed

This method is called from the content edit form when a {content_module} tag is encountered.

This method can be overridden if the module is providing content block types to the CMSMS content objects.

Parameters
$blockName : string

Content block name

$value : mixed

Content block value

$params : array<string|int, mixed>

Associative array containing content block parameters

$adding : bool

A flag indicating whether the content editor is in create mode (adding) vs. edit mod.

$content_obj : ContentBase

The content object being edited.

Tags
abstract
since
2.0
Return values
mixed

Either an array with two elements (prompt, and xhtml element) or a string containing only the xhtml input element.

GetContentBlockFieldValue()

Return a value for a module generated content block type.

public GetContentBlockFieldValue(string $blockName, array<string|int, mixed> $blockParams, array<string|int, mixed> $inputParams, ContentBase $content_obj) : mixed|false

This mehod is called from a {content_module} tag, when the content edit form is being edited.

Given input parameters (i.e: via _POST or _REQUEST), this method will extract a value for the given content block information.

This method can be overridden if the module is providing content block types to the CMSMS content objects.

Parameters
$blockName : string

Content block name

$blockParams : array<string|int, mixed>

Content block parameters

$inputParams : array<string|int, mixed>

input parameters

$content_obj : ContentBase

The content object being edited.

Tags
abstract
since
2.0
Return values
mixed|false

The content block value if possible.

GetDatabaseResource()

Build a resource string for an old module templates resource.

public final GetDatabaseResource(string $template) : string

If the template name provided ends with .tpl a module file template is assumed.

Parameters
$template : string

The template name.

Tags
final
since
1.11
author

calguy1000

Return values
string

GetDb()

Returns the cms->db object as a reference

public final GetDb() : Connection
Tags
final
throws
Exception
Return values
Connection

ADOConnection Adodb Database object

GetDependencies()

Returns a list of dependencies and minimum versions that this module requires. It should return an hash, eg.

public GetDependencies() : array<string|int, mixed>

return array('somemodule'=>'1.0', 'othermodule'=>'1.1');

Tags
abstract
Return values
array<string|int, mixed>

GetDescription()

Returns a short description of the module

public GetDescription() : string
Tags
abstract
Return values
string

GetEventDescription()

Get a (langified) description for an event this module created.

public GetEventDescription(string $eventname) : string

This method must be over-ridden if this module created any events.

Parameters
$eventname : string

The name of the event

Tags
abstract
Return values
string

GetEventHelp()

Get a (langified) descriptionof the details about when an event is created, and the parameters that are attached with it.

public GetEventHelp(string $eventname) : string

This method must be over-ridden if this module created any events.

Parameters
$eventname : string

The name of the event

Tags
abstract
Return values
string

GetFileResource()

A function to return a resource identifier to a module specific file template

public final GetFileResource(string $template) : string
Parameters
$template : string

The template name.

Tags
since
1.11
author

calguy1000

Return values
string

GetFriendlyName()

Returns a translatable name of the module. For modulues who's names can probably be translated into another language (like News)

public GetFriendlyName() : string
Tags
abstract
Return values
string

GetHeaderHTML()

Returns XHTML that needs to go between the <head> tags when this module is called from an admin side action.

public GetHeaderHTML() : string

This method is called by the admin theme when executing an action for a specific module.

Return values
string

XHTML text

GetHelp()

Returns the help for the module

public GetHelp() : string

Note: New for CMSMS 1.11.12 - If the global variable CMSMS_GENERATING_XML is set it indicates that the help output will be stored in an XML file. This variable can be used to check wether advanced html output (like links to other documents) should be generated.

Tags
abstract
Return values
string

Help HTML Text.

GetHelpPage()

Returns a sufficient help page for a module this function should not be overridden

public final GetHelpPage() : string
Tags
final
Return values
string

The help page HTML text.

GetModuleInstance()

Get a reference to another module object

public static GetModuleInstance(string $module) : CMSModule
Parameters
$module : string

The required module name.

Tags
final
Return values
CMSModule

The module object, or FALSE

GetModulePath()

Returns the full path to the module directory.

public final GetModulePath() : string
Tags
final
Return values
string

The full path to the module directory.

GetModulesWithCapability()

Returns an array of modulenames with the specified capability and which are installed and enabled, of course

public final GetModulesWithCapability(string $capability[, array<string|int, mixed> $params = array() ]) : array<string|int, mixed>
Parameters
$capability : string

name of the capability we are checking for. could be "wysiwyg" etc.

$params : array<string|int, mixed> = array()

further params to get more detailed info about the capabilities. Should be syncronized with other modules of same type

Tags
final
Return values
array<string|int, mixed>

GetModuleURLPath()

Returns the URL path to the module directory.

public final GetModuleURLPath([bool $use_ssl = false ]) : string
Parameters
$use_ssl : bool = false

Optional generate an URL using HTTPS path

Tags
final
Return values
string

The full path to the module directory.

GetName()

Returns the name of the module

public GetName() : string
Tags
abstract
Return values
string

The name of the module.

GetPreference()

Returns a module preference if it exists.

public final GetPreference(string $preference_name[, string $defaultvalue = '' ]) : string
Parameters
$preference_name : string

The name of the preference to check

$defaultvalue : string = ''

The default value, just in case it doesn't exist

Tags
final
Return values
string

GetTemplate()

Returns a database saved template. This should be used for admin functions only, as it doesn't follow any smarty caching rules.

public final GetTemplate(string $tpl_name[, string $modulename = '' ]) : string
Parameters
$tpl_name : string

the template name.

$modulename : string = ''

If empty the current module name is used.

Tags
final
Return values
string

GetTemplateFromFile()

Returns contents of the template that resides in modules/ModuleName/templates/{template_name}.tpl Code adapted from the Guestbook module

public final GetTemplateFromFile(string $template_name) : string
Parameters
$template_name : string
Tags
final
Return values
string

GetTemplateResource()

A function to return a resource identifier to a module specific template if the template specified ends in .tpl then a file template is assumed.

public final GetTemplateResource(string $template) : string

Note: Since 2.2.1 This function will throw a logic exception if a string or eval resource is supplied.

Parameters
$template : string

The template name.

Tags
since
2.0
author

calguy1000

Return values
string

GetVersion()

Returns the version of the module

public abstract GetVersion() : string
Tags
abstract
Return values
string

HandlesEvents()

A callback indicating if this module has a DoEvent method to handle incoming events.

public HandlesEvents() : bool
Tags
abstract
Return values
bool

HasAdmin()

Return true if there is an admin for the module. Returns false by default.

public HasAdmin() : bool
Tags
abstract
Return values
bool

HasCapability()

Returns true if the modules thinks it has the capability specified

public HasCapability(string $capability[, array<string|int, mixed> $params = array() ]) : bool
Parameters
$capability : string

an id specifying which capability to check for, could be "wysiwyg" etc.

$params : array<string|int, mixed> = array()

An associative array further params to get more detailed info about the capabilities. Should be syncronized with other modules of same type

Tags
abstract
Return values
bool

Install()

Function that will get called as module is installed. This function should do any initialization functions including creating database tables. It should return a string message if there is a failure. Returning nothing (FALSE) will allow the install procedure to proceed.

public Install() : string|false

The default behavior of this method is to include a file named method.install.php in the module directory, if one can be found. This provides a way of splitting secondary functions into other files.

Tags
abstract
Return values
string|false

A value of FALSE indicates no error. Any other value will be used as an error message.

InstallPostMessage()

Display a message after a successful installation of the module.

public InstallPostMessage() : XHTML
Tags
abstract
Return values
XHTML

Text

IsAdminOnly()

Returns whether this module should only be loaded from the admin

public IsAdminOnly() : bool
Tags
abstract
Return values
bool

IsPluginModule()

Returns true if the module should be treated as a plugin module (like {cms_module module='name'}. Returns false by default.

public IsPluginModule() : bool
Tags
abstract
Return values
bool

Lang()

Returns the corresponding translated string for the id given.

public Lang() : string

This method accepts variable arguments. The first argument (required) is the language string key (a string) Further arguments may be sprintf arguments matching the specified key.

Return values
string

LazyLoadAdmin()

Returns true if the module may support lazy loading in the admin interface.

public LazyLoadAdmin() : bool

Note: The results of this function are not read on each request, only during install and upgrade therefore if the return value of this function changes the version number of the module should be increased to force a re-load

In CMSMS 1.10 routes are loaded upon each request, if a module registers routes it cannot be lazy loaded.

Tags
since
1.10
abstract
Return values
bool

LazyLoadFrontend()

Returns true if the module may support lazy loading in the front end

public LazyLoadFrontend() : bool

Note: The results of this function are not read on each request, only during install and upgrade therefore if the return value of this function changes the version number of the module should be increased to force a re-load

In CMSMS 1.10 routes are loaded upon each request, if a module registers routes it cannot be lazy loaded.

Tags
since
1.10
abstract
Return values
bool

ListPreferencesByPrefix()

List all preferences for a specific module by prefix.

public final ListPreferencesByPrefix(string $prefix) : array<string|int, string>|null
Parameters
$prefix : string
Tags
final
since
2.0
Return values
array<string|int, string>|null

An array of preference names, or null.

ListTemplates()

List Templates associated with a module

public final ListTemplates([string $modulename = '' ]) : array<string|int, mixed>
Parameters
$modulename : string = ''

If empty the current module name is used.

Tags
final
Return values
array<string|int, mixed>

ListUserTags()

Return a list of user defined tags

public final ListUserTags() : array<string|int, mixed>
Tags
final
Return values
array<string|int, mixed>

MinimumCMSVersion()

Returns the minimum version necessary to run this version of the module.

public MinimumCMSVersion() : string
Tags
abstract
Return values
string

ProcessTemplate()

Process A File template through smarty

public final ProcessTemplate(string $tpl_name[, string $designation = '' ][, bool $cache = false ][, string $cacheid = '' ]) : string
Parameters
$tpl_name : string

Template name

$designation : string = ''

Cache Designation

$cache : bool = false

Cache flag

$cacheid : string = ''

Unique cache flag

Tags
final
Return values
string

ProcessTemplateFromData()

Given a template in a variable, this method processes it through smarty note, there is no caching involved.

public final ProcessTemplateFromData(data $data) : string

Note: this function is deprecated and scheduled for removal.

Parameters
$data : data

Input template

Tags
final
Return values
string

ProcessTemplateFromDatabase()

Process a smarty template associated with a module through smarty and return the results

public final ProcessTemplateFromDatabase(string $tpl_name[, string $designation = '' ][, bool $cache = false ][, string $modulename = '' ]) : string
Parameters
$tpl_name : string

Template name

$designation : string = ''

(optional) Designation

$cache : bool = false

(optional) Cachable flag

$modulename : string = ''

(optional) module name, if empty the current module is used.

Tags
final
Return values
string

Redirect()

Redirects the user to another action of the module.

public Redirect(string $id, string $action[, string $returnid = '' ][, string $params = array() ][, bool $inline = false ]) : mixed
Parameters
$id : string

The id given to the module on execution

$action : string

The action that this form should do when the form is submitted

$returnid : string = ''

The id to eventually return to when the module is finished it's task

$params : string = array()

An array of params that should be inlucded in the URL of the link. These should be in a $key=>$value format.

$inline : bool = false

A flag to determine if actions should be handled inline (no moduleinterface.php -- only works for frontend)

RedirectContent()

Redirects the user to a content page outside of the module. The passed around returnid is frequently used for this so that the user will return back to the page from which they first entered the module.

public RedirectContent(int $id) : mixed
Parameters
$id : int

Content id to redirect to.

RedirectForFrontEnd()

Redirects the user to another action of the module.

public RedirectForFrontEnd(string $id, string $returnid, string $action[, string $params = array() ][, bool $inline = true ]) : mixed

This function is optimized for frontend use.

Parameters
$id : string

The id given to the module on execution

$returnid : string

The action that this form should do when the form is submitted

$action : string

The id to eventually return to when the module is finished it's task

$params : string = array()

An array of params that should be inlucded in the URL of the link. These should be in a $key=>$value format.

$inline : bool = true

A flag to determine if actions should be handled inline (no moduleinterface.php -- only works for frontend)

RedirectToAdmin()

Redirects to an admin page

public RedirectToAdmin(string $page[, array<string|int, mixed> $params = array() ]) : mixed
Parameters
$page : string

php script to redirect to

$params : array<string|int, mixed> = array()

optional array of url parameters

RedirectToAdminTab()

Redirect to the specified tab.

public RedirectToAdminTab([string $tab = '' ][, mixed|null $params = '' ][, string $action = '' ]) : mixed

Applicable only to admin actions.

Parameters
$tab : string = ''

The tab name. If empty, the current tab is used.

$params : mixed|null = ''

An assoiciative array of params, or null

$action : string = ''

The action name (if not specified, defaultadmin is assumed)

Tags
since
1.11
author

Robert Campbell

see
CMSModule::SetCurrentTab

RegisterBulkContentFunction()

Register a bulk content action

public final RegisterBulkContentFunction(string $label, string $action) : mixed

For use in the CMSMS content list this method allows a module to register a bulk content action.

Parameters
$label : string

A label for the action

$action : string

A module action name.

Tags
final

RegisterModulePlugin()

Register a plugin to smarty with the name of the module. This method should be called from the module constructor, or from the SetParameters method.

public final RegisterModulePlugin([bool $forcedb = FALSE ][, bool|null $cachable = false ]) : mixed

Note:

Parameters
$forcedb : bool = FALSE

Indicate wether this registration should be forced to be entered in the database. Default value is false (for compatibility)

$cachable : bool|null = false

Indicate wether this plugins output should be cachable. If null, use the site preferences, and the can_cache_output method. Otherwise a bool is expected.

Tags
final
see
CMSModule::SetParameters
see
can_cache_output

RegisterRoute()

Register a dynamic route to use for pretty url parsing

public final RegisterRoute(string $routeregex[, array<string|int, mixed> $defaults = array() ]) : mixed

Note: This method is not compatible wih lazy loading in the front end.

Parameters
$routeregex : string

Regular Expression Route to register

$defaults : array<string|int, mixed> = array()

Associative array containing defaults for parameters that might not be included in the url

Tags
final
see
SetParameters

RegisterSmartyPlugin()

Register a smarty plugin and attach it to this module.

public RegisterSmartyPlugin(string $name, string $type, callable $callback[, bool $cachable = TRUE ][, int $usage = 0 ]) : mixed

This method registers a static plugin to the plugins database table, and should be used only when a module is installed or upgraded.

Parameters
$name : string

The plugin name

$type : string

The plugin type (function,compiler,block, etc)

$callback : callable

The function callback (must be a static function)

$cachable : bool = TRUE

Wether this function is cachable.

$usage : int = 0

Indicates frontend (0), or frontend and backend (1) availability.

Tags
see
smarty

documentation.

author

calguy1000

since
1.11

RemoveEvent()

Remove an event from the CMS system This function removes all handlers to the event, and completely removes all references to this event from the database

public final RemoveEvent(string $eventname) : mixed

Note, only events created by this module can be removed.

Parameters
$eventname : string

The name of the event

Tags
final

RemoveEventHandler()

Remove an event handler from the CMS system This function removes all handlers to the event, and completely removes all references to this event from the database

public final RemoveEventHandler(string $modulename, string $eventname) : mixed

Note, only events created by this module can be removed.

Parameters
$modulename : string

The module name (or Core)

$eventname : string

The name of the event

Tags
final

RemovePermission()

Removes a permission from the system. If recreated, the permission would have to be set to all groups again.

public final RemovePermission(string $permission_name) : mixed
Parameters
$permission_name : string

The name of the permission to remove

Tags
final

RemovePreference()

Removes a module preference. If no preference name is specified, removes all module preferences.

public final RemovePreference([string $preference_name = '' ]) : bool
Parameters
$preference_name : string = ''

The name of the preference to remove. If empty all preferences associated with the module are removed.

Tags
final
Return values
bool

RemoveSmartyPlugin()

Unregister a smarty plugin from the system.

public RemoveSmartyPlugin([string $name = '' ]) : mixed

This method removes any matching rows from the database, and should only be used in a modules uninstall or upgrade routine.

Parameters
$name : string = ''

The smarty plugin name. If no name is specified all smarty plugins registered to this module will be removed.

Tags
author

calguy1000

since
1.11

RenderContentBlockField()

Render the value of a module content block on the frontend of the website.

public RenderContentBlockField(string $blockName, string $value, array<string|int, mixed> $blockparams, ContentBase $content_obj) : string

This gives modules the opportunity to render data stored in content blocks differently.

Parameters
$blockName : string

Content block name

$value : string

Content block value as stored in the database

$blockparams : array<string|int, mixed>

Content block parameters

$content_obj : ContentBase

The content object that is currently being displayed

Tags
abstract
since
2.2
Return values
string

RestrictUnknownParams()

A method to indicate that the system should drop and optionally generate an error about unknown parameters on frontend actions.

public final RestrictUnknownParams([bool $flag = true ]) : mixed
Parameters
$flag : bool = true

Indicates whether unknown params should be restricted.

Tags
see
SetParameterType
see
CreateParameter
final

SendEvent()

Trigger an event.

public final SendEvent(string $eventname, array<string|int, mixed> $params) : mixed

This function will call all registered event handlers for the event

Parameters
$eventname : string

The name of the event

$params : array<string|int, mixed>

The parameters associated with this event.

Tags
final

SetContentType()

Set the content-type header.

public SetContentType(string $contenttype) : mixed
Parameters
$contenttype : string

Value to set the content-type header too

Tags
abstract

SetCurrentTab()

Set the current tab for the action.

public SetCurrentTab(string $tab) : mixed

Used for the various template forms, this method can be used to control the tab that is displayed by default when redirecting to an admin action that displays multiple tabs.

Parameters
$tab : string

The tab name

Tags
final
since
1.11
author

calguy1000

see

CMSModule::RedirectToAdminTab();)

SetError()

Set an error message.

public SetError(string|array<string|int, string> $str) : mixed
Parameters
$str : string|array<string|int, string>

The message. Accepts either an array of messages or a single string.

Tags
since
1.11
author

Robert Campbell

SetMessage()

Set a display message.

public SetMessage(string|array<string|int, string> $str) : mixed
Parameters
$str : string|array<string|int, string>

The message. Accepts either an array of messages or a single string.

Tags
since
1.11
author

Robert Campbell

SetParameters()

This method can be used to perform initialization functions that should be done both for frontend and admin requests but not necessarily for lighweight module load requests (such as needed by ModuleManager).

public SetParameters() : mixed

Note: This method is called from within the InitializeFrontend() and InitializeAdmin methods. so, if your module overrides one or both of these methods be sure to call the appropriate parent method.

Tags
abstract
see
CreateParameter
see
InitializeFrontend()
see
InitializeAdmin()

SetParameterType()

Indicate the name of, and type of a parameter that is acceptable for frontend actions.

public final SetParameterType(string $param, define $type) : mixed

possible values for type are: CLEAN_INT,CLEAN_FLOAT,CLEAN_NONE,CLEAN_STRING,CLEAN_REGEXP,CLEAN_FILE

i.e: $this->SetParameterType('numarticles',CLEAN_INT);

Parameters
$param : string

Parameter name;

$type : define

Parameter type;

Tags
see
CreateParameter
see
SetParameters
final

SetPreference()

Sets a module preference.

public final SetPreference(string $preference_name, string $value) : mixed
Parameters
$preference_name : string

The name of the preference to set

$value : string

The value to set it to

Tags
final

SetTabHeader()

Set a specific tab header.

public SetTabHeader(string $tabid, string $title[, bool $active = false ]) : string

i.e: echo $this->SetTabHeader('preferences',$this->Lang('preferences'));

Parameters
$tabid : string

The tab id

$title : string

The tab title

$active : bool = false

wether the tab is active or not.

Tags
final
Return values
string

SetTemplate()

Sets a smarty template into the database and associates it with a module.

public final SetTemplate(string $tpl_name, string $content[, string $modulename = '' ]) : bool
Parameters
$tpl_name : string

The template name

$content : string

The template content

$modulename : string = ''

The module name, if empty the current module name is used.

Tags
final
Return values
bool

ShowErrors()

ShowErrors Outputs errors in a nice error box with a troubleshooting link to the wiki

public ShowErrors(string|array<string|int, string> $errors) : string
Parameters
$errors : string|array<string|int, string>

array or string of errors to be shown

Tags
final
Return values
string

ShowMessage()

ShowMessage Returns a formatted page status message

public ShowMessage(string $message) : string
Parameters
$message : string

Message to be shown

Tags
final
Return values
string

StartTab()

Output a string to indicate the start of the output for a specific tab

public StartTab(string $tabid[, arrray $params = array() ]) : string
Parameters
$tabid : string

the tab id

$params : arrray = array()

Parameters

Tags
final
see
CMSModule::SetTabHeaders()
Return values
string

StartTabContent()

Output a string to indicate the start of XHTML areas for tabs.

public StartTabContent() : string
Tags
final
Return values
string

StartTabHeaders()

Output a string suitable for staring tab headers.

public StartTabHeaders() : string

i.e: echo $this->StartTabHeaders();

Tags
final
Return values
string

SuppressAdminOutput()

Use this method to prevent the admin interface from outputting header, footer, theme, etc, so your module can output files directly to the administrator.

public SuppressAdminOutput(array<string|int, mixed> &$request) : bool

Do this by returning true.

Parameters
$request : array<string|int, mixed>

The input request. This can be used to test conditions wether or not admin output should be suppressed.

Return values
bool

SyntaxGenerateHeader()

Returns header code specific to this SyntaxHighlighter

public SyntaxGenerateHeader() : string
Tags
abstract
Return values
string

Uninstall()

Function that will get called as module is uninstalled. This function should remove any database tables that it uses and perform any other cleanup duties.

public Uninstall() : string|false

It should return a string message if there is a failure. Returning nothing (FALSE) will allow the uninstall procedure to proceed.

The default behaviour of this function is to include a file called method.uninstall.php in your module directory to do uninstall operations.

Tags
abstract
throws
Exception
Return values
string|false

A result of FALSE indicates that the module uninstalled correctly, any other value indicates an error message.

UninstallPostMessage()

Display a message after a successful uninstall of the module.

public UninstallPostMessage() : XHTML
Tags
abstract
Return values
XHTML

Text, or FALSE

UninstallPreMessage()

Display a message and a Yes/No dialog before doing an uninstall. Returning noting (FALSE) will go right to the uninstall.

public UninstallPreMessage() : XHTML
Tags
abstract
Return values
XHTML

Text, or FALSE.

Upgrade()

Function to perform any upgrade procedures. This is mostly used to for updating databsae tables, but can do other duties as well. It should return a string message if there is a failure. Returning nothing (FALSE) will allow the upgrade procedure to proceed. Upgrades should have a path so that they can be upgraded from more than one version back. While not a requirement, it makes life easy for your users.

public Upgrade(string $oldversion, string $newversion) : bool

The default behavior of this method is to call a function called method.upgrade.php in your module directory, if it exists.

Parameters
$oldversion : string

The version we are upgrading from

$newversion : string

The version we are upgrading to

Return values
bool

ValidateContentBlockFieldValue()

Validate the value for a module generated content block type.

public ValidateContentBlockFieldValue(string $blockName, mixed $value, array<string|int, mixed> $blockparams, contentBase $content_obj) : string

This mehod is called from a {content_module} tag, when the content edit form is being validated.

This method can be overridden if the module is providing content block types to the CMSMS content objects.

Parameters
$blockName : string

Content block name

$value : mixed

Content block value

$blockparams : array<string|int, mixed>

Content block parameters.

$content_obj : contentBase

The content object that is currently being edited.

Tags
abstract
since
2.0
Return values
string

An error message if the value is invalid, empty otherwise.

VisibleToAdminUser()

Returns true or false, depending on whether the user has the right permissions to see the module in their Admin menus.

public VisibleToAdminUser() : bool

Typically, permission checks are done in the overridden version of this method.

Defaults to true.

Tags
abstract
Return values
bool

WYSIWYGGenerateHeader()

Returns header code specific to this WYSIWYG

public WYSIWYGGenerateHeader([string $selector = null ][, string $cssname = null ]) : string
Parameters
$selector : string = null

(optional) The id of the element that is being initialized, if null the WYSIWYG module should assume the selector to be textarea.<ModuleName>.

$cssname : string = null

(optional) The name of the CMSMS stylesheet to associate with the wysiwyg editor for additional styling. if elementid is not null then the cssname is only used for the specific element. WYSIWYG modules may not obey the cssname paramter depending on their settings and capabilities.

Tags
abstract
Return values
string

InitializeAdmin()

Called from within the constructor, ONLY for admin module actions. This method should be overridden to create routes, and set handled parameters, and perform other initialization tasks that need to be setup for all frontend actions.

protected InitializeAdmin() : mixed
Tags
abstract
see
CreateParameter

InitializeFrontend()

Called from within the constructor, ONLY for frontend module actions. This method should be overridden to create routes, and set handled parameters, and perform other initialization tasks that need to be setup for all frontend actions.

protected InitializeFrontend() : mixed
Tags
abstract
see
SetParameterType
see
RegisterRoute
see
RestrictUnknownParams
see
RegisterModulePlugin

        
On this page

Search results