diff --git a/app/core/PluginManager.php b/app/core/PluginManager.php index 57c5d54..36fc3fe 100644 --- a/app/core/PluginManager.php +++ b/app/core/PluginManager.php @@ -215,12 +215,12 @@ class PluginManager // Use App API to get database connection $db = \App\App::db(); - + // If database unavailable, fallback to manifest if (!$db) { return self::$catalog[$plugin]['meta']['enabled'] ?? false; } - + $pdo = ($db instanceof \PDO) ? $db : $db->getConnection(); try { @@ -305,7 +305,7 @@ class PluginManager // Disable foreign key checks temporarily to allow table drops $pdo->exec('SET FOREIGN_KEY_CHECKS=0'); - + foreach ($tables as $table) { // Check if this table belongs to the plugin by checking its migration file $migrationFile = self::$catalog[$plugin]['path'] . '/migrations/create_' . $plugin . '_tables.sql'; @@ -317,7 +317,7 @@ class PluginManager } } } - + // Re-enable foreign key checks $pdo->exec('SET FOREIGN_KEY_CHECKS=1'); diff --git a/app/pages/admin.php b/app/pages/admin.php index 03c38d1..ba78506 100644 --- a/app/pages/admin.php +++ b/app/pages/admin.php @@ -613,7 +613,7 @@ if ($queryAction === 'plugin_check_page' && isset($_GET['plugin'])) { if ($hasMigration) { foreach ($migrationFiles as $migrationFile) { $migrationContent = file_get_contents($migrationFile); - + // Extract tables created by this migration (plugin-owned) if (preg_match_all('/CREATE\s+TABLE(?:\s+IF\s+NOT\s+EXISTS)?\s+`?([a-zA-Z0-9_]+)`?/i', $migrationContent, $matches)) { foreach ($matches[1] as $tableName) { @@ -622,7 +622,7 @@ if ($queryAction === 'plugin_check_page' && isset($_GET['plugin'])) { } } } - + // Find all referenced tables (dependencies) foreach ($allTables as $table) { if (strpos($migrationContent, $table) !== false && !in_array($table, $pluginOwnedTables)) { @@ -709,6 +709,18 @@ if (is_array($overviewStatusesPayload)) { $adminOverviewStatuses = $overviewStatusesPayload['statuses'] ?? (is_array($overviewStatusesPayload) ? $overviewStatusesPayload : []); } +$adminTabDotsPayload = \App\Core\HookDispatcher::applyFilters('admin.tabs.dot_indicators', [ + 'dots' => [], + 'sections' => $sectionRegistry, + 'section_state' => $sectionState, + 'app_root' => $app_root, + 'user_id' => $userId, +]); +$adminTabDots = []; +if (is_array($adminTabDotsPayload)) { + $adminTabDots = $adminTabDotsPayload['dots'] ?? (is_array($adminTabDotsPayload) ? $adminTabDotsPayload : []); +} + // Get any new feedback messages include_once '../app/helpers/feedback.php'; diff --git a/app/templates/admin.php b/app/templates/admin.php index 6b99550..f7fefaf 100644 --- a/app/templates/admin.php +++ b/app/templates/admin.php @@ -31,6 +31,17 @@ if (!empty($modal_to_open)) { font-size: 0.75rem; max-width: 300px; } +.tm-admin-tab-label, +.tm-admin-subnav-link { + display: inline-flex; + align-items: center; + gap: 0.3rem; +} +.tm-admin-tab-label { + display: inline-flex; + align-items: center; + gap: 0.3rem; +} " aria-controls="tm-admin-tab-"> - + + + + + + @@ -637,7 +653,7 @@ endif; ?> if ($hasMigration) { foreach ($migrationFiles as $migrationFile) { $migrationContent = file_get_contents($migrationFile); - + // Extract tables created by this migration (plugin-owned) if (preg_match_all('/CREATE\s+TABLE(?:\s+IF\s+NOT\s+EXISTS)?\s+`?([a-zA-Z0-9_]+)`?/i', $migrationContent, $matches)) { foreach ($matches[1] as $tableName) { @@ -646,7 +662,7 @@ endif; ?> } } } - + // Find all referenced tables (dependencies) foreach ($allTables as $table) { if (strpos($migrationContent, $table) !== false && !in_array($table, $pluginOwnedTables)) { diff --git a/app/templates/page-menu.php b/app/templates/page-menu.php index c221aae..3a358d8 100644 --- a/app/templates/page-menu.php +++ b/app/templates/page-menu.php @@ -1,4 +1,33 @@ + [], + 'app_root' => $app_root, + 'user_id' => $userId ?? 0, + 'db' => $db ?? null, +]); +$navMainDots = []; +if (is_array($navMainDotsPayload)) { + $navMainDots = $navMainDotsPayload['dots'] ?? (is_array($navMainDotsPayload) ? $navMainDotsPayload : []); +} +$navMainHasDot = false; +if (!empty($navMainDots) && is_array($navMainDots)) { + $navMainHasDot = (bool)array_filter($navMainDots, static function($value) { + return (bool)$value; + }); +} + +$navSettingsDotsPayload = \App\Core\HookDispatcher::applyFilters('nav.settings.dot_indicators', [ + 'dots' => [], + 'app_root' => $app_root, + 'user_id' => $userId ?? 0, + 'db' => $db ?? null, +]); +$navSettingsDots = []; +if (is_array($navSettingsDotsPayload)) { + $navSettingsDots = $navSettingsDotsPayload['dots'] ?? (is_array($navSettingsDotsPayload) ? $navSettingsDotsPayload : []); +} +?>
@@ -65,14 +94,22 @@