{
"event": "PreToolUse",
"tool_name": "Read",
"tool_input": {
"file_path": "\/var\/www\/dev.campus.systemische-tools.de\/src\/View\/partials\/form\/collections-select.php"
}
}
{
"tool_response": {
"type": "text",
"file": {
"filePath": "\/var\/www\/dev.campus.systemische-tools.de\/src\/View\/partials\/form\/collections-select.php",
"content": "<?php\n\n\/**\n * Collections Select Partial\n *\n * Einheitliches Dropdown für RAG-Collection-Auswahl.\n * Verwendet in: Chat, Content Studio\n *\n * @param array $collections Array von Collection-Daten aus CollectionRepository\n * @param array $selected Array von ausgewählten collection_ids\n * @param string $name Form-Feldname (default: 'collections[]')\n * @param string $variant 'default', 'inline' oder 'checkbox'\n * @param bool $multiple Multi-Select (default: true)\n * @param bool $required Mindestens eine Auswahl erforderlich\n *\/\n\n$collections ??= [];\n$selected ??= [];\n\n\/\/ JSON-String zu Array konvertieren (Abwärtskompatibilität)\nif (is_string($selected)) {\n $selected = json_decode($selected, true) ?: [];\n}\n\n$name ??= 'collections[]';\n$variant ??= 'default';\n$multiple ??= true;\n$required ??= false;\n\n$class = match ($variant) {\n 'inline' => 'form-select form-select--inline',\n 'checkbox' => '', \/\/ Für Checkbox-Variante\n default => 'form-select',\n};\n?>\n<?php if ($variant === 'checkbox'): ?>\n<div class=\"checkbox-group collections-select\">\n <?php foreach ($collections as $col):\n $colId = $col['collection_id'];\n $isSelected = in_array($colId, $selected, true);\n $points = (int) ($col['points_count'] ?? 0);\n ?>\n <label class=\"checkbox-label\" title=\"<?= number_format($points) ?> Dokumente\">\n <input type=\"checkbox\" name=\"<?= htmlspecialchars($name) ?>\"\n value=\"<?= htmlspecialchars($colId) ?>\"\n <?= $isSelected ? 'checked' : '' ?>>\n <?= htmlspecialchars($col['display_name']) ?>\n <span class=\"checkbox-meta\">(<?= number_format($points) ?>)<\/span>\n <\/label>\n <?php endforeach; ?>\n<\/div>\n<?php else: ?>\n<select name=\"<?= htmlspecialchars($name) ?>\"\n <?= $multiple ? 'multiple' : '' ?>\n class=\"<?= $class ?> collections-select\"\n title=\"Collections für RAG auswählen\"\n <?= $required ? 'required' : '' ?>>\n <?php foreach ($collections as $col):\n $colId = $col['collection_id'];\n $isSelected = in_array($colId, $selected, true);\n $points = (int) ($col['points_count'] ?? 0);\n ?>\n <option value=\"<?= htmlspecialchars($colId) ?>\"\n <?= $isSelected ? 'selected' : '' ?>\n title=\"<?= number_format($points) ?> Dokumente\">\n <?= htmlspecialchars($col['display_name']) ?>\n <\/option>\n <?php endforeach; ?>\n<\/select>\n<?php endif; ?>\n",
"numLines": 71,
"startLine": 1,
"totalLines": 71
}
}
}