index.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; Seiten
</nav>

<h1>Seiten</h1>
<p>Unterseiten der Dokumentation (depth > 0).</p>

<form method="get" class="filter-form">
    <input type="text" name="search" value="<?= htmlspecialchars($currentSearch) ?>" placeholder="Suche...">
    <select name="parent">
        <option value="">Alle Dokumente</option>
        <?php foreach ($dokumente as $d): ?>
        <option value="<?= $d['id'] ?>" <?= $currentParent == $d['id'] ? 'selected' : '' ?>><?= htmlspecialchars($d['title']) ?></option>
        <?php endforeach; ?>
    </select>
    <button type="submit" class="btn btn--primary">Filtern</button>
    <?php if ($currentSearch || $currentParent): ?>
    <a href="/system-explorer/seiten" class="btn">Reset</a>
    <?php endif; ?>
</form>

<table data-sortable>
    <thead>
        <tr>
            <th data-sort="title">Titel</th>
            <th data-sort="parent">Dokument</th>
            <th data-sort="depth">Tiefe</th>
            <th data-sort="chunks">Chunks</th>
            <th data-sort="tokens">Tokens</th>
            <th>Aktionen</th>
        </tr>
    </thead>
    <tbody>
        <?php foreach ($seiten as $s): ?>
        <tr>
            <td><a href="/system-explorer/seiten/<?= $s['id'] ?>"><?= htmlspecialchars($s['title']) ?></a></td>
            <td>
                <?php if ($s['parent_title']): ?>
                <a href="/system-explorer/seiten?parent=<?= $s['parent_id'] ?>"><?= htmlspecialchars($s['parent_title']) ?></a>
                <?php else: ?>
                -
                <?php endif; ?>
            </td>
            <td><?= $s['depth'] ?></td>
            <td><?= $s['chunks_count'] ?></td>
            <td><?= number_format($s['token_count']) ?></td>
            <td>
                <a href="/system-explorer/seiten/<?= $s['id'] ?>" class="btn btn--small btn--primary">Details</a>
                <a href="/docs/<?= htmlspecialchars($s['path']) ?>" class="btn btn--small">Docs</a>
            </td>
        </tr>
        <?php endforeach; ?>
    </tbody>
</table>

<p>Gesamt: <?= count($seiten) ?> Seiten</p>

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

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