Get a reference to another module object
static
object The
&GetModuleInstance
(string $module)
-
string
$module: The required module name.
Constructor
CMSModule
CMSModule
()
Add an event handler for an existing eg event.
mixed
AddEventHandler
(string $modulename, string $eventname, [boolean $removable = true])
-
string
$eventname: The name of the event
-
boolean
$removable: Can this event be removed from the list?
-
string
$modulename: modulename The name of the module sending the event, or 'Core'
Called in the admin theme for every installed module, this method allows the module to output style information for use in the admin theme.
string
AdminStyle
()
Returns whether or not modules should be autoupgraded while upgrading
CMS versions. Generally only useful for modules included with the CMS base install, but there could be a situation down the road where we have different distributions with different modules included in them. Defaults to TRUE, as there is not many reasons to not allow it.
boolean
AllowAutoInstall
()
Returns whether or not modules should be autoupgraded while upgrading
CMS versions. Generally only useful for modules included with the CMS base install, but there could be a situation down the road where we have different distributions with different modules included in them. Defaults to TRUE, as there is not many reasons to not allow it.
boolean
AllowAutoUpgrade
()
Callback to determine if the output from a call to the module can be cached by smarty.
boolean
AllowSmartyCaching
()
Function that gets called upon module uninstall, and returns a boolean to indicate whether or not the core should remove all module events, event handlers, module templates, and preferences.
The module must still remove its own database tables and permissions
boolean
AllowUninstallCleanup
()
Put an event into the audit (admin) log. This should be done on most admin events for consistency.
void
Audit
(string $itemid, string $itemname, string $action)
-
string
$itemid: item id, useful for working on a specific record (i.e article or user)
-
string
$itemname: item name
-
string
$action: action name
Call a specific user defined tag
array
CallUserTag
(string $name, [array $params = array()])
-
string
$name: Name of the user defined tag
-
array
$params: Parameters for the user defined tag.
Callback to determine if the output from a call to the module can be cached by smarty.
boolean
can_cache_output
()
Checks to see if currently installed modules depend on this module. This is used by the plugins.php page to make sure that a module can't be uninstalled before any modules depending on it are uninstalled first.
boolean
CheckForDependents
()
Checks a permission against the currently logged in user.
boolean
CheckPermission
(string $permission_name)
-
string
$permission_name: The name of the permission to check against the current user
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
string
CreateContentLink
(string $pageid, [string $contents = ''])
-
string
$pageid: the page id of the page we want to direct to
-
string
$contents: The optional text or XHTML contents of the generated link
Inform the system about a new event that can be generated
nothing
CreateEvent
(string $eventname)
-
string
$eventname: The name of the event
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.
string
CreateFieldsetEnd
()
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.
string
CreateFieldsetStart
(string $id, string $name, [string $legend_text = ''], [string $addtext = ''], [string $addtext_legend = ''])
-
string
$id: The id given to the module on execution (not really used yet, but might be later)
-
string
$name: The html name of the textbox (not really used yet, but might be later on)
-
string
$legend_text: The legend_text for this fieldset, if applicaple
-
string
$addtext: Any additional text that should be added into the tag when rendered
-
string
$addtext_legend: Any additional text that should be added into the legend tag when rendered
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.
string
CreateFileUploadInput
(string $id, string $name, [string $addttext = ''], [integer $size = '10'], [integer $maxlength = '255'])
-
string
$id: The id given to the module on execution
-
string
$name: The html name of the input
-
string
$addttext: Any additional text that should be added into the tag when rendered
-
integer
$size: The size of the text field associated with the file upload field. Some browsers may not respect this value.
-
integer
$maxlength: The maximim length of the content of the text field associated with the file upload field. Some browsers may not respect this value.
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.
string
CreateFormEnd
()
Returns the start of a module form
string
CreateFormStart
(string $id, [string $action = 'default'], [string $returnid = ''], [string $method = 'post'], [string $enctype = ''], [boolean $inline = false], [string $idsuffix = ''], [array $params = array()], [string $extra = ''])
-
string
$id: The id given to the module on execution
-
string
$action: The action that this form should do when the form is submitted
-
string
$returnid: The id to eventually return to when the module is finished it's task
-
string
$method: Method to use for the form tag. Defaults to 'post'
-
string
$enctype: Optional enctype to use, Good for situations where files are being uploaded
-
boolean
$inline: A flag to determine if actions should be handled inline (no moduleinterface.php -- only works for frontend)
-
string
$idsuffix: Text to append to the end of the id and name of the form
-
array
$params: Extra parameters to pass along when the form is submitted
-
string
$extra: Text to append to the <form>-statement, for instanse for javascript-validation code
Returns the start of a module form, optimized for frontend use
string
CreateFrontendFormStart
(string $id, string $returnid, [string $action = 'default'], [string $method = 'post'], [string $enctype = ''], [boolean $inline = true], [string $idsuffix = ''], [array $params = array()])
-
string
$id: The id given to the module on execution
-
string
$returnid: The id to eventually return to when the module is finished it's task
-
string
$action: The action that this form should do when the form is submitted
-
string
$method: Method to use for the form tag. Defaults to 'post'
-
string
$enctype: Optional enctype to use, Good for situations where files are being uploaded
-
boolean
$inline: A flag to determine if actions should be handled inline (no moduleinterface.php -- only works for frontend)
-
string
$idsuffix: Text to append to the end of the id and name of the form
-
array
$params: Extra parameters to pass along when the form is submitted
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.
string
CreateFrontendLink
(string $id, string $returnid, string $action, [string $contents = ''], [string $params = array()], [string $warn_message = ''], [boolean $onlyhref = false], [boolean $inline = true], [string $addtext = ''], [boolean $targetcontentonly = false], [string $prettyurl = ''])
-
string
$id: The id given to the module on execution
-
string
$returnid: The id to eventually return to when the module is finished it's task
-
string
$action: The action that this form should do when the link is clicked
-
string
$contents: The text that will have to be clicked to follow the link
-
string
$params: An array of params that should be inlucded in the URL of the link. These should be in a $key=>$value format.
-
string
$warn_message: Text to display in a javascript warning box. If they click no, the link is not followed by the browser.
-
boolean
$onlyhref: A flag to determine if only the href section should be returned
-
boolean
$inline: A flag to determine if actions should be handled inline (no moduleinterface.php -- only works for frontend)
-
string
$addtext: Any additional text that should be added into the tag when rendered
-
boolean
$targetcontentonly: A flag indicating that the output of this link should target the content area of the destination page.
-
string
$prettyurl: An optional pretty url segment (relative to the root of the site) to use when generating the link.
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.
string
CreateInputCheckbox
(string $id, string $name, [string $value = ''], [string $selectedvalue = ''], [string $addttext = ''])
-
string
$id: The id given to the module on execution
-
string
$name: The html name of the checkbox
-
string
$value: The value returned from the input if selected
-
string
$selectedvalue: The current value. If equal to $value the checkbox is selected
-
string
$addttext: Any additional text that should be added into the tag when rendered
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.
string
CreateInputColor
(string $id, string $name, [string $value = ''], [string $addttext = ''])
-
string
$id: The id given to the module on execution
-
string
$name: The html name of the input field
-
string
$value: The predefined value of the textbox, if any
-
string
$addttext: Any additional text that should be added into the tag when rendered
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.
string
CreateInputDataList
(string $id, string $name, [string $value = ''], string $items, [string $size = '10'], [string $maxlength = '255'], [string $addttext = ''])
-
string
$id: The id given to the module on execution
-
string
$name: The html name of the textbox
-
string
$value: The predefined value of the textbox, if any
-
string
$items: An array of items to put into the list... they should be $key=>$value pairs
-
string
$size: The number of columns wide the textbox should be displayed
-
string
$maxlength: The maximum number of characters that should be allowed to be entered
-
string
$addttext: Any additional text that should be added into the tag when rendered
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.
string
CreateInputDate
(string $id, string $name, [string $value = ''], [string $addttext = ''])
-
string
$id: The id given to the module on execution
-
string
$name: The html name of the input field
-
string
$value: The predefined value of the textbox, if any
-
string
$addttext: Any additional text that should be added into the tag when rendered
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.
string
CreateInputDatetime
(string $id, string $name, [string $value = ''], [string $addttext = ''])
-
string
$id: The id given to the module on execution
-
string
$name: The html name of the input field
-
string
$value: The predefined value of the textbox, if any
-
string
$addttext: Any additional text that should be added into the tag when rendered
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.
string
CreateInputDatetimeLocal
(string $id, string $name, [string $value = ''], [string $addttext = ''])
-
string
$id: The id given to the module on execution
-
string
$name: The html name of the input field
-
string
$value: The predefined value of the textbox, if any
-
string
$addttext: Any additional text that should be added into the tag when rendered
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.
string
CreateInputDropdown
(string $id, string $name, string $items, [string $selectedindex = -1], [string $selectedvalue = ''], [string $addttext = ''])
-
string
$id: The id given to the module on execution
-
string
$name: The html name of the dropdown list
-
string
$items: An array of items to put into the dropdown list... they should be $key=>$value pairs
-
string
$selectedindex: The default selected index of the dropdown list. Setting to -1 will result in the first choice being selected
-
string
$selectedvalue: The default selected value of the dropdown list. Setting to '' will result in the first choice being selected
-
string
$addttext: Any additional text that should be added into the tag when rendered
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.
string
CreateInputEmail
(string $id, string $name, [string $value = ''], [string $size = '10'], [string $maxlength = '255'], [string $addttext = ''])
-
string
$id: The id given to the module on execution
-
string
$name: The html name of the textbox
-
string
$value: The predefined value of the textbox, if any
-
string
$size: The number of columns wide the textbox should be displayed
-
string
$maxlength: The maximum number of characters that should be allowed to be entered
-
string
$addttext: Any additional text that should be added into the tag when rendered
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.
string
CreateInputFile
(string $id, string $name, [string $accept = ''], [string $size = '10'], [string $addttext = ''])
-
string
$id: The id given to the module on execution
-
string
$name: The html name of the textbox
-
string
$accept: The MIME-type to be accepted, default is all
-
string
$size: The number of columns wide the textbox should be displayed
-
string
$addttext: Any additional text that should be added into the tag when rendered
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.
string
CreateInputHidden
(string $id, string $name, [string $value = ''], [string $addttext = ''])
-
string
$id: The id given to the module on execution
-
string
$name: The html name of the hidden field
-
string
$value: The predefined value of the field, if any
-
string
$addttext: Any additional text that should be added into the tag when rendered
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.
string
CreateInputMonth
(string $id, string $name, [string $value = ''], [string $addttext = ''])
-
string
$id: The id given to the module on execution
-
string
$name: The html name of the input field
-
string
$value: The predefined value of the textbox, if any
-
string
$addttext: Any additional text that should be added into the tag when rendered
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.
string
CreateInputNumber
(string $id, string $name, [string $value = ''], [string $addttext = ''])
-
string
$id: The id given to the module on execution
-
string
$name: The html name of the input field
-
string
$value: The predefined value of the textbox, if any
-
string
$addttext: Any additional text that should be added into the tag when rendered
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.
string
CreateInputPassword
(string $id, string $name, [string $value = ''], [string $size = '10'], [string $maxlength = '255'], [string $addttext = ''])
-
string
$id: The id given to the module on execution
-
string
$name: The html name of the textbox
-
string
$value: The predefined value of the textbox, if any
-
string
$size: The number of columns wide the textbox should be displayed
-
string
$maxlength: The maximum number of characters that should be allowed to be entered
-
string
$addttext: Any additional text that should be added into the tag when rendered
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.
string
CreateInputRadioGroup
(string $id, string $name, string $items, [string $selectedvalue = ''], [string $addttext = ''], [string $delimiter = ''])
-
string
$id: The id given to the module on execution
-
string
$name: The html name of the radio group
-
string
$items: An array of items to create as radio buttons... they should be $key=>$value pairs
-
string
$selectedvalue: The default selected index of the radio group. Setting to -1 will result in the first choice being selected
-
string
$addttext: Any additional text that should be added into the tag when rendered
-
string
$delimiter: A delimiter to throw between each radio button, e.g., a
tag or something for formatting
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.
string
CreateInputRange
(string $id, string $name, [string $value = ''], [string $addttext = ''])
-
string
$id: The id given to the module on execution
-
string
$name: The html name of the input field
-
string
$value: The predefined value of the textbox, if any
-
string
$addttext: Any additional text that should be added into the tag when rendered
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.
string
CreateInputReset
(string $id, string $name, [string $value = 'Reset'], [string $addttext = ''])
-
string
$id: The id given to the module on execution
-
string
$name: The html name of the button
-
string
$value: The predefined value of the button, if any
-
string
$addttext: Any additional text that should be added into the tag when rendered
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.
string
CreateInputSearch
(string $id, string $name, [string $value = ''], [string $size = '10'], [string $maxlength = '255'], [string $addttext = ''])
-
string
$id: The id given to the module on execution
-
string
$name: The html name of the textbox
-
string
$value: The predefined value of the textbox, if any
-
string
$size: The number of columns wide the textbox should be displayed
-
string
$maxlength: The maximum number of characters that should be allowed to be entered
-
string
$addttext: Any additional text that should be added into the tag when rendered
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.
string
CreateInputSelectList
(string $id, string $name, string $items, [string $selecteditems = array()], [string $size = 3], [string $addttext = ''], [boolean $multiple = true])
-
string
$id: The id given to the module on execution
-
string
$name: The html name of the select list
-
string
$items: An array of items to put into the list... they should be $key=>$value pairs
-
string
$selecteditems: An array of items in the list that should default to selected.
-
string
$size: The number of rows to be visible in the list (before scrolling).
-
string
$addttext: Any additional text that should be added into the tag when rendered
-
boolean
$multiple: indicates wether multiple selections are allowed (defaults to true)
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.
string
CreateInputSubmit
(string $id, string $name, [string $value = ''], [string $addttext = ''], [string $image = ''], [string $confirmtext = ''])
-
string
$id: The id given to the module on execution
-
string
$name: The html name of the button
-
string
$value: The predefined value of the button, if any
-
string
$addttext: Any additional text that should be added into the tag when rendered
-
string
$image: Use an image instead of a regular button
-
string
$confirmtext: Optional text to display in a confirmation message.
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.
string
CreateInputTel
(string $id, string $name, [string $value = ''], [string $size = '10'], [string $maxlength = '255'], [string $addttext = ''])
-
string
$id: The id given to the module on execution
-
string
$name: The html name of the textbox
-
string
$value: The predefined value of the textbox, if any
-
string
$size: The number of columns wide the textbox should be displayed
-
string
$maxlength: The maximum number of characters that should be allowed to be entered
-
string
$addttext: Any additional text that should be added into the tag when rendered
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.
string
CreateInputText
(string $id, string $name, [string $value = ''], [string $size = '10'], [string $maxlength = '255'], [string $addttext = ''])
-
string
$id: The id given to the module on execution
-
string
$name: The html name of the textbox
-
string
$value: The predefined value of the textbox, if any
-
string
$size: The number of columns wide the textbox should be displayed
-
string
$maxlength: The maximum number of characters that should be allowed to be entered
-
string
$addttext: Any additional text that should be added into the tag when rendered
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.
string
CreateInputTextWithLabel
(string $id, string $name, [string $value = ''], [string $size = '10'], [string $maxlength = '255'], [string $addttext = ''], [string $label = ''], [string $labeladdtext = ''])
-
string
$id: The id given to the module on execution
-
string
$name: The html name of the textbox
-
string
$value: The predefined value of the textbox, if any
-
string
$size: The number of columns wide the textbox should be displayed
-
string
$maxlength: The maximum number of characters that should be allowed to be entered
-
string
$addttext: Any additional text that should be added into the tag when rendered
-
string
$label: The text for label
-
string
$labeladdtext: Any additional text that should be added into the tag when rendered
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.
string
CreateInputTime
(string $id, string $name, [string $value = ''], [string $addttext = ''])
-
string
$id: The id given to the module on execution
-
string
$name: The html name of the input field
-
string
$value: The predefined value of the textbox, if any
-
string
$addttext: Any additional text that should be added into the tag when rendered
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.
string
CreateInputUrl
(string $id, string $name, [string $value = ''], [string $size = '10'], [string $maxlength = '255'], [string $addttext = ''])
-
string
$id: The id given to the module on execution
-
string
$name: The html name of the textbox
-
string
$value: The predefined value of the textbox, if any
-
string
$size: The number of columns wide the textbox should be displayed
-
string
$maxlength: The maximum number of characters that should be allowed to be entered
-
string
$addttext: Any additional text that should be added into the tag when rendered
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.
string
CreateInputWeek
(string $id, string $name, [string $value = ''], [string $addttext = ''])
-
string
$id: The id given to the module on execution
-
string
$name: The html name of the input field
-
string
$value: The predefined value of the textbox, if any
-
string
$addttext: Any additional text that should be added into the tag when rendered
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.
string
CreateLabelForInput
(string $id, string $name, [string $labeltext = ''], [string $addttext = ''])
-
string
$id: The id given to the module on execution
-
string
$name: The html name of the input field this label is associated to
-
string
$labeltext: The text in the label
-
string
$addttext: Any additional text that should be added into the tag when rendered
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.
string
CreateLink
(string $id, string $action, [string $returnid = ''], [string $contents = ''], [string $params = array()], [string $warn_message = ''], [boolean $onlyhref = false], [boolean $inline = false], [string $addttext = ''], [boolean $targetcontentonly = false], [string $prettyurl = ''])
-
string
$id: The id given to the module on execution
-
string
$action: The action that this form should do when the link is clicked
-
string
$returnid: The id to eventually return to when the module is finished it's task
-
string
$contents: The text that will have to be clicked to follow the link
-
string
$params: An array of params that should be inlucded in the URL of the link. These should be in a $key=>$value format.
-
string
$warn_message: Text to display in a javascript warning box. If they click no, the link is not followed by the browser.
-
boolean
$onlyhref: A flag to determine if only the href section should be returned
-
boolean
$inline: A flag to determine if actions should be handled inline (no moduleinterface.php -- only works for frontend)
-
string
$addttext: Any additional text that should be added into the tag when rendered
-
boolean
$targetcontentonly: A flag to determine if the link should target the default content are of the destination page.
-
string
$prettyurl: An optional pretty url segment (related to the root of the website) for a pretty url.
Creates a string containing links to all the pages.
string
CreatePagination
(string $id, string $action, string $returnid, string $page, string $totalrows, string $limit, [boolean $inline = false])
-
string
$id: The id given to the module on execution
-
string
$action: The action that this form should do when the form is submitted
-
string
$returnid: The id to eventually return to when the module is finished it's task
-
string
$page: the current page to display
-
string
$totalrows: the amount of items being listed
-
string
$limit: the amount of items to list per page
-
boolean
$inline: A flag to determine if actions should be handled inline (no moduleinterface.php -- only works for frontend)
Create a parameter and it's documentation for display in the module help.
i.e: $this->CreateParameter('numarticles',100000,$this->Lang('help_numarticles'),true);
void;
CreateParameter
(string $param, [string $defaultval = ''], [string $helpstring = ''], [boolean $optional = true])
-
string
$param: Parameter name;
-
string
$defaultval: Default parameter value
-
string
$helpstring: Help String
-
boolean
$optional: Flag indicating wether this parameter is optional or required.
Create's a new permission for use by the module.
void
CreatePermission
(string $permission_name, string $permission_text)
-
string
$permission_name: Name of the permission to create
-
string
$permission_text: Description of the permission
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.
string
CreateReturnLink
(string $id, string $returnid, [string $contents = ''], [string $params = array()], [boolean $onlyhref = false])
-
string
$id: The id given to the module on execution
-
string
$returnid: The id to return to when the module is finished it's task
-
string
$contents: The text that will have to be clicked to follow the link
-
string
$params: An array of params that should be inlucded in the URL of the link. These should be in a $key=>$value format.
-
boolean
$onlyhref: A flag to determine if only the href section should be returned
Register all static routes for this module.
void
CreateStaticRoutes
()
Returns the xhtml equivalent of a textarea. Also takes Syntax hilighter preference into consideration if it's called from the admin side.
string
CreateSyntaxArea
(string $id, string $text, string $name, [string $classname = ''], [string $htmlid = ''], [string $encoding = ''], [string $stylesheet = ''], [string $cols = '80'], [string $rows = '15'], [string $addtext = ''])
-
string
$id: The id given to the module on execution
-
string
$text: The text to display in the textarea's content
-
string
$name: The html name of the textarea
-
string
$classname: The CSS class to associate this textarea to
-
string
$htmlid: The html id to give to this textarea
-
string
$encoding: The encoding to use for the content
-
string
$stylesheet: The text of the stylesheet associated to this content. Only used for certain WYSIWYGs
-
string
$cols: The number of characters wide (columns) the resulting textarea should be
-
string
$rows: The number of characters high (rows) the resulting textarea should be
-
string
$addtext: Additional text for the text area tag.
Returns the xhtml equivalent of a textarea. Also takes WYSIWYG preference into consideration if it's called from the admin side.
string
CreateTextArea
(bool $enablewysiwyg, string $id, string $text, string $name, [string $classname = ''], [string $htmlid = ''], [string $encoding = ''], [string $stylesheet = ''], [string $cols = '80'], [string $rows = '15'], [string $forcewysiwyg = ''], [string $wantedsyntax = ''], [string $addtext = ''])
-
bool
$enablewysiwyg: Should we try to create a WYSIWYG for this textarea?
-
string
$id: The id given to the module on execution
-
string
$text: The text to display in the textarea's content
-
string
$name: The html name of the textarea
-
string
$classname: The CSS class to associate this textarea to
-
string
$htmlid: The html id to give to this textarea
-
string
$encoding: The encoding to use for the content
-
string
$stylesheet: The text of the stylesheet associated to this content. Only used for certain WYSIWYGs
-
string
$cols: The number of characters wide (columns) the resulting textarea should be
-
string
$rows: The number of characters high (rows) the resulting textarea should be
-
string
$forcewysiwyg: The wysiwyg-system to be forced even if the user has chosen another one
-
string
$wantedsyntax: The language the content should be syntaxhightlighted as
-
string
$addtext: Any additional text to include with the textarea field.
Returns the xhtml equivalent of a tooltip help link.
string
CreateTooltip
(string $helptext, [string $linktext = "?"], [string $forcewidth = ""], [string $classname = "admin-tooltip admin-tooltip-box"], [string $href = ""])
-
string
$helptext: The help text to be shown on mouse over
-
string
$linktext: The text to be shown as the link, default to a simple question mark
-
string
$forcewidth: Forces another width of the popupbox than the one set in admin css
-
string
$classname: An alternative classname for the a-link of the tooltip
-
string
$href: The URL or url portion to use in the href portion of the generated link.
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.
string
CreateTooltipLink
(string $id, string $action, string $returnid, string $contents, string $tooltiptext, [string $params = array()])
-
string
$id: The id given to the module on execution
-
string
$action: The action that this form should do when the link is clicked
-
string
$returnid: The id to eventually return to when the module is finished it's task
-
string
$contents: The text that will have to be clicked to follow the link
-
string
$tooltiptext: The helptext to be shown as tooltip-popup
-
string
$params: An array of params that should be inlucded in the URL of the link. These should be in a $key=>$value format.
Creates an xml data package from the module directory.
string
CreateXMLPackage
(string &$message, integer &$filecount)
-
string
&$message: reference to returned message.
-
integer
&$filecount: reference to returned file count.
Returns a URL to a module action This method is called by the CreateLink methods when creating a link to a module action.
string.
create_url
(string $id, string $action, [integer $returnid = ''], [hash $params = array()], [boolean $inline = false], [boolean $targetcontentonly = false], [string $prettyurl = ''])
-
string
$id: The module action id (cntnt01 indicates that the defaul content block of the destination page should be used).
-
string
$action: The module action name
-
integer
$returnid: The destination page.
-
hash
$params: Areay of parameters for the URL. These will be ignored if the prettyurl argument is specified.
-
boolean
$inline: Wether the target of the output link is the same tag on the same page.
-
boolean
$targetcontentonly: Wether the target of the output link targets the content area of the destination page.
-
string
$prettyurl: An optional url segment related to the root of the page for pretty url purposes.
Sets the default language (usually en_US) for the module. There should be at least a language file for this language if the Lang() function is used at all.
void
DefaultLanguage
()
Delete a module template from the database
boolean
DeleteTemplate
([string $tpl_name = ''], [string $modulename = ''])
-
string
$tpl_name: the Template name, if empty all templates associated with the module are deleted.
-
string
$modulename: The module name, if empty the current module name is used.
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.
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.<action name>.php in the modules directory, and if it exists include it.
string
DoAction
(string $name, string $id, string $params, [integer $returnid = ''])
-
string
$name: Name of the action to perform
-
string
$id: The ID of the module
-
string
$params: The parameters targeted for this module
-
integer
$returnid: The current page id that is being displayed.
An event that this module is listening to has occurred, and should be handled.
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.<originator>.<eventname>.php in the module directory, and if this file exists it, include it to handle the event.
boolean
DoEvent
(string $originator, string $eventname, array &$params)
-
string
$originator: The name of the originating module
-
string
$eventname: The name of the event
-
array
&$params: Array of parameters provided with the event.
Output a string to indicate the end of the output for a specific tab.
string
EndTab
()
Output a string to indicate the end of XHTML areas for tabs.
string
EndTabContent
()
Output a string to stop the output of headers and close the necessary XHTML div.
string
EndTabHeaders
()
Returns a sufficient about page for a module
string
GetAbout
()
Returns a description of what the admin link does.
string
GetAdminDescription
()
Returns which admin section this module belongs to.
this is used to place the module in the appropriate admin navigation section. Valid options are currently:
content, layout, files, usersgroups, extensions, preferences, admin
string
GetAdminSection
()
Returns the name of the author
string
GetAuthor
()
Returns the email address of the author
string
GetAuthorEmail
()
Returns the changelog for the module
string
GetChangeLog
()
Returns the cms->config object as a reference
array
GetConfig
()
Get an input field for a module generated content block type.
This method can be overridden if the module is providing content block types to the CMSMS content objects.
mixed
GetContentBlockInput
(string $blockName, mixed $value, array $params, [boolean $adding = false])
-
string
$blockName: Content block name
-
mixed
$value: Content block value
-
array
$params: Content block parameters
-
boolean
$adding: A flag indicating wether the content editor is in create mode (adding) vs. edit mod.
Return a value for a module generated content block type.
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.
mixed
GetContentBlockValue
(string $blockName, array $blockParams, array $inputParams)
-
string
$blockName: Content block name
-
array
$blockParams: Content block parameters
-
array
$inputParams: input parameters
Return an instance of the new content type
This method must be overridden if this object is providing a content type.
object
GetContentTypeInstance
()
Returns the output the module wants displayed in the dashboard
string
GetDashboardOutput
()
A function to return a resource identifier to a module specific database template
string
GetDatabaseResource
(string $template)
-
string
$template: The template name.
Returns the cms->db object as a reference
object Adodb
&GetDb
()
Returns a list of dependencies and minimum versions that this module requires. It should return an hash, eg.
return array('somemodule'=>'1.0', 'othermodule'=>'1.1');
array
GetDependencies
()
Returns a short description of the module
string
GetDescription
([string $lang = 'en_US'])
-
string
$lang: Optional language that the admin is using. If that language is not defined, use en_US.
Get a (langified) description for an event this module created.
This method must be over-ridden if this module created any events.
string
GetEventDescription
(string $eventname)
-
string
$eventname: The name of the event
Get a (langified) descriptionof the details about when an event is created, and the parameters that are attached with it.
This method must be over-ridden if this module created any events.
string
GetEventHelp
(string $eventname)
-
string
$eventname: The name of the event
A function to return a resource identifier to a module specific file template
string
GetFileResource
(string $template)
-
string
$template: The template name.
Returns a translatable name of the module. For modulues who's names can probably be translated into another language (like News)
string
GetFriendlyName
()
Returns XHTML that needs to go between the <head> tags when this module is called from an admin side action.
This method is called by the admin theme when executing an action for a specific module.
string
GetHeaderHTML
()
Returns the help for the module
string
GetHelp
(string 0)
-
string
0: Optional language that the admin is using. If that language is not defined, use en_US.
Returns a sufficient help page for a module this function should not be overridden
string
GetHelpPage
()
Returns the full path to the module directory.
string
GetModulePath
()
Returns an array of modulenames with the specified capability and which are installed and enabled, of course
array
GetModulesWithCapability
(an $capability, [associative $params = array()])
-
an
$capability: id specifying which capability to check for, could be "wysiwyg" etc.
-
associative
$params: array further params to get more detailed info about the capabilities. Should be syncronized with other modules of same type
Returns the URL path to the module directory.
string
GetModuleURLPath
([boolean $use_ssl = false])
-
boolean
$use_ssl: Optional generate an URL using HTTPS path
Returns the name of the module
string
GetName
()
Returns the output the module wants displayed in the notification area
object A
GetNotificationOutput
([int $priority = 2])
-
int
$priority: Notification priority between 1 and 3
Returns a list of parameters and their help strings in a hash. This is generally used internally.
array
GetParameters
()
Returns a module preference if it exists.
string
GetPreference
(string $preference_name, [string $defaultvalue = ''])
-
string
$preference_name: The name of the preference to check
-
string
$defaultvalue: The default value, just in case it doesn't exist
Returns a database saved template. This should be used for admin functions only, as it doesn't follow any smarty caching rules.
string
GetTemplate
(string $tpl_name, [string $modulename = ''])
-
string
$tpl_name: template name
-
string
$modulename: module name. If empty the current module name is used.
Returns contents of the template that resides in modules/ModuleName/templates/{template_name}.tpl Code adapted from the Guestbook module
string
GetTemplateFromFile
(string $template_name)
-
string
$template_name: template name
Returns CMSMS temporary and state variables.
array
GetVariables
()
Returns the version of the module
string
GetVersion
()
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.
string
get_pretty_url
(string $id, string $action, [integer $returnid = ''], [hash $params = array()], [boolean $inline = false])
-
string
$id: The module action id (cntnt01 indicates that the defaul content block of the destination page should be used).
-
string
$action: The module action name
-
integer
$returnid: The destination page.
-
hash
$params: Areay of parameters for the URL. These will be ignored if the prettyurl argument is specified.
-
boolean
$inline: Wether the target of the output link is the same tag on the same page.
Returns a list of the tasks that this module manages
array
get_tasks
()
A callback indicating if this module has a DoEvent method to handle incoming events.
boolean
HandlesEvents
()
Return true if there is an admin for the module. Returns false by default.
boolean
HasAdmin
()
Returns true if the modules thinks it has the capability specified
boolean
HasCapability
(an $capability, [associative $params = array()])
-
an
$capability: id specifying which capability to check for, could be "wysiwyg" etc.
-
associative
$params: array further params to get more detailed info about the capabilities. Should be syncronized with other modules of same type
Does this module support a custom content type?
This method can be overridden if the module is defining one or more custom content types (note this is different than content block types)
boolean
HasContentType
()
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.
void
InitializeAdmin
()
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.
void
InitializeFrontend
()
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.
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.
mixed
Install
()
Display a message after a successful installation of the module.
XHTML
InstallPostMessage
()
Returns whether this module should only be loaded from the admin
boolean
IsAdminOnly
()
Returns true if the module should be treated as a content module.
Returns false by default.
boolean
IsContentModule
()
Test if a database template has been compiled and is cached by smarty.
void
IsDatabaseTemplateCached
(string $tpl_name, [string $designation = ''], [string $timestamp = ''])
-
string
$tpl_name: The template name
-
string
$designation: The cache designation
-
string
$timestamp: The cache timestamp
Test if a file template has been compiled and is cached by smarty.
void
IsFileTemplateCached
(string $tpl_name, [string $designation = ''], [string $timestamp = ''], [string $cacheid = ''])
-
string
$tpl_name: The template name
-
string
$designation: The cache designation
-
string
$timestamp: The cache timestamp
-
string
$cacheid: The cache id (for caching).
Returns true if the module should be treated as a plugin module (like {cms_module module='name'}. Returns false by default.
boolean
IsPluginModule
()
Returns true if the module acts as a soap server
boolean
IsSoapModule
()
Returns true if this module should be treated as a Syntax Highlighting module. It returns false be default.
boolean
IsSyntaxHighlighter
()
Returns true if this module should be treated as a WYSIWYG module. It returns false be default.
boolean
IsWYSIWYG
()
Returns the corresponding translated string for the id given.
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.
string
Lang
()
Returns true if the module may support lazy loading in the admin interface.
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.
boolean
LazyLoadAdmin
()
Returns true if the module may support lazy loading in the front end
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.
boolean
LazyLoadFrontend
()
List Templates associated with a module
array
ListTemplates
([string $modulename = ''])
-
string
$modulename: module name. If empty the current module name is used.
Return a list of user defined tags
array
ListUserTags
()
Returns the maximum version necessary to run this version of the module.
string
MaximumCMSVersion
()
Returns the minimum version necessary to run this version of the module.
string
MinimumCMSVersion
()
Process A File template through smarty
string
ProcessTemplate
(string $tpl_name, [string $designation = ''], [boolean $cache = false], [string $cacheid = ''])
-
string
$tpl_name: Template name
-
string
$designation: Cache Designation
-
boolean
$cache: Cache flag
-
string
$cacheid: Unique cache flag
Given a template in a variable, this method processes it through smarty note, there is no caching involved.
Note: this function is deprecated and scheduled for removal.
string
ProcessTemplateFromData
(data $data)
-
data
$data: Input template
Process a smarty template associated with a module through smarty and return the results
string
ProcessTemplateFromDatabase
(string $tpl_name, [string $designation = ''], [boolean $cache = false], [string $modulename = ''])
-
string
$tpl_name: Template name
-
string
$designation: (optional) Designation
-
boolean
$cache: (optional) Cachable flag
-
string
$modulename: (optional) module name, if empty the current module is used.
Redirects the user to another action of the module.
void
Redirect
(string $id, string $action, [string $returnid = ''], [string $params = array()], [boolean $inline = false])
-
string
$id: The id given to the module on execution
-
string
$action: The action that this form should do when the form is submitted
-
string
$returnid: The id to eventually return to when the module is finished it's task
-
string
$params: An array of params that should be inlucded in the URL of the link. These should be in a $key=>$value format.
-
boolean
$inline: A flag to determine if actions should be handled inline (no moduleinterface.php -- only works for frontend)
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.
void
RedirectContent
(string $id)
-
string
$id: Content id to redirect to.
Redirects the user to another action of the module.
This function is optimized for frontend use.
void
RedirectForFrontEnd
(string $id, string $returnid, string $action, [string $params = array()], [boolean $inline = true])
-
string
$id: The id given to the module on execution
-
string
$returnid: The action that this form should do when the form is submitted
-
string
$action: The id to eventually return to when the module is finished it's task
-
string
$params: An array of params that should be inlucded in the URL of the link. These should be in a $key=>$value format.
-
boolean
$inline: A flag to determine if actions should be handled inline (no moduleinterface.php -- only works for frontend)
Redirects to an admin page
void
RedirectToAdmin
(string $page, [array $params = array()])
-
string
$page: php script to redirect to
-
array
$params: optional array of url parameters
Redirect to the specified tab.
Applicable only to admin actions.
void
RedirectToAdminTab
([string $tab = ''], [mixed $params = ''], [string $action = ''])
-
string
$tab: The tab name. If empty, the current tab is used.
-
mixed
$params: An assoiciative array of params, or null
-
string
$action: The action name (if not specified, defaultadmin is assumed)
Register a bulk content action
For use in the CMSMS content list this method allows a module to register a bulk content action.
void
RegisterBulkContentFunction
(string $label, string $action)
-
string
$label: A label for the action
-
string
$action: A module action name.
Register a new content type
void
RegisterContentType
(string $name, string $file, [string $friendlyname = ''])
-
string
$name: A name for the new content type
-
string
$file: A filename containing the content type definition.
-
string
$friendlyname: A friendly name for this content type.
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.
Note:
void
RegisterModulePlugin
([boolean $forcedb = FALSE], [mixed $cachable = null])
-
boolean
$forcedb: Indicate wether this registration should be forced to be entered in the database. Default value is false (for compatibility)
-
mixed
$cachable: Indicate wether this plugins output should be cachable. If null, use the site preferences, and the can_cache_output method. Otherwise a boolean is expected.
Register a route to use for pretty url parsing
Note: This method is not compatible wih lazy loading in the front end.
void
RegisterRoute
(string $routeregex, [array $defaults = array()])
-
string
$routeregex: Regular Expression Route to register
-
array
$defaults: Defaults for parameters that might not be included in the url
Register a smarty plugin and attach it to this module.
This method registers a static plugin to the plugins database table, and should be used only when a module is installed or upgraded.
void
RegisterSmartyPlugin
(string $name, string $type, mixed $callback, [boolean $cachable = TRUE], [integer $usage = 0])
-
string
$name: The plugin name
-
string
$type: The plugin type (function,compiler,block, etc)
-
mixed
$callback: The function callback (must be a static function)
-
boolean
$cachable: Wether this function is cachable.
-
integer
$usage: Indicates frontend (0), or frontend and backend (1) availability.
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
Note, only events created by this module can be removed.
void
RemoveEvent
(string $eventname)
-
string
$eventname: The name of the event
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
Note, only events created by this module can be removed.
void
RemoveEventHandler
(string $modulename, string $eventname)
-
string
$modulename: The module name (or Core)
-
string
$eventname: The name of the event
Removes a permission from the system. If recreated, the permission would have to be set to all groups again.
void
RemovePermission
(string $permission_name)
-
string
$permission_name: The name of the permission to remove
Removes a module preference. If no preference name is specified, removes all module preferences.
boolean
RemovePreference
([string $preference_name = ''])
-
string
$preference_name: The name of the preference to remove. If empty all preferences associated with the module are removed.
Unregister a smarty plugin from the system.
This method removes any matching rows from the database, and should only be used in a modules uninstall or upgrade routine.
void
RemoveSmartyPlugin
([string $name = ''])
-
string
$name: The smarty plugin name. If no name is specified all smarty plugins registered to this module will be removed.
A method to indicate that the system should drop and optionally generate an error about unknown parameters on frontend actions.
void
RestrictUnknownParams
([boolean $flag = true])
-
boolean
$flag: Flag indicating wether unknown params should be restricted.
Trigger an event.
This function will call all registered event handlers for the event
void
SendEvent
(string $eventname, array $params)
-
string
$eventname: The name of the event
-
array
$params: The parameters associated with this event.
Set the content-type header.
string
SetContentType
(string $contenttype)
-
string
$contenttype: Value to set the content-type header too
Set the current tab for the action.
Used for the various template forms, this method can be used to control the tab that is displayed by default when redirecting to an action that displays multiple tabs.
void
SetCurrentTab
(string $tab)
-
string
$tab: The tab name
Set an error message.
void
SetError
(mixed $str)
-
mixed
$str: The message. Accepts either an array of messages or a single string.
Set a display message.
void
SetMessage
(mixed $str)
-
mixed
$str: The message. Accepts either an array of messages or a single string.
Called from within the constructor, This method should be overridden to call the CreaeteParameter method for each parameter that the module understands.
Note: In past versions of CMSMS This method was used for both admin and frontend requests to register routes, and create parameters, and register a module plugin, etc. As of version 1.10 this method is deprecated, and the appropriate functions are InitializeFrontend() and InitializeAdmin() This method is scheduled for removal in version 1.11
void
SetParameters
()
Indicate the name of, and type of a parameter that is acceptable for frontend actions.
possible values for type are: CLEAN_INT,CLEAN_FLOAT,CLEAN_NONE,CLEAN_STRING
i.e: $this->SetParameterType('numarticles',CLEAN_INT);
void;
SetParameterType
(string $param, define $type)
-
string
$param: Parameter name;
-
define
$type: Parameter type;
Sets a module preference.
void
SetPreference
(string $preference_name, string $value)
-
string
$preference_name: The name of the preference to set
-
string
$value: The value to set it to
Set a specific tab header.
i.e: echo $this->SetTabHeader('preferences',$this->Lang('preferences'));
string
SetTabHeader
(string $tabid, string $title, [boolean $active = false])
-
string
$tabid: The tab id
-
string
$title: The tab title
-
boolean
$active: A flag indicating wether this tab is active.
Sets a smarty template into the database and associates it with a module.
boolean
SetTemplate
(string $tpl_name, string $content, [string $modulename = ''])
-
string
$tpl_name: The template name
-
string
$content: The template content
-
string
$modulename: The module name, if empty the current module name is used.
ShowErrors Outputs errors in a nice error box with a troubleshooting link to the wiki
string
ShowErrors
(errors $errors)
-
errors
$errors: - array or string of errors to be shown
Returns whether or not this module should show in any module lists generated by a WYSIWYG.
boolean
ShowInSyntaxList
()
Returns whether or not this module should show in any module lists generated by a WYSIWYG.
boolean
ShowInWYSIWYG
()
ShowMessage Returns a formatted page status message
string
ShowMessage
(message $message)
-
message
$message: - Message to be shown
Output a string to indicate the start of the output for a specific tab
string
StartTab
(string $tabid, [arrray $params = array()])
-
string
$tabid: tabid (see SetTabHeader)
-
arrray
$params: Parameters
Output a string to indicate the start of XHTML areas for tabs.
string
StartTabContent
()
Output a string suitable for staring tab headers i.e: echo $this->StartTabHeaders();
string
StartTabHeaders
()
Returns true if the module may support lazy loading in the front end
boolean
SupportsLazyLoading
()
Use this method to prevent the admin interface from outputting header, footer, theme, etc, so your module can output files directly to the administrator.
Do this by returning true.
boolean
SuppressAdminOutput
(array &$request)
-
array
&$request: The input request. This can be used to test conditions wether or not admin output should be suppressed.
Returns true if this SyntaxHighlighter should be considered active, eventhough it's not the choice of the user. Used for forcing a wysiwyg.
returns false be default.
boolean
SyntaxActive
()
Returns body code specific to this SyntaxHighlighter
string
SyntaxGenerateBody
()
Returns header code specific to this SyntaxHighlighter
string
SyntaxGenerateHeader
([string $htmlresult = ''])
-
string
$htmlresult: The html-code of the page before replacing SyntaxHighlighter-stuff
Returns content destined for the <form> tag. It's useful if javascript is needed for the onsubmit of the form.
string
SyntaxPageForm
()
This is a function that would be called before a form is submitted.
Generally, a dropdown box or something similar that would force a submit of the form via javascript should put this in their onchange line as well so that the SyntaxHighlighter can do any cleanups before the actual form submission takes place.
string
SyntaxPageFormSubmit
()
Returns the textarea specific for this WYSIWYG.
string
SyntaxTextarea
([string $name = 'textarea'], [string $syntax = 'html'], [int $columns = '80'], [int $rows = '15'], [string $encoding = ''], [string $content = ''], [string $stylesheet = ''], [string $addtext = ''])
-
string
$name: HTML name of the textarea
-
string
$syntax: the language which the content should be highlighted as
-
int
$columns: Number of columns wide that the textarea should be
-
int
$rows: Number of rows long that the textarea should be
-
string
$encoding: Encoding of the content
-
string
$content: Content to show in the textarea
-
string
$stylesheet: Stylesheet for content, if available
-
string
$addtext: additional attributes to include in textarea tag.
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.
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.
mixed
Uninstall
()
Display a message after a successful uninstall of the module.
XHTML
UninstallPostMessage
()
Display a message and a Yes/No dialog before doing an uninstall. Returning noting (FALSE) will go right to the uninstall.
XHTML
UninstallPreMessage
()
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.
The default behavior of this method is to call a function called method.upgrade.php in your module directory, if it exists.
boolean
Upgrade
(string $oldversion, string $newversion)
-
string
$oldversion: The version we are upgrading from
-
string
$newversion: The version we are upgrading to
Validate the value for a module generated content block type.
This method can be overridden if the module is providing content block types to the CMSMS content objects.
string
ValidateContentBlockValue
(string $blockName, mixed $value, arrray $blockparams)
-
string
$blockName: Content block name
-
mixed
$value: Content block value
-
arrray
$blockparams: Content block parameters.
Returns true or false, depending on whether the user has the right permissions to see the module in their Admin menus.
Typically permission checks are done in the overriden version of this method.
Defaults to true.
boolean
VisibleToAdminUser
()
Returns true if this wysiwyg should be considered active, eventhough it's not the choice of the user. Used for forcing a wysiwyg.
returns false be default.
boolean
WYSIWYGActive
()
Returns body code specific to this WYSIWYG
string
WYSIWYGGenerateBody
()
Returns header code specific to this WYSIWYG
string
WYSIWYGGenerateHeader
([string $htmlresult = ''])
-
string
$htmlresult: The html-code of the page before replacing WYSIWYG-stuff
Returns content destined for the <form> tag. It's useful if javascript is needed for the onsubmit of the form.
string
WYSIWYGPageForm
()
This is a function that would be called before a form is submitted.
Generally, a dropdown box or something similar that would force a submit of the form via javascript should put this in their onchange line as well so that the WYSIWYG can do any cleanups before the actual form submission takes place.
string
WYSIWYGPageFormSubmit
()
Returns the textarea specific for this WYSIWYG.
string
WYSIWYGTextarea
([string $name = 'textarea'], [int $columns = '80'], [int $rows = '15'], [string $encoding = ''], [string $content = ''], [string $stylesheet = ''], [string $addtext = ''])
-
string
$name: HTML name of the textarea
-
int
$columns: Number of columns wide that the textarea should be
-
int
$rows: Number of rows long that the textarea should be
-
string
$encoding: Encoding of the content
-
string
$content: Content to show in the textarea
-
string
$stylesheet: Stylesheet for content, if available
-
string
$addtext: Additional attributes to include in textarea tag.
Magic methods. This handles the deprecated. $this->db etc, syntax.
void
&__get
(string $key)
-
string
$key: The key to get. possible values are cms,db,smarty.config