{
"event": "PreToolUse",
"tool_name": "Read",
"tool_input": {
"file_path": "\/var\/www\/dev.campus.systemische-tools.de\/src\/View\/semantic-explorer\/entitaeten\/edit.php"
}
}
{
"tool_response": {
"type": "text",
"file": {
"filePath": "\/var\/www\/dev.campus.systemische-tools.de\/src\/View\/semantic-explorer\/entitaeten\/edit.php",
"content": "<?php ob_start(); ?>\n\n<nav class=\"breadcrumb\">\n <a href=\"\/\">Campus KI<\/a> »\n <a href=\"\/semantic-explorer\">Semantic Explorer<\/a> »\n <a href=\"\/semantic-explorer\/entitaeten\">Entitäten<\/a> »\n <a href=\"\/semantic-explorer\/entitaeten\/<?= $entity['id'] ?>\"><?= htmlspecialchars($entity['name']) ?><\/a> » Bearbeiten\n<\/nav>\n\n<h1>Entität bearbeiten<\/h1>\n\n<form id=\"entity-form\" class=\"form\" style=\"max-width: 600px;\">\n <div class=\"form-group\">\n <label for=\"name\">Name *<\/label>\n <input type=\"text\" id=\"name\" name=\"name\" class=\"form-input\" required\n value=\"<?= htmlspecialchars($entity['name']) ?>\">\n <\/div>\n\n <div class=\"form-group\">\n <label for=\"type\">Typ *<\/label>\n <select id=\"type\" name=\"type\" class=\"form-select\" required>\n <?php foreach ($types as $t): ?>\n <option value=\"<?= htmlspecialchars($t) ?>\"\n <?= $entity['type'] === $t ? 'selected' : '' ?>><?= ucfirst(htmlspecialchars($t)) ?><\/option>\n <?php endforeach; ?>\n <\/select>\n <\/div>\n\n <div class=\"form-group\">\n <label for=\"description\">Beschreibung<\/label>\n <textarea id=\"description\" name=\"description\" class=\"form-textarea\" rows=\"4\"><?= htmlspecialchars($entity['description'] ?? '') ?><\/textarea>\n <\/div>\n\n <div class=\"form-actions\">\n <button type=\"submit\" class=\"btn btn--primary\">Speichern<\/button>\n <a href=\"\/semantic-explorer\/entitaeten\/<?= $entity['id'] ?>\" class=\"btn\">Abbrechen<\/a>\n <button type=\"button\" id=\"delete-btn\" class=\"btn btn--danger\" style=\"margin-left: auto;\">Loeschen<\/button>\n <\/div>\n<\/form>\n<div id=\"form-message\" class=\"form-message\"><\/div>\n\n<script>\ndocument.getElementById('entity-form').addEventListener('submit', async (e) => {\n e.preventDefault();\n const form = e.target;\n const formData = new FormData(form);\n const data = Object.fromEntries(formData.entries());\n\n const response = await fetch('\/semantic-explorer\/entitaeten\/<?= $entity['id'] ?>', {\n method: 'POST',\n headers: {'Content-Type': 'application\/json'},\n body: JSON.stringify(data)\n });\n const result = await response.json();\n\n if (result.success) {\n window.location.href = '\/semantic-explorer\/entitaeten\/<?= $entity['id'] ?>';\n } else {\n document.getElementById('form-message').innerHTML =\n '<span class=\"form-message--error\">Fehler: ' + result.error + '<\/span>';\n }\n});\n\ndocument.getElementById('delete-btn').addEventListener('click', async () => {\n if (!confirm('Entität wirklich löschen?')) return;\n\n const response = await fetch('\/semantic-explorer\/entitaeten\/<?= $entity['id'] ?>\/delete', {\n method: 'POST'\n });\n const result = await response.json();\n\n if (result.success) {\n window.location.href = '\/semantic-explorer\/entitaeten';\n } else {\n document.getElementById('form-message').innerHTML =\n '<span class=\"form-message--error\">Fehler: ' + result.error + '<\/span>';\n }\n});\n<\/script>\n\n<?php $content = ob_get_clean(); ?>\n<?php require VIEW_PATH . '\/layout.php'; ?>\n",
"numLines": 83,
"startLine": 1,
"totalLines": 83
}
}
}