Delegates in Symphony 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 #869
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 #398
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 #386
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 #749
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 #48
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 #1125
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 #1138
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 #1070
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

content.blueprintsdatasources.php #823
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 #1086
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

/blueprints/events/

content.blueprintsevents.php #496
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 #509
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 #199
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 #458
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

content.blueprintsevents.php #442
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

/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 #415
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 #951
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 #564
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 #829
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 #879
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 #698
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 #801
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 #851
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 #902
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/sections/

content.blueprintssections.php #690
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 #704
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 #722
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 #738
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 #606
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 #761
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 #635
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)

Prior to deleting the Utility

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 #187
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 #314
EventFinalSaveFilter(string $page='/frontend/', array $context)
Context
  • $fields array
  • $event string
  • $filter_errors array
  • $entry Entry
event.section.php #289
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 error array reference. 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 array
event.section.php #40
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 error array reference. Provided with references to this object, the $_POST data and also the error array

Context
  • $fields array
  • $event string
  • $filter_results array
  • $post_values XMLElement
class.frontendpage.php #179
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 #730
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 #248
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 #205
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 #317
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 #423
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 #376
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 #500
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 #236
FrontendPreRenderHeaders(string $page='/frontend/')

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

class.frontendpage.php #678
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 #183
AddCustomPublishColumn(string $page='/publish/', array $context)

Allows the creation of custom Publish Index columns. 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 #297
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 #921
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 #890
EntryPostEdit(string $page='/publish/edit/', array $context)

Just after the editing of an Entry

Context
  • $section Section
  • $entry Entry
  • $fields array
content.publish.php #870
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 #636
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 #617
EntryPreCreate(string $page='/publish/new/', array $context)

Just prior to creation of an Entry

Context
  • $section Section
  • $entry Entry
  • $fields array
content.publish.php #707
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 #345
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 #413
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 #455
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 #541
AuthorPostEdit(string $page='/system/authors/', array $context)

After editing an author, provided with the Author object

Context
  • $author AuthorAn Author object

content.systemauthors.php #563
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 #165
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 #145
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 #184
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 #105
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 #130
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 #147
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