feat(component): complete core MVC, map rendering, and router

Admin:
- LocationController (FormController for save/edit/cancel)
- LocationsController (AdminController for publish/delete/ordering)
- Location edit view with tabbed form and Leaflet coordinate picker
- Component extension implements RouterServiceInterface

Frontend:
- Single location detail view with Schema.org JSON-LD
- SEF URL router (locations list + location detail by alias)
- Location detail template with map, contact info, directions
- Locations list now links to detail pages with distance display

Map module:
- Full Leaflet.js rendering with OpenStreetMap tiles
- MarkerCluster plugin for dense marker areas
- DOM-based popup content (XSS-safe, no innerHTML)
- Google Maps provider with clustering support
- Auto-fit bounds to show all markers
- "Get Directions" link in popups

Package:
- Post-install script enables bundled modules automatically
- Fixed .gitignore to allow src/**/site/ paths

Authored-by: Moko Consulting

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jonathan Miller
2026-05-21 15:16:44 -05:00
parent d0b9a40157
commit f2afe8e9d9
18 changed files with 1277 additions and 8 deletions
+42 -2
View File
@@ -85,7 +85,10 @@ class Pkg_MokojoomstorelocatorInstallerScript
*/
public function postflight($type, $parent)
{
// TODO: Post-installation tasks (enable modules, set defaults, etc.)
if ($type === 'install')
{
$this->enableModules();
}
return true;
}
@@ -101,6 +104,43 @@ class Pkg_MokojoomstorelocatorInstallerScript
*/
public function uninstall($parent)
{
// TODO: Cleanup tasks on uninstall
Log::add('MokoJoomStoreLocator package uninstalled.', Log::INFO, 'jerror');
}
/**
* Enable the bundled modules after first install.
*
* @return void
*
* @since 1.0.0
*/
private function enableModules(): void
{
$db = Factory::getContainer()->get(\Joomla\Database\DatabaseInterface::class);
$modules = [
'mod_mokojoomstorelocator_map',
'mod_mokojoomstorelocator_search',
];
foreach ($modules as $module)
{
$query = $db->getQuery(true)
->update($db->quoteName('#__extensions'))
->set($db->quoteName('enabled') . ' = 1')
->where($db->quoteName('element') . ' = :element')
->where($db->quoteName('type') . ' = ' . $db->quote('module'))
->bind(':element', $module);
$db->setQuery($query);
try
{
$db->execute();
}
catch (\Exception $e)
{
Log::add('Failed to enable ' . $module . ': ' . $e->getMessage(), Log::WARNING, 'jerror');
}
}
}
}