Add MokoJoomTOS component for Terms of Service and Privacy Policy management #1

Merged
Copilot merged 7 commits from copilot/add-terms-privacy-component into main 2026-02-23 03:19:19 +00:00
Copilot commented 2026-02-23 01:59:33 +00:00 (Migrated from github.com)

Summary

Joomla 4.x/5.x component for managing and displaying Terms of Service and Privacy Policy content, with guaranteed access during site offline mode.

Implementation

Architecture

  • Single-table design: #__mokojoomtos_content table with content_type discriminator ('terms'/'privacy')
  • Namespaced classes: MokoConsulting\Component\MokoJoomTOS following PSR-4
  • MVC separation: Admin (CRUD) and Site (read-only display) packages
  • Dependency injection: Service provider in admin/services/provider.php
  • SEF routing: RouterView implementation for clean URLs

Admin Backend (src/admin/)

  • Controllers, models, and views for Terms and Privacy editing
  • Form definitions with WYSIWYG editor and published status control
  • Version tracking (created/modified dates and users)
  • SQL install/uninstall scripts with default content

Site Frontend (src/site/)

  • Display controllers and models
  • Responsive templates with CSS
  • Menu item type definitions (XML metadata)

Offline Access

System plugin (plugins/system/mokojoomtosaccess) intercepts requests to com_mokojoomtos and temporarily overrides global offline configuration:

public function onAfterInitialise()
{
    if ($this->app->input->get('option', '') === 'com_mokojoomtos') {
        $config = Factory::getConfig();
        $config->set('offline', '0');
    }
}

Plugin auto-enabled during component installation via script.php.

Files Created

  • 18 PHP files (controllers, models, views)
  • 8 XML files (manifest, forms, menu types)
  • 2 SQL files (install/uninstall)
  • 6 language files (admin/site)
  • 1 CSS file (responsive styling)

Configuration

  • Updated Makefile component name to mokojoomtos
  • Modified .gitignore: added !src/site/ exception (allows Joomla site directory while excluding static site generators)
Original prompt

In src directory create a component to create and edit the terms of service and privacy policy for a joomla site, and create a customizable link that can be accessed even when the site is in offline mode


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

## Summary Joomla 4.x/5.x component for managing and displaying Terms of Service and Privacy Policy content, with guaranteed access during site offline mode. ## Implementation ### Architecture - **Single-table design**: `#__mokojoomtos_content` table with `content_type` discriminator ('terms'/'privacy') - **Namespaced classes**: `MokoConsulting\Component\MokoJoomTOS` following PSR-4 - **MVC separation**: Admin (CRUD) and Site (read-only display) packages - **Dependency injection**: Service provider in `admin/services/provider.php` - **SEF routing**: RouterView implementation for clean URLs ### Admin Backend (`src/admin/`) - Controllers, models, and views for Terms and Privacy editing - Form definitions with WYSIWYG editor and published status control - Version tracking (created/modified dates and users) - SQL install/uninstall scripts with default content ### Site Frontend (`src/site/`) - Display controllers and models - Responsive templates with CSS - Menu item type definitions (XML metadata) ### Offline Access System plugin (`plugins/system/mokojoomtosaccess`) intercepts requests to `com_mokojoomtos` and temporarily overrides global offline configuration: ```php public function onAfterInitialise() { if ($this->app->input->get('option', '') === 'com_mokojoomtos') { $config = Factory::getConfig(); $config->set('offline', '0'); } } ``` Plugin auto-enabled during component installation via `script.php`. ### Files Created - 18 PHP files (controllers, models, views) - 8 XML files (manifest, forms, menu types) - 2 SQL files (install/uninstall) - 6 language files (admin/site) - 1 CSS file (responsive styling) ## Configuration - Updated `Makefile` component name to `mokojoomtos` - Modified `.gitignore`: added `!src/site/` exception (allows Joomla site directory while excluding static site generators) <!-- START COPILOT CODING AGENT SUFFIX --> <!-- START COPILOT ORIGINAL PROMPT --> <details> <summary>Original prompt</summary> > In src directory create a component to create and edit the terms of service and privacy policy for a joomla site, and create a customizable link that can be accessed even when the site is in offline mode </details> <!-- START COPILOT CODING AGENT TIPS --> --- 💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs.
jmiller-moko (Migrated from github.com) reviewed 2026-02-23 01:59:33 +00:00
copilot-pull-request-reviewer[bot] (Migrated from github.com) reviewed 2026-02-23 03:23:57 +00:00
copilot-pull-request-reviewer[bot] (Migrated from github.com) left a comment

Pull request overview

This PR adds a comprehensive Joomla component for managing Terms of Service and Privacy Policy content with guaranteed access during site offline mode.

Changes:

  • Created MokoJoomTOS component with admin CRUD interface and frontend display
  • Implemented system plugin to bypass offline mode for legal document access
  • Updated project configuration (Makefile, .gitignore) for the new component

Reviewed changes

Copilot reviewed 39 out of 40 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/com_mokojoomtos.xml Component manifest defining structure, SQL scripts, and update server
src/script.php Installation script with version checks, plugin auto-enable, and post-install messaging
src/admin/* Backend controllers, models, views, forms, and templates for content management
src/site/* Frontend controllers, models, views, and templates for displaying terms/privacy
src/plugins/system/mokojoomtosaccess/* System plugin to allow component access during offline mode
src/media/css/mokojoomtos.css Responsive styling for frontend content display
Makefile Updated component name from mokoevents to mokojoomtos
.gitignore Added exception to allow src/site/ directory

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

## Pull request overview This PR adds a comprehensive Joomla component for managing Terms of Service and Privacy Policy content with guaranteed access during site offline mode. **Changes:** - Created MokoJoomTOS component with admin CRUD interface and frontend display - Implemented system plugin to bypass offline mode for legal document access - Updated project configuration (Makefile, .gitignore) for the new component ### Reviewed changes Copilot reviewed 39 out of 40 changed files in this pull request and generated no comments. <details> <summary>Show a summary per file</summary> | File | Description | | ---- | ----------- | | src/com_mokojoomtos.xml | Component manifest defining structure, SQL scripts, and update server | | src/script.php | Installation script with version checks, plugin auto-enable, and post-install messaging | | src/admin/* | Backend controllers, models, views, forms, and templates for content management | | src/site/* | Frontend controllers, models, views, and templates for displaying terms/privacy | | src/plugins/system/mokojoomtosaccess/* | System plugin to allow component access during offline mode | | src/media/css/mokojoomtos.css | Responsive styling for frontend content display | | Makefile | Updated component name from mokoevents to mokojoomtos | | .gitignore | Added exception to allow src/site/ directory | </details> --- 💡 <a href="/mokoconsulting-tech/MokoJoomTOS/new/main/.github/instructions?filename=*.instructions.md" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Add Copilot custom instructions</a> for smarter, more guided reviews. <a href="https://docs.github.com/en/copilot/customizing-copilot/adding-repository-custom-instructions-for-github-copilot" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Learn how to get started</a>.
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/MokoJoomTOS#1