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:
@@ -231,27 +231,73 @@ while ($row = mysqli_fetch_assoc($resultParents)) {
|
||||
}
|
||||
$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">
|
||||
<!-- Überschrift und Message-Container -->
|
||||
<div class="cf-layout">
|
||||
<!-- 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">
|
||||
<div class="tabbar_with_button">
|
||||
<a href="?action=Categories&embedded=<?= $isEmbedded ?>">←</a>
|
||||
<!-- Tab: Allgemein -->
|
||||
<div id="cf-tab-allgemein" class="cf-tab-pane active">
|
||||
<div class="cf-general-layout">
|
||||
<div>
|
||||
<ul class="nav nav-tabs" id="languageTabs" role="tablist">
|
||||
<?php foreach ($languages as $index => $lang): ?>
|
||||
<li class="nav-item" role="presentation">
|
||||
<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">
|
||||
<?= htmlspecialchars(strtoupper($lang['code'])) ?> </button>
|
||||
<?= htmlspecialchars(strtoupper($lang['code'])) ?>
|
||||
</button>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<div>
|
||||
<button id="message" style="opacity:0;"></button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-content-languages" id="languageTabsContent">
|
||||
<?php foreach ($languages as $index => $lang):
|
||||
$trans = $translations[$lang['code']];
|
||||
@@ -277,8 +323,7 @@ $parentCount = count($parentCategories);
|
||||
<input type="hidden" name="image-<?= $lang['code'] ?>" id="image-<?= $lang['code'] ?>"
|
||||
value="<?= htmlspecialchars($trans['image']) ?>">
|
||||
<div class="post-action-btn green openFileGallery" data-ajax-function="saveCategoryAjax"
|
||||
data-target="image-<?= $lang['code'] ?>">
|
||||
+</div>
|
||||
data-target="image-<?= $lang['code'] ?>">+</div>
|
||||
<div class="post-action-btn clearImage" data-target="image-<?= $lang['code'] ?>">✕</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
@@ -286,164 +331,36 @@ $parentCount = count($parentCategories);
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</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>
|
||||
|
||||
<!-- Container für verfügbare Kategorien -->
|
||||
<div class="category_sub_select_container">
|
||||
<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">
|
||||
<!-- Settings sidebar -->
|
||||
<div class="cf-settings-col">
|
||||
<label for="stateCheckbox">
|
||||
<?= $translation->get("active_state") ?>
|
||||
<input type="checkbox" id="stateCheckbox" name="state" value="1" <?= $state === 1 ? 'checked' : '' ?>>
|
||||
</label>
|
||||
|
||||
</div>
|
||||
<?php $is_navigation_item = $translations[$languages[0]['code']]['is_navigation_item'] ?? 0; ?>
|
||||
|
||||
<div class="aside_section">
|
||||
<label for="createNavigationCheckbox">
|
||||
<label for="isNavigationItem">
|
||||
<?= $translation->get("create_navigation_menu") ?>
|
||||
<input type="checkbox" id="isNavigationItem" name="is_navigation_item" value="1"
|
||||
<?= $is_navigation_item == 1 ? 'checked' : '' ?>>
|
||||
</label>
|
||||
</div>
|
||||
<div class="aside_section">
|
||||
|
||||
<label for="color_hex">
|
||||
<?= $translation->get("color_hex") ?>
|
||||
<input type="color" id="color_hex" name="color_hex" value="<?= $category['color_hex'] ?? '#3B82F6FF' ?>">
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<?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">
|
||||
<?= $translation->get("enable_post_color_pickers") ?>
|
||||
<input type="checkbox" id="enablePostColorPickersCheckbox" name="enable_post_color_pickers" value="1"
|
||||
<?= $enable_post_color_pickers === 1 ? 'checked' : '' ?>>
|
||||
</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
|
||||
if (!empty($categoryId)) {
|
||||
$formatter = new IntlDateFormatter(
|
||||
'de_DE',
|
||||
IntlDateFormatter::LONG,
|
||||
@@ -451,7 +368,7 @@ $parentCount = count($parentCategories);
|
||||
);
|
||||
$timestamp = strtotime($category["modified_at"]);
|
||||
?>
|
||||
<div class="aside_section">
|
||||
<div class="cf-settings-meta">
|
||||
<small><?= $translation->get("connected_subcategories") ?> (<?= $parentCount ?>)</small>
|
||||
<?php if ($parentCount > 0): ?>
|
||||
<ul class="connected_categories">
|
||||
@@ -466,16 +383,103 @@ $parentCount = count($parentCategories);
|
||||
<?php else: ?>
|
||||
<p style="font-style: italic;"><?= $translation->get("not_connected_as_subcategory") ?></p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="aside_section">
|
||||
<small><?= $translation->get("last_change_on") ?></small>
|
||||
<p style="font-style: italic;">
|
||||
<?= $formatter->format($timestamp) ?> - <?= $category["modified_by"] ?>
|
||||
</p>
|
||||
<p style="font-style: italic;"><?= $formatter->format($timestamp) ?> - <?= $category["modified_by"] ?></p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</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 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>
|
||||
|
||||
<input type="hidden" id="category_id" value="<?= $categoryId ?>">
|
||||
@@ -484,6 +488,15 @@ $parentCount = count($parentCategories);
|
||||
|
||||
<script>
|
||||
$(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
|
||||
window.saveCategoryAjax = function (callback) {
|
||||
var forms = $(".translationForm");
|
||||
@@ -733,6 +746,7 @@ $parentCount = count($parentCategories);
|
||||
}
|
||||
}
|
||||
|
||||
<?php if ($categoryId != 0): ?>
|
||||
// Initialisierung der Tagify-Objekte
|
||||
var mandantsData = <?php echo json_encode(array_map(function ($item) {
|
||||
return ['value' => $item['id'], 'name' => $item['description']];
|
||||
@@ -850,6 +864,8 @@ $parentCount = count($parentCategories);
|
||||
}
|
||||
});
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
// Handler für das Löschen einer Kategorie
|
||||
$("#deleteCategory").on("click", function () {
|
||||
if (confirm("Möchten Sie diese Kategorie wirklich löschen? Diese Aktion kann nicht rückgängig gemacht werden.")) {
|
||||
|
||||
@@ -439,10 +439,14 @@ if ($resLinkedForm && mysqli_num_rows($resLinkedForm) > 0) {
|
||||
</div>
|
||||
<div id="tab-discussion" class="tab-content forum">
|
||||
<?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>
|
||||
|
||||
<!-- Tab Content: Versionsgeschichte -->
|
||||
|
||||
Reference in New Issue
Block a user