mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-07-27 23:27:04 -04:00
feat(plugins): add registerModule helper and replace asset injection with explicit CSS links
- Add BasePlugin::registerModule() to register permission-system modules, auto-grant to admin (person_id=1), idempotent via INSERT IGNORE - Replace inject:css/js placeholders in header.php with explicit versioned asset links for reliable loading outside build pipeline - Update home.php module icons to use pluginContent() hook with SVG fallback, enabling plugins to override module icons Signed-off-by: Travis Garrison <travis@chiraqbookstore.com>
This commit is contained in:
@@ -88,7 +88,11 @@ $request = Services::request();
|
||||
<?php foreach ($allowed_modules as $module): ?>
|
||||
<li class="<?= $module->module_id == $request->getUri()->getSegment(1) ? 'active' : '' ?>">
|
||||
<a href="<?= base_url($module->module_id) ?>" title="<?= lang("Module.$module->module_id") ?>" class="menu-icon">
|
||||
<img src="<?= base_url("images/menubar/$module->module_id.svg") ?>" style="border: none;" alt="Module Icon"><br>
|
||||
<?php if (pluginContentExists("module_icon_$module->module_id")): ?>
|
||||
<?= pluginContent("module_icon_$module->module_id") ?>
|
||||
<?php else: ?>
|
||||
<img src="<?= base_url("images/menubar/$module->module_id.svg") ?>" style="border: none;" alt="Module Icon">
|
||||
<?php endif; ?><br>
|
||||
<?= lang('Module.' . $module->module_id) ?>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
Reference in New Issue
Block a user