System Events Fired in the MODX Code

This list of MODX System Events shows the file(s) they occur in, and the variables sent to each event. Events appear more than once in the list because they are fired in multiple places.

Use the alphabetized links below to jump to a particular event. Scroll up to see the file in which the event is fired.

The first three events are called using a variable for the event name. The first one, in the modTemplateVar class, represents either OnTVOutputRenderList or OnTVInputRenderList — the variables are the same for both events. The other two are in the user/update processor. They represent one of the four following events: OnBeforeUserActivate, OnUserActivate, OnBeforeUserDeactivate, OnUserDeactivate — the variables are the same for all four events.



$event
$event
$event
$this
$this
$this
$this
$this
$this
$this
OnBeforeCacheUpdate
OnBeforeCacheUpdate
OnBeforeDocFormDelete
OnBeforeDocFormSave
OnBeforeEmptyTrash
OnBeforeEmptyTrash
OnBeforeManagerPageInit
OnBeforeManagerPageInit
OnBeforeRegisterClientScripts
OnBeforeResourceGroupRemove
OnBeforeSaveWebPageCache
OnBeforeUserActivate
OnBeforeUserDeactivate
OnCacheUpdate
OnCacheUpdate
OnCategoryBeforeRemove
OnCategoryBeforeSave
OnCategoryRemove
OnCategorySave
OnChunkBeforeRemove
OnChunkBeforeSave
OnChunkFormPrerender
OnChunkFormPrerender
OnChunkFormRender
OnChunkFormRender
OnChunkRemove
OnChunkSave
OnContextBeforeRemove
OnContextBeforeSave
OnContextFormPrerender
OnContextFormRender
OnContextRemove
OnContextSave
OnContextUpdate
OnContextUpdate
OnDocFormDelete
OnDocFormPrerender
OnDocFormRender
OnDocFormSave
OnDocPublished
OnDocUnPublished
OnElementNotFound
OnEmptyTrash
OnEmptyTrash
OnFileCreateFormPrerender
OnFileEditFormPrerender
OnFileManagerBeforeUpload
OnFileManagerDirCreate
OnFileManagerDirRemove
OnFileManagerDirRename
OnFileManagerFileCreate
OnFileManagerFileRemove
OnFileManagerFileRename
OnFileManagerFileUpdate
OnFileManagerMoveObject
OnFileManagerUpload
OnFileManagerUpload
OnHandleRequest
OnHandleRequest
OnInitCulture
OnLoadWebDocument
OnLoadWebPageCache
OnManagerLoginFormPrerender
OnManagerLoginFormRender
OnManagerPageAfterRender
OnManagerPageBeforeRender
OnManagerPageInit
OnMediaSourceDuplicate
OnMediaSourceGetProperties
OnPageNotFound
OnPageUnauthorized
OnParseDocument
OnParseDocument
OnPluginBeforeRemove
OnPluginBeforeSave
OnPluginEventBeforeRemove
OnPluginEventBeforeSave
OnPluginEventRemove
OnPluginEventSave
OnPluginFormPrerender
OnPluginFormPrerender
OnPluginFormRender
OnPluginFormRender
OnPluginRemove
OnPluginSave
OnPropertySetBeforeRemove
OnPropertySetBeforeSave
OnPropertySetRemove
OnPropertySetSave
OnResourceAddToResourceGroup
OnResourceAddToResourceGroup
OnResourceAutoPublish
OnResourceBeforeSort
OnResourceCacheUpdate
OnResourceDelete
OnResourceDelete
OnResourceDuplicate
OnResourceGroupBeforeSave
OnResourceGroupRemove
OnResourceGroupSave
OnResourceRemoveFromResourceGroup
OnResourceRemoveFromResourceGroup
OnResourceRemoveFromResourceGroup
OnResourceSort
OnResourceTVFormPrerender
OnResourceTVFormRender
OnResourceToolbarLoad
OnResourceUndelete
OnResourceUndelete
OnResourceUndelete
OnRichTextBrowserInit
OnRichTextEditorInit
OnRichTextEditorInit
OnRichTextEditorInit
OnRichTextEditorInit
OnRichTextEditorRegister
OnRichTextEditorRegister
OnSiteRefresh
OnSiteRefresh
OnSiteSettingsRender
OnSnipFormPrerender
OnSnipFormPrerender
OnSnipFormRender
OnSnipFormRender
OnSnippetBeforeRemove
OnSnippetBeforeSave
OnSnippetRemove
OnSnippetSave
OnTVFormPrerender
OnTVFormPrerender
OnTVFormRender
OnTVFormRender
OnTVInputRenderList
OnTVOutputRenderList
OnTempFormPrerender
OnTempFormPrerender
OnTempFormRender
OnTempFormRender
OnTemplateBeforeRemove
OnTemplateBeforeSave
OnTemplateRemove
OnTemplateSave
OnTemplateVarBeforeRemove
OnTemplateVarBeforeSave
OnTemplateVarRemove
OnTemplateVarSave
OnUserActivate
OnUserAddToGroup
OnUserAddToGroup
OnUserAddToGroup
OnUserAddToGroup
OnUserAddToGroup
OnUserBeforeAddToGroup
OnUserBeforeAddToGroup
OnUserBeforeAddToGroup
OnUserBeforeAddToGroup
OnUserBeforeAddToGroup
OnUserBeforeRemove
OnUserBeforeRemoveFromGroup
OnUserBeforeSave
OnUserChangePassword
OnUserDeactivate
OnUserFormPrerender
OnUserFormPrerender
OnUserFormRender
OnUserFormRender
OnUserGroupBeforeRemove
OnUserGroupBeforeSave
OnUserGroupRemove
OnUserGroupSave
OnUserNotFound
OnUserProfileBeforeRemove
OnUserProfileBeforeSave
OnUserProfileRemove
OnUserProfileSave
OnUserRemove
OnUserRemoveFromGroup
OnUserSave
OnWebPageComplete
OnWebPageInit
OnWebPagePrerender
OnWebPagePrerender
name
name
name
name
name
name
name
name
name
name
name
name
name
name
name
name
name
name
name
name
name
name
name
namn
nombre
nome
nome
název
név

core/lexicon/sv/events.inc.php

    Event: namn
    Variables: attribut).';

Back to Top

core/lexicon/zh/events.inc.php

    Event: name
    Variables: properties) call.';

Back to Top

core/lexicon/he/events.inc.php

    Event: name
    Variables: properties) call.';

Back to Top

core/lexicon/id/events.inc.php

    Event: name
    Variables: properties).';

Back to Top

core/lexicon/et/events.inc.php

    Event: name
    Variables: properties) call.';

Back to Top

core/lexicon/ja/events.inc.php

    Event: name
    Variables: properties) call.';

Back to Top

core/lexicon/hu/events.inc.php

    Event: név
    Variables: tulajdonságok) formában hívhat meg.';

Back to Top

core/lexicon/ar/events.inc.php

    Event: name
    Variables: properties).';

Back to Top

core/lexicon/ro/events.inc.php

    Event: name
    Variables: properties) call.';

Back to Top

core/lexicon/es/events.inc.php

    Event: nombre
    Variables: propiedades).';

Back to Top

core/lexicon/pl/events.inc.php

    Event: name
    Variables: properties) call.';

Back to Top

core/lexicon/sl/events.inc.php

    Event: name
    Variables: properties) call.';

Back to Top

core/lexicon/fr/events.inc.php

    Event: name
    Variables: properties)';

Back to Top

core/lexicon/yo/events.inc.php

    Event: name
    Variables: properties) call.';

Back to Top

core/lexicon/fa/events.inc.php

    Event: name
    Variables: properties) call.';

Back to Top

core/lexicon/cs/events.inc.php

    Event: název
    Variables: vlastnosti).';

Back to Top

core/lexicon/be/events.inc.php

    Event: name
    Variables: properties).';

Back to Top

core/lexicon/pt-br/events.inc.php

    Event: nome
    Variables: Propriedades).';

Back to Top

core/lexicon/th/events.inc.php

    Event: name
    Variables: properties) call.';

Back to Top

core/lexicon/da/events.inc.php

    Event: name
    Variables: properties) call.';

Back to Top

core/lexicon/pt/events.inc.php

    Event: nome
    Variables: Propriedades).';

Back to Top

core/lexicon/hi/events.inc.php

    Event: name
    Variables: properties) कॉल में उपयोग करना चाहिए ';

Back to Top

core/lexicon/de/events.inc.php

    Event: name
    Variables: properties) benutzen können.';

Back to Top

core/lexicon/el/events.inc.php

    Event: name
    Variables: properties) call.';

Back to Top

core/lexicon/nl/events.inc.php

    Event: name
    Variables: properties) aanroep.';

Back to Top

core/lexicon/bg/events.inc.php

    Event: name
    Variables: properties) call.';

Back to Top

core/lexicon/en/events.inc.php

    Event: name
    Variables: properties) call.';

Back to Top

core/lexicon/fi/events.inc.php

    Event: name
    Variables: properties) call.';

Back to Top

core/lexicon/it/events.inc.php

    Event: name
    Variables: properties) .';

Back to Top

core/model/modx/modcategory.class.php

    Event: OnCategoryBeforeSave
    Variables: array(
        'mode' => $isNew ? modSystemEvent::MODE_NEW : modSystemEvent::MODE_UPD,
        'category' => &$this,
        'cacheFlag' => $cacheFlag,
    );

    Event: OnCategorySave
    Variables: array(
        'mode' => $isNew ? modSystemEvent::MODE_NEW : modSystemEvent::MODE_UPD,
        'category' => &$this,
        'cacheFlag' => $cacheFlag,
    );

    Event: OnCategoryBeforeRemove
    Variables: array(
        'category' => &$this,
        'ancestors' => $ancestors,
    );

    Event: OnCategoryRemove
    Variables: array(
        'category' => &$this,
        'ancestors' => $ancestors,
    );

Back to Top

core/model/modx/modmanagercontroller.class.php

    Event: OnBeforeManagerPageInit
    Variables: array(
        'action' => $this->config,
    );

    Event: OnManagerPageBeforeRender
    Variables: array('controller' => &$this));

    Event: OnManagerPageAfterRender
    Variables: array('controller' => &$this));

Back to Top

core/model/modx/modresource.class.php

    Event: OnResourceCacheUpdate
    Variables: array('id' => $this->get('id')));

Back to Top

core/model/modx/modmanagercontrollerdeprecated.class.php

    Event: OnBeforeManagerPageInit
    Variables: array(
        'action' => $this->config,
        'filename' => $f,
    );

Back to Top

core/model/modx/modusergroup.class.php

    Event: OnUserGroupBeforeSave
    Variables: array(
        'mode' => $isNew ? modSystemEvent::MODE_NEW : modSystemEvent::MODE_UPD,
        'usergroup' => &$this,
        'cacheFlag' => $cacheFlag,
    );

    Event: OnUserGroupSave
    Variables: array(
        'mode' => $isNew ? modSystemEvent::MODE_NEW : modSystemEvent::MODE_UPD,
        'usergroup' => &$this,
        'cacheFlag' => $cacheFlag,
    );

    Event: OnUserGroupBeforeRemove
    Variables: array(
        'usergroup' => &$this,
        'ancestors' => $ancestors,
    );

    Event: OnUserGroupRemove
    Variables: array(
        'usergroup' => &$this,
        'ancestors' => $ancestors,
    );

Back to Top

core/model/modx/modresourcegroup.class.php

    Event: OnResourceGroupBeforeSave
    Variables: array(
        'mode' => $isNew ? modSystemEvent::MODE_NEW : modSystemEvent::MODE_UPD,
        'resourceGroup' => &$this,
        'cacheFlag' => $cacheFlag,
    );

    Event: OnResourceGroupSave
    Variables: array(
        'mode' => $isNew ? modSystemEvent::MODE_NEW : modSystemEvent::MODE_UPD,
        'resourceGroup' => &$this,
        'cacheFlag' => $cacheFlag,
    );

    Event: OnBeforeResourceGroupRemove
    Variables: array(
        'resourceGroup' => &$this,
        'ancestors' => $ancestors,
    );

    Event: OnResourceGroupRemove
    Variables: array(
        'resourceGroup' => &$this,
        'ancestors' => $ancestors,
    );

Back to Top

core/model/modx/modsnippet.class.php

    Event: OnSnippetBeforeSave
    Variables: array(
        'mode' => $isNew ? modSystemEvent::MODE_NEW : modSystemEvent::MODE_UPD,
        'snippet' => &$this,
        'cacheFlag' => $cacheFlag,
    );

    Event: OnSnippetSave
    Variables: array(
        'mode' => $isNew ? modSystemEvent::MODE_NEW : modSystemEvent::MODE_UPD,
        'snippet' => &$this,
        'cacheFlag' => $cacheFlag,
    );

    Event: OnSnippetBeforeRemove
    Variables: array(
        'snippet' => &$this,
        'ancestors' => $ancestors,
    );

    Event: OnSnippetRemove
    Variables: array(
        'snippet' => &$this,
        'ancestors' => $ancestors,
    );

Back to Top

core/model/modx/modcachemanager.class.php

    Event: OnCacheUpdate
    Variables: array(
        'results' => $results,
        'paths' => $providers,
        'options' => array_values($providers),
    );

    Event: OnResourceAutoPublish
    Variables: array(
        'results' => $publishingResults
    );

    Event: OnCacheUpdate
    Variables: array(
        'results' => $results,
        'paths' => $paths,
        'options' => $options,
    );

Back to Top

core/model/modx/modrequest.class.php

    Event: OnHandleRequest
    Variables: None

    Event: OnWebPageInit
    Variables: None

    Event: OnLoadWebDocument
    Variables: None

    Event: OnLoadWebPageCache
    Variables: array(
        'resource' => &$resource,
    );

Back to Top

core/model/modx/modchunk.class.php

    Event: OnChunkBeforeSave
    Variables: array(
        'mode' => $isNew ? modSystemEvent::MODE_NEW : modSystemEvent::MODE_UPD,
        'chunk' => &$this,
        'cacheFlag' => $cacheFlag,
    );

    Event: OnChunkSave
    Variables: array(
        'mode' => $isNew ? modSystemEvent::MODE_NEW : modSystemEvent::MODE_UPD,
        'chunk' => &$this,
        'cacheFlag' => $cacheFlag,
    );

    Event: OnChunkBeforeRemove
    Variables: array(
        'chunk' => &$this,
        'ancestors' => $ancestors,
    );

    Event: OnChunkRemove
    Variables: array(
        'chunk' => &$this,
        'ancestors' => $ancestors,
    );

Back to Top

core/model/modx/modresponse.class.php

    Event: OnBeforeRegisterClientScripts
    Variables: None

    Event: OnWebPagePrerender
    Variables: None

    Event: OnWebPagePrerender
    Variables: None

Back to Top

core/model/modx/processors/system/clearcache.class.php

    Event: OnSiteRefresh
    Variables: array(
        'results' => $results,
        'partitions' => $partitions,
    );

    Event: OnBeforeCacheUpdate
    Variables: None

Back to Top

core/model/modx/processors/system/rte/getlist.class.php

    Event: OnRichTextEditorRegister
    Variables: None

Back to Top

core/model/modx/processors/source/duplicate.class.php

    Event: OnMediaSourceDuplicate
    Variables: array(
        'newResource' => &$this->newObject,
        'oldResource' => &$this->object,
        'newName' => $this->getProperty($this->nameField,''),
    );

Back to Top

core/model/modx/processors/resource/publish.class.php

    Event: OnDocPublished
    Variables: array(
        'docid' => $this->resource->get('id'),
        'id' => $this->resource->get('id'),
        'resource' => &$this->resource,
    );

Back to Top

core/model/modx/processors/resource/gettoolbar.class.php

    Event: OnResourceToolbarLoad
    Variables: array(
        'items' => &$items,
    );

Back to Top

core/model/modx/processors/resource/sort.class.php

    Event: OnResourceBeforeSort
    Variables: array(
        'nodes' => &$this->nodes,
        'contexts' => &$this->contexts,
    );

    Event: OnResourceSort
    Variables: array(
        'nodes' => &$this->nodes,
        'nodesAffected' => &$this->nodesAffected,
        'contexts' => &$this->contexts,
        'contextsAffected' => &$this->contextsAffected,
        'modifiedNodes' => &$this->nodesAffected, /* backward compat */
    );

Back to Top

core/model/modx/processors/resource/delete.class.php

    Event: OnBeforeDocFormDelete
    Variables: array (
        'id' => $this->resource->get('id'),
        'resource' => &$this->resource,
        'children' => $childrenIds,
    );

    Event: OnDocFormDelete
    Variables: array (
        'id' => $this->resource->get('id'),
        'children' => $childrenIds,
        'resource' => &$this->resource,
    );

    Event: OnResourceDelete
    Variables: array(
        'id' => $this->resource->get('id'),
        'children' => &$childrenIds,
        'resource' => &$this->resource,
    );

Back to Top

core/model/modx/processors/resource/emptyrecyclebin.class.php

    Event: OnBeforeEmptyTrash
    Variables: array(
        'ids' => &$ids,
        'resources' => &$resources,
    );

    Event: OnEmptyTrash
    Variables: array(
        'num_deleted' => $count,
        'resources' => &$resources,
        'ids' => &$ids,
    );

Back to Top

core/model/modx/processors/resource/duplicate.class.php

    Event: OnResourceDuplicate
    Variables: array(
        'newResource' => &$this->newResource,
        'oldResource' => &$this->oldResource,
        'newName' => $this->getProperty('name',''),
        'duplicateChildren' => $this->getProperty('duplicate_children',false),
        'prefixDuplicate' => $this->getProperty('prefixDuplicate',false),
        'publishedMode' => $this->getProperty('published_mode','preserve'),
    );

Back to Top

core/model/modx/processors/resource/create.class.php

    Event: OnBeforeDocFormSave
    Variables: array(
        'mode' => modSystemEvent::MODE_NEW,
        'id' => 0,
        'resource' => &$this->object,
        'reloadOnly' => $this->getProperty('reloadOnly',false),
    );

    Event: OnResourceAddToResourceGroup
    Variables: array(
        'mode' => 'resource-create',
        'resource' => &$this->object,
        'resourceGroup' => &$resourceGroup,
    );

    Event: OnResourceRemoveFromResourceGroup
    Variables: array(
        'mode' => 'resource-create',
        'resource' => &$this->object,
        'resourceGroup' => &$resourceGroup,
    );

    Event: OnDocFormSave
    Variables: array(
        'mode' => modSystemEvent::MODE_NEW,
        'id' => $this->object->get('id'),
        'resource' => &$this->object,
        'reloadOnly' => $this->getProperty('reloadOnly',false),
    );

Back to Top

core/model/modx/processors/resource/trash/purge.class.php

    Event: OnBeforeEmptyTrash
    Variables: array(
        'ids' => &$this->ids,
        'resources' => &$this->resources,
    );

    Event: OnEmptyTrash
    Variables: array(
        'num_deleted' => count($success),
        'resources' => &$this->resources,
        'ids' => &$success,
    );

Back to Top

core/model/modx/processors/resource/trash/restore.class.php

    Event: OnResourceUndelete
    Variables: array(
        'id' => $resource->get('id'),
        'resource' => &$resource,
    );

Back to Top

core/model/modx/processors/resource/update.class.php

    Event: OnResourceAddToResourceGroup
    Variables: array(
        'mode' => 'resource-update',
        'resource' => &$this->object,
        'resourceGroup' => &$resourceGroup,
    );

    Event: OnResourceRemoveFromResourceGroup
    Variables: array(
        'mode' => 'resource-update',
        'resource' => &$this->object,
        'resourceGroup' => &$resourceGroup,
    );

    Event: OnResourceUndelete
    Variables: array(
        'id' => $this->object->get('id'),
        'resource' => &$this->object,
    );

    Event: OnResourceDelete
    Variables: array(
        'id' => $this->object->get('id'),
        'resource' => &$this->object,
    );

Back to Top

core/model/modx/processors/resource/undelete.class.php

    Event: OnResourceUndelete
    Variables: array(
        'id' => $this->resource->get('id'),
        'resource' => &$this->resource,
    );

Back to Top

core/model/modx/processors/resource/unpublish.class.php

    Event: OnDocUnPublished
    Variables: array(
        'docid' => $this->resource->get('id'),
        'id' => $this->resource->get('id'),
        'resource' => &$this->resource,
    );

Back to Top

core/model/modx/processors/context/updatefromgrid.class.php

    Event: OnContextUpdate
    Variables: array(
        'context' => &$this->context,
        'properties' => $this->getProperties(),
    );

Back to Top

core/model/modx/processors/context/update.class.php

    Event: OnContextUpdate
    Variables: array(
        'context' => &$this->object,
        'properties' => $this->getProperties(),
    );

Back to Top

core/model/modx/processors/security/group/removeuser.php

    Event: OnUserBeforeRemoveFromGroup
    Variables: array(
        'user' => &$user,
        'usergroup' => &$usergroup,
        'membership' => &$membership,
    );

    Event: OnUserRemoveFromGroup
    Variables: array(
        'user' => &$user,
        'usergroup' => &$usergroup,
        'membership' => &$membership,
    );

Back to Top

core/model/modx/processors/security/group/user/create.class.php

    Event: OnUserBeforeAddToGroup
    Variables: array(
        'user' => &$this->user,
        'usergroup' => &$this->userGroup,
        'membership' => &$membership,
    );

    Event: OnUserAddToGroup
    Variables: array(
        'user' => &$this->user,
        'usergroup' => &$this->userGroup,
        'membership' => &$membership,
    );

Back to Top

core/model/modx/processors/security/group/update.class.php

    Event: OnUserBeforeAddToGroup
    Variables: array(
        'user' => &$user,
        'usergroup' => &$this->object,
        'membership' => &$membership,
    );

    Event: OnUserAddToGroup
    Variables: array(
        'user' => &$user,
        'usergroup' => &$this->object,
        'membership' => &$membership,
    );

Back to Top

core/model/modx/processors/security/group/adduser.php

    Event: OnUserBeforeAddToGroup
    Variables: array(
        'user' => &$user,
        'usergroup' => &$usergroup,
        'membership' => &$membership,
    );

    Event: OnUserAddToGroup
    Variables: array(
        'user' => &$user,
        'usergroup' => &$usergroup,
        'membership' => &$membership,
    );

Back to Top

core/model/modx/processors/security/resourcegroup/updateresourcesin.class.php

    Event: $this
    Variables: array(
        'mode' => 'resource-group-tree-drag',
        'resource' => &$this->resource,
        'resourceGroup' => &$this->resourceGroup,
    );

Back to Top

core/model/modx/processors/security/resourcegroup/removeresource.class.php

    Event: OnResourceRemoveFromResourceGroup
    Variables: array(
        'mode' => 'resource-group-tree-remove-resource',
        'resource' => &$this->resource,
        'resourceGroup' => &$this->resourceGroup,
    );

Back to Top

core/model/modx/processors/security/login.class.php

    Event: $this
    Variables: OnBeforeManagerLogin" : "OnBeforeWebLogin", $onBeforeLoginParams

    Event: OnUserNotFound
    Variables: $OnUserNotFoundParams

    Event: $this
    Variables: OnManagerAuthentication" : "OnWebAuthentication", $loginParams

    Event: $this
    Variables: OnManagerLogin" : "OnWebLogin", $postLoginParams

Back to Top

core/model/modx/processors/security/logout.class.php

    Event: $this
    Variables: OnBeforeManagerLogout' : 'OnBeforeWebLogout', array(
        'userid' => $this->modx->user->get('id'),
        'username' => $this->modx->user->get('username'),
        'user' => &$this->modx->user,
        'loginContext' => &$this->loginContext,
        'addContexts' => &$this->addContexts
    );

    Event: $this
    Variables: OnManagerLogout' : 'OnWebLogout', array(
        'userid' => $this->modx->user->get('id'),
        'username' => $this->modx->user->get('username'),
        'user' => &$this->modx->user,
        'loginContext' => &$this->loginContext,
        'addContexts' => &$this->addContexts
    );

Back to Top

core/model/modx/processors/security/user/deactivatemultiple.class.php

    Event: OnBeforeUserDeactivate
    Variables: array(
        'id' => $userId,
        'user' => &$user,
        'mode' => 'multiple',
    );

    Event: OnUserDeactivate
    Variables: array(
        'id' => $userId,
        'user' => &$user,
        'mode' => 'multiple',
    );

Back to Top

core/model/modx/processors/security/user/activatemultiple.class.php

    Event: OnBeforeUserActivate
    Variables: array(
        'id' => $userId,
        'user' => &$user,
        'mode' => 'multiple',
    );

    Event: OnUserActivate
    Variables: array(
        'id' => $userId,
        'user' => &$user,
        'mode' => 'multiple',
    );

Back to Top

core/model/modx/processors/security/user/create.class.php

    Event: OnUserBeforeAddToGroup
    Variables: array(
        'user' => &$this->object,
        'usergroup' => &$usergroup,
        'membership' => &$membership,
    );

    Event: OnUserAddToGroup
    Variables: array(
        'user' => &$this->object,
        'usergroup' => &$usergroup,
        'membership' => &$membership,
    );

Back to Top

core/model/modx/processors/security/user/update.class.php

    Event: $event
    Variables: array(
        'id' => $this->object->get('id'),
        'user' => &$this->object,
        'mode' => modSystemEvent::MODE_UPD,
    );

    Event: OnUserBeforeAddToGroup
    Variables: array(
        'user' => &$this->object,
        'usergroup' => &$usergroup,
        'membership' => &$membership,
    );

    Event: OnUserAddToGroup
    Variables: array(
        'user' => &$this->object,
        'usergroup' => &$usergroup,
        'membership' => &$membership,
    );

    Event: $event
    Variables: array(
        'id' => $this->object->get('id'),
        'user' => &$this->object,
        'mode' => modSystemEvent::MODE_UPD,
    );

Back to Top

core/model/modx/processors/element/tv/renders/getinputproperties.class.php

    Event: $this
    Variables: array(
        'context' => $this->getProperty('context'),
    );

Back to Top

core/model/modx/processors/element/tv/renders/web/output/richtext.class.php

    Event: OnRichTextEditorInit
    Variables: array (
        'editor' => $richtexteditor,
        'elements' => $replace_richtext,
        'forfrontend' => 1,
        'width' => $w,
        'height' => $h
    );

Back to Top

core/model/modx/processors/element/tv/renders/getoutputs.class.php

    Event: OnTVOutputRenderList
    Variables: array(
        'context' => $context,
    );

Back to Top

core/model/modx/processors/element/tv/renders/getinputs.class.php

    Event: OnTVInputRenderList
    Variables: array(
        'context' => $context,
    );

Back to Top

core/model/modx/modtemplate.class.php

    Event: OnTemplateBeforeSave
    Variables: array(
        'mode' => $isNew ? modSystemEvent::MODE_NEW : modSystemEvent::MODE_UPD,
        'template' => &$this,
        'cacheFlag' => $cacheFlag,
    );

    Event: OnTemplateSave
    Variables: array(
        'mode' => $isNew ? modSystemEvent::MODE_NEW : modSystemEvent::MODE_UPD,
        'template' => &$this,
        'cacheFlag' => $cacheFlag,
    );

    Event: OnTemplateBeforeRemove
    Variables: array(
        'template' => &$this,
        'ancestors' => $ancestors,
    );

    Event: OnTemplateRemove
    Variables: array(
        'template' => &$this,
        'ancestors' => $ancestors,
    );

Back to Top

core/model/modx/moduserprofile.class.php

    Event: OnUserProfileBeforeSave
    Variables: array(
        'mode' => $isNew ? modSystemEvent::MODE_NEW : modSystemEvent::MODE_UPD,
        'userprofile' => &$this,
        'cacheFlag' => $cacheFlag,
    );

    Event: OnUserProfileSave
    Variables: array(
        'mode' => $isNew ? modSystemEvent::MODE_NEW : modSystemEvent::MODE_UPD,
        'userprofile' => &$this,
        'cacheFlag' => $cacheFlag,
    );

    Event: OnUserProfileBeforeRemove
    Variables: array(
        'userprofile' => &$this,
        'ancestors' => $ancestors,
    );

    Event: OnUserProfileRemove
    Variables: array(
        'userprofile' => &$this,
        'ancestors' => $ancestors,
    );

Back to Top

core/model/modx/modtemplatevar.class.php

    Event: OnTemplateVarBeforeSave
    Variables: array(
        'mode' => $isNew ? modSystemEvent::MODE_NEW : modSystemEvent::MODE_UPD,
        'templateVar' => &$this,
        'cacheFlag' => $cacheFlag,
    );

    Event: OnTemplateVarSave
    Variables: array(
        'mode' => $isNew ? modSystemEvent::MODE_NEW : modSystemEvent::MODE_UPD,
        'templateVar' => &$this,
        'cacheFlag' => $cacheFlag,
    );

    Event: OnTemplateVarBeforeRemove
    Variables: array(
        'templateVar' => &$this,
        'cacheFlag' => true,
    );

    Event: OnTemplateVarRemove
    Variables: array(
        'templateVar' => &$this,
        'cacheFlag' => true,
    );

    Event: $event
    Variables: array(
        'context' => $context,
    );

Back to Top

core/model/modx/modpropertyset.class.php

    Event: OnPropertySetBeforeSave
    Variables: array(
        'mode' => $isNew ? modSystemEvent::MODE_NEW : modSystemEvent::MODE_UPD,
        'propertySet' => &$this,
        'cacheFlag' => $cacheFlag,
    );

    Event: OnPropertySetSave
    Variables: array(
        'mode' => $isNew ? modSystemEvent::MODE_NEW : modSystemEvent::MODE_UPD,
        'propertySet' => &$this,
        'cacheFlag' => $cacheFlag,
    );

    Event: OnPropertySetBeforeRemove
    Variables: array(
        'propertySet' => &$this,
        'ancestors' => $ancestors,
    );

    Event: OnPropertySetRemove
    Variables: array(
        'propertySet' => &$this,
        'ancestors' => $ancestors,
    );

Back to Top

core/model/modx/modx.class.php

    Event:
    Variables: OnMODXInit', array(
        'contextKey' => $contextKey,
        'options' => $options ) );

    Event: OnPageNotFound
    Variables: $options

    Event: OnPageUnauthorized
    Variables: $options

    Event: OnInitCulture
    Variables: None

    Event: OnBeforeSaveWebPageCache
    Variables: None

    Event: OnWebPageComplete
    Variables: None

Back to Top

core/model/modx/modparser.class.php

    Event: OnParseDocument
    Variables: array('content' => &$content));

    Event: OnElementNotFound
    Variables: array('class' => $class, 'name' => $realname));

Back to Top

core/model/modx/modpluginevent.class.php

    Event: OnPluginEventBeforeSave
    Variables: array(
        'mode' => $isNew ? modSystemEvent::MODE_NEW : modSystemEvent::MODE_UPD,
        'pluginEvent' => &$this,
        'cacheFlag' => $cacheFlag,
    );

    Event: OnPluginEventSave
    Variables: array(
        'mode' => $isNew ? modSystemEvent::MODE_NEW : modSystemEvent::MODE_UPD,
        'pluginEvent' => &$this,
        'cacheFlag' => $cacheFlag,
    );

    Event: OnPluginEventBeforeRemove
    Variables: array(
        'pluginEvent' => &$this,
        'ancestors' => $ancestors,
    );

    Event: OnPluginEventRemove
    Variables: array(
        'pluginEvent' => &$this,
        'ancestors' => $ancestors,
    );

Back to Top

core/model/modx/moduser.class.php

    Event: OnUserBeforeSave
    Variables: array(
        'mode' => $isNew ? modSystemEvent::MODE_NEW : modSystemEvent::MODE_UPD,
        'user' => &$this,
        'cacheFlag' => $cacheFlag,
    );

    Event: OnUserSave
    Variables: array(
        'mode' => $isNew ? modSystemEvent::MODE_NEW : modSystemEvent::MODE_UPD,
        'user' => &$this,
        'cacheFlag' => $cacheFlag,
    );

    Event: OnUserBeforeRemove
    Variables: array(
        'user' => &$this,
        'ancestors' => $ancestors,
    );

    Event: OnUserRemove
    Variables: array(
        'user' => &$this,
        'ancestors' => $ancestors,
    );

    Event: OnUserChangePassword
    Variables: array (
        'user' => &$this,
        'newpassword' => $newPassword,
        'oldpassword' => $oldPassword,
        'userid' => $this->get('id'),/* deprecated */
        'username' => $this->get('username'),/* deprecated */
        'userpassword' => $newPassword,/* deprecated */
    );

Back to Top

core/model/modx/modplugin.class.php

    Event: OnPluginBeforeSave
    Variables: array(
        'mode' => $isNew ? modSystemEvent::MODE_NEW : modSystemEvent::MODE_UPD,
        'plugin' => &$this,
        'cacheFlag' => $cacheFlag,
    );

    Event: OnPluginSave
    Variables: array(
        'mode' => $isNew ? modSystemEvent::MODE_NEW : modSystemEvent::MODE_UPD,
        'plugin' => &$this,
        'cacheFlag' => $cacheFlag,
    );

    Event: OnPluginBeforeRemove
    Variables: array(
        'plugin' => &$this,
        'ancestors' => $ancestors,
    );

    Event: OnPluginRemove
    Variables: array(
        'plugin' => &$this,
        'ancestors' => $ancestors,
    );

Back to Top

core/model/modx/sources/modmediasource.class.php

    Event: OnMediaSourceGetProperties
    Variables: array(
        'properties' => $this->xpdo->toJSON($properties),
    );

Back to Top

core/model/modx/sources/mods3mediasource.class.php

    Event: OnFileManagerUpload
    Variables: array(
        'files' => &$objects,
        'directory' => $container,
        'source' => &$this,
    );

Back to Top

core/model/modx/sources/modfilemediasource.class.php

    Event: OnFileManagerDirCreate
    Variables: array(
        'directory' => $newDirectoryPath,
        'source' => &$this,
    );

    Event: OnFileManagerDirRemove
    Variables: array(
        'directory' => $path,
        'source' => &$this,
    );

    Event: OnFileManagerDirRename
    Variables: array(
        'directory' => $newPath,
        'source' => &$this,
    );

    Event: OnFileManagerFileRename
    Variables: array(
        'path' => $newPath,
        'source' => &$this,
    );

    Event: OnFileManagerFileRemove
    Variables: array(
        'path' => $fullPath,
        'source' => &$this,
    );

    Event: OnFileManagerFileUpdate
    Variables: array(
        'path' => $fullPath,
        'source' => &$this,
    );

    Event: OnFileManagerFileCreate
    Variables: array(
        'path' => $fullPath,
        'source' => &$this,
    );

    Event: OnFileManagerBeforeUpload
    Variables: array(
        'files' => &$objects,
        'file' => &$file,
        'directory' => $container,
        'source' => &$this,
    );

    Event: OnFileManagerUpload
    Variables: array(
        'files' => &$objects,
        'directory' => $container,
        'source' => &$this,
    );

    Event: OnFileManagerMoveObject
    Variables: array(
        'from' => $fromObject->getPath(),
        'to' => $toObject->getPath(),
        'source' => &$this,
    );

Back to Top

core/model/modx/modmanagerrequest.class.php

    Event: OnHandleRequest
    Variables: None

    Event: OnManagerPageInit
    Variables: array(
        'action' => $this->action,
        'namespace' => $this->namespace,
    );

Back to Top

core/model/modx/modcontext.class.php

    Event: OnContextBeforeRemove
    Variables: array(
        'context' => &$this,
        'ancestors' => $ancestors,
    );

    Event: OnContextRemove
    Variables: array(
        'context' => &$this,
        'ancestors' => $ancestors,
    );

    Event: OnContextBeforeSave
    Variables: array(
        'context' => &$this,
        'mode' => $isNew ? modSystemEvent::MODE_NEW : modSystemEvent::MODE_UPD,
        'cacheFlag' => $cacheFlag,
    );

    Event: OnContextSave
    Variables: array(
        'context' => &$this,
        'mode' => $isNew ? modSystemEvent::MODE_NEW : modSystemEvent::MODE_UPD,
        'cacheFlag' => $cacheFlag,
    );

Back to Top

core/model/modx/modparser095.class.php

    Event: OnParseDocument
    Variables: None

Back to Top

manager/controllers/default/system/file/create.class.php

    Event: OnFileCreateFormPrerender
    Variables: array(
        'mode' => modSystemEvent::MODE_NEW,
        'directory' => $this->directory,
    );

Back to Top

manager/controllers/default/system/file/edit.class.php

    Event: OnFileEditFormPrerender
    Variables: array(
        'mode' => modSystemEvent::MODE_UPD,
        'file' => $this->filename,
        'fa' => &$this->fileRecord,
    );

Back to Top

manager/controllers/default/system/settings.class.php

    Event: OnSiteSettingsRender
    Variables: None

Back to Top

manager/controllers/default/system/refresh_site.php

    Event: OnBeforeCacheUpdate
    Variables: None

    Event: OnSiteRefresh
    Variables: None

Back to Top

manager/controllers/default/browser/index.class.php

    Event: OnRichTextBrowserInit
    Variables: $scriptProperties

Back to Top

manager/controllers/default/resource/resource.class.php

    Event: OnDocFormPrerender
    Variables: $properties

    Event: OnDocFormRender
    Variables: array(
        'id' => $resourceId,
        'resource' => &$this->resource,
        'mode' => !empty($resourceId) ? modSystemEvent::MODE_UPD : modSystemEvent::MODE_NEW,
    );

    Event: OnRichTextEditorRegister
    Variables: None

    Event: OnRichTextEditorInit
    Variables: array(
        'editor' => $rte,
        'elements' => $this->rteFields,
        'id' => $resourceId,
        'resource' => &$this->resource,
        'mode' => !empty($resourceId) ? modSystemEvent::MODE_UPD : modSystemEvent::MODE_NEW,
    );

    Event: OnResourceTVFormRender
    Variables: array(
        'categories' => &$finalCategories,
        'template' => $templateId,
        'resource' => $this->resource->get('id'),
        'tvCounts' => &$this->tvCounts,
        'hidden' => &$hidden,
    );

    Event: OnResourceTVFormPrerender
    Variables: array(
        'resource' => $this->resource->get('id'),
    );

Back to Top

manager/controllers/default/context/update.class.php

    Event: OnContextFormPrerender
    Variables: array(
        'key' => $this->context->get('key'),
        'context' => &$this->context,
        'mode' => modSystemEvent::MODE_UPD,
    );

    Event: OnContextFormRender
    Variables: array(
        'key' => $this->context->get('key'),
        'context' => &$this->context,
        'mode' => modSystemEvent::MODE_UPD,
    );

Back to Top

manager/controllers/default/security/login.class.php

    Event: OnManagerLoginFormPrerender
    Variables: None

    Event: OnManagerLoginFormRender
    Variables: None

Back to Top

manager/controllers/default/security/user/create.class.php

    Event: OnUserFormPrerender
    Variables: array(
        'id' => 0,
        'mode' => modSystemEvent::MODE_NEW,
    );

    Event: OnUserFormRender
    Variables: array(
        'id' => 0,
        'mode' => modSystemEvent::MODE_NEW,
    );

Back to Top

manager/controllers/default/security/user/update.class.php

    Event: OnUserFormPrerender
    Variables: array(
        'id' => $this->user->get('id'),
        'user' => &$this->user,
        'mode' => modSystemEvent::MODE_UPD,
    );

    Event: OnUserFormRender
    Variables: array(
        'id' => $this->user->get('id'),
        'user' => &$this->user,
        'mode' => modSystemEvent::MODE_UPD,
    );

Back to Top

manager/controllers/default/element/snippet/create.class.php

    Event: OnSnipFormPrerender
    Variables: array(
        'id' => 0,
        'mode' => modSystemEvent::MODE_NEW,
    );

    Event: OnSnipFormRender
    Variables: array(
        'id' => 0,
        'mode' => modSystemEvent::MODE_NEW,
    );

Back to Top

manager/controllers/default/element/snippet/update.class.php

    Event: OnSnipFormPrerender
    Variables: array(
        'id' => $this->snippetArray['id'],
        'snippet' => &$this->snippet,
        'mode' => modSystemEvent::MODE_UPD,
    );

    Event: OnSnipFormRender
    Variables: array(
        'id' => $this->snippetArray['id'],
        'snippet' => &$this->snippet,
        'mode' => modSystemEvent::MODE_UPD,
    );

Back to Top

manager/controllers/default/element/plugin/create.class.php

    Event: OnPluginFormPrerender
    Variables: array(
        'id' => 0,
        'mode' => modSystemEvent::MODE_NEW,
    );

    Event: OnPluginFormRender
    Variables: array(
        'id' => 0,
        'mode' => modSystemEvent::MODE_NEW,
    );

Back to Top

manager/controllers/default/element/plugin/update.class.php

    Event: OnPluginFormPrerender
    Variables: array(
        'id' => $this->pluginArray['id'],
        'plugin' => &$this->plugin,
        'mode' => modSystemEvent::MODE_UPD,
    );

    Event: OnPluginFormRender
    Variables: array(
        'id' => $this->pluginArray['id'],
        'plugin' => &$this->plugin,
        'mode' => modSystemEvent::MODE_UPD,
    );

Back to Top

manager/controllers/default/element/template/create.class.php

    Event: OnTempFormPrerender
    Variables: array(
        'id' => 0,
        'mode' => modSystemEvent::MODE_NEW,
    );

    Event: OnTempFormRender
    Variables: array(
        'id' => 0,
        'mode' => modSystemEvent::MODE_NEW,
    );

Back to Top

manager/controllers/default/element/template/update.class.php

    Event: OnTempFormPrerender
    Variables: array(
        'id' => $this->templateArray['id'],
        'template' => &$this->template,
        'mode' => modSystemEvent::MODE_UPD,
    );

    Event: OnTempFormRender
    Variables: array(
        'id' => $this->templateArray['id'],
        'template' => &$this->template,
        'mode' => modSystemEvent::MODE_UPD,
    );

Back to Top

manager/controllers/default/element/tv/create.class.php

    Event: OnTVFormPrerender
    Variables: array(
        'id' => 0,
        'mode' => modSystemEvent::MODE_NEW,
    );

    Event: OnTVFormRender
    Variables: array(
        'id' => 0,
        'mode' => modSystemEvent::MODE_NEW,
    );

Back to Top

manager/controllers/default/element/tv/update.class.php

    Event: OnTVFormPrerender
    Variables: array(
        'id' => $this->tvArray['id'],
        'tv' => &$this->tv,
        'mode' => modSystemEvent::MODE_UPD,
    );

    Event: OnTVFormRender
    Variables: array(
        'id' => $this->tvArray['id'],
        'tv' => &$this->tv,
        'mode' => modSystemEvent::MODE_UPD,
    );

Back to Top

manager/controllers/default/element/chunk/create.class.php

    Event: OnRichTextEditorInit
    Variables: array(
        'elements' => array('post'),
        'mode' => modSystemEvent::MODE_NEW,
    );

    Event: OnChunkFormRender
    Variables: array(
        'id' => 0,
        'mode' => modSystemEvent::MODE_NEW,
        'chunk' => null,
    );

    Event: OnChunkFormPrerender
    Variables: array(
        'id' => 0,
        'mode' => modSystemEvent::MODE_NEW,
        'chunk' => null,
    );

Back to Top

manager/controllers/default/element/chunk/update.class.php

    Event: OnChunkFormPrerender
    Variables: array(
        'id' => $this->chunkArray['id'],
        'mode' => modSystemEvent::MODE_UPD,
        'chunk' => $this->chunk,
    );

    Event: OnRichTextEditorInit
    Variables: array(
        'elements' => array('post'),
        'chunk' => &$this->chunk,
        'mode' => modSystemEvent::MODE_UPD,
    );

    Event: OnChunkFormRender
    Variables: array(
        'id' => $this->chunk->get('id'),
        'mode' => modSystemEvent::MODE_UPD,
        'chunk' => $this->chunk,
    );

Back to Top

 

My book, MODX: The Official Guide - Digital Edition is now available here. The paper version of the book may still be available from Amazon.

If you have the book and would like to download the code, you can find it here.

If you have the book and would like to see the updates and corrections page, you can find it here.

MODX: The Official Guide is 772 pages long and goes far beyond this web site in explaining beginning and advanced MODX techniques. It includes detailed information on:

  • Installing MODX
  • How MODX Works
  • Working with MODX resources and Elements
  • Using Git with MODX
  • Using common MODX add-on components like SPForm, Login, getResources, and FormIt
  • MODX security Permissions
  • Customizing the MODX Manager
  • Using Form Customization
  • Creating Transport Packages
  • MODX and xPDO object methods
  • MODX System Events
  • Using PHP with MODX

Go here for more information about the book.

Thank you for visiting BobsGuides.com

  —  Bob Ray