LiveWhale CMS

Welcome, Guest Login

Support Center

Handlers

Last Updated: Jul 20, 2016 10:50AM PDT

LiveWhale offers a rich set of handlers that give you the ability to insert your code into LiveWhale’s process. Additionally, you can create your own handlers and register them globally.

If you add any custom handlers to your applications and wish to trigger them or want to trigger LiveWhale’s handlers from within your code, use the following:

// to call all handlers of a specific type
// $scope : string, 'application', 'data' or 'widget'
// $handlerName : string name of the handler, e.g. 'onLoad'
// $params : associative array of parameters [optional]
 
$_LW->callHandlersByType($scope, $handlerName, $params);

// or to call a specific module's handler directly
// $moduleName : string name of the module

$_LW->callHandler($scope, $moduleName, $handlerName, $params);

The following list covers all the existing handlers that ship with LiveWhale as of the current version.

Scope Name Description Frontend Backend Arguments
application onLoad The module was loaded. X X  
application onBeforeOutput Filters an entire page's contents at runtime (before widgets parsed). X X $buffer
application onOutput Filters an entire page's contents at runtime (after widgets parsed). X X $buffer
application onOutputRSS Filters an entire RSS feed's contents at runtime. X   $buffer
application onOutputICAL Filters an entire ICAL feed's contents at runtime. X   $buffer
application onOutputJSON Filters an entire JSON feed's contents at runtime. X   $buffer
application onLaunch An application was launched. X X  
application onBeforeLogin Fires before a user login.   X $username
application onAfterLogin Fires after a user login. All data module logins are complete.   X $username
application onLoginSuccess A user login was successful.   X $username
application onLoginFailure A user login failed.   X $username
application onLogout A user is logging out.   X $username
application onSession A user's login session has begun, either by login or group switch.   X $username, $group
application onBeforePagesSaveFilter Filters an entire page's contents before saving. X X $buffer
application onBeforePagesSaveFilterElement Filters each page's editable elements before saving. X   $buffer
application onManager A manager was loaded.   X $type, $page
application onManagerSubmit A manager was submitted.   X $type, $page
application onManagerQuery A manager's database query before execution.   X $manager,$query
application onBeforeValidate Fires before an item is validated.   X $type, $page, $id
application onValidateSuccess An item was successfully validated.   X $type, $page, $id
application onValidateFailure An item was not successfully validated.   X $type, $page, $id
application onAfterValidate Fires after an item is successfully or non-successfully validated.   X $type, $page, $id
application onEditorSubmit An editor was submitted after successful validation.   X $type, $page, $id
application onAfterEdit Fires after an item is retrieved for its editor.   X $type, $page, $id
application onEditor An editor was loaded.   X $type, $page, $id
application onBeforeSave Fires before an item is saved.   X $type, $id
application onSaveSuccess An item was successfully saved.   X $type, $id
application onSaveFailure An item was not saved successfully.   X $type, $id
application onAfterSave Fires after an item is successfully or unsuccessfully saved.   X $type, $id
application onAfterUpdate An item was saved either from an editor or manager. (Occurs before onAfterSave and is called for every instance of a repeating event.)   X $type, $id
application onAfterCreate A new item was saved. (Occurs before onAfterSave and is called for every instance of a repeating event.)   X $type, $id
application onAfterPublicSubmission An item was submitted from the public. (Occurs after onAfterCreate.) X   $type, $id
application onBeforeSync Fires immediately before an item is created or updated that originates from a synced source. (At present, $type may only be 'events'.)   X $type, $id, $fields
application onAfterSyncCreate Fires immediately after an item has been created from a synced source. (At present, $type may only be 'events'.)   X $type, $id
application onAfterSyncUpdate Fires immediately after an item has been updated from a synced source. (At present, $type may only be 'events'.)   X $type, $id
application onBeforeDelete Fires before an item is deleted.   X $type, $id
application onAfterDelete Fires after an item is deleted.   X $type, $id
application onAfterShareAccept An item was copied.   X $type, $ids, $mode
application onAfterShareReject An item was rejected.   X $type, $id
application onBeforeRedirect Fires before a redirect is handled. X    
application onAfterRedirect Fires after a redirect is handled and no match was found, but before returning a 404. X    
application onTabs The tabs for the management interface are configured.   X $tabs
application onSubnavs The subnavs for the active tab are created.   X $type, $subnavs
application onFormsOutput A DOM object of the form immediately prior to output. X   $xml
application onFormsSubmission A form created in the forms module was submitted. X   $id
application onTransform Transforms a widget before converted from an XML object to XHTML. X   $type, $xml
application onWidgetFormat The widget variables are about to be displayed.

Note:
1) You can use onWidgetFormat[Type]($handler, $buffer) instead of onWidgetFormat($type, $handler, $buffer) if you’re targeting just one type of widget  

2) always opt to use the type specific one over the non-type-specific one when possible.
X   $type, $handler,$variables
application onWidgetLoad A DOM object of the widget, prior to parsing. X   $xml
application onWidgetConfig The widget's config, prior to loading in the widget editor.   X $widget, $config
application onRegisterEventSuccess

This is to target something explicitly

  X

$id, $post

application onManagerFormatResults

This formats individual results instead of the format arg for the entire manager.

  X $type, $page
data onLoad The module was loaded. X X  
data onActivate An interface for the module was activated.   X $page_left, $page_requested
data onLogin A user logged in.   X  
data onLogout A user is logging out.   X  
data onSession A user's login session has begun, by login or group switch.   X  
data onSearch Outputs search results for the module.   X  
data onReport Outputs report results for the module.   X  
data onManager A manager was loaded.   X  
data onManagerSubmit A manager was submitted.   X  
data onValidate Validate's an item being saved.   X  
data onEditorSubmit An editor was submitted after successful validation.   X  
data onEdit Retrieves data for an item's editor.   X  
data onEditor An editor was loaded.   X  
data onSave Saves an item.   X  
data onBeforeSave Fires before an item is saved.   X $type, $id
data onSaveSuccess An item was successfully saved.   X  
data onSaveFailure An item was not saved successfully.   X  
data onUpdate An item was updated either by an editor or manager save.   X $id
data onCreate A new item was saved.   X $id
data onDelete Performs additional deletions for the item being deleted.   X $id
data onShareAccept Copies a shared item.   X $ids, $mode
data onShareReject Rejects a shared item.   X $id
data onTabs The tabs for the management interface are configured.   X $tabs
data onSubnavs The subnavs for the active tab are created.   X $type, $subnavs
data onDiagnostics Diagnostic checks are performed for the module.   X  
widget onLoad The module was loaded. X    
widget onDisplay Displays a widget. X    
widget onTransform Transforms a widget before converted from an XML object to XHTML. X   $xml
widget onWhere Creates additional where clauses for a widget. X    
widget onJSON Outputs a widget list in JSON. X    
widget onDetails Formats an item's details page. X   $xphp, $args
widget onRSS Outputs an RSS feed. X    
widget onICAL Outputs an iCAL feed. X    
widget onFetch Outputs an item's details in JSON. X   $id
eb8f96c071020d8b0923da726d6cab65@livewhale.desk-mail.com
https://cdn.desk.com/
false
desk
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete?b_id=4256