Skip to content

feat: migrate scripture settings to ScriptureLinks plugin#1191

Merged
bcordis merged 10 commits intodevelopmentfrom
feature/scripture-settings-migration
Mar 20, 2026
Merged

feat: migrate scripture settings to ScriptureLinks plugin#1191
bcordis merged 10 commits intodevelopmentfrom
feature/scripture-settings-migration

Conversation

@bcordis
Copy link
Member

@bcordis bcordis commented Mar 20, 2026

Summary

Moves scripture provider settings from Proclaim's component params (#__bsms_admin.params) to the ScriptureLinks plugin params (#__extensions.params). The scripture system becomes self-contained — install the library + plugin and you get full scripture functionality without Proclaim.

Architecture

  • Plugin params own all scripture config (providers, API key, cache, default version)
  • Library owns ScriptureParamsHelper for reading/writing plugin params, shared form fields, and the TranslationsmanagerField renderer
  • Proclaim embeds the Scripture tab via TranslationsmanagerField::renderScriptureTab() — single shared renderer for identical UI on both plugin and Proclaim admin pages
  • GDPR mode syncs bidirectionally — Proclaim keeps its own copy for analytics/privacy, plugin keeps its copy for scripture API calls

Changes

Library (CWMScriptureLinks submodule)

  • ScriptureParamsHelper — read/write plugin params from #__extensions
  • ApiKeyField + BibleTranslationField — moved to library namespace
  • TranslationsmanagerField — complete Scripture tab UI (panels + translations table)
  • bible-translations.js + cwm-fetch.js — copied to library media
  • Plugin AJAX handler with 9 Proclaim actions + 3 plugin-native actions
  • Removed BibleGateway external links — all display modes use local/API text
  • Attribute-style tag syntax: {scripture display="tooltip" version="kjv"}...{/scripture}

Proclaim

  • Admin Center Scripture tab calls shared renderer (replaces ~130 lines of template HTML)
  • CwmadminModel intercepts save to redirect scripture params to plugin
  • bible-translations.es6.js AJAX URLs use com_ajax instead of com_proclaim
  • Controller: removed ~630 lines of scripture AJAX methods
  • Form fields: thin backward-compat wrappers delegating to library
  • Migration script copies params from component to plugin on upgrade
  • Library manifest symlinked for namespace autoloading

Test plan

  • Plugin standalone: Configure scripture settings via Extensions > Plugins > ScriptureLinks. Add {scripture}John 3:16{/scripture} to an article. Verify passage renders.
  • Proclaim admin: Scripture tab displays current plugin settings. Toggle providers, change defaults, save. Verify changes persist in plugin params.
  • AJAX endpoints: Local Translations panel loads, download/remove/sync all work via com_ajax URLs.
  • GDPR sync: Change GDPR mode in plugin → verify Proclaim picks it up. Change in Proclaim → verify plugin picks it up.
  • Migration: Install upgrade on a site with existing scripture settings. Verify settings migrated from component to plugin params.
  • Fresh install: New Proclaim install registers plugin with default settings. Scripture tab works immediately.
  • composer test: All PHPUnit + Jest tests pass.

🤖 Generated with Claude Code

bcordis and others added 10 commits March 20, 2026 15:08
Move scripture provider settings (GetBible, API.Bible, API key, GDPR
mode, cache days, default version) from component params to plugin
params. The scripture system becomes self-contained in the library +
plugin.

Library changes:
- ScriptureParamsHelper: read/write plugin params from #__extensions
- ApiKeyField + BibleTranslationField: moved to library namespace
- TranslationsmanagerField: full Scripture tab UI (panels + table)
- bible-translations.js + cwm-fetch.js: copied to library media

Plugin changes:
- onAjaxScripturelinks: 9 AJAX actions for Proclaim + 3 for plugin UI
- Settings tab: mode + display only
- Scripture tab: full provider/settings/translations management

Proclaim changes:
- Admin Center Scripture tab reads/writes plugin params
- CwmadminModel intercepts save to redirect scripture params
- bible-translations.js AJAX URLs use com_ajax
- Controller: removed ~630 lines of scripture AJAX methods
- Form fields: thin wrappers delegating to library
- Migration script copies params on upgrade

Build changes:
- Library manifest symlinked for namespace autoloading
- npm build outputs updated JS with com_ajax URLs

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… tab

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace ~130 lines of custom Scripture tab HTML + 60-line config div
with a single call to TranslationsmanagerField::renderScriptureTab().
Both plugin and Proclaim now render identical Scripture tab UI from
the same code path.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
gdpr_mode is a shared setting — Proclaim needs it for analytics/privacy,
the plugin needs it for scripture API calls.

- Proclaim keeps gdpr_mode in component params (not stripped on save)
- Proclaim syncs gdpr_mode to plugin params via SHARED_KEYS
- Plugin syncs gdpr_mode back to #__bsms_admin.params on save
- CwmanalyticsHelper reads from component params (its own copy)
- Migration copies gdpr_mode to plugin but keeps component copy

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
All scripture display modes now use local/API text only. No external
links that expose visitor IPs to third parties.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Supports {scripture display="tooltip" version="kjv"}...{/scripture}
per-tag overrides for display mode and translation version.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@bcordis bcordis merged commit fca1af2 into development Mar 20, 2026
5 of 6 checks passed
@bcordis bcordis deleted the feature/scripture-settings-migration branch March 20, 2026 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant