CSWidget
extends CSPlugin
in package
This plugin controls the CSPortal Interface and should be used to create a widget in CSPortal
It contains methods which are called in different phases of the widget livecycle. To be included, it must be placed in a plugins/portal/widgets subfolder with a file name ending with Widget.php. All methods of the CSPortalGuiWidgetRequest can be used as the method calls are directly forwarded to the current request object
Tags
Table of Contents
- __call() : mixed|string
- All method calls which are not defined within the plugin are forwarded to the module Therefore it is possible to get, e.g. the label by calling the getSuiteName() method.
- __construct() : CSWidget
- Creates the basic Portal Widget and prepares its layout and navigation
- _construct() : void
- The construct method may be used to initialize custom plugin properties it is called immediately after instantiating the plugin all arguments passed to the getPlugins method are also available in this method.
- addAlternativePluginFolder() : void
- A path to a specific folder in which should be search for plugins.
- addCSSCode() : void
- Adds a CSS snippet to the Widget's internal CSS code that are added to the HTML head on rendering the Widget
- addCSSLink() : void
- Adds a link to the widgets external cascading style sheets
- addEditModeButton() : void
- Adds a text button to the Widget toolbar that switches the edit mode from "view" to "edit" and reloads the current view in the new mode.
- addImportantJSCode() : void
- Adds a JavaScript code snippet to the widgets internal JS scripts which is directly evaluated - before any other JavaScript code
- addJSCode() : void
- Adds a js code snippet to the Widget's internal JavaScript scripts that are added to the HTML head part of the Widget
- addJSLink() : void
- Adds link to external JavaScript files
- addListModeButtons() : CSPortalGuiToolbarGroup
- Adds text button to the Widget toolbar that switches the list view mode from "list" to "details" and "thumb"
- addListModePreferences() : void
- Adds a listMode preference to the preferences section
- checkAvailibility() : string
- Checks whether the Widget is available at the moment
- clearCache() : void
- Clears the cache
- getAlternativePluginFolder() : array<string|int, mixed>
- getConfigurationHintHtml() : mixed
- getCurrentLayout() : CSWidgetDefaultLayout
- Retrieve current CSWidget[Default]Layout of Widget instance
- getCurrentNavigationID() : string
- Retrieve current Navigation identifier
- getCurrentNavigationMap() : CSWidgetNavigationMap
- Retrieve current CSWidgetNavigationMap of Widget instance
- getCurrentNavigationNode() : CSWidgetNavigationNode
- Retrieve current CSWidgetNavigationNode of Widget instance
- getDictionary() : string
- Returns the relative path to the widgets dictionary files.
- getEditMode() : string
- Retrieve information about edit mode of a widget
- getHelpHtml() : string
- Create Help HTML Output from file structure of Widget
- getIcon() : string
- Returns the relative path to the icon with the specified name inside the current widget folder.
- getIframeURL() : string
- Can be used, if the Widget should just display an iframe containing an URL, e.g. a backend component
- getInstance() : CSWidget
- Retrieve current CSWidget instance
- getLabel() : string
- Returns the display name of a Widget
- getLayout() : CSWidgetDefaultLayout
- Returns current CSWidgetLayout of a Widget.
- getLevel() : int
- The getLevel method may be overwritten in the plugins and defines the order, the plugins are called, where the highest level is called first.
- getLicenseValue() : bool
- Enter description here .
- getListMode() : string
- Retrieve view mode of list in Widget content
- getMetaData() : CSWidgetMetaData
- Returns the CSWidgetMetaData of the current widget
- getModule() : CSModule
- Returns the module, if the plugin is defined within a module.
- getNavigateToUrl() : string
- Returns the URL to the widgets navigation path
- getNavigationMap() : CSWidgetNavigationMap
- Returns the CSNavigationMap of the widget.
- getPlugin() : CSPlugin|null
- Returns a CSPlugin for the given plugin type and plugin class name.
- getPluginChooser() : array<string|int, mixed>
- Returns an array all defined CSPlugins for the current plugin type
- getPluginData() : mixed
- getPluginDefinitionFile() : string
- Returns the path to the file, the plugin is defined.
- getPluginName() : mixed
- getPlugins() : array<string|int, CSPlugin>
- Returns all defined CSPlugins for the current plugin type It should be used to get all matching plugins for a given plugin api.
- getPluginsInModule() : array<string|int, mixed>
- Returns all CSPlugins for the current plugin type which are defined within the given module It should be used to get all matching plugins for a given plugin api.
- getPreferences() : CSWidgetPreferences
- Returns the CSWidgetPreferences of the current widget
- getPreferenceValue() : mixed
- Retrieve the value of a named preference field of a Widget.
- getPreferredStaticHeight() : int
- Returns the desired fixed height of the widget or null, if it should be calculated dynamically.
- getRegistryValue() : mixed
- Enter description here .
- getRequest() : CSPortalGuiWidgetRequest
- Retrieve current CSPortalGuiWidgetRequest object of a Widget
- getRequestValue() : mixed
- Retrieve value from Widget request (e.g. from load, reload, navigate)
- getSessionValue() : mixed
- Retrieve the named value of a Widget session
- getSubmitForm() : CSPortalGuiForm
- Retrieve the current Widget form.
- getSuiteName() : string
- Retrieves the Suite the widget is located within e.g. for current license checks
- getWidgetFolder() : string
- Returns the relative path to the folder, the current widget is placed within.
- getWidgetSubFolder() : string
- Retrieve folder that contains Widget files
- hasRight() : bool
- Returns whether the current user has a given right on this widget.
- hasWriteRight() : bool
- Returns whether the current user has the default write right on this widget
- includeFile() : void
- Includes a file containing this widget with $this
- initForDisplay() : void
- Is called by framework to initialize necessary parts of the widget for display request
- isAvailable() : bool
- This method is called to check, whether the plugin is available.
- makeHtml() : string
- Returns the HTML representation of the current widget Extend with care as call of Widget functions from JavaScript or Bookmarking support are handled here.
- makeUWAHtml() : string
- Request creation of UWA conform XML
- onNavigationChange() : void
- This method is called, if the user navigates to a different navigationID
- onSearch() : string
- Executes a global search on the widget
- prepareLicenses() : void
- Extend to add Widget preferences {@see CSWidgetPreferences}
- resetLoadedPlugins() : mixed
- reset the internal plugins cache for loaded plugins
- setEditMode() : void
- Enter description here .
- setNavigationLabel() : void
- Set Label in Navigation
- setRegistryValue() : Registry
- Enter description here .
- setSessionValue() : void
- Set a session value that stays available as long as the browser window stays open. Use an empty value to unset an existing session value.
- setSubmitForm() : CSPortalGuiForm
- Creates a Widget form with basic operations already set.
- translate() : string
- Translates a word with the CONTENTSERV Dictionary
Methods
__call()
All method calls which are not defined within the plugin are forwarded to the module Therefore it is possible to get, e.g. the label by calling the getSuiteName() method.
public
__call(mixed $methodName, mixed $methodArguments) : mixed|string
Parameters
- $methodName : mixed
- $methodArguments : mixed
Tags
Return values
mixed|string —__construct()
Creates the basic Portal Widget and prepares its layout and navigation
public
__construct() : CSWidget
Tags
Return values
CSWidget —_construct()
The construct method may be used to initialize custom plugin properties it is called immediately after instantiating the plugin all arguments passed to the getPlugins method are also available in this method.
public
_construct() : void
Tags
Return values
void —addAlternativePluginFolder()
A path to a specific folder in which should be search for plugins.
public
static addAlternativePluginFolder(mixed $sPluginFolder) : void
Parameters
- $sPluginFolder : mixed
Tags
Return values
void —addCSSCode()
Adds a CSS snippet to the Widget's internal CSS code that are added to the HTML head on rendering the Widget
public
addCSSCode(string $code) : void
Note that links to urls within the file must be relative to the portal.php
Parameters
- $code : string
-
CSS source without any <style> elements
Tags
Return values
void —addCSSLink()
Adds a link to the widgets external cascading style sheets
public
addCSSLink(string $href) : void
Note that
- the link to the file is from the browsers point of view relative to the portal.php
- that links to urls within the file are relative to the CSS file location.
Parameters
- $href : string
-
relative path to the CSS file
Tags
Return values
void —addEditModeButton()
Adds a text button to the Widget toolbar that switches the edit mode from "view" to "edit" and reloads the current view in the new mode.
public
addEditModeButton([string $editType = '' ][, bool $createFormToEdit = false ][, string $float = 'right' ][, CSPortalGuiToolbar $toolbar = null ][, string $onclick = '' ]) : void
If the $createFormToEdit parameter is set to true the reload will, in addition, create a form element around the Widget contents that is to be used to send content updates. If a CSPortalGuiEditor should be used instead of a CSPortalGuiForm, it must first be defined using the CSWidget::setSubmitForm method. Retrieval of that form is possible by CSWidget::getSubmitForm
Parameters
- $editType : string = ''
-
name of Widget-specific edit mode (optional)
- $createFormToEdit : bool = false
-
true creates a large form around Widget content on edit mode (optional)
- $float : string = 'right'
-
float of text button in toolbar: left, right, center (optional)
- $toolbar : CSPortalGuiToolbar = null
-
specify the toolbar the text button should be attached to (optional)
- $onclick : string = ''
-
add javascript onclick methods to text button (optional)
Tags
Return values
void —addImportantJSCode()
Adds a JavaScript code snippet to the widgets internal JS scripts which is directly evaluated - before any other JavaScript code
public
addImportantJSCode(string $code) : void
Parameters
- $code : string
-
JavaScript source without any <javascript> elements
Tags
Return values
void —addJSCode()
Adds a js code snippet to the Widget's internal JavaScript scripts that are added to the HTML head part of the Widget
public
addJSCode(string $code) : void
Parameters
- $code : string
-
JavaScript source without any <javascript> elements
Tags
Return values
void —addJSLink()
Adds link to external JavaScript files
public
addJSLink(string $href) : void
Note that the link to the file is from the browsers point of view relative to the portal.php
Parameters
- $href : string
-
relative path to the JavaScript file
Tags
Return values
void —addListModeButtons()
Adds text button to the Widget toolbar that switches the list view mode from "list" to "details" and "thumb"
public
addListModeButtons([string $float = 'right' ][, CSPortalGuiToolbar $toolbar = null ][, array<string|int, mixed> $options = array('list', 'details', 'thumb') ][, string $params = '' ]) : CSPortalGuiToolbarGroup
Parameters
- $float : string = 'right'
-
float of text button in toolbar: left, right, center (optional)
- $toolbar : CSPortalGuiToolbar = null
-
specify the toolbar the text button should be attached to (optional)
- $options : array<string|int, mixed> = array('list', 'details', 'thumb')
-
extend available list options with an array of modes (optional)
- $params : string = ''
-
additional params for the navigateTo url params
Tags
Return values
CSPortalGuiToolbarGroup —addListModePreferences()
Adds a listMode preference to the preferences section
public
addListModePreferences(CSWidgetPreferences $preferences[, array<string|int, mixed> $additionalModes = array() ]) : void
Parameters
- $preferences : CSWidgetPreferences
-
the preferences to add the settings to
- $additionalModes : array<string|int, mixed> = array()
-
array containing more modes apart from list, detail and thumb in the form mode=>LABEL
Tags
Return values
void —checkAvailibility()
Checks whether the Widget is available at the moment
public
checkAvailibility() : string
Tags
Return values
string —the html error output if it is not available
clearCache()
Clears the cache
public
static clearCache([bool $clearCompleteCache = true ][, bool $onlyDynamicElements = true ]) : void
Parameters
- $clearCompleteCache : bool = true
-
whether the complete cache should be cleared (true) or only this request should not be cached (false)
- $onlyDynamicElements : bool = true
-
if the complete cache should be cleared this flag determines whether only those elements are cleared, which are marked as dynamic or the static elements too
Tags
Return values
void —getAlternativePluginFolder()
public
static getAlternativePluginFolder() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —getConfigurationHintHtml()
public
getConfigurationHintHtml([mixed $sTitle = 'CSP_MAP_MSG_ERR_TITLE_ROOT_FOLDER_IDS' ][, mixed $sMessage = 'CSP_MAP_MSG_ERR_TXT_ROOT_FOLDER_IDS' ]) : mixed
Parameters
- $sTitle : mixed = 'CSP_MAP_MSG_ERR_TITLE_ROOT_FOLDER_IDS'
- $sMessage : mixed = 'CSP_MAP_MSG_ERR_TXT_ROOT_FOLDER_IDS'
Tags
Return values
mixed —getCurrentLayout()
Retrieve current CSWidget[Default]Layout of Widget instance
public
final static getCurrentLayout() : CSWidgetDefaultLayout
Tags
Return values
CSWidgetDefaultLayout —getCurrentNavigationID()
Retrieve current Navigation identifier
public
final static getCurrentNavigationID() : string
Tags
Return values
string —the current navigation ID
getCurrentNavigationMap()
Retrieve current CSWidgetNavigationMap of Widget instance
public
final static getCurrentNavigationMap() : CSWidgetNavigationMap
Tags
Return values
CSWidgetNavigationMap —getCurrentNavigationNode()
Retrieve current CSWidgetNavigationNode of Widget instance
public
final static getCurrentNavigationNode() : CSWidgetNavigationNode
Tags
Return values
CSWidgetNavigationNode —getDictionary()
Returns the relative path to the widgets dictionary files.
public
getDictionary() : string
Tags
Return values
string —the path to the widgets dictionaries
getEditMode()
Retrieve information about edit mode of a widget
public
getEditMode([string $editType = '' ][, string $default = 'view' ]) : string
In combination with the CSWidget::addEditModeButton this allows to create dependant edit modes per widget. This method informs implementations of Widget nodes of their current edit mode state.
Parameters
- $editType : string = ''
-
name of Widget-specific edit mode
- $default : string = 'view'
-
fallback edit mode (optional)
Tags
Return values
string —current edit mode of Widget: "edit"/"view"/$default
getHelpHtml()
Create Help HTML Output from file structure of Widget
public
final getHelpHtml() : string
Tags
Return values
string —getIcon()
Returns the relative path to the icon with the specified name inside the current widget folder.
public
getIcon(string $name[, string $subFolder = '' ][, string $extension = 'png' ]) : string
All icons are searched within the 'images' folder inside the current widget folder
Parameters
- $name : string
-
the name of the icon (without extension)
- $subFolder : string = ''
-
the sub folder within the images folder of the current widget
- $extension : string = 'png'
-
the extension of the icon file
Tags
Return values
string —the path to the icon or null if the icon does not exist
getIframeURL()
Can be used, if the Widget should just display an iframe containing an URL, e.g. a backend component
public
getIframeURL() : string
Tags
Return values
string —the URL which should be displayed
getInstance()
Retrieve current CSWidget instance
public
final static getInstance() : CSWidget
Tags
Return values
CSWidget —getLabel()
Returns the display name of a Widget
public
getLabel() : string
Tags
Return values
string —getLayout()
Returns current CSWidgetLayout of a Widget.
public
final getLayout() : CSWidgetDefaultLayout
Tags
Return values
CSWidgetDefaultLayout —getLevel()
The getLevel method may be overwritten in the plugins and defines the order, the plugins are called, where the highest level is called first.
public
getLevel() : int
The method can also be set for all plugins within a module by overwriting the modules getLevel method.
Tags
Return values
int —the level of the plugin where it is called
getLicenseValue()
Enter description here .
public
getLicenseValue(string $name) : bool
..
Parameters
- $name : string
Tags
Return values
bool —getListMode()
Retrieve view mode of list in Widget content
public
getListMode([string $default = null ]) : string
Parameters
- $default : string = null
-
if set to an existing list mode, only this list mode is returned
Tags
Return values
string —list mode or empty otherwise
getMetaData()
Returns the CSWidgetMetaData of the current widget
public
final getMetaData() : CSWidgetMetaData
Tags
Return values
CSWidgetMetaData —getModule()
Returns the module, if the plugin is defined within a module.
public
getModule() : CSModule
This method can be used in the plugin api and the plugin wherever access to the defining module is required. If it is used in the Api, it should be noticed that this method may return null, if the plugin is directly defined in the projects or admin.local plugins directory.
Tags
Return values
CSModule —the module object, if the plugin defined in a module or null otherwise
getNavigateToUrl()
Returns the URL to the widgets navigation path
public
getNavigateToUrl([string $navigationID = null ][, string $params = '' ][, bool $forNewFrame = false ]) : string
Parameters
- $navigationID : string = null
-
current navigation map position identifier
- $params : string = ''
-
additional key-value pairs that are attached to the result URL
- $forNewFrame : bool = false
-
whether the url should be prepared to be used as destination in another frame
Tags
Return values
string —the url to the widgets navigation node
getNavigationMap()
Returns the CSNavigationMap of the widget.
public
final getNavigationMap() : CSWidgetNavigationMap
If it is dynamic it must contain at least the nodes on the path of the currentID including all direct sub nodes
Tags
Return values
CSWidgetNavigationMap —getPlugin()
Returns a CSPlugin for the given plugin type and plugin class name.
public
static getPlugin(string $pluginApiPath, string $className[, mixed $arguments = NULL ]) : CSPlugin|null
As standard behaviour the module subfolder is guessed from the forward URL parameter. If a plugin should point to something in a special module subfolder, this scope can be added by adding the module name in squared bracket at the end of the $pluginApiPath, e.g. 'core/api/plugins/CSRecordPlugin.php[pms]' to get all CSRecordPlugins defined for pms records.
Parameters
- $pluginApiPath : string
-
The relative path in filesystem for the requested plugin api (optional: ending with the module subfolder).
- $className : string
-
The target plugin class name, which should be loaded.
- $arguments : mixed = NULL
-
one or multiple arguments which should be passed to the isAvailable method.
Tags
Return values
CSPlugin|null —Returns the requested plugin for the given parameter.
getPluginChooser()
Returns an array all defined CSPlugins for the current plugin type
public
static getPluginChooser(string $pluginApiPath[, mixed $arguments = NULL ]) : array<string|int, mixed>
Parameters
- $pluginApiPath : string
-
the relative path in filesystem for the requested plugin api (optional: ending with the module subfolder).
- $arguments : mixed = NULL
-
one ore multiple arguments which should be passed to the isAvailable method.
Tags
Return values
array<string|int, mixed> —of CSPlugins in the form [CLASSNAME => LABEL] where the CLASSNAME may be used in the CSPlugin::getPlugin method
getPluginData()
public
getPluginData() : mixed
Tags
Return values
mixed —getPluginDefinitionFile()
Returns the path to the file, the plugin is defined.
public
getPluginDefinitionFile() : string
Tags
Return values
string —the path to the plugin
getPluginName()
public
getPluginName() : mixed
Tags
Return values
mixed —getPlugins()
Returns all defined CSPlugins for the current plugin type It should be used to get all matching plugins for a given plugin api.
public
static getPlugins(string $pluginApiPath[, mixed $arguments = NULL ]) : array<string|int, CSPlugin>
As standard behaviour the module subfolder is guessed from the forward URL parameter. If a plugin should point to something in a special module subfolder, this scope can be added by adding the module name in squared bracket at the end of the $pluginApiPath, e.g. 'core/api/plugins/CSRecordPlugin.php[pms]' to get all CSRecordPlugins defined for pms records.
Parameters
- $pluginApiPath : string
-
the relative path in filesystem for the requested plugin api (optional: ending with the module subfolder).
- $arguments : mixed = NULL
-
one ore multiple arguments which should be passed to the isAvailable method.
Tags
Return values
array<string|int, CSPlugin> —array of CSPlugin objects matching the defined plugin criteria
getPluginsInModule()
Returns all CSPlugins for the current plugin type which are defined within the given module It should be used to get all matching plugins for a given plugin api.
public
static getPluginsInModule(string $moduleName, string $pluginApiPath[, mixed $sFileNamePattern = '' ][, mixed $arguments = NULL ]) : array<string|int, mixed>
Parameters
- $moduleName : string
-
the module which should be searched for plugins
- $pluginApiPath : string
-
the relative path in filesystem for the requested plugin api.
- $sFileNamePattern : mixed = ''
- $arguments : mixed = NULL
-
one ore multiple arguments which should be passed to the isAvailable method.
Tags
Return values
array<string|int, mixed> —of CSPlugin objects matching the defined plugin criterias
getPreferences()
Returns the CSWidgetPreferences of the current widget
public
final getPreferences() : CSWidgetPreferences
Tags
Return values
CSWidgetPreferences —getPreferenceValue()
Retrieve the value of a named preference field of a Widget.
public
getPreferenceValue(string $name[, mixed $default = '' ]) : mixed
As preference values can have different types, this method returns either the target value in its own format (e.g. a boolean value), or an empty text value if the preference has not been set and no default value is supplied or if $name is not a key for an existing preference field. This method will never return NULL or FALSE in those cases.
Parameters
- $name : string
-
key of the preference field
- $default : mixed = ''
-
use this value of no value has been configured yet (optional)
Tags
Return values
mixed —value of named preference or empty when missing or not set
getPreferredStaticHeight()
Returns the desired fixed height of the widget or null, if it should be calculated dynamically.
public
getPreferredStaticHeight() : int
Extend to define default Widget dimensons
Tags
Return values
int —the wished height
getRegistryValue()
Enter description here .
public
final getRegistryValue(string $context, string $key[, string $default = '' ]) : mixed
..
Parameters
- $context : string
- $key : string
- $default : string = ''
Tags
Return values
mixed —getRequest()
Retrieve current CSPortalGuiWidgetRequest object of a Widget
public
final getRequest() : CSPortalGuiWidgetRequest
Tags
Return values
CSPortalGuiWidgetRequest —getRequestValue()
Retrieve value from Widget request (e.g. from load, reload, navigate)
public
getRequestValue(string $name[, mixed $default = '' ]) : mixed
Parameters
- $name : string
-
key of request fielde
- $default : mixed = ''
-
value returned when no request value is available (optional)
Tags
Return values
mixed —content of named request field, optional default value or empty
getSessionValue()
Retrieve the named value of a Widget session
public
getSessionValue(string $name[, mixed $default = null ]) : mixed
Parameters
- $name : string
-
key of session value to retrieve
- $default : mixed = null
-
return this value if session value is empty (optional)
Tags
Return values
mixed —value of named session attribute empty when missing
getSubmitForm()
Retrieve the current Widget form.
public
getSubmitForm() : CSPortalGuiForm
It is required to do a CSWidget::setSubmitForm or a CSWidget::addEditModeButton with the second parameter set to true first.
Tags
Return values
CSPortalGuiForm —if set CSPortal API for form in use is returned, null otherwise
getSuiteName()
Retrieves the Suite the widget is located within e.g. for current license checks
public
getSuiteName() : string
Tags
Return values
string —the name of the Suite the plugin is guessed to belong to
getWidgetFolder()
Returns the relative path to the folder, the current widget is placed within.
public
static getWidgetFolder() : string
Tags
Return values
string —the path to the widgets folder
getWidgetSubFolder()
Retrieve folder that contains Widget files
public
getWidgetSubFolder() : string
Tags
Return values
string —hasRight()
Returns whether the current user has a given right on this widget.
public
hasRight(string $sRightName[, string $sModuleName = 'portal' ]) : bool
Parameters
- $sRightName : string
-
The requested right.
- $sModuleName : string = 'portal'
-
The name of the module from the right (default is portal).
Tags
Return values
bool —Whether the user has the given right.
hasWriteRight()
Returns whether the current user has the default write right on this widget
public
hasWriteRight() : bool
Tags
Return values
bool —whether the user may write in this widget
includeFile()
Includes a file containing this widget with $this
public
final includeFile(string $file) : void
Parameters
- $file : string
Tags
Return values
void —initForDisplay()
Is called by framework to initialize necessary parts of the widget for display request
public
initForDisplay() : void
Tags
Return values
void —isAvailable()
This method is called to check, whether the plugin is available.
public
isAvailable() : bool
If further arguments are added to the CSPlugin::getPlugins call, they are added as arguments to this method.
For simpler usage of the plugin concept: This method should be overwritten with the correct signature for a plugin call, if arguments are passed.
Tags
Return values
bool —whether the plugin is available for the given arguments
makeHtml()
Returns the HTML representation of the current widget Extend with care as call of Widget functions from JavaScript or Bookmarking support are handled here.
public
makeHtml([string $navigationID = '' ][, string $subRequestID = '' ]) : string
Parameters
- $navigationID : string = ''
-
the ID of the current navigation element (optional)
- $subRequestID : string = ''
-
the ID of the current subRequest, if given (optional)
Tags
Return values
string —the html representation of the current request
makeUWAHtml()
Request creation of UWA conform XML
public
final makeUWAHtml() : string
Tags
Return values
string —UWA XML
onNavigationChange()
This method is called, if the user navigates to a different navigationID
public
onNavigationChange(string $oldNavigationID, string $newNavigationID) : void
Parameters
- $oldNavigationID : string
-
the displayed navigationID of the Frontend
- $newNavigationID : string
-
the new requested navigationID
Tags
Return values
void —onSearch()
Executes a global search on the widget
public
onSearch(string $searchWord[, string $navigationID = '' ][, string $subRequestID = '' ]) : string
The search count should be set using the widgets requests setSearchResultCount method
Parameters
- $searchWord : string
-
the word which is searched
- $navigationID : string = ''
-
the ID of the current navigation element (optional)
- $subRequestID : string = ''
-
the ID of the current subRequest, if given (optional)
Tags
Return values
string —the result of the search as HTML
prepareLicenses()
Extend to add Widget preferences {@see CSWidgetPreferences}
public
prepareLicenses(CSWidgetLicenses $licenses) : void
Parameters
- $licenses : CSWidgetLicenses
Tags
Return values
void —resetLoadedPlugins()
reset the internal plugins cache for loaded plugins
public
static resetLoadedPlugins() : mixed
Tags
Return values
mixed —setEditMode()
Enter description here .
public
setEditMode([string $editType = '' ][, string $editMode = 'view' ]) : void
..
Parameters
- $editType : string = ''
- $editMode : string = 'view'
Tags
Return values
void —setNavigationLabel()
Set Label in Navigation
public
final static setNavigationLabel(string $label) : void
Parameters
- $label : string
Tags
Return values
void —setRegistryValue()
Enter description here .
public
final setRegistryValue(string $context, string $key, string $value) : Registry
..
Parameters
- $context : string
- $key : string
- $value : string
Tags
Return values
Registry —setSessionValue()
Set a session value that stays available as long as the browser window stays open. Use an empty value to unset an existing session value.
public
setSessionValue(string $name[, mixed $value = '' ]) : void
Parameters
- $name : string
-
key of session value to set
- $value : mixed = ''
-
value of session attribute
Tags
Return values
void —setSubmitForm()
Creates a Widget form with basic operations already set.
public
setSubmitForm([string $navigationID = '' ][, string $params = '' ][, mixed $submitFormObject = null ]) : CSPortalGuiForm
This method returns a CSPortalGuiForm object that is already set up with a target navigation ID and action parameters, a hidden field named "csNewFrame" and the definition that this form will be send via an AJAX-Request. It does not create input fields or the submit button.
Parameters
- $navigationID : string = ''
-
target Widget navigation, false will remove the form from being processed in the Widget (optional)
- $params : string = ''
-
additional get parameters of the form action (optional)
- $submitFormObject : mixed = null
-
eigher a CSPortalGuiEditor or a CSPortalGuiForm component, to which the submit or null to create a default CSPortalGuiForm
Tags
Return values
CSPortalGuiForm —API object of form
translate()
Translates a word with the CONTENTSERV Dictionary
public
translate(mixed $word[, string $language = '' ][, array<string|int, mixed> $alternatives = array() ]) : string
Parameters
- $word : mixed
- $language : string = ''
-
optional language to use for the translation
- $alternatives : array<string|int, mixed> = array()
-
optional alternative words which are tried, if the first word failed. If no alternative matches, the key of the last alternative is returned.
Tags
Return values
string —the translated word
