taxonomie.php
- Pfad:
src/View/semantic-explorer/taxonomie.php - Namespace: -
- Zeilen: 119 | Größe: 3,546 Bytes
- Geändert: 2025-12-27 09:44:19 | Gescannt: 2025-12-31 10:22:15
Code Hygiene Score: 100
- Dependencies: 100 (25%)
- LOC: 100 (20%)
- Methods: 100 (20%)
- Secrets: 100 (15%)
- Classes: 100 (10%)
- Magic Numbers: 100 (10%)
Keine Issues gefunden.
Funktionen 1
-
renderTaxonomyTree()Zeile 3
Versionen 3
-
v3
2025-12-27 09:44 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Edit-Operation -
v2
2025-12-26 07:24 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Write-Operation -
v1
2025-12-20 16:43 | claude-code-hook | modified
Claude Code Pre-Hook Backup vor Write-Operation
Code
<?php ob_start();
function renderTaxonomyTree(array $items, int $level = 0): string
{
if (empty($items)) {
return '';
}
$html = '<ol class="taxonomy-tree">';
foreach ($items as $item) {
$html .= '<li>';
$html .= '<span class="taxonomy-term">';
$html .= htmlspecialchars($item['name']);
if ($item['chunk_count'] > 0) {
$html .= ' (' . $item['chunk_count'] . ')';
}
$html .= '</span>';
if (!empty($item['children'])) {
$html .= renderTaxonomyTree($item['children'], $level + 1);
}
$html .= '</li>';
}
$html .= '</ol>';
return $html;
}
?>
<nav class="breadcrumb">
<a href="/">Campus KI</a> » <a href="/semantic-explorer">Semantic Explorer</a> » Taxonomie
</nav>
<h1>Taxonomie</h1>
<p>Hierarchische Kategorisierung der Inhalte.</p>
<div class="stats-grid">
<div class="stat-card">
<span class="stat-card__value"><?= $stats['total_terms'] ?? 0 ?></span>
<span class="stat-card__label">Begriffe</span>
</div>
<div class="stat-card">
<span class="stat-card__value"><?= $stats['root_terms'] ?? 0 ?></span>
<span class="stat-card__label">Hauptkategorien</span>
</div>
<div class="stat-card">
<span class="stat-card__value"><?= $stats['max_depth'] ?? 0 ?></span>
<span class="stat-card__label">Max. Tiefe</span>
</div>
<div class="stat-card">
<span class="stat-card__value"><?= $stats['tagged_chunks'] ?? 0 ?></span>
<span class="stat-card__label">Getaggte Chunks</span>
</div>
</div>
<?php if (!empty($hierarchy)): ?>
<h2>Hierarchie</h2>
<?= renderTaxonomyTree($hierarchy) ?>
<?php endif; ?>
<?php if (!empty($terms)): ?>
<h2>Alle Begriffe</h2>
<div class="filters">
<input type="search" id="taxonomy-search" class="form-input" placeholder="Durchsuchen...">
</div>
<table id="taxonomy-table" data-sortable>
<thead>
<tr>
<th data-sort="name">Begriff</th>
<th data-sort="path">Pfad</th>
<th data-sort="depth">Tiefe</th>
<th data-sort="chunk_count">Chunks</th>
<th data-sort="children_count">Unterbegriffe</th>
</tr>
</thead>
<tbody>
<?php foreach ($terms as $t): ?>
<tr>
<td><?= htmlspecialchars($t['name']) ?></td>
<td><?= htmlspecialchars($t['path'] ?? $t['slug']) ?></td>
<td><?= $t['depth'] ?></td>
<td><?= $t['chunk_count'] ?></td>
<td><?= $t['children_count'] ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php else: ?>
<p class="empty-state">Keine Taxonomie-Begriffe gefunden. Fuehren Sie die semantische Analyse aus.</p>
<?php endif; ?>
<p class="links-bar">
<a href="/semantic-explorer">Zurueck zum Explorer</a> |
<a href="/semantic-explorer/ontologie">Ontologie</a>
</p>
<script type="module">
import { init } from '/js/components/data-table.js';
const dataTable = init({
clock: { now_epoch_ms_utc: () => Date.now() },
logger: console,
ui: {
showMessage: (msg) => { console.log(msg.type + ': ' + msg.text); },
disableFeature: (key) => { console.warn('Feature disabled: ' + key); },
offerRetry: () => Promise.resolve(false)
},
runId: crypto.randomUUID()
});
dataTable.create('taxonomy-table', {
searchInput: 'taxonomy-search',
pageSize: 20
});
</script>
<?php $content = ob_get_clean(); ?>
<?php require VIEW_PATH . '/layout.php'; ?>