Skip to content

MelisCmsPageHistoric

Audit log for CMS page editing — records who did what to a page and when, surfaced in a Historic tab and a dashboard widget. Package melisplatform/melis-cms-page-historic.

Purpose

MelisCmsPageHistoric automatically captures every page action (create, edit, publish, unpublish, delete) with the author identity and timestamp. History is written via event listeners that hook the CMS page lifecycle — nothing needs to be wired up per page. The log is exposed read-only in a Historic tab inside the page editor and in a Recent User Activity dashboard widget.

Enable it

Add to config/melis.module.load.php:

php
return [
    'MelisCmsPageHistoric',
];

Run the bundled install/dbdeploy/ deltas to create the history table (extra.dbdeploy: true). Requires melis-core, melis-engine, melis-front and melis-cms (^5.2).

Key services

Service aliasRole
MelisPageHistoricTableTable gateway over melis_hist_page_historic. Handles all reads and writes for history rows.

No dedicated service class is provided — reads and writes go through MelisPageHistoricTable plus the controller's save/delete actions.

Backoffice

Historic tab (page editor)

Injected via config/app.interface.php (key melispagehistoric_historic, icon history) into the CMS page-editor tabs. The tab renders a read-only DataTable scoped to the current page (hist_page_id). Available filters: limit, user, date range, action type. The user list for the filter is served by getBackOfficeUsersAction. Tool config is declared in config/app.tools.php (tool_meliscmspagehistoric).

Controller: PageHistoricController — action getPageHistoricDataAction feeds the DataTable.

Dashboard plugin

MelisCmsPageHistoricRecentUserActivityPlugin (recentActivityPages) renders the Recent User Activity widget on the back-office dashboard. Configuration lives under config/dashboard-plugins/, section MelisCms.

How history is written (listener pattern)

Two listeners are wired in src/Module.php (back-office bootstrap only):

ListenerEventWhat it records
MelisPageHistoricPageEventListenermeliscms_page_save_end, meliscms_page_publish_end, meliscms_page_unpublish_end, …Save / Publish / Unpublish actions
MelisPageHistoricDeletePageListenermeliscms_page_delete_endDelete action (also cleans up)

Database tables

TableHolds
melis_hist_page_historicOne row per recorded action: hist_id (PK), hist_page_id, hist_action, hist_date, hist_user_id, hist_description.

Example

Attaching to a CMS page event (the same pattern the listeners use — reusable by any module):

php
// In Module.php onBootstrap:
$sharedEvents = $eventManager->getSharedManager();
$sharedEvents->attach('MelisCms', 'meliscms_page_publish_end', function ($e) {
    $params = $e->getParams(); // page id, page data…
    // record: who/what/when -> melis_hist_page_historic
}, 50);

You do not need to write history rows yourself — saving, publishing or deleting a page through the CMS triggers the listeners automatically.

Key files

ConcernPath
Module bootstrap (listeners)vendor/melisplatform/melis-cms-page-historic/src/Module.php
Historic tab controllervendor/melisplatform/melis-cms-page-historic/src/Controller/PageHistoricController.php
Table gatewayvendor/melisplatform/melis-cms-page-historic/src/Model/Tables/MelisPageHistoricTable.php
Page event listenervendor/melisplatform/melis-cms-page-historic/src/Listener/MelisPageHistoricPageEventListener.php
Delete listenervendor/melisplatform/melis-cms-page-historic/src/Listener/MelisPageHistoricDeletePageListener.php
Dashboard pluginvendor/melisplatform/melis-cms-page-historic/src/Controller/DashboardPlugins/MelisCmsPageHistoricRecentUserActivityPlugin.php
Historic tab interface configvendor/melisplatform/melis-cms-page-historic/config/app.interface.php
Tool configvendor/melisplatform/melis-cms-page-historic/config/app.tools.php
Install SQL / dbdeployvendor/melisplatform/melis-cms-page-historic/install/

See also: MelisCms, Module reference