Base module class.
All modules should inherit and extend this class with their functionality.
since | 0.9 |
---|---|
version | 2.0 |
package |
CMS |
__construct()
RegisterSmartyPlugin(string $name, string $type, callback $callback, boolean $cachable = TRUE, integer $usage)
This method registers a static plugin to the plugins database table, and should be used only when a module is installed or upgraded.
string
$nameThe plugin name
string
$typeThe plugin type (function,compiler,block, etc)
callback
$callbackThe function callback (must be a static function)
boolean
$cachableWether this function is cachable.
integer
$usageIndicates frontend (0), or frontend and backend (1) availability.
RemoveSmartyPlugin(string $name = '')
This method removes any matching rows from the database, and should only be used in a modules uninstall or upgrade routine.
string
$nameThe smarty plugin name. If no name is specified all smarty plugins registered to this module will be removed.
RegisterModulePlugin(boolean $forcedb = FALSE, boolean|null $cachable = false)
Note:
boolean
$forcedbIndicate wether this registration should be forced to be entered in the database. Default value is false (for compatibility)
boolean|null
$cachableIndicate wether this plugins output should be cachable. If null, use the site preferences, and the can_cache_output method. Otherwise a bool is expected.
can_cache_output() : boolean
boolean
AllowSmartyCaching() : boolean
boolean
GetAbout() : string
string
The about page HTML text.
GetHelpPage() : string
string
The help page HTML text.
GetName() : string
string
The name of the module.
GetModulePath() : string
string
The full path to the module directory.
GetModuleURLPath(boolean $use_ssl = false) : string
boolean
$use_sslOptional generate an URL using HTTPS path
string
The full path to the module directory.
GetFriendlyName() : string
string
GetVersion() : string
string
MinimumCMSVersion() : string
string
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.
string
Help HTML Text.
GetHeaderHTML() : string
This method is called by the admin theme when executing an action for a specific module.
string
XHTML text
SuppressAdminOutput(array &$request) : boolean
Do this by returning true.
array
$requestThe input request. This can be used to test conditions wether or not admin output should be suppressed.
boolean
RegisterRoute(string $routeregex, array $defaults = array())
Note: This method is not compatible wih lazy loading in the front end.
string
$routeregexRegular Expression Route to register
array
$defaultsAssociative array containing defaults for parameters that might not be included in the url
CreateStaticRoutes()
SetParameters()
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
InitializeFrontend()
InitializeAdmin()
RestrictUnknownParams(boolean $flag = true)
boolean
$flagIndicaties wether unknown params should be restricted.
SetParameterType(string $param, \define $type)
possible values for type are: CLEAN_INT,CLEAN_FLOAT,CLEAN_NONE,CLEAN_STRING,CLEAN_REGEXP,CLEAN_FILE
i.e: $this->SetParameterType('numarticles',CLEAN_INT);
string
$paramParameter name;
\define
$typeParameter type;
CreateParameter(string $param, string $defaultval = '', string $helpstring = '', boolean $optional = true)
i.e: $this->CreateParameter('numarticles',100000,$this->Lang('help_numarticles'),true);
string
$paramParameter name;
string
$defaultvalDefault parameter value
string
$helpstringHelp String
boolean
$optionalFlag indicating wether this parameter is optional or required.
GetDescription() : string
string
GetAdminDescription() : string
string
IsAdminOnly() : boolean
boolean
GetChangeLog() : string
string
HTML text of the changelog.
GetAuthor() : string
string
The name of the author.
GetAuthorEmail() : string
string
The email address of the author.
GetConfig() : array
array
The config hash.
GetDb() : \ADOConnection
\ADOConnection
Adodb Database object.
GetContentBlockFieldInput(string $blockName, mixed $value, array $params, boolean $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.
string
$blockNameContent block name
mixed
$valueContent block value
array
$paramsAssociative array containing content block parameters
boolean
$addingA flag indicating wether the content editor is in create mode (adding) vs. edit mod.
\ContentBase
$content_objThe content object being edited.
mixed
Either an array with two elements (prompt, and xhtml element) or a string containing only the xhtml input element.
GetContentBlockFieldValue(string $blockName, array $blockParams, array $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.
string
$blockNameContent block name
array
$blockParamsContent block parameters
array
$inputParamsinput parameters
\ContentBase
$content_objThe content object being edited.
mixed|false
The content block value if possible.
ValidateContentBlockFieldValue(string $blockName, mixed $value, \arrray $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.
string
$blockNameContent block name
mixed
$valueContent block value
\arrray
$blockparamsContent block parameters.
\contentBase
$content_objThe content object that is currently being edited.
string
An error message if the value is invalid, empty otherwise.
RenderContentBlockField(string $blockName, string $value, array $blockparams, \ContentBase $content_obj) : string
This gives modules the opportunity to render data stored in content blocks differently.
string
$blockNameContent block name
string
$valueContent block value as stored in the database
array
$blockparamsContent block parameters
\ContentBase
$content_objThe content object that is currently being displayed
string
RegisterBulkContentFunction(string $label, string $action)
For use in the CMSMS content list this method allows a module to register a bulk content action.
string
$labelA label for the action
string
$actionA module action name.
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.
string|false
A value of FALSE indicates no error. Any other value will be used as an error message.
InstallPostMessage() : \XHTML
\XHTML
Text
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.
string|false
A result of FALSE indicates that the module uninstalled correctly, any other value indicates an error message.
AllowUninstallCleanup() : boolean
The module must still remove its own database tables and permissions
boolean
Whether the core may remove all module events, event handles, module templates, and preferences on uninstall (defaults to true)
UninstallPreMessage() : \XHTML
\XHTML
Text, or FALSE.
UninstallPostMessage() : \XHTML
\XHTML
Text, or FALSE
Upgrade(string $oldversion, string $newversion) : boolean
The default behavior of this method is to call a function called method.upgrade.php in your module directory, if it exists.
string
$oldversionThe version we are upgrading from
string
$newversionThe version we are upgrading to
boolean
GetDependencies() : array
return array('somemodule'=>'1.0', 'othermodule'=>'1.1');
array
CreateXMLPackage(string &$message, integer &$filecount) : string
string
$messagereference to returned message.
integer
$filecountreference to returned file count.
string
XML Text
HasAdmin() : boolean
boolean
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
string
GetAdminMenuItems() : array
This method should do all permissions checking when building the array of objects.
array
of CmsAdminMenuItem objects
VisibleToAdminUser() : boolean
Typically permission checks are done in the overriden version of this method.
Defaults to true.
boolean
IsPluginModule() : boolean
boolean
LazyLoadFrontend() : boolean
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() : boolean
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
HasCapability(string $capability, array $params = array()) : boolean
string
$capabilityan id specifying which capability to check for, could be "wysiwyg" etc.
array
$paramsAn associative array further params to get more detailed info about the capabilities. Should be syncronized with other modules of same type
boolean
get_tasks() : array
array
of CmsRegularTask objects, or one object. NULL if not handled.
SyntaxGenerateHeader() : string
string
WYSIWYGGenerateHeader(string $selector = null, string $cssname = null) : string
string
$selector(optional) The id of the element that is being initialized, if null the WYSIWYG module should assume the selector
to be textarea.
string
$cssname(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.
string
DoAction(string $name, string $id, string $params, integer $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.
string
$nameThe Name of the action to perform
string
$idThe ID of the module
string
$paramsThe parameters targeted for this module
integer
$returnidThe current page id that is being displayed.
string
output XHTML.
CreateTooltip(string $helptext, string $linktext = "?", string $forcewidth = "", string $classname = "admin-tooltip admin-tooltip-box", string $href = "") : string
string
$helptextThe help text to be shown on mouse over
string
$linktextThe text to be shown as the link, default to a simple question mark
string
$forcewidthForces another width of the popupbox than the one set in admin css
string
$classnameAn alternative classname for the a-link of the tooltip
string
$hrefThe URL or url portion to use in the href portion of the generated link.
string
CreateTooltipLink(string $id, string $action, string $returnid, string $contents, string $tooltiptext, string $params = array()) : string
string
$idThe id given to the module on execution
string
$actionThe action that this form should do when the link is clicked
string
$returnidThe id to eventually return to when the module is finished it's task
string
$contentsThe text that will have to be clicked to follow the link
string
$tooltiptextThe helptext to be shown as tooltip-popup
string
$paramsAn array of params that should be inlucded in the URL of the link. These should be in a $key=>$value format.
string
CreateFieldsetStart(string $id, string $name, string $legend_text = '', string $addtext = '', string $addtext_legend = '') : string
string
$idThe id given to the module on execution (not really used yet, but might be later)
string
$nameThe html name of the textbox (not really used yet, but might be later on)
string
$legend_textThe legend_text for this fieldset, if applicaple
string
$addtextAny additional text that should be added into the tag when rendered
string
$addtext_legendAny additional text that should be added into the legend tag when rendered
string
CreateFieldsetEnd() : string
string
CreateFrontendFormStart(string $id, string $returnid, string $action = 'default', string $method = 'post', string $enctype = '', boolean $inline = true, string $idsuffix = '', array $params = array()) : string
string
$idThe id given to the module on execution
string
$returnidThe page id to eventually return to when the module is finished it's task
string
$actionThe name of the action that this form should do when the form is submitted
string
$methodMethod to use for the form tag. Defaults to 'post'
string
$enctypeOptional enctype to use, Good for situations where files are being uploaded
boolean
$inlineA flag to determine if actions should be handled inline (no moduleinterface.php -- only works for frontend)
string
$idsuffixText to append to the end of the id and name of the form
array
$paramsExtra parameters to pass along when the form is submitted
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
string
$idThe id given to the module on execution
string
$actionThe action that this form should do when the form is submitted
string
$returnidThe page id to eventually return to when the module is finished it's task
string
$methodMethod to use for the form tag. Defaults to 'post'
string
$enctypeOptional enctype to use, Good for situations where files are being uploaded
boolean
$inlineA flag to determine if actions should be handled inline (no moduleinterface.php -- only works for frontend)
string
$idsuffixText to append to the end of the id and name of the form
array
$paramsExtra parameters to pass along when the form is submitted
string
$extraText to append to the
string
CreateFormEnd() : string
string
CreateInputText(string $id, string $name, string $value = '', string $size = '10', string $maxlength = '255', string $addttext = '') : string
string
$idThe id given to the module on execution
string
$nameThe html name of the textbox
string
$valueThe predefined value of the textbox, if any
string
$sizeThe number of columns wide the textbox should be displayed
string
$maxlengthThe maximum number of characters that should be allowed to be entered
string
$addttextAny additional text that should be added into the tag when rendered
string
CreateLabelForInput(string $id, string $name, string $labeltext = '', string $addttext = '') : string
string
$idThe id given to the module on execution
string
$nameThe html name of the input field this label is associated to
string
$labeltextThe text in the label
string
$addttextAny additional text that should be added into the tag when rendered
string
CreateInputTextWithLabel(string $id, string $name, string $value = '', string $size = '10', string $maxlength = '255', string $addttext = '', string $label = '', string $labeladdtext = '') : string
string
$idThe id given to the module on execution
string
$nameThe html name of the textbox
string
$valueThe predefined value of the textbox, if any
string
$sizeThe number of columns wide the textbox should be displayed
string
$maxlengthThe maximum number of characters that should be allowed to be entered
string
$addttextAny additional text that should be added into the tag when rendered
string
$labelThe text for label
string
$labeladdtextAny additional text that should be added into the tag when rendered
string
CreateInputColor(string $id, string $name, string $value = '', string $addttext = '') : string
string
$idThe id given to the module on execution
string
$nameThe html name of the input field
string
$valueThe predefined value of the textbox, if any
string
$addttextAny additional text that should be added into the tag when rendered
string
CreateInputDate(string $id, string $name, string $value = '', string $addttext = '') : string
string
$idThe id given to the module on execution
string
$nameThe html name of the input field
string
$valueThe predefined value of the textbox, if any
string
$addttextAny additional text that should be added into the tag when rendered
string
CreateInputDatetime(string $id, string $name, string $value = '', string $addttext = '') : string
string
$idThe id given to the module on execution
string
$nameThe html name of the input field
string
$valueThe predefined value of the textbox, if any
string
$addttextAny additional text that should be added into the tag when rendered
string
CreateInputDatetimeLocal(string $id, string $name, string $value = '', string $addttext = '') : string
string
$idThe id given to the module on execution
string
$nameThe html name of the input field
string
$valueThe predefined value of the textbox, if any
string
$addttextAny additional text that should be added into the tag when rendered
string
CreateInputMonth(string $id, string $name, string $value = '', string $addttext = '') : string
string
$idThe id given to the module on execution
string
$nameThe html name of the input field
string
$valueThe predefined value of the textbox, if any
string
$addttextAny additional text that should be added into the tag when rendered
string
CreateInputWeek(string $id, string $name, string $value = '', string $addttext = '') : string
string
$idThe id given to the module on execution
string
$nameThe html name of the input field
string
$valueThe predefined value of the textbox, if any
string
$addttextAny additional text that should be added into the tag when rendered
string
CreateInputTime(string $id, string $name, string $value = '', string $addttext = '') : string
string
$idThe id given to the module on execution
string
$nameThe html name of the input field
string
$valueThe predefined value of the textbox, if any
string
$addttextAny additional text that should be added into the tag when rendered
string
CreateInputNumber(string $id, string $name, string $value = '', string $addttext = '') : string
string
$idThe id given to the module on execution
string
$nameThe html name of the input field
string
$valueThe predefined value of the textbox, if any
string
$addttextAny additional text that should be added into the tag when rendered
string
CreateInputRange(string $id, string $name, string $value = '', string $addttext = '') : string
string
$idThe id given to the module on execution
string
$nameThe html name of the input field
string
$valueThe predefined value of the textbox, if any
string
$addttextAny additional text that should be added into the tag when rendered
string
CreateInputEmail(string $id, string $name, string $value = '', string $size = '10', string $maxlength = '255', string $addttext = '') : string
string
$idThe id given to the module on execution
string
$nameThe html name of the textbox
string
$valueThe predefined value of the textbox, if any
string
$sizeThe number of columns wide the textbox should be displayed
string
$maxlengthThe maximum number of characters that should be allowed to be entered
string
$addttextAny additional text that should be added into the tag when rendered
string
CreateInputTel(string $id, string $name, string $value = '', string $size = '10', string $maxlength = '255', string $addttext = '') : string
string
$idThe id given to the module on execution
string
$nameThe html name of the textbox
string
$valueThe predefined value of the textbox, if any
string
$sizeThe number of columns wide the textbox should be displayed
string
$maxlengthThe maximum number of characters that should be allowed to be entered
string
$addttextAny additional text that should be added into the tag when rendered
string
CreateInputSearch(string $id, string $name, string $value = '', string $size = '10', string $maxlength = '255', string $addttext = '') : string
string
$idThe id given to the module on execution
string
$nameThe html name of the textbox
string
$valueThe predefined value of the textbox, if any
string
$sizeThe number of columns wide the textbox should be displayed
string
$maxlengthThe maximum number of characters that should be allowed to be entered
string
$addttextAny additional text that should be added into the tag when rendered
string
CreateInputUrl(string $id, string $name, string $value = '', string $size = '10', string $maxlength = '255', string $addttext = '') : string
string
$idThe id given to the module on execution
string
$nameThe html name of the textbox
string
$valueThe predefined value of the textbox, if any
string
$sizeThe number of columns wide the textbox should be displayed
string
$maxlengthThe maximum number of characters that should be allowed to be entered
string
$addttextAny additional text that should be added into the tag when rendered
string
CreateInputFile(string $id, string $name, string $accept = '', string $size = '10', string $addttext = '') : string
string
$idThe id given to the module on execution
string
$nameThe html name of the textbox
string
$acceptThe MIME-type to be accepted, default is all
string
$sizeThe number of columns wide the textbox should be displayed
string
$addttextAny additional text that should be added into the tag when rendered
string
CreateInputPassword(string $id, string $name, string $value = '', string $size = '10', string $maxlength = '255', string $addttext = '') : string
string
$idThe id given to the module on execution
string
$nameThe html name of the textbox
string
$valueThe predefined value of the textbox, if any
string
$sizeThe number of columns wide the textbox should be displayed
string
$maxlengthThe maximum number of characters that should be allowed to be entered
string
$addttextAny additional text that should be added into the tag when rendered
string
CreateInputHidden(string $id, string $name, string $value = '', string $addttext = '') : string
string
$idThe id given to the module on execution
string
$nameThe html name of the hidden field
string
$valueThe predefined value of the field, if any
string
$addttextAny additional text that should be added into the tag when rendered
string
CreateInputCheckbox(string $id, string $name, string $value = '', string $selectedvalue = '', string $addttext = '') : string
string
$idThe id given to the module on execution
string
$nameThe html name of the checkbox
string
$valueThe value returned from the input if selected
string
$selectedvalueThe current value. If equal to $value the checkbox is selected
string
$addttextAny additional text that should be added into the tag when rendered
string
CreateInputSubmit(string $id, string $name, string $value = '', string $addttext = '', string $image = '', string $confirmtext = '') : string
string
$idThe id given to the module on execution
string
$nameThe html name of the button
string
$valueThe predefined value of the button, if any
string
$addttextAny additional text that should be added into the tag when rendered
string
$imageUse an image instead of a regular button
string
$confirmtextOptional text to display in a confirmation message.
string
CreateInputReset(string $id, string $name, string $value = 'Reset', string $addttext = '') : string
string
$idThe id given to the module on execution
string
$nameThe html name of the button
string
$valueThe predefined value of the button, if any
string
$addttextAny additional text that should be added into the tag when rendered
string
CreateFileUploadInput(string $id, string $name, string $addttext = '', integer $size = '10', integer $maxlength = '255') : string
string
$idThe id given to the module on execution
string
$nameThe html name of the input
string
$addttextAny additional text that should be added into the tag when rendered
integer
$sizeThe size of the text field associated with the file upload field. Some browsers may not respect this value.
integer
$maxlengthThe maximim length of the content of the text field associated with the file upload field. Some browsers may not respect this value.
string
CreateInputDropdown(string $id, string $name, string $items, string $selectedindex = -1, string $selectedvalue = '', string $addttext = '') : string
string
$idThe id given to the module on execution
string
$nameThe html name of the dropdown list
string
$itemsAn array of items to put into the dropdown list... they should be $key=>$value pairs
string
$selectedindexThe default selected index of the dropdown list. Setting to -1 will result in the first choice being selected
string
$selectedvalueThe default selected value of the dropdown list. Setting to '' will result in the first choice being selected
string
$addttextAny additional text that should be added into the tag when rendered
string
CreateInputDataList(string $id, string $name, string $value = '', string $items, string $size = '10', string $maxlength = '255', string $addttext = '') : string
string
$idThe id given to the module on execution
string
$nameThe html name of the textbox
string
$valueThe predefined value of the textbox, if any
string
$itemsAn array of items to put into the list... they should be $key=>$value pairs
string
$sizeThe number of columns wide the textbox should be displayed
string
$maxlengthThe maximum number of characters that should be allowed to be entered
string
$addttextAny additional text that should be added into the tag when rendered
string
CreateInputSelectList(string $id, string $name, string $items, string $selecteditems = array(), string $size = 3, string $addttext = '', boolean $multiple = true) : string
string
$idThe id given to the module on execution
string
$nameThe html name of the select list
string
$itemsAn array of items to put into the list... they should be $key=>$value pairs
string
$selecteditemsAn array of items in the list that should default to selected.
string
$sizeThe number of rows to be visible in the list (before scrolling).
string
$addttextAny additional text that should be added into the tag when rendered
boolean
$multipleindicates wether multiple selections are allowed (defaults to true)
string
CreateInputRadioGroup(string $id, string $name, string $items, string $selectedvalue = '', string $addttext = '', string $delimiter = '') : string
string
$idThe id given to the module on execution
string
$nameThe html name of the radio group
string
$itemsAn array of items to create as radio buttons... they should be $key=>$value pairs
string
$selectedvalueThe default selected index of the radio group. Setting to -1 will result in the first choice being selected
string
$addttextAny additional text that should be added into the tag when rendered
string
$delimiterA delimiter to throw between each radio button, e.g., a
tag or something for formatting
string
CreateTextArea(boolean $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
boolean
$enablewysiwygShould we try to create a WYSIWYG for this textarea?
string
$idThe id given to the module on execution
string
$textThe text to display in the textarea's content
string
$nameThe html name of the textarea
string
$classnameThe CSS class to associate this textarea to
string
$htmlidThe html id to give to this textarea
string
$encodingThe encoding to use for the content
string
$stylesheetThe text of the stylesheet associated to this content. Only used for certain WYSIWYGs
string
$colsThe number of characters wide (columns) the resulting textarea should be
string
$rowsThe number of characters high (rows) the resulting textarea should be
string
$forcewysiwygThe wysiwyg-system to be forced even if the user has chosen another one
string
$wantedsyntaxThe language the content should be syntaxhightlighted as
string
$addtextAny additional text to include with the textarea field.
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
string
$idThe id given to the module on execution
string
$textThe text to display in the textarea's content
string
$nameThe html name of the textarea
string
$classnameThe CSS class to associate this textarea to
string
$htmlidThe html id to give to this textarea
string
$encodingThe encoding to use for the content
string
$stylesheetThe text of the stylesheet associated to this content. Only used for certain WYSIWYGs
string
$colsThe number of characters wide (columns) the resulting textarea should be
string
$rowsThe number of characters high (rows) the resulting textarea should be
string
$addtextAdditional text for the text area tag.
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
string
$idThe id given to the module on execution
string
$returnidThe id to eventually return to when the module is finished it's task
string
$actionThe action that this form should do when the link is clicked
string
$contentsThe text that will have to be clicked to follow the link
string
$paramsAn array of params that should be inlucded in the URL of the link. These should be in a $key=>$value format.
string
$warn_messageText to display in a javascript warning box. If they click no, the link is not followed by the browser.
boolean
$onlyhrefA flag to determine if only the href section should be returned
boolean
$inlineA flag to determine if actions should be handled inline (no moduleinterface.php -- only works for frontend)
string
$addtextAny additional text that should be added into the tag when rendered
boolean
$targetcontentonlyA flag indicating that the output of this link should target the content area of the destination page.
string
$prettyurlAn optional pretty url segment (relative to the root of the site) to use when generating the link.
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
string
$idThe id given to the module on execution
string
$actionThe action that this form should do when the link is clicked
string
$returnidThe id to eventually return to when the module is finished it's task
string
$contentsThe text that will have to be clicked to follow the link
string
$paramsAn array of params that should be inlucded in the URL of the link. These should be in a $key=>$value format.
string
$warn_messageText to display in a javascript warning box. If they click no, the link is not followed by the browser.
boolean
$onlyhrefA flag to determine if only the href section should be returned
boolean
$inlineA flag to determine if actions should be handled inline (no moduleinterface.php -- only works for frontend)
string
$addttextAny additional text that should be added into the tag when rendered
boolean
$targetcontentonlyA flag to determine if the link should target the default content are of the destination page.
string
$prettyurlAn optional pretty url segment (related to the root of the website) for a pretty url.
string
create_url(string $id, string $action, integer $returnid = '', \hash $params = array(), boolean $inline = false, boolean $targetcontentonly = false, string $prettyurl = '') : \string.
string
$idThe module action id (cntnt01 indicates that the defaul content block of the destination page should be used).
string
$actionThe module action name
integer
$returnidThe destination page.
\hash
$paramsAreay of parameters for the URL. These will be ignored if the prettyurl argument is specified.
boolean
$inlineWether the target of the output link is the same tag on the same page.
boolean
$targetcontentonlyWether the target of the output link targets the content area of the destination page.
string
$prettyurlAn optional url segment related to the root of the page for pretty url purposes.
\string.
get_pretty_url(string $id, string $action, integer $returnid = '', array $params = array(), boolean $inline = false) : string
string
$idThe module action id (cntnt01 indicates that the defaul content block of the destination page should be used).
string
$actionThe module action name
integer
$returnidThe destination page.
array
$paramsAreay of parameters for the URL. These will be ignored if the prettyurl argument is specified.
boolean
$inlineWether the target of the output link is the same tag on the same page.
string
CreateContentLink(integer $pageid, string $contents = '') : string
integer
$pageidthe page id of the page we want to direct to
string
$contentsThe optional text or XHTML contents of the generated link
string
CreateReturnLink(string $id, string $returnid, string $contents = '', string $params = array(), boolean $onlyhref = false) : string
string
$idThe id given to the module on execution
string
$returnidThe id to return to when the module is finished it's task
string
$contentsThe text that will have to be clicked to follow the link
string
$paramsAn array of params that should be inlucded in the URL of the link. These should be in a $key=>$value format.
boolean
$onlyhrefA flag to determine if only the href section should be returned
string
RedirectToAdminTab(string $tab = '', mixed|null $params = '', string $action = '')
Applicable only to admin actions.
string
$tabThe tab name. If empty, the current tab is used.
mixed|null
$paramsAn assoiciative array of params, or null
string
$actionThe action name (if not specified, defaultadmin is assumed)
RedirectForFrontEnd(string $id, string $returnid, string $action, string $params = array(), boolean $inline = true)
This function is optimized for frontend use.
string
$idThe id given to the module on execution
string
$returnidThe action that this form should do when the form is submitted
string
$actionThe id to eventually return to when the module is finished it's task
string
$paramsAn array of params that should be inlucded in the URL of the link. These should be in a $key=>$value format.
boolean
$inlineA flag to determine if actions should be handled inline (no moduleinterface.php -- only works for frontend)
Redirect(string $id, string $action, string $returnid = '', string $params = array(), boolean $inline = false)
string
$idThe id given to the module on execution
string
$actionThe action that this form should do when the form is submitted
string
$returnidThe id to eventually return to when the module is finished it's task
string
$paramsAn array of params that should be inlucded in the URL of the link. These should be in a $key=>$value format.
boolean
$inlineA flag to determine if actions should be handled inline (no moduleinterface.php -- only works for frontend)
RedirectToAdmin(string $page, array $params = array())
string
$pagephp script to redirect to
array
$paramsoptional array of url parameters
RedirectContent(integer $id)
integer
$idContent id to redirect to.
GetModuleInstance(string $module) : \CMSModule
GetModulesWithCapability(string $capability, array $params = array()) : array
string
$capabilityname of the capability we are checking for. could be "wysiwyg" etc.
array
$paramsfurther params to get more detailed info about the capabilities. Should be syncronized with other modules of same type
array
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.
string
GetActionTemplateObject() : \Smarty_Internal_Template
This method is only valid within a module action.
\Smarty_Internal_Template
GetDatabaseResource(string $template) : string
If the template name provided ends with .tpl a module file template is assumed.
string
$templateThe template name.
string
GetTemplateResource(string $template) : string
string
$templateThe template name.
string
GetFileResource(string $template) : string
string
$templateThe template name.
string
ListTemplates(string $modulename = '') : array
string
$modulenameIf empty the current module name is used.
array
GetTemplate(string $tpl_name, string $modulename = '') : string
string
$tpl_namethe template name.
string
$modulenameIf empty the current module name is used.
string
GetTemplateFromFile(string $template_name) : string
string
$template_name string
SetTemplate(string $tpl_name, string $content, string $modulename = '') : boolean
string
$tpl_nameThe template name
string
$contentThe template content
string
$modulenameThe module name, if empty the current module name is used.
boolean
DeleteTemplate(string $tpl_name = '', string $modulename = '') : boolean
string
$tpl_nameThe Template name, if empty all templates associated with the module are deleted.
string
$modulenameThe module name, if empty the current module name is used.
boolean
ProcessTemplate(string $tpl_name, string $designation = '', boolean $cache = false, string $cacheid = '') : string
string
$tpl_nameTemplate name
string
$designationCache Designation
boolean
$cacheCache flag
string
$cacheidUnique cache flag
string
ProcessTemplateFromData(\data $data) : string
Note: this function is deprecated and scheduled for removal.
\data
$dataInput template
string
ProcessTemplateFromDatabase(string $tpl_name, string $designation = '', boolean $cache = false, string $modulename = '') : string
string
$tpl_nameTemplate name
string
$designation(optional) Designation
boolean
$cache(optional) Cachable flag
string
$modulename(optional) module name, if empty the current module is used.
string
ListUserTags() : array
array
CallUserTag(string $name, array $params = array()) : array
string
$nameName of the user defined tag
array
$paramsParameters for the user defined tag.
array
SetCurrentTab(string $tab)
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.
string
$tabThe tab name
StartTabHeaders() : string
i.e: echo $this->StartTabHeaders();
string
SetTabHeader(string $tabid, string $title, boolean $active = false) : string
i.e: echo $this->SetTabHeader('preferences',$this->Lang('preferences'));
string
$tabidThe tab id
string
$titleThe tab title
boolean
$activewether the tab is active or not.
string
EndTabHeaders() : string
string
StartTabContent() : string
string
EndTabContent() : string
string
StartTab(string $tabid, \arrray $params = array()) : string
string
$tabidthe tab id
\arrray
$paramsParameters
string
EndTab() : string
string
AdminStyle()
SetContentType(string $contenttype)
string
$contenttypeValue to set the content-type header too
Audit(string $itemid = '', string $itemname, string $action)
string
$itemiduseful for working on a specific record (i.e article or user)
string
$itemnameitem name
string
$actionaction name
ShowMessage(string $message) : string
string
$messageMessage to be shown
string
SetMessage(string|array<mixed,string> $str)
string|array<mixed,string>
$strThe message. Accepts either an array of messages or a single string.
ShowErrors(string|array<mixed,string> $errors) : string
string|array<mixed,string>
$errorsarray or string of errors to be shown
string
SetError(string|array<mixed,string> $str)
string|array<mixed,string>
$strThe message. Accepts either an array of messages or a single string.
CreatePermission(string $permission_name, string $permission_text = null)
string
$permission_nameName of the permission to create
string
$permission_textDescription of the permission
CheckPermission(string $permission_name) : boolean
string
$permission_nameThe name of the permission to check against the current user
boolean
RemovePermission(string $permission_name)
string
$permission_nameThe name of the permission to remove
GetPreference(string $preference_name, string $defaultvalue = '') : string
string
$preference_nameThe name of the preference to check
string
$defaultvalueThe default value, just in case it doesn't exist
string
SetPreference(string $preference_name, string $value)
string
$preference_nameThe name of the preference to set
string
$valueThe value to set it to
RemovePreference(string $preference_name = '') : boolean
string
$preference_nameThe name of the preference to remove. If empty all preferences associated with the module are removed.
boolean
ListPreferencesByPrefix(string $prefix) : array<mixed,string>|null
string
$prefix array<mixed,string>|null
An array of preference names, or null.
AddEventHandler(string $modulename, string $eventname, boolean $removable = true)
string
$modulenameThe name of the module sending the event, or 'Core'
string
$eventnameThe name of the event
boolean
$removableCan this event be removed from the list?
CreateEvent(string $eventname)
string
$eventnameThe name of the event
DoEvent(string $originator, string $eventname, array &$params) : boolean
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.
string
$originatorThe name of the originating module
string
$eventnameThe name of the event
array
$paramsArray of parameters provided with the event.
boolean
GetEventDescription(string $eventname) : string
This method must be over-ridden if this module created any events.
string
$eventnameThe name of the event
string
GetEventHelp(string $eventname) : string
This method must be over-ridden if this module created any events.
string
$eventnameThe name of the event
string
HandlesEvents() : boolean
boolean
RemoveEvent(string $eventname)
Note, only events created by this module can be removed.
string
$eventnameThe name of the event
RemoveEventHandler(string $modulename, string $eventname)
Note, only events created by this module can be removed.
string
$modulenameThe module name (or Core)
string
$eventnameThe name of the event
SendEvent(string $eventname, array $params)
This function will call all registered event handlers for the event
string
$eventnameThe name of the event
array
$paramsThe parameters associated with this event.
cms : \CmsApp
A reference to the application object (deprecated)
\CmsApp
smarty : \Smarty_CMS
A reference to the global smarty object (deprecated)
\Smarty_CMS
config : \cms_config
A reference to the global app configuration object (deprecated)
\cms_config
db : \ADOConnection
A reference to the global database configuration object (deprecated)
\ADOConnection