Delegates in Symphony 2.2.2

Delegates are functions in Symphony's core that allow extension developers to intervene at key moments in the generation of a back-end or front-end Symphony page. The delegate will usually provide a contextually relevant PHP object (for instance a page object or an event object) that the developer can then work with and pass back to the system for further processing.

More on Delegates

/backend/

class.administrationpage.php #885
AddElementToFooter(string $page='/backend/', array $context)

Add new list elements to the footer

Context
  • $wrapper XMLElementA XMLElement representing the `` at in the Symphony footer, passed by reference

class.administration.php #407
AdminPagePostGenerate(string $page='/backend/', array $context)

Immediately after generating the admin page. Provided with string containing page source

Context
  • $output stringThe resulting backend page HTML as a string, passed by reference

class.administration.php #395
AdminPagePreGenerate(string $page='/backend/', array $context)

Immediately before generating the admin page. Provided with the page object

Context
  • $oPage HTMLPageAn instance of the current page to be rendered, this will usually be a class that extends HTMLPage. The Symphony backend uses a convention of contentPageName as the class that extends the HTMLPage

class.administrationpage.php #273
AppendElementBelowView(string $page='/backend/')

Allows developers to add items just above the page footer. Use $context['parent']->Page for access to the page object

class.administrationpage.php #460
AppendPageAlert(string $page='/backend/')

Allows for appending of alerts. Administration::instance()->Page->Alert is way to tell what is currently in the system

class.administrationpage.php #752
ExtensionsAddToNavigation(string $page='/backend/', array $context)

After building the Navigation properties array. This is specifically for extensions to add their groups to the navigation or items to groups, already in the navigation. Note: THIS IS FOR ADDING ONLY! If you need to edit existing navigation elements, use the NavigationPreRender delegate.

Context
  • $navigation array
class.administrationpage.php #237
InitaliseAdminPageHead(string $page='/backend/')

Allows developers to insert items into the page HEAD. Use $context['parent']->Page for access to the page object

field.textarea.php #155
ModifyTextareaFieldPublishWidget(string $page='/backend/', array $context)

Allows developers modify the textarea before it is rendered in the publish forms

Context
  • $field Field
  • $label Widget
  • $textarea Widget

/blueprints/datasources/

content.blueprintsdatasources.php #1192
DatasourcePostCreate(string $page='/blueprints/datasources/', array $context)

After creating the Datasource, the path to the Datasource file is provided

Context
  • $file stringThe path to the Datasource file

content.blueprintsdatasources.php #1205
DatasourcePostEdit(string $page='/blueprints/datasources/', array $context)

After editing the Datasource, the path to the Datasource file is provided

Context
  • $file stringThe path to the Datasource file

content.blueprintsdatasources.php #1114
DatasourcePreCreate(string $page='/blueprints/datasources/', array $context)

Prior to creating the Datasource, the file path where it will be written to is provided and well as the contents of that file.

Context
  • $file stringThe path to the Datasource file

  • $contents stringThe contents for this Datasource as a string passed by reference

  • $params arrayAn array of all the $dsParam* values

  • $elements arrayAn array of all the elements included in this datasource

  • $filters arrayAn associative array of all the filters for this datasource with the key being the field_id and the value the filter.

  • $dependencies arrayAn array of dependencies that this datasource has

content.blueprintsdatasources.php #855
DatasourcePreDelete(string $page='/blueprints/datasources/', array $context)

Prior to deleting the Datasource file. Target file path is provided.

Context
  • $file stringThe path to the Datasource file

content.blueprintsdatasources.php #1146
DatasourcePreEdit(string $page='/blueprints/datasources/', array $context)

Prior to editing a Datasource, the file path where it will be written to is provided and well as the contents of that file.

Context
  • $file stringThe path to the Datasource file

  • $contents stringThe contents for this Datasource as a string passed by reference

  • $params arrayAn array of all the $dsParam* values

  • $elements arrayAn array of all the elements included in this datasource

  • $filters arrayAn associative array of all the filters for this datasource with the key being the field_id and the value the filter.

  • $dependencies arrayAn array of dependencies that this datasource has

/blueprints/events/

content.blueprintsevents.php #538
EventPostCreate(string $page='/blueprints/events/', array $context)

After creating the Event, the path to the Event file is provided

Context
  • $file stringThe path to the Event file

content.blueprintsevents.php #551
EventPostEdit(string $page='/blueprints/events/', array $context)

After editing the Event, the path to the Event file is provided

Context
  • $file stringThe path to the Event file

content.blueprintsevents.php #226
EventPreDelete(string $page='/blueprints/events/', array $context)

Prior to deleting the Event file. Target file path is provided.

Context
  • $file stringThe path to the Event file

content.blueprintsevents.php #496
EventPreEdit(string $page='/blueprints/events/', array $context)

Prior to editing an Event, the file path where it will be written to is provided and well as the contents of that file.

Context
  • $file stringThe path to the Event file

  • $contents stringThe contents for this Event as a string passed by reference

  • $filters arrayAn array of the filters attached to this event

content.blueprintsevents.php #474
EventsPreCreate(string $page='/blueprints/events/', array $context)

Prior to creating an Event, the file path where it will be written to is provided and well as the contents of that file.

Context
  • $file stringThe path to the Event file

  • $contents stringThe contents for this Event as a string passed by reference

  • $filters arrayAn array of the filters attached to this event

/blueprints/events/(edit|new|info)/

content.blueprintsevents.php #148
AppendEventFilter(string $page='/blueprints/events/(edit|new|info)/', array $context)

Allows adding of new filter rules to the Event filter rule select box

Context
  • $selected arrayAn array of all the selected filters for this Event

  • $options arrayAn array of all the filters that are available, passed by reference

content.blueprintsevents.php #445
AppendEventFilterDocumentation(string $page='/blueprints/events/(edit|new|info)/', array $context)

Allows adding documentation for new filters. A reference to the $documentation array is provided, along with selected filters

Context
  • $selected arrayAn array of all the selected filters for this Event

  • $documentation arrayAn array of all the documentation XMLElements, passed by reference

/blueprints/pages/

content.blueprintspages.php #983
PagePreDelete(string $page='/blueprints/pages/, array $context)

Prior to deleting Pages

Context
  • $page_ids arrayAn array of Page ID's that are about to be deleted, passed by reference

  • $redirect stringThe absolute path that the Developer will be redirected to after the Pages are deleted

/blueprints/pages/

content.blueprintspages.php #568
AppendPageContent(string $page='/blueprints/pages/', array $context)

After all Page related Fields have been added to the DOM, just before the actions.

Context
  • $form XMLElement
  • $fields array
  • $errors array
content.blueprintspages.php #861
PagePostCreate(string $page='/blueprints/pages/', array $context)

Just after the creation of a new page in tbl_pages

Context
  • $page_id integerThe ID of the newly created Page

  • $fields arrayAn associative array of data that was just saved for this page

content.blueprintspages.php #911
PagePostEdit(string $page='/blueprints/pages/', array $context)

Just after updating a page in tbl_pages

Context
  • $page_id integerThe ID of the Page that was just updated

  • $fields arrayAn associative array of data that was just saved for this page

content.blueprintspages.php #729
PagePostValidate(string $page='/blueprints/pages/', array $context)

Just after the Symphony validation has run, allows Developers to run custom validation logic on a Page

Context
  • $fields arrayThe $_POST['fields'] array. This should be read-only and not changed through this delegate.

  • $errors arrayAn associative array of errors, with the key matching a key in the $fields array, and the value being the string of the error. $errors is passed by reference.

content.blueprintspages.php #833
PagePreCreate(string $page='/blueprints/pages/', array $context)

Just prior to creating a new Page record in tbl_pages, provided with the $fields associative array. Use with caution, as no duplicate page checks are run after this delegate has fired

Context
  • $fields arrayThe $_POST['fields'] array passed by reference

content.blueprintspages.php #883
PagePreEdit(string $page='/blueprints/pages/', array $context)

Just prior to updating a Page record in tbl_pages, provided with the $fields associative array. Use with caution, as no duplicate page checks are run after this delegate has fired

Context
  • $page_id integerThe ID of the Page that is about to be updated

  • $fields arrayThe $_POST['fields'] array passed by reference

content.blueprintspages.php #1195
PageTemplatePostCreate(string $page='/blueprints/pages/', array $context)

Just after a Page Template is saved after been created.

Context
  • $file stringThe path to the Page Template file

content.blueprintspages.php #1182
PageTemplatePreCreate(string $page='/blueprints/pages/', array $context)

Just before a Page Template is about to be created & written to disk

Context
  • $file stringThe path to the Page Template file

  • $contents stringThe contents of the $data, passed by reference

content.blueprintspages.php #934
PageTypePreCreate(string $page='/blueprints/pages/', array $context)

Just before the page's types are saved into tbl_pages_types. Use with caution as no further processing is done on the $types array to prevent duplicate $types from occurring (ie. two index page types). Your logic can use the contentBlueprintsPages::typeUsed function to perform this logic.

Context
  • $page_id integerThe ID of the Page that was just created or updated

  • $types arrayAn associative array of the types for this page passed by reference.

/blueprints/pages/template/

content.blueprintspages.php #653
PageTemplatePostEdit(string $page='/blueprints/pages/template/', array $context)

Just after a Page Template has been edited and written to disk

Context
  • $file stringThe path to the Page Template file

content.blueprintspages.php #636
PageTemplatePreEdit(string $page='/blueprints/pages/template/', array $context)

Just before a Page Template is about to written to disk

Context
  • $file stringThe path to the Page Template file

  • $contents stringThe contents of the $fields['body'], passed by reference

/blueprints/sections/

content.blueprintssections.php #402
AddSectionElements(string $page='/blueprints/sections/', array $context)

Allows extensions to add elements to the header of the Section Editor form. Usually for section settings, this delegate is passed the current $meta array and the $this->_errors array.

Context
  • $form XMLElementAn XMLElement of the current $this->Form, just after the Section settings have been appended, but before the Fields duplicator

  • $meta arrayThe current $_POST['meta'] array

  • $errors arrayThe current errors array

content.blueprintssections.php #745
FieldPostCreate(string $page='/blueprints/sections/', array $context)

After creation of a Field.

Context
  • $field FieldThe Field object, passed by reference

  • $data arrayThe settings for ths $field, passed by reference

content.blueprintssections.php #759
FieldPostEdit(string $page='/blueprints/sections/', array $context)

After editing of a Field.

Context
  • $field FieldThe Field object, passed by reference

  • $data arrayThe settings for ths $field, passed by reference

content.blueprintssections.php #777
SectionPostCreate(string $page='/blueprints/sections/', array $context)

After the Section has been created, and all the Field's have been created for this section, but just before the redirect

Context
  • $section_id integerThe newly created Section ID.

content.blueprintssections.php #793
SectionPostEdit(string $page='/blueprints/sections/', array $context)

After the Section has been updated, and all the Field's have been updated for this section, but just before the redirect

Context
  • $section_id integerThe edited Section ID.

content.blueprintssections.php #661
SectionPreCreate(string $page='/blueprints/sections/', array $context)

Just prior to saving the Section settings. Use with caution as there is no additional processing to ensure that Field's or Section's are unique.

Context
  • $meta arrayThe section's settings, passed by reference

  • $fields arrayAn associative array of the fields that will be saved to this section with the key being the position in the Section Editor and the value being a Field object, passed by reference

content.blueprintssections.php #816
SectionPreDelete(string $page='/blueprints/sections/', array $context)

Just prior to calling the Section Manager's delete function

Context
  • $section_ids arrayAn array of Section ID's passed by reference

content.blueprintssections.php #690
SectionPreEdit(string $page='/blueprints/sections/', array $context)

Just prior to updating the Section settings. Use with caution as there is no additional processing to ensure that Field's or Section's are unique.

Context
  • $section_id integerThe Section ID that is about to be edited.

  • $meta arrayThe section's settings, passed by reference

  • $fields arrayAn associative array of the fields that will be saved to this section with the key being the position in the Section Editor and the value being a Field object, passed by reference

/blueprints/utilities/

content.blueprintsutilities.php #241
UtilityPostCreate(string $page='/blueprints/utilities/', array $context)

Just after the Utility has been written to disk

Context
  • $file stringThe path to the Utility file

content.blueprintsutilities.php #254
UtilityPostEdit(string $page='/blueprints/utilities/', array $context)

Just after a Utility has been edited and written to disk

Context
  • $file stringThe path to the Utility file

content.blueprintsutilities.php #200
UtilityPreCreate(string $page='/blueprints/utilities/', array $context)

Just before the Utility has been created

Context
  • $file stringThe path to the Utility file

  • $contents stringThe contents of the $fields['body'], passed by reference

content.blueprintsutilities.php #275
UtilityPreDelete(string $page='/blueprints/utilities/', array $context)

Prior to deleting the Utility

Context
  • $file stringThe path to the Utility file

content.blueprintsutilities.php #215
UtilityPreEdit(string $page='/blueprints/utilities/', array $context)

Just before the Utility has been updated

Context
  • $file stringThe path to the Utility file

  • $contents stringThe contents of the $fields['body'], passed by reference

/frontend/

datasource.section.php #206
DataSourceEntriesBuilt(string $page='/frontend/', array $context)

Immediately after building entries allow modification of the Data Source entry list

Context
  • $datasource Datasource
  • $entries array
  • $filters array
event.section.php #378
EventFinalSaveFilter(string $page='/frontend/', array $context)

This delegate that lets extensions know the final status of the current Event. It is triggered when everything has processed correctly. The $messages array contains the results of the previous filters that have executed, and the $errors array contains any errors that have occurred as a result of this delegate. These errors cannot stop the processing of the Event, as that has already been done.

Context
  • $fields array
  • $event string
  • $messages arrayAn associative array of array's which contain 4 values, the name of the filter (string), the status (boolean), the message (string) an optionally an associative array of additional attributes to add to the filter element.

  • $errors arrayAn associative array of array's which contain 4 values, the name of the filter (string), the status (boolean), the message (string) an optionally an associative array of additional attributes to add to the filter element.

  • $entry Entry
event.section.php #335
EventPostSaveFilter(string $page='/frontend/', array $context)

After saving entry from the front-end. This delegate will not force the Events to terminate if it populates the $filter_results array. Provided with references to this object, the $_POST data and also the error array

Context
  • $entry_id integer
  • $fields array
  • $entry Entry
  • $event string
  • $messages arrayAn associative array of array's which contain 4 values, the name of the filter (string), the status (boolean), the message (string) an optionally an associative array of additional attributes to add to the filter element.

event.section.php #52
EventPreSaveFilter(string $page='/frontend/', array $context)

Prior to saving entry from the front-end. This delegate will force the Event to terminate if it populates the $filter_results array. All parameters are passed by reference.

Context
  • $fields array
  • $event string
  • $messages arrayAn associative array of array's which contain 4 values, the name of the filter (string), the status (boolean), the message (string) an optionally an associative array of additional attributes to add to the filter element.

  • $post_values XMLElement
  • $entry_id integerIf editing an entry, this parameter will be an integer, otherwise null.

class.frontendpage.php #191
FrontendDevKitResolve(string $page='/frontend/', array $context)

Allows a devkit object to be specified, and stop continued execution:

Context
  • $full_generate booleanWhether this page will be completely generated (ie. invoke the XSLT transform) or not, by default this is true. Passed by reference

  • $devkit mixedAllows a devkit to register to this page

class.frontendpage.php #747
FrontendEventPostProcess(string $page='/frontend/', array $context)

Just after the page events have triggered. Provided with the XML object

Context
  • $xml XMLElementThe XMLElement to append the Events results to. Event results are contained in a root XMLElement that is the handlised version of their name.

class.frontendpage.php #260
FrontendOutputPostGenerate(string $page='/frontend/', array $context)

Immediately after generating the page. Provided with string containing page source

Context
  • $output stringThe generated output of this page, ie. a string of HTML, passed by reference

class.frontendpage.php #217
FrontendOutputPreGenerate(string $page='/frontend/', array $context)

Immediately before generating the page. Provided with the page object, XML and XSLT

Context
  • $page FrontendPageThis FrontendPage object, by reference

  • $xml stringThis pages XML, including the Parameters, Datasource and Event XML, by reference

  • $xsl stringThis pages XSLT

class.frontendpage.php #329
FrontendPageResolved(string $page='/frontend/', array $context)

Just after having resolved the page, but prior to any commencement of output creation

Context
  • $page FrontendPageAn instance of this class, passed by reference

  • $page_data arrayAn associative array of page data, which is a combination from tbl_pages and the path of the page on the filesystem. Passed by reference

class.frontendpage.php #442
FrontendParamsPostResolve(string $page='/frontend/', array $context)

Access to the resolved param pool, including additional parameters provided by Data Source outputs

Context
  • $params arrayAn associative array of this page's parameters

class.frontendpage.php #395
FrontendParamsResolve(string $page='/frontend/', array $context)

Just after having resolved the page params, but prior to any commencement of output creation

Context
  • $params arrayAn associative array of this page's parameters

class.frontendpage.php #519
FrontendPrePageResolve(string $page='/frontend/', array $context)

Before page resolve. Allows manipulation of page without redirection

Context
  • $row mixed
  • $page FrontendPageAn instance of this FrontendPage

class.frontendpage.php #248
FrontendPreRenderHeaders(string $page='/frontend/')

This is just prior to the page headers being rendered, and is suitable for changing them

class.frontendpage.php #697
FrontendProcessEvents(string $page='/frontend/', array $context)

Manipulate the events array and event element wrapper

Context
  • $env array
  • $events stringA string of all the Events attached to this page, comma separated.

  • $wrapper XMLElementThe XMLElement to append the Events results to. Event results are contained in a root XMLElement that is the handlised version of their name.

  • $page_data arrayAn associative array of page meta data

class.devkit.php #145
ManipulateDevKitNavigation(string $page='/frontend/', array $context)

Allow navigation XML to be manipulated before it is rendered.

Context
  • $xml DOMDocument

/login/

content.login.php #180
AuthorLoginFailure(string $page='/login/', array $context)

A failed login attempt into the Symphony backend

Context
  • $username stringThe username of the Author who attempted to login.

content.login.php #195
AuthorLoginSuccess(string $page='/login/', array $context)

A successful login attempt into the Symphony backend

Context
  • $username stringThe username of the Author who logged in.

content.login.php #298
AuthorPostPasswordChange(string $page='/login/', array $context)

When an Author changes their password as the result of a login with an emergency token (ie. forgot password). Just after their new password has been set successfully

Context
  • $author_id integerThe ID of the Author who has just changed their password

content.login.php #264
AuthorPostPasswordResetFailure(string $page='/login/', array $context)

When a password reset has been attempted, but Symphony doesn't recognise the credentials the user has given.

Context
  • $email stringThe santizied Email of the Author who tried to request the password reset

content.login.php #342
AuthorPostPasswordResetRequest(string $page='/login/', array $context)

Just after a Forgot Password email has been sent to the Author who has requested a password reset.

Context
  • $author_id integerThe ID of the Author who has requested their password be reset

content.login.php #248
AuthorPostPasswordResetSuccess(string $page='/login/', array $context)

When a password reset has occured and after the Password Reset email has been sent.

Context
  • $author_id integerThe ID of the Author who requested the password reset

/publish/

content.publish.php #187
AddCustomPublishColumn(string $page='/publish/', array $context)

Allows the creation of custom entries tablecolumns. Called after all the Section Visible columns have been added as well as the Section Associations

Context
  • $tableHead arrayAn array of the current columns, passed by reference

  • $section_id integerThe current Section ID

content.publish.php #301
AddCustomPublishColumnData(string $page='/publish/', array $context)

Allows Extensions to inject custom table data for each Entry into the Publish Index

Context
  • $tableData arrayAn array of Widget::TableData, passed by reference

  • $section_id integerThe current Section ID

  • $entry_id integerThe Entry ID for this row

content.publish.php #931
Delete(string $page='/publish/', array $context)

Prior to deletion of entries. Array of Entry ID's is provided. The array can be manipulated

Context
  • $checked arrayAn array of Entry ID's passed by reference

/publish/edit/

content.publish.php #898
EntryPostEdit(string $page='/publish/edit/', array $context)

Just after the editing of an Entry

Context
  • $section Section
  • $entry Entry
  • $fields array
content.publish.php #878
EntryPreEdit(string $page='/publish/edit/', array $context)

Just prior to editing of an Entry.

Context
  • $section Section
  • $entry Entry
  • $fields array

/publish/new/

content.publish.php #645
EntryPostCreate(string $page='/publish/new/', array $context)

Creation of an Entry. New Entry object is provided.

Context
  • $section Section
  • $entry Entry
  • $fields array
content.publish.php #626
EntryPreCreate(string $page='/publish/new/', array $context)

Just prior to creation of an Entry

Context
  • $section Section
  • $entry Entry
  • $fields array
content.publish.php #718
EntryPreRender(string $page='/publish/new/', array $context)

Just prior to rendering of an Entry edit form.

Context
  • $section Section
  • $entry Entry
  • $fields array

/system/authors/

content.systemauthors.php #353
AddDefaultAuthorAreas(string $page='/system/authors/, array $context)

Allows injection or manipulation of the Default Area dropdown for an Author. Take care with adding in options that are only valid for Developers, as if a normal Author is set to that option, they will be redirected to their own Author record.

Context
  • $options arrayAn associative array of options, suitable for use for the Widget::Select function. By default this will be an array of the Sections in the current installation. New options should be the path to the page after the SYMPHONY_URL constant.

  • $default_area stringThe current default_area for this Author.

content.systemauthors.php #421
AddElementstoAuthorForm(string $page='/system/authors/, array $context)

Allows the injection of custom form fields given the current $this->Form object. Please note that this custom data should be saved in own extension tables and that modifying tbl_authors to house your data is highly discouraged.

Context
  • $form XMLElementThe contents of $this->Form after all the default form elements have been appended.

  • $author AuthorThe current Author object that is being edited

/system/authors/

content.systemauthors.php #463
AuthorPostCreate(string $page='/system/authors/', array $context)

Creation of a new Author. The Author object is provided as read only through this delegate.

Context
  • $author AuthorThe Author object that has just been created

content.systemauthors.php #561
AuthorPostEdit(string $page='/system/authors/', array $context)

After editing an author, provided with the Author object

Context
  • $author AuthorAn Author object

content.systemauthors.php #583
AuthorPreDelete(string $page='/system/authors/', array $context)

Prior to deleting an author, provided with the Author ID.

Context
  • $author_id integerThe ID of Author ID that is about to be deleted

/system/extensions/

content.systemextensions.php #167
ExtensionPreDisable(string $page='/system/extensions/', array $context)

Notifies just before an Extension is to be disabled.

Context
  • $extensions arrayAn array of all the extension name's to be disabled, passed by reference

content.systemextensions.php #147
ExtensionPreEnable(string $page='/system/extensions/', array $context)

Notifies just before an Extension is to be enabled.

Context
  • $extensions arrayAn array of all the extension name's to be enabled, passed by reference

content.systemextensions.php #186
ExtensionPreUninstall(string $page='/system/extensions/', array $context)

Notifies just before an Extension is to be uninstalled

Context
  • $extensions arrayAn array of all the extension name's to be uninstalled, passed by reference

/system/preferences/

content.systempreferences.php #104
AddCustomPreferenceFieldsets(string $page='/system/preferences/', array $context)

Add Extension custom preferences. Use the $wrapper reference to append objects.

Context
  • $wrapper XMLElementAn XMLElement of the current page

content.systempreferences.php #129
CustomActions(string $page='/system/preferences/')

This is where Extensions can hook on to custom actions they may need to provide as a result of adding some custom actions through the AddCustomPreferenceFieldsets delegate

content.systempreferences.php #146
Save(string $page='/system/preferences/', array $context)

Just prior to saving the preferences and writing them to the CONFIG Allows extensions to preform custom validaton logic on the settings.

Context
  • $settings arrayAn array of the preferences to be saved, passed by reference

  • $errors arrayAn array of errors passed by reference

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details