Sign3x is a MODX 3 component for storing, managing and signing PDF documents with a simple electronic signature under Russian Federal Law No. 63-FZ “On Electronic Signature”. The signature records the signer’s full name, position, date/time and a unique SHA-256 hash key.
1. Requirements
| Component | Version | Note |
|---|---|---|
| MODX Revolution | 3.x | Required |
| PHP | 8.1 or higher | Required |
| MySQL / MariaDB | any current version | Required |
| pdoTools | any current version | Optional — only needed for Fenom templates (&fenom=`1`) |
| FPDI + TCPDF | — | Included in the package — only needed for the visual PDF stamp |
2. Installation
- Install the package via the MODX Package Manager (or copy the files manually).
- Installation creates two database tables:
sign3x_documents— documentssign3x_profiles— signer profiles
- Go to System Settings → Namespace: sign3x and configure the parameters (see System settings).
- Be sure to create signer profiles on the “Employees” tab for every user who should be able to sign.
Access. The Sign3x panel is only available to users logged in to the MODX manager (
mgr). The right to sign is further restricted by user groups via thesign3x_allowed_groupssetting.
3. System settings
All settings are in the sign3x namespace. Open System Settings → filter “sign3x”.
General
| Setting key | Default | Description |
|---|---|---|
sign3x_allowed_groups | (empty) | IDs of user groups allowed to sign, comma-separated: 1,5,12. Sudo users skip the group check — a signer profile is enough for them. |
sign3x_secret_salt | (empty) | Secret salt for the SHA-256 hash key. Set any long random string. Never change it after the first signature — this invalidates the existing hash keys. |
sign3x_upload_dir | assets/sign3x/uploads/ | Upload folder for PDF files relative to the site root. Must be writable by the web server. |
sign3x_filename_mode | translit | File naming: translit — transliteration, original — the original name, unique — a unique UUID. |
sign3x_delete_files | Yes | Delete the PDF files on disk when a document is deleted. |
sign3x_frontend_css | assets/components/sign3x/css/frontend.css | URL of the built-in frontend styles. If the field is empty, no styles are added. |
Visual PDF stamp
The default stamp texts are in Russian; change them in the settings below if you need another language.
| Setting key | Default | Description |
|---|---|---|
sign3x_pdf_stamp | No | Add a visual stamp to the PDF when signing. |
sign3x_pdf_stamp_mode | overlay | Mode: overlay — on top of the last page, newpage — a separate “signature sheet” page. |
sign3x_stamp_title | ЭЛЕКТРОННАЯ ПОДПИСЬ (ПЭП) | Stamp title (both modes). |
sign3x_stamp_page_title | ЛИСТ ЭЛЕКТРОННОЙ ПОДПИСИ | Signature page title (newpage). |
sign3x_stamp_hash_label | Программный ключ (SHA-256): | Label above the hash key (newpage). |
sign3x_stamp_law_text | Text on compliance with Law 63-FZ | Legal compliance text inside the frame (newpage). |
sign3x_stamp_verify_text | Verification text | Text below the frame (newpage). |
sign3x_stamp_footer_text | Сформировано автоматически системой Sign3x | Page footer (newpage). |
4. Administration
The Sign3x panel is opened from the menu: Extras → Sign3x. It has two tabs.
4.1. “Employees” tab
Here you manage signer profiles — records linking a MODX user with their full name and position.
| Field | Description |
|---|---|
| MODX user | The linked manager user account |
| Full name | The signer’s full name (recorded in the signature) |
| Position | The signer’s position (recorded in the signature) |
Important: a user must both have a signer profile and belong to one of the groups listed in
sign3x_allowed_groups. If either condition is missing, the “Sign” button is not shown. The exception is users with the sudo flag: the group check is skipped for them.
4.2. “Documents” tab
A table of all uploaded documents with search, pagination and colour coding.
- Grey row — draft (status = 0, not signed)
- Green row — signed (status = 1)
Search works on the document name, the signer’s name and the hash key.
| Button | Description | Condition |
|---|---|---|
| Upload document | Uploads a PDF file and creates a document with the “Draft” status | Always available |
| Sign | Opens the signature confirmation dialog | Drafts only + the current user has the right to sign |
| Delete | Deletes the document from the database (and the file, if the setting is on) | Always available; asks for confirmation |
4.3. Signing
- Click “Sign” next to the document.
- The dialog shows:
- The document name and a link to preview the PDF
- Your full name, position and the signing date/time
- A warning that the action cannot be undone
- Click “Confirm”. The system:
- Records the full name, position and exact signing time in the database
- Generates a unique SHA-256 hash key
- Sets the document status to “Signed”
- Adds the visual stamp to the file if the PDF stamp is enabled
Signing cannot be undone. A signed document cannot be turned back into a draft from the interface.
5. The Sign3x snippet
The snippet outputs signed documents (status = 1) on the site with an electronic signature icon and the signer’s details.
5.1. Snippet parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
&id | int | not set | ID of a specific document. If set, only this document is shown. |
&limit | int | 20 | Maximum number of documents. Sorted by signing date (newest first). |
&tpl | string | sign3x.doc.default | Template for one document: a chunk name or inline Fenom (@INLINE {$name}, requires &fenom=`1`). |
&fenom | 0 / 1 | 0 | Process the template with Fenom (pdoTools). With 1 the {$placeholder} syntax is used. |
Template placeholders
| Placeholder | Description |
|---|---|
id | Document ID |
name | Document name (HTML-escaped) |
file_url | Full URL of the PDF file |
file_path | File path relative to the site root |
signer_fio | Signer’s full name |
signer_position | Signer’s position |
signed_at | Signing date and time (dd.mm.yyyy hh:mm:ss) |
hash_key | SHA-256 signature hash key |
aria_label | Full ARIA text for the icon (accessibility) |
assets_url | URL of the assets/ folder — for SVG icon links |
5.2. Call examples
<!-- Last 20 signed documents, default template -->
[[!Sign3x]]
<!-- With a limit -->
[[!Sign3x? &limit=`5`]]
<!-- One specific document -->
[[!Sign3x? &id=`3`]]
<!-- Your own chunk (MODX syntax) -->
[[!Sign3x? &tpl=`sign3x.doc.bs5`]]
<!-- Your own chunk (Fenom syntax, requires pdoTools) -->
[[!Sign3x? &tpl=`sign3x.doc.bs5.fenom` &fenom=`1`]]
<!-- Inline Fenom template -->
[[!Sign3x? &tpl=`@INLINE <a href="{$file_url}">{$name}</a>` &fenom=`1`]]
6. Ready-made chunks
The component comes with six ready-made template chunks:
| Chunk | CSS framework | Syntax | Note |
|---|---|---|---|
sign3x.doc.default | Built-in (frontend.css) | MODX [[+]] | Default chunk |
sign3x.doc.default.fenom | Built-in (frontend.css) | Fenom {$} | Requires pdoTools |
sign3x.doc.bs5 | Bootstrap 5 | MODX [[+]] | — |
sign3x.doc.bs5.fenom | Bootstrap 5 | Fenom {$} | Requires pdoTools |
sign3x.doc.uikit3 | UIKit 3 | MODX [[+]] | — |
sign3x.doc.uikit3.fenom | UIKit 3 | Fenom {$} | Requires pdoTools |
All chunks can be edited in Elements → Chunks. They contain the signature SVG icon, a tooltip with the name, position, date and hash, a link to the PDF and ARIA attributes for accessibility.
7. Fenom templates
Fenom is a template engine with {$var} syntax and {if}...{/if} conditions, provided by pdoTools. It does not depend on the MODX “Allow Fenom on pages” setting.
When to use Fenom chunks: when the template needs logic — conditional fields or loops. For example, showing the position only if it is set.
Syntax comparison
| Task | MODX syntax | Fenom syntax |
|---|---|---|
| Output a variable | [[+name]] | {$name} |
| Conditional block | — | {if $signer_position}...{/if} |
| Escaping | Done in PHP | Done in PHP |
A Fenom chunk with a condition:
<div class="sign3x-document">
<span class="sign3x-stamp" aria-label="{$aria_label}">
<img src="{$assets_url}components/sign3x/img/sign3x.svg" width="32" height="32" alt="">
</span>
<a href="{$file_url}">{$name}</a>
{if $signer_position}
<small>{$signer_position}</small>
{/if}
</div>
Calling the snippet with a Fenom chunk:
[[!Sign3x? &tpl=`sign3x.doc.default.fenom` &fenom=`1`]]
8. CSS and styles
The built-in styles are added automatically if sign3x_frontend_css is not empty. To disable the built-in styles and use your own CSS, clear the sign3x_frontend_css setting.
Key CSS classes
| Class | Description |
|---|---|
.sign3x-list | Wrapper of the default template: a vertical flex list with gaps |
.sign3x-document | One document: a flex row (icon + link) |
.sign3x-stamp | Icon trigger element with a tooltip |
.sign3x-stamp-icon | Electronic signature SVG icon |
.sign3x-stamp-tooltip | Tooltip with the signature details |
.sign3x-stamp-key | Hash key (monospace font, wrapping) |
.sign3x-doc-link | Link to the PDF document |
9. Visual PDF stamp
When sign3x_pdf_stamp is on, a visual stamp is added to the PDF file after signing. The FPDI and TCPDF libraries are included in the package.
Stamp modes
| Mode | Description |
|---|---|
overlay | A blue rectangular stamp on top of the last page of the document (bottom right corner) |
newpage | A separate “electronic signature sheet” page is appended to the document |
When the stamp is created successfully, the original file is replaced with the signed version and the path is updated in the database. On error the document is kept without the stamp and the error is written to the MODX log.
All stamp texts are configured with the
sign3x_stamp_*system settings.
10. Signature verification
Every signature comes with a unique SHA-256 hash key built from the following data:
SHA-256(id|name|file_path|fio|position|signed_at|salt)
| Component | Value |
|---|---|
id | Document ID in the database |
name | Document name |
file_path | File path at the moment of signing |
fio | Signer’s full name from the profile |
position | Signer’s position from the profile |
signed_at | Exact signing date/time (MySQL datetime) |
salt | Secret salt from the sign3x_secret_salt setting |
The hash key is shown:
- In the documents table (“Documents” tab)
- In the tooltip on the site when hovering over the signature icon
- In the PDF stamp (if enabled)
Do not change
sign3x_secret_saltafter the first signature. Changing the salt makes it impossible to reproduce the hash keys and effectively voids the verifiability of all existing signatures.