knowledgecenter: tab layout for category form + fix post discussion crash

categories_cardform.php now uses a 3-tab layout (Allgemein / Berechtigungen /
Unterkategorien) instead of a content+sidebar layout. The permissions section
spans full width with a 6-column grid: Mandanten/Abteilungen/Rollen each in
2 cols, Einrichtungen/Fachbereiche each in 3 cols for more space.

post_cardform.php: the Diskussion tab crashed with a fatal require_once when
the forum module doesn't exist. Now guarded with file_exists() and shows a
placeholder message for new posts and missing modules.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-22 11:25:15 +02:00
parent 4e8dd8745f
commit d1b9e89df3
2 changed files with 247 additions and 227 deletions

View File

@@ -231,27 +231,73 @@ while ($row = mysqli_fetch_assoc($resultParents)) {
} }
$parentCount = count($parentCategories); $parentCount = count($parentCategories);
?> ?>
<div class="cardform_containern"> <style>
.cf-layout{background:#fff;border-radius:8px;box-shadow:0 1px 3px rgba(0,0,0,.1);overflow:hidden;}
.cf-topbar{display:flex;align-items:center;gap:10px;padding:12px 16px;border-bottom:2px solid #e5e7eb;}
.cf-topbar-back{font-size:18px;text-decoration:none;color:#374151;padding:4px 8px;border-radius:4px;}
.cf-topbar-back:hover{background:#f3f4f6;}
.cf-section-tabs{display:flex;gap:4px;flex:1;}
.cf-section-tab{padding:6px 18px;border:1px solid #d1d5db;border-radius:6px;background:#f9fafb;cursor:pointer;font-size:13px;color:#374151;font-weight:500;line-height:1.4;}
.cf-section-tab.active{background:#3B82F6;color:#fff;border-color:#3B82F6;}
.cf-topbar-actions{display:flex;gap:6px;align-items:center;margin-left:auto;}
.cf-tab-pane{display:none;padding:20px;}
.cf-tab-pane.active{display:block;}
.cf-general-layout{display:grid;grid-template-columns:1fr 260px;gap:24px;align-items:start;}
.cf-settings-col{border-left:1px solid #e5e7eb;padding-left:20px;display:flex;flex-direction:column;gap:12px;}
.cf-settings-col label{display:flex;justify-content:space-between;align-items:center;gap:8px;font-size:14px;color:#374151;cursor:pointer;}
.cf-settings-meta{font-size:12px;color:#6b7280;margin-top:8px;}
.cf-settings-meta ul{margin:4px 0;padding-left:16px;}
.cf-settings-meta a{color:#3B82F6;}
.cf-perm-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:20px;align-items:start;}
.cf-perm-sm{grid-column:span 2;}
.cf-perm-lg{grid-column:span 3;}
.cf-perm-block h4{font-size:13px;font-weight:600;margin:0 0 8px 0;color:#374151;}
</style>
<div class="cardform"> <div class="cf-layout">
<!-- Überschrift und Message-Container --> <!-- Top bar: navigation, section tabs, save/delete -->
<div class="cf-topbar">
<a class="cf-topbar-back" href="?action=Categories&embedded=<?= $isEmbedded ?>">←</a>
<div class="cf-section-tabs">
<button class="cf-section-tab active" data-target="cf-tab-allgemein">Allgemein</button>
<?php if ($categoryId != 0): ?>
<button class="cf-section-tab" data-target="cf-tab-berechtigungen">Berechtigungen</button>
<button class="cf-section-tab" data-target="cf-tab-unterkategorien">Unterkategorien</button>
<?php endif; ?>
</div>
<div class="cf-topbar-actions">
<button id="message" style="opacity:0; pointer-events:none; min-width:1px;"></button>
<?php if (get_permission_state('r-wiki', $GLOBALS['main_contact']['master_mandant_id'], $GLOBALS['main_contact']['id']) == 1): ?>
<button class="post-action-btn" id="saveAllTranslations" style="background:#14b814;">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
class="bi bi-check" viewBox="0 0 16 16">
<path d="M10.97 4.97a.75.75 0 0 1 1.07 1.05l-3.99 4.99a.75.75 0 0 1-1.08.02L4.324 8.384a.75.75 0 1 1 1.06-1.06l2.094 2.093 3.473-4.425z"/>
</svg>
</button>
<button class="post-action-btn red" id="deleteCategory">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
class="bi bi-trash3-fill" viewBox="0 0 16 16">
<path d="M11 1.5v1h3.5a.5.5 0 0 1 0 1h-.538l-.853 10.66A2 2 0 0 1 11.115 16h-6.23a2 2 0 0 1-1.994-1.84L2.038 3.5H1.5a.5.5 0 0 1 0-1H5v-1A1.5 1.5 0 0 1 6.5 0h3A1.5 1.5 0 0 1 11 1.5m-5 0v1h4v-1a.5.5 0 0 0-.5-.5h-3a.5.5 0 0 0-.5.5M4.5 5.029l.5 8.5a.5.5 0 1 0 .998-.06l-.5-8.5a.5.5 0 1 0-.998.06m6.53-.528a.5.5 0 0 0-.528.47l-.5 8.5a.5.5 0 0 0 .998.058l.5-8.5a.5.5 0 0 0-.47-.528M8 4.5a.5.5 0 0 0-.5.5v8.5a.5.5 0 0 0 1 0V5a.5.5 0 0 0-.5-.5"/>
</svg>
</button>
<?php endif; ?>
</div>
</div>
<div class="card-body"> <!-- Tab: Allgemein -->
<div class="tabbar_with_button"> <div id="cf-tab-allgemein" class="cf-tab-pane active">
<a href="?action=Categories&embedded=<?= $isEmbedded ?>">←</a> <div class="cf-general-layout">
<div>
<ul class="nav nav-tabs" id="languageTabs" role="tablist"> <ul class="nav nav-tabs" id="languageTabs" role="tablist">
<?php foreach ($languages as $index => $lang): ?> <?php foreach ($languages as $index => $lang): ?>
<li class="nav-item" role="presentation"> <li class="nav-item" role="presentation">
<button class="nav-link <?= ($index === 0) ? 'active' : '' ?>" id="tab-<?= $lang['code'] ?>" <button class="nav-link <?= ($index === 0) ? 'active' : '' ?>" id="tab-<?= $lang['code'] ?>"
data-bs-toggle="tab" data-bs-target="#lang-<?= $lang['code'] ?>" type="button" role="tab"> data-bs-toggle="tab" data-bs-target="#lang-<?= $lang['code'] ?>" type="button" role="tab">
<?= htmlspecialchars(strtoupper($lang['code'])) ?> </button> <?= htmlspecialchars(strtoupper($lang['code'])) ?>
</button>
</li> </li>
<?php endforeach; ?> <?php endforeach; ?>
</ul> </ul>
<div>
<button id="message" style="opacity:0;"></button>
</div>
</div>
<div class="tab-content-languages" id="languageTabsContent"> <div class="tab-content-languages" id="languageTabsContent">
<?php foreach ($languages as $index => $lang): <?php foreach ($languages as $index => $lang):
$trans = $translations[$lang['code']]; $trans = $translations[$lang['code']];
@@ -277,8 +323,7 @@ $parentCount = count($parentCategories);
<input type="hidden" name="image-<?= $lang['code'] ?>" id="image-<?= $lang['code'] ?>" <input type="hidden" name="image-<?= $lang['code'] ?>" id="image-<?= $lang['code'] ?>"
value="<?= htmlspecialchars($trans['image']) ?>"> value="<?= htmlspecialchars($trans['image']) ?>">
<div class="post-action-btn green openFileGallery" data-ajax-function="saveCategoryAjax" <div class="post-action-btn green openFileGallery" data-ajax-function="saveCategoryAjax"
data-target="image-<?= $lang['code'] ?>"> data-target="image-<?= $lang['code'] ?>">+</div>
+</div>
<div class="post-action-btn clearImage" data-target="image-<?= $lang['code'] ?>">✕</div> <div class="post-action-btn clearImage" data-target="image-<?= $lang['code'] ?>">✕</div>
</div> </div>
<?php endif; ?> <?php endif; ?>
@@ -286,164 +331,36 @@ $parentCount = count($parentCategories);
</div> </div>
<?php endforeach; ?> <?php endforeach; ?>
</div> </div>
<?php if ($categoryId != 0): ?>
<!-- Container für Unterkategorien nur anzeigen, wenn Kategorie bereits existiert -->
<div class="category_sub_select">
<!-- Container für verknüpfte Unterkategorien -->
<div class="category_sub_select_container">
<h3><?= $translation->get("connected_subcategories") ?></h3>
<!-- Suchfeld für verknüpfte Kategorien -->
<input type="search" class="subcategory-search" id="search-selected"
placeholder="Suche in verknüpften Kategorien">
<ul id="selectedSubcategories" class="list-group connectedSortable">
<?php if (empty($subcategories)): ?>
<li class="list-group-item empty-hint">
<?= $translation->get("no_connected_subcategories") ?>
</li>
<?php else: ?>
<?php foreach ($subcategories as $sub): ?>
<li class="list-group-item" data-id="<?= $sub['id'] ?>">
<div>
<!-- Icon und Titel -->
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
class="bi bi-grip-vertical" viewBox="0 0 16 16">
<path
d="M7 2a1 1 0 1 1-2 0 1 1 0 0 1 2 0m3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0M7 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0m3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0M7 8a1 1 0 1 1-2 0 1 1 0 0 1 2 0m3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0m-3 3a1 1 0 1 1-2 0 1 1 0 0 1 2 0m3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0m-3 3a1 1 0 1 1-2 0 1 1 0 0 1 2 0m3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0" />
</svg>
<?= htmlspecialchars($sub['title'] ?? "Fehlende Übersetzung ID {$sub['id']}") ?>
</div>
<button title="<?= $translation->get("delete") ?>" type="button"
class="unlinkSubcategory">✕</button>
</li>
<?php endforeach; ?>
<?php endif; ?>
</ul>
</div> </div>
<!-- Container für verfügbare Kategorien --> <!-- Settings sidebar -->
<div class="category_sub_select_container"> <div class="cf-settings-col">
<h3><?= $translation->get("available_categories") ?></h3>
<!-- Suchfeld für verfügbare Kategorien -->
<input type="search" class="subcategory-search" id="search-available"
placeholder="Suche in verfügbaren Kategorien">
<ul id="availableSubcategories" class="list-group connectedSortable">
<?php if (mysqli_num_rows($availableResult) == 0): ?>
<li class="list-group-item empty-hint">
<?= $translation->get("all_available_categories_used") ?>
</li>
<?php else: ?>
<?php while ($row = mysqli_fetch_assoc($availableResult)): ?>
<li class="list-group-item" data-id="<?= $row['id'] ?>">
<div>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
class="bi bi-grip-vertical" viewBox="0 0 16 16">
<path
d="M7 2a1 1 0 1 1-2 0 1 1 0 0 1 2 0m3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0M7 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0m3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0M7 8a1 1 0 1 1-2 0 1 1 0 0 1 2 0m3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0m-3 3a1 1 0 1 1-2 0 1 1 0 0 1 2 0m3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0m-3 3a1 1 0 1 1-2 0 1 1 0 0 1 2 0m3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0" />
</svg>
<?= htmlspecialchars($row['title'] ?: "Fehlende Übersetzung ID {$row['id']}") ?>
</div>
</li>
<?php endwhile; ?>
<?php endif; ?>
</ul>
</div>
</div>
<?php endif; ?>
</div>
</div>
<div class="aside">
<div class="aside_section">
<div class="aside_toolbar">
<?php if (get_permission_state('r-wiki', $GLOBALS['main_contact']['master_mandant_id'], $GLOBALS['main_contact']['id']) == 1) { ?>
<button class="post-action-btn" id="saveAllTranslations" style="background: #14b814;">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
class="bi bi-check" viewBox="0 0 16 16">
<path
d="M10.97 4.97a.75.75 0 0 1 1.07 1.05l-3.99 4.99a.75.75 0 0 1-1.08.02L4.324 8.384a.75.75 0 1 1 1.06-1.06l2.094 2.093 3.473-4.425z">
</path>
</svg>
</button>
<?php } ?>
<?php if (get_permission_state('r-wiki', $GLOBALS['main_contact']['master_mandant_id'], $GLOBALS['main_contact']['id']) == 1) { ?>
<button class="post-action-btn red" id="deleteCategory">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
class="bi bi-trash3-fill" viewBox="0 0 16 16">
<path
d="M11 1.5v1h3.5a.5.5 0 0 1 0 1h-.538l-.853 10.66A2 2 0 0 1 11.115 16h-6.23a2 2 0 0 1-1.994-1.84L2.038 3.5H1.5a.5.5 0 0 1 0-1H5v-1A1.5 1.5 0 0 1 6.5 0h3A1.5 1.5 0 0 1 11 1.5m-5 0v1h4v-1a.5.5 0 0 0-.5-.5h-3a.5.5 0 0 0-.5.5M4.5 5.029l.5 8.5a.5.5 0 1 0 .998-.06l-.5-8.5a.5.5 0 1 0-.998.06m6.53-.528a.5.5 0 0 0-.528.47l-.5 8.5a.5.5 0 0 0 .998.058l.5-8.5a.5.5 0 0 0-.47-.528M8 4.5a.5.5 0 0 0-.5.5v8.5a.5.5 0 0 0 1 0V5a.5.5 0 0 0-.5-.5" />
</svg>
</button>
<?php } ?>
</div>
</div>
<div class="aside_section">
<label for="stateCheckbox"> <label for="stateCheckbox">
<?= $translation->get("active_state") ?> <?= $translation->get("active_state") ?>
<input type="checkbox" id="stateCheckbox" name="state" value="1" <?= $state === 1 ? 'checked' : '' ?>> <input type="checkbox" id="stateCheckbox" name="state" value="1" <?= $state === 1 ? 'checked' : '' ?>>
</label> </label>
</div>
<?php $is_navigation_item = $translations[$languages[0]['code']]['is_navigation_item'] ?? 0; ?> <?php $is_navigation_item = $translations[$languages[0]['code']]['is_navigation_item'] ?? 0; ?>
<label for="isNavigationItem">
<div class="aside_section">
<label for="createNavigationCheckbox">
<?= $translation->get("create_navigation_menu") ?> <?= $translation->get("create_navigation_menu") ?>
<input type="checkbox" id="isNavigationItem" name="is_navigation_item" value="1" <input type="checkbox" id="isNavigationItem" name="is_navigation_item" value="1"
<?= $is_navigation_item == 1 ? 'checked' : '' ?>> <?= $is_navigation_item == 1 ? 'checked' : '' ?>>
</label> </label>
</div>
<div class="aside_section">
<label for="color_hex"> <label for="color_hex">
<?= $translation->get("color_hex") ?> <?= $translation->get("color_hex") ?>
<input type="color" id="color_hex" name="color_hex" value="<?= $category['color_hex'] ?? '#3B82F6FF' ?>"> <input type="color" id="color_hex" name="color_hex" value="<?= $category['color_hex'] ?? '#3B82F6FF' ?>">
</label> </label>
</div>
<?php $enable_post_color_pickers = isset($category['enable_post_color_pickers']) ? (int) $category['enable_post_color_pickers'] : 0; ?> <?php $enable_post_color_pickers = isset($category['enable_post_color_pickers']) ? (int) $category['enable_post_color_pickers'] : 0; ?>
<div class="aside_section">
<label for="enablePostColorPickersCheckbox"> <label for="enablePostColorPickersCheckbox">
<?= $translation->get("enable_post_color_pickers") ?> <?= $translation->get("enable_post_color_pickers") ?>
<input type="checkbox" id="enablePostColorPickersCheckbox" name="enable_post_color_pickers" value="1" <input type="checkbox" id="enablePostColorPickersCheckbox" name="enable_post_color_pickers" value="1"
<?= $enable_post_color_pickers === 1 ? 'checked' : '' ?>> <?= $enable_post_color_pickers === 1 ? 'checked' : '' ?>>
</label> </label>
</div>
<?php if ($categoryId != 0): ?>
<div class="aside_section">
<h3><?= $translation->get("permissions_and_filters") ?></h3>
<label for="selected_mandants">
<?= $translation->get("mandants") ?>
<input type="text" id="selected_mandants" name="selected_mandants"
value='<?= htmlspecialchars(json_encode($savedMandantsData)); ?>'>
</label>
<label for="selected_departments">
<?= $translation->get("departments") ?>
<input type="text" id="selected_departments" name="selected_departments"
value='<?= htmlspecialchars(json_encode($savedDepartmentsData)); ?>'>
</label>
<label for="selected_roles">
<?= $translation->get("roles") ?>
<input type="text" id="selected_roles" name="selected_roles"
value='<?= htmlspecialchars(json_encode($savedRolesData)); ?>'>
</label>
<label for="selected_einrichts">
Einrichtungen
<input type="text" id="selected_einrichts" name="selected_einrichts"
value='<?= htmlspecialchars(json_encode($savedEinrichtsData)); ?>'>
</label>
<label for="selected_fachbereiche">
Fachbereiche
<input type="text" id="selected_fachbereiche" name="selected_fachbereiche"
value='<?= htmlspecialchars(json_encode($savedFachbereicheData)); ?>'>
</label>
</div>
<?php endif; ?>
<?php if (!empty($categoryId)): ?>
<?php <?php
if (!empty($categoryId)) {
$formatter = new IntlDateFormatter( $formatter = new IntlDateFormatter(
'de_DE', 'de_DE',
IntlDateFormatter::LONG, IntlDateFormatter::LONG,
@@ -451,7 +368,7 @@ $parentCount = count($parentCategories);
); );
$timestamp = strtotime($category["modified_at"]); $timestamp = strtotime($category["modified_at"]);
?> ?>
<div class="aside_section"> <div class="cf-settings-meta">
<small><?= $translation->get("connected_subcategories") ?> (<?= $parentCount ?>)</small> <small><?= $translation->get("connected_subcategories") ?> (<?= $parentCount ?>)</small>
<?php if ($parentCount > 0): ?> <?php if ($parentCount > 0): ?>
<ul class="connected_categories"> <ul class="connected_categories">
@@ -466,16 +383,103 @@ $parentCount = count($parentCategories);
<?php else: ?> <?php else: ?>
<p style="font-style: italic;"><?= $translation->get("not_connected_as_subcategory") ?></p> <p style="font-style: italic;"><?= $translation->get("not_connected_as_subcategory") ?></p>
<?php endif; ?> <?php endif; ?>
</div>
<div class="aside_section">
<small><?= $translation->get("last_change_on") ?></small> <small><?= $translation->get("last_change_on") ?></small>
<p style="font-style: italic;"> <p style="font-style: italic;"><?= $formatter->format($timestamp) ?> - <?= $category["modified_by"] ?></p>
<?= $formatter->format($timestamp) ?> - <?= $category["modified_by"] ?> </div>
</p> <?php endif; ?>
</div>
</div>
</div> </div>
<?php } ?> <?php if ($categoryId != 0): ?>
<!-- Tab: Berechtigungen & Filter -->
<div id="cf-tab-berechtigungen" class="cf-tab-pane">
<div class="cf-perm-grid">
<div class="cf-perm-block cf-perm-sm">
<h4><?= $translation->get("mandants") ?></h4>
<input type="text" id="selected_mandants" name="selected_mandants"
value='<?= htmlspecialchars(json_encode($savedMandantsData)); ?>'>
</div> </div>
<div class="cf-perm-block cf-perm-sm">
<h4><?= $translation->get("departments") ?></h4>
<input type="text" id="selected_departments" name="selected_departments"
value='<?= htmlspecialchars(json_encode($savedDepartmentsData)); ?>'>
</div>
<div class="cf-perm-block cf-perm-sm">
<h4><?= $translation->get("roles") ?></h4>
<input type="text" id="selected_roles" name="selected_roles"
value='<?= htmlspecialchars(json_encode($savedRolesData)); ?>'>
</div>
<div class="cf-perm-block cf-perm-lg">
<h4>Einrichtungen</h4>
<input type="text" id="selected_einrichts" name="selected_einrichts"
value='<?= htmlspecialchars(json_encode($savedEinrichtsData)); ?>'>
</div>
<div class="cf-perm-block cf-perm-lg">
<h4>Fachbereiche</h4>
<input type="text" id="selected_fachbereiche" name="selected_fachbereiche"
value='<?= htmlspecialchars(json_encode($savedFachbereicheData)); ?>'>
</div>
</div>
</div>
<!-- Tab: Unterkategorien -->
<div id="cf-tab-unterkategorien" class="cf-tab-pane">
<div class="category_sub_select">
<div class="category_sub_select_container">
<h3><?= $translation->get("connected_subcategories") ?></h3>
<input type="search" class="subcategory-search" id="search-selected"
placeholder="Suche in verknüpften Kategorien">
<ul id="selectedSubcategories" class="list-group connectedSortable">
<?php if (empty($subcategories)): ?>
<li class="list-group-item empty-hint">
<?= $translation->get("no_connected_subcategories") ?>
</li>
<?php else: ?>
<?php foreach ($subcategories as $sub): ?>
<li class="list-group-item" data-id="<?= $sub['id'] ?>">
<div>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
class="bi bi-grip-vertical" viewBox="0 0 16 16">
<path d="M7 2a1 1 0 1 1-2 0 1 1 0 0 1 2 0m3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0M7 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0m3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0M7 8a1 1 0 1 1-2 0 1 1 0 0 1 2 0m3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0m-3 3a1 1 0 1 1-2 0 1 1 0 0 1 2 0m3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0m-3 3a1 1 0 1 1-2 0 1 1 0 0 1 2 0m3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0"/>
</svg>
<?= htmlspecialchars($sub['title'] ?? "Fehlende Übersetzung ID {$sub['id']}") ?>
</div>
<button title="<?= $translation->get("delete") ?>" type="button"
class="unlinkSubcategory">✕</button>
</li>
<?php endforeach; ?>
<?php endif; ?>
</ul>
</div>
<div class="category_sub_select_container">
<h3><?= $translation->get("available_categories") ?></h3>
<input type="search" class="subcategory-search" id="search-available"
placeholder="Suche in verfügbaren Kategorien">
<ul id="availableSubcategories" class="list-group connectedSortable">
<?php if (mysqli_num_rows($availableResult) == 0): ?>
<li class="list-group-item empty-hint">
<?= $translation->get("all_available_categories_used") ?>
</li>
<?php else: ?>
<?php while ($row = mysqli_fetch_assoc($availableResult)): ?>
<li class="list-group-item" data-id="<?= $row['id'] ?>">
<div>
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
class="bi bi-grip-vertical" viewBox="0 0 16 16">
<path d="M7 2a1 1 0 1 1-2 0 1 1 0 0 1 2 0m3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0M7 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0m3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0M7 8a1 1 0 1 1-2 0 1 1 0 0 1 2 0m3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0m-3 3a1 1 0 1 1-2 0 1 1 0 0 1 2 0m3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0m-3 3a1 1 0 1 1-2 0 1 1 0 0 1 2 0m3 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0"/>
</svg>
<?= htmlspecialchars($row['title'] ?: "Fehlende Übersetzung ID {$row['id']}") ?>
</div>
</li>
<?php endwhile; ?>
<?php endif; ?>
</ul>
</div>
</div>
</div>
<?php endif; ?>
</div> </div>
<input type="hidden" id="category_id" value="<?= $categoryId ?>"> <input type="hidden" id="category_id" value="<?= $categoryId ?>">
@@ -484,6 +488,15 @@ $parentCount = count($parentCategories);
<script> <script>
$(function () { $(function () {
// Section tab switching
$('.cf-section-tab').on('click', function () {
var target = $(this).data('target');
$('.cf-section-tab').removeClass('active');
$(this).addClass('active');
$('.cf-tab-pane').removeClass('active').hide();
$('#' + target).addClass('active').show();
});
// Funktion zum sequentiellen Speichern der Übersetzungen // Funktion zum sequentiellen Speichern der Übersetzungen
window.saveCategoryAjax = function (callback) { window.saveCategoryAjax = function (callback) {
var forms = $(".translationForm"); var forms = $(".translationForm");
@@ -733,6 +746,7 @@ $parentCount = count($parentCategories);
} }
} }
<?php if ($categoryId != 0): ?>
// Initialisierung der Tagify-Objekte // Initialisierung der Tagify-Objekte
var mandantsData = <?php echo json_encode(array_map(function ($item) { var mandantsData = <?php echo json_encode(array_map(function ($item) {
return ['value' => $item['id'], 'name' => $item['description']]; return ['value' => $item['id'], 'name' => $item['description']];
@@ -850,6 +864,8 @@ $parentCount = count($parentCategories);
} }
}); });
<?php endif; ?>
// Handler für das Löschen einer Kategorie // Handler für das Löschen einer Kategorie
$("#deleteCategory").on("click", function () { $("#deleteCategory").on("click", function () {
if (confirm("Möchten Sie diese Kategorie wirklich löschen? Diese Aktion kann nicht rückgängig gemacht werden.")) { if (confirm("Möchten Sie diese Kategorie wirklich löschen? Diese Aktion kann nicht rückgängig gemacht werden.")) {

View File

@@ -439,10 +439,14 @@ if ($resLinkedForm && mysqli_num_rows($resLinkedForm) > 0) {
</div> </div>
<div id="tab-discussion" class="tab-content forum"> <div id="tab-discussion" class="tab-content forum">
<?php <?php
// require_once 'post_cardform_discussion.php'; $forumView = __DIR__ . '/../../forum/Views/topic_listform.php';
if (!$isNew && $postId > 0 && file_exists($forumView)) {
$knowledgecenter_post_id = $postId;
require_once $forumView;
} else {
echo '<p style="color:#6b7280;font-style:italic;padding:16px;">Diskussionsfunktion noch nicht verfügbar.</p>';
}
?> ?>
<?php $knowledgecenter_post_id = $_GET['id']; ?>
<?php require_once(__DIR__ . '/../../forum/Views/topic_listform.php'); ?>
</div> </div>
<!-- Tab Content: Versionsgeschichte --> <!-- Tab Content: Versionsgeschichte -->