Fix post save and file gallery for knowledgecenter

- Create module/shared_components/quill/ with toolbar_presets.js,
  quill_resize.js and quill_resize.css — missing files caused a JS crash
  in $(document).ready() before the save button's click handler was
  registered, so clicking save did nothing
- Fix filesgallery.php session detection to search any sid* cookie
  dynamically (site session name is 'sidawo', not the hardcoded
  'sidintranet'), fixing the popup showing the homepage instead of
  the gallery
- Revert categories_cardform.php from 3-tab layout back to original
  sidebar layout with full-width permissions section below

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-22 11:49:59 +02:00
parent 0a0196bd89
commit 887ac6a4bb
5 changed files with 383 additions and 223 deletions

View File

@@ -232,62 +232,17 @@ while ($row = mysqli_fetch_assoc($resultParents)) {
$parentCount = count($parentCategories);
?>
<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;}
.perm-row { margin-bottom: 16px; }
.perm-row label { display: block; font-weight: 500; font-size: 13px; color: #374151; margin-bottom: 6px; }
.perm-row .tagify { width: 100%; }
</style>
<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="cardform_containern">
<!-- Tab: Allgemein -->
<div id="cf-tab-allgemein" class="cf-tab-pane active">
<div class="cf-general-layout">
<div>
<div class="cardform">
<div class="card-body">
<div class="tabbar_with_button">
<a href="?action=Categories&embedded=<?= $isEmbedded ?>">←</a>
<ul class="nav nav-tabs" id="languageTabs" role="tablist">
<?php foreach ($languages as $index => $lang): ?>
<li class="nav-item" role="presentation">
@@ -298,189 +253,231 @@ $parentCount = count($parentCategories);
</li>
<?php endforeach; ?>
</ul>
<div class="tab-content-languages" id="languageTabsContent">
<?php foreach ($languages as $index => $lang):
$trans = $translations[$lang['code']];
?>
<div class="tab-pane fade <?= ($index === 0) ? 'show active' : '' ?>" id="lang-<?= $lang['code'] ?>"
role="tabpanel">
<form class="translationForm" data-lang="<?= $lang['id'] ?>" data-lang-code="<?= $lang['code'] ?>">
<div class="label title-<?php echo $lang['code']; ?>">
<label for="title-<?php echo $lang['code']; ?>">Titel
(<?php echo htmlspecialchars($lang['code']); ?>)</label>
</div>
<div class="input title-<?php echo $lang['code']; ?>">
<input required name="title-<?php echo $lang['code']; ?>"
id="title-<?php echo $lang['code']; ?>" class="text" type="text"
value="<?php echo htmlspecialchars($translations[$lang['code']]['title']); ?>">
</div>
<?php if ($categoryId != 0): ?>
<div class="single_image_group">
<img id="preview-<?= $lang['code'] ?>"
src="<?= $trans['image'] ? '/userdata/' . htmlspecialchars($trans['image']) : '/userdata/intranet/mandant/platzhalter_kategorie.png' ?>"
alt="Bildvorschau" style="max-width: 100px; min-height: 60px;
border-radius: 5px; <?= $trans['image'] ? '' : 'background-color:#f3f3f3;' ?>">
<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>
<div class="post-action-btn clearImage" data-target="image-<?= $lang['code'] ?>">✕</div>
</div>
<?php endif; ?>
</form>
</div>
<?php endforeach; ?>
<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']];
?>
<div class="tab-pane fade <?= ($index === 0) ? 'show active' : '' ?>" id="lang-<?= $lang['code'] ?>"
role="tabpanel">
<form class="translationForm" data-lang="<?= $lang['id'] ?>" data-lang-code="<?= $lang['code'] ?>">
<div class="label title-<?php echo $lang['code']; ?>">
<label for="title-<?php echo $lang['code']; ?>">Titel
(<?php echo htmlspecialchars($lang['code']); ?>)</label>
</div>
<div class="input title-<?php echo $lang['code']; ?>">
<input required name="title-<?php echo $lang['code']; ?>"
id="title-<?php echo $lang['code']; ?>" class="text" type="text"
value="<?php echo htmlspecialchars($translations[$lang['code']]['title']); ?>">
</div>
<?php if ($categoryId != 0): ?>
<div class="single_image_group">
<img id="preview-<?= $lang['code'] ?>"
src="<?= $trans['image'] ? '/userdata/' . htmlspecialchars($trans['image']) : '/userdata/intranet/mandant/platzhalter_kategorie.png' ?>"
alt="Bildvorschau" style="max-width: 100px; min-height: 60px;
border-radius: 5px; <?= $trans['image'] ? '' : 'background-color:#f3f3f3;' ?>">
<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>
<div class="post-action-btn clearImage" data-target="image-<?= $lang['code'] ?>">✕</div>
</div>
<?php endif; ?>
</form>
</div>
<?php endforeach; ?>
</div>
<!-- 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>
<?php $is_navigation_item = $translations[$languages[0]['code']]['is_navigation_item'] ?? 0; ?>
<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>
<label for="color_hex">
<?= $translation->get("color_hex") ?>
<input type="color" id="color_hex" name="color_hex" value="<?= $category['color_hex'] ?? '#3B82F6FF' ?>">
</label>
<?php $enable_post_color_pickers = isset($category['enable_post_color_pickers']) ? (int) $category['enable_post_color_pickers'] : 0; ?>
<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>
<?php if (!empty($categoryId)): ?>
<?php
$formatter = new IntlDateFormatter(
'de_DE',
IntlDateFormatter::LONG,
IntlDateFormatter::SHORT
);
$timestamp = strtotime($category["modified_at"]);
?>
<div class="cf-settings-meta">
<small><?= $translation->get("connected_subcategories") ?> (<?= $parentCount ?>)</small>
<?php if ($parentCount > 0): ?>
<ul class="connected_categories">
<?php foreach ($parentCategories as $parent): ?>
<li>
<a target="_blank" href="?action=Categories&detail=<?= $parent['id'] ?>">
<?= htmlspecialchars($parent['title'] ?: "Kategorie-ID " . $parent['id']) ?> ↗
</a>
<?php if ($categoryId != 0): ?>
<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; ?>
</ul>
<?php else: ?>
<p style="font-style: italic;"><?= $translation->get("not_connected_as_subcategory") ?></p>
<?php endif; ?>
<small><?= $translation->get("last_change_on") ?></small>
<p style="font-style: italic;"><?= $formatter->format($timestamp) ?> - <?= $category["modified_by"] ?></p>
<?php endif; ?>
</ul>
</div>
<?php endif; ?>
</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>
<?php endif; ?>
</div>
</div>
<?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>
<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">
<?= $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="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 (!empty($categoryId)): ?>
<?php
$formatter = new IntlDateFormatter(
'de_DE',
IntlDateFormatter::LONG,
IntlDateFormatter::SHORT
);
$timestamp = strtotime($category["modified_at"]);
?>
<div class="aside_section">
<small><?= $translation->get("connected_subcategories") ?> (<?= $parentCount ?>)</small>
<?php if ($parentCount > 0): ?>
<ul class="connected_categories">
<?php foreach ($parentCategories as $parent): ?>
<li>
<a target="_blank" href="?action=Categories&detail=<?= $parent['id'] ?>">
<?= htmlspecialchars($parent['title'] ?: "Kategorie-ID " . $parent['id']) ?> ↗
</a>
</li>
<?php endforeach; ?>
</ul>
<?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>
</div>
<?php endif; ?>
</div>
</div>
<?php if ($categoryId != 0): ?>
<div class="cardform_containern perm-fullwidth">
<div class="cardform" style="flex:1;">
<div class="card-body">
<h3><?= $translation->get("permissions_and_filters") ?></h3>
<div class="perm-row">
<label for="selected_mandants"><?= $translation->get("mandants") ?></label>
<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>
<div class="perm-row">
<label for="selected_departments"><?= $translation->get("departments") ?></label>
<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>
<div class="perm-row">
<label for="selected_roles"><?= $translation->get("roles") ?></label>
<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>
<div class="perm-row">
<label for="selected_einrichts">Einrichtungen</label>
<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>
<div class="perm-row">
<label for="selected_fachbereiche">Fachbereiche</label>
<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>
<?php endif; ?>
<input type="hidden" id="category_id" value="<?= $categoryId ?>">
<input type="hidden" id="modified_by"
@@ -488,15 +485,6 @@ $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");