API:Document (System Event)
Document System Events are related to document manipulation (creation, modification, duplication, etc.). Keep in mind that System Events can only be called through the use of Plugins.
Contents |
OnBeforeDocFormDelete
| File: | manager/processors/delete_content.processor.php |
|---|---|
| Line: | 66 |
Called before the document is marked to be deleted from the database. Note: The document will not be deleted from the database yet!
Variable Scope
- $modx - the document parser
- $etomite - deprecated - Use $modx
- $id - Unique ID of the document
- $children - IDs of all the child documents (if any)
Common Uses
- Document Synchronization (if this document is deleted, should other rows be deleted as well?)
OnBeforeDocFormSave
| File: | manager/processors/save_content.processor.php |
|---|---|
| Line: | 245 |
| File: | manager/processors/save_content.processor.php |
|---|---|
| Line: | 430 |
Just before a document is saved to the database this event is called. The QuickEdit module also invokes this event before the document is saved.
Variable Scope
- $modx - the document parser
- $etomite - deprecated - Use $modx
- $mode - either upd or new
- $id - Unique ID of the document. Note: this is empty if new document
Common Uses
- To do
OnCreateDocGroup
To do
OnDocFormDelete
| File: | manager/processors/delete_content.processor.php |
|---|---|
| Line: | 100 |
Called after the document is marked to be deleted from the database. Note: The document will not be deleted from the database yet!
Variable Scope
- $modx - the document parser
- $etomite - deprecated - Use $modx
- $id - Unique ID of the document
- $children - IDs of all the child documents (if any)
Common Uses
- Document Synchronization (if this document is deleted, should other rows be deleted as well?)
OnDocFormPrerender
To do
OnDocFormRender
| File: | manager/actions/mutate_content.dynamic.php |
|---|---|
| Line: | 1180 |
Called after the form for adding /changing content or adding a folder is rendered
Variable Scope
- $id - Unique ID of the document
Common Uses
Extending the form. Additional (HTML-)output is placed outside the tabs, but within the form-fieldset
In order to create another tab, the following HTML-code must be generated:
This can be achieved with the following example plugin-code
$e = &$modx->Event; $html = '<div class="tab-page" id="tabExtra"> <h2 class="tab">Extra</h2> <p>Your content </p> </div> <script type="text/javascript">tpSettings.addTabPage( document.getElementById( "tabExtra" ) );</script>'; $e->output($html);
OnDocFormSave
| File: | manager/processors/save_content.processor.php |
|---|---|
| Line: | 311 |
| File: | manager/processors/save_content.processor.php |
|---|---|
| Line: | 523 |
A document is saved to the database. The QuickEdit module also invokes this event when the document is saved.
Variable Scope
- $modx - the document parser
- $etomite - deprecated - Use $modx
- $mode - either upd or new
- $id - Unique ID of the document.
Common Uses
- To do