Requirements
- Omeka S 4.x
- PHP 8.1 or later
- MySQL or MariaDB
- The web server user (for example
www-data) needs write access to theview/directory of every theme you want to edit. The module never changes file permissions itself. - Optional:
exec()enabled in PHP and a PHP CLI binary available. This is used to runphp -lfor syntax checking. Without it the module falls back to a simpler heuristic check.
The module has no Composer dependencies. The CodeMirror editor and all other JavaScript and CSS are bundled inside the module, so no requests go to a CDN.
Installing
- Copy the
ThemeFileEditorfolder into your Omeka Smodules/directory. - Log in to the Omeka S admin panel as a Global Administrator.
- Go to Admin > Modules and click Install next to ThemeFileEditor.
Installation creates one database table, theme_file_revision, which holds the revision history, and stores the five module settings with their defaults (see Configuration).
After installing you will find:
- Theme File Editor in the admin sidebar, with File Editor, Search and Settings sub-pages, at
/admin/theme-file-editor. - A Theme Files link in the sidebar of every site's admin area. It opens the editor with that site's current theme selected.
- An Edit Theme Files button on each site's Theme page (
/admin/site/s/<slug>/theme), which does the same.
Only users with the site_admin or global_admin role see these links. See Security Model.
Upgrading
Copy the new version over the existing modules/ThemeFileEditor folder, then visit Admin > Modules. If the module shows Upgrade available, click Upgrade. Version 1.0.0 has no database migrations.
Uninstalling
Go to Admin > Modules, find ThemeFileEditor and click Uninstall. Uninstalling:
- drops the
theme_file_revisiontable, which permanently deletes all revision history; - deletes the module's five settings (
tfe_*) from Omeka's settings table.
Uninstalling does not touch the filesystem. Theme files you edited keep their current content, any .bak backup files created by the module stay next to the originals, and any theme you created with Copy Theme remains in themes/.
If you need to clean up manually:
DROP TABLE IF EXISTS theme_file_revision;
DELETE FROM setting WHERE id LIKE 'tfe_%';