Module Parameters Export Import

Technical Details

Version: 1.0.0

Technical Details

How It Works

The plugin uses backend AJAX handlers for reliable data operations:

Export Process
  1. JavaScript sends AJAX request with module ID
  2. PHP handler queries database: SELECT params FROM #__modules WHERE id = ?
  3. JSON params are decoded and returned to frontend
  4. JSON file is generated and downloaded to user's computer
Import Process
  1. User selects JSON file and confirms import
  2. JavaScript sends AJAX request with module ID and JSON params
  3. PHP handler validates data and updates database: UPDATE #__modules SET params = ? WHERE id = ?
  4. Module cache is cleared
  5. Page reloads to show updated parameters
Field Support
  • Regular Fields: Text, number, select, checkbox, radio buttons - handled via database JSON
  • Editor Fields: Uses JoomlaEditor API to get/set editor content correctly
  • Subforms: Exported as arrays, imported with automatic row creation
  • Hidden Fields: All parameters in database are exported regardless of visibility
Security Features
  • CSRF token validation on all AJAX requests
  • Permission checks (core.edit on com_modules)
  • Administrator-only operation
  • Input validation and JSON parsing error handling
  • Database query parameterization
AJAX Endpoint

Plugin uses Joomla's com_ajax system:

index.php?option=com_ajax&plugin=modexport&group=system&format=json&action=[export|import]