taxonomie.php

Code Hygiene Score: 100

Keine Issues gefunden.

Code

<?php ob_start(); ?>

<nav class="breadcrumb">
    <a href="/">Home</a> &raquo; <a href="/explorer">Explorer</a> &raquo; <a href="/system-explorer">System Explorer</a> &raquo; Taxonomie
</nav>

<h1>Taxonomie & Entities</h1>
<p>Aggregierte Kategorien, Keywords und Entities aus allen Chunks.</p>

<h2>Kategorien</h2>
<table data-sortable>
    <thead>
        <tr>
            <th data-sort="category">Kategorie</th>
            <th data-sort="chunks">Chunks</th>
            <th data-sort="tokens">Tokens</th>
            <th>Filter</th>
        </tr>
    </thead>
    <tbody>
        <?php foreach ($categories as $cat): ?>
        <tr>
            <td><span class="badge badge--primary"><?= htmlspecialchars($cat['taxonomy_category']) ?></span></td>
            <td><?= number_format($cat['chunk_count']) ?></td>
            <td><?= number_format($cat['token_count']) ?></td>
            <td>
                <a href="/system-explorer/chunks?category=<?= urlencode($cat['taxonomy_category']) ?>" class="btn btn--small">Chunks anzeigen</a>
            </td>
        </tr>
        <?php endforeach; ?>
    </tbody>
</table>

<h2>Top Keywords (<?= count($topKeywords) ?>)</h2>
<div class="tags">
    <?php foreach ($topKeywords as $keyword => $count): ?>
    <span class="badge" title="<?= $count ?> Vorkommen"><?= htmlspecialchars($keyword) ?> (<?= $count ?>)</span>
    <?php endforeach; ?>
</div>

<h2>Top Entities (<?= count($topEntities) ?>)</h2>
<table data-sortable>
    <thead>
        <tr>
            <th data-sort="name">Name</th>
            <th data-sort="type">Typ</th>
            <th data-sort="count">Vorkommen</th>
        </tr>
    </thead>
    <tbody>
        <?php foreach ($topEntities as $key => $count): ?>
        <?php [$name, $type] = explode('|', $key); ?>
        <tr>
            <td><?= htmlspecialchars($name) ?></td>
            <td><span class="badge"><?= htmlspecialchars($type) ?></span></td>
            <td><?= $count ?></td>
        </tr>
        <?php endforeach; ?>
    </tbody>
</table>

<p class="links-bar">
    <a href="/system-explorer">Zurück zum Explorer</a> |
    <a href="/system-explorer/chunks">Alle Chunks</a>
</p>

<?php $content = ob_get_clean(); ?>
<?php require VIEW_PATH . '/layout.php'; ?>
← Übersicht