prepare('SELECT * FROM projects WHERE id = ?'); $stmt->execute([$project_id]); $project = $stmt->fetch(); if (!$project) { http_response_code(404); include ROOT . '/views/error.php'; exit; } $type = ProjectTypes::get($project['type']); $tabs = $type ? $type::tabs() : ['files']; $isHexo = $project['type'] === 'hexo'; $isStorage = $project['type'] === 'storage'; $pid = (int)$project['id']; // Remove 'git' tab if no git repo found at project root or one level deep if (in_array('git', $tabs)) { $projectPath = $project['path']; $hasGit = is_dir($projectPath . '/.git'); if (!$hasGit) { foreach (@scandir($projectPath) ?: [] as $item) { if ($item[0] === '.') continue; if (is_dir($projectPath . '/' . $item . '/.git')) { $hasGit = true; break; } } } if (!$hasGit) $tabs = array_values(array_diff($tabs, ['git'])); } $tab = $_GET['tab'] ?? $tabs[0]; if (!in_array($tab, $tabs)) $tab = $tabs[0]; $page_title = $project['name']; $nav_active = ''; include ROOT . '/views/_header.php'; ?> 'Dashboard', 'analytics' => 'Analytics', 'posts' => 'Posts', 'config' => 'Config', 'files' => 'Files', 'media' => 'Media', 'run' => 'Run', 'themes' => 'Themes', 'plugins' => 'Plugins', 'git' => 'Git', 'notes' => 'Notes', 'settings' => 'Settings', ]; $tabIcons = [ 'dashboard' => 'bi-grid-1x2', 'analytics' => 'bi-graph-up', 'posts' => 'bi-file-earmark-text','config' => 'bi-sliders', 'files' => 'bi-folder2', 'media' => 'bi-images', 'run' => 'bi-terminal', 'themes' => 'bi-palette', 'plugins' => 'bi-puzzle', 'git' => 'bi-git', 'notes' => 'bi-sticky', 'settings' => 'bi-gear', ]; $tabGroups = [ ['dashboard', 'analytics'], ['posts', 'config', 'files', 'media'], ['run', 'themes', 'plugins', 'git'], ['notes', 'settings'], ]; ?>
Select a post to edit
Loading…
Select a file to edit
Commands
Output

        
Loading…
'; include ROOT . '/views/_footer.php'; ?>