Backup #1622

ID1622
Dateipfad/var/www/dev.campus.systemische-tools.de/src/View/semantic-explorer/taxonomie.php
Version3
Typ modified
Größe3.5 KB
Hash85172011d02a847d3874dede553d83fa063d3402f42bd82d5b83062555e1f4a1
Datum2025-12-27 09:44:19
Geändert vonclaude-code-hook
GrundClaude Code Pre-Hook Backup vor Edit-Operation
Datei existiert Ja

Dateiinhalt

<?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="/">Home</a> &raquo; <a href="/explorer">Explorer</a> &raquo; <a href="/semantic-explorer">Semantic Explorer</a> &raquo; 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'; ?>

Vollständig herunterladen

Aktionen

Herunterladen

Andere Versionen dieser Datei

ID Version Typ Größe Datum
1622 3 modified 3.5 KB 2025-12-27 09:44
1533 2 modified 3.6 KB 2025-12-26 07:24
14 1 modified 2.9 KB 2025-12-20 16:43

← Zurück zur Übersicht