show.php

Code Hygiene Score: 99

Issues 1

Zeile Typ Beschreibung
91 magic_number Magic Number gefunden: 100

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; <a href="/system-explorer/seiten">Seiten</a> &raquo;
    <?php foreach ($breadcrumb as $i => $b): ?>
        <?php if ($i < count($breadcrumb) - 1): ?>
            <a href="/system-explorer/<?= $b['depth'] == 0 ? 'dokumente' : 'seiten' ?>/<?= $b['id'] ?>"><?= htmlspecialchars($b['title']) ?></a> &raquo;
        <?php else: ?>
            <?= htmlspecialchars($b['title']) ?>
        <?php endif; ?>
    <?php endforeach; ?>
</nav>

<h1><?= htmlspecialchars($seite['title']) ?></h1>
<p><code><?= htmlspecialchars($seite['path']) ?></code></p>

<div class="stats-grid">
    <div class="stat-card stat-card--info">
        <span class="stat-card__value"><?= $seite['depth'] ?></span>
        <span class="stat-card__label">Tiefe</span>
    </div>
    <div class="stat-card stat-card--success">
        <span class="stat-card__value"><?= count($chunks) ?></span>
        <span class="stat-card__label">Chunks</span>
    </div>
    <div class="stat-card">
        <span class="stat-card__value"><?= count($unterseiten) ?></span>
        <span class="stat-card__label">Unterseiten</span>
    </div>
</div>

<?php if (!empty($unterseiten)): ?>
<h2>Unterseiten</h2>
<table>
    <thead>
        <tr>
            <th>Titel</th>
            <th>Pfad</th>
            <th>Tiefe</th>
            <th>Aktionen</th>
        </tr>
    </thead>
    <tbody>
        <?php foreach ($unterseiten as $u): ?>
        <tr>
            <td><a href="/system-explorer/seiten/<?= $u['id'] ?>"><?= htmlspecialchars($u['title']) ?></a></td>
            <td><code><?= htmlspecialchars($u['path']) ?></code></td>
            <td><?= $u['depth'] ?></td>
            <td>
                <a href="/system-explorer/seiten/<?= $u['id'] ?>" class="btn btn--small btn--primary">Details</a>
            </td>
        </tr>
        <?php endforeach; ?>
    </tbody>
</table>
<?php endif; ?>

<?php if (!empty($chunks)): ?>
<h2>Chunks</h2>
<table>
    <thead>
        <tr>
            <th>Index</th>
            <th>Kategorie</th>
            <th>Tokens</th>
            <th>Status</th>
            <th>Analysiert</th>
            <th>Inhalt</th>
        </tr>
    </thead>
    <tbody>
        <?php foreach ($chunks as $c): ?>
        <tr>
            <td><a href="/system-explorer/chunks/<?= $c['id'] ?>">#<?= $c['chunk_index'] ?></a></td>
            <td>
                <?php if ($c['taxonomy_category']): ?>
                <span class="badge"><?= htmlspecialchars($c['taxonomy_category']) ?></span>
                <?php endif; ?>
            </td>
            <td><?= $c['token_count'] ?></td>
            <td>
                <?php if ($c['qdrant_id']): ?>
                <span class="badge badge--success">synced</span>
                <?php elseif ($c['analysis_status'] === 'completed'): ?>
                <span class="badge badge--info">analyzed</span>
                <?php else: ?>
                <span class="badge"><?= $c['analysis_status'] ?></span>
                <?php endif; ?>
            </td>
            <td><?= $c['analyzed_at'] ? date('d.m.Y H:i', strtotime($c['analyzed_at'])) : '-' ?></td>
            <td><?= htmlspecialchars(substr(strip_tags($c['content']), 0, 100)) ?>...</td>
        </tr>
        <?php endforeach; ?>
    </tbody>
</table>
<?php endif; ?>

<p class="links-bar">
    <a href="/system-explorer/seiten">Alle Seiten</a> |
    <a href="/docs/<?= htmlspecialchars($seite['path']) ?>">In Docs anzeigen</a>
    <?php if ($seite['parent_id']): ?>
    | <a href="/system-explorer/<?= $seite['depth'] == 1 ? 'dokumente' : 'seiten' ?>/<?= $seite['parent_id'] ?>">Zurück zu <?= htmlspecialchars($seite['parent_title']) ?></a>
    <?php endif; ?>
</p>

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