- Updated action buttons across multiple files to use icons (e.g., "Save" to "💾+", "Delete" to "X").
- Replaced "Cancel" button text with a left arrow (←) for a more intuitive navigation experience.
- Removed unnecessary action columns from tables to streamline the interface.
- Enhanced table rows to be clickable for better user interaction, redirecting to relevant management pages.
- Adjusted font sizes and styles in CSS for improved readability and aesthetics.
- Standardized back button functionality to use a left arrow across various pages.
70 lines
2.3 KiB
PHP
70 lines
2.3 KiB
PHP
<?php
|
|
defined(page_security_key) or exit;
|
|
|
|
//Check if allowed
|
|
if (isAllowed('language',$_SESSION['profile'],$_SESSION['permission'],'R') === 0){
|
|
header('location: index.php');
|
|
exit;
|
|
}
|
|
|
|
// Capture post data
|
|
if (isset($_POST['language_US'], $_POST['language_NL'])) {
|
|
// Save templates
|
|
file_put_contents('./settings/translations/translations_US.php', $_POST['language_US']);
|
|
file_put_contents('./settings/translations/translations_NL.php', $_POST['language_NL']);
|
|
header('Location: index.php?page=language&success_msg=1');
|
|
exit;
|
|
}
|
|
// Read language_US template PHP file
|
|
$contents = file_get_contents('./settings/translations/translations_US.php');
|
|
// Read language template PHP file
|
|
$contents2 = file_get_contents('./settings/translations/translations_NL.php');
|
|
// Handle success messages
|
|
if (isset($_GET['success_msg'])) {
|
|
if ($_GET['success_msg'] == 1) {
|
|
$success_msg = 'Settings updated successfully!';
|
|
}
|
|
}
|
|
?>
|
|
|
|
<?=template_header('Language', 'language','view')?>
|
|
|
|
<form action="" method="post">
|
|
|
|
<div class="content-title responsive-flex-wrap responsive-pad-bot-3">
|
|
<h2 class="responsive-width-100">Translations</h2>
|
|
<input type="submit" name="submit" value="💾+" class="btn">
|
|
</div>
|
|
|
|
<?php if (isset($success_msg)): ?>
|
|
<div class="msg success">
|
|
<i class="fas fa-check-circle"></i>
|
|
<p><?=$success_msg?></p>
|
|
<i class="fas fa-times"></i>
|
|
</div>
|
|
<?php endif; ?>
|
|
<div class="tabs">
|
|
<a href="#" class="active">US</a>
|
|
<a href="#" class="active">NL</a>
|
|
</div>
|
|
<div class="content-block">
|
|
<div class="form responsive-width-100">
|
|
<div class="tab-content active">
|
|
<label for="language_US"></label>
|
|
<textarea name="language_US" id="language_US" style="min-height: 100vh;"><?=$contents?></textarea>
|
|
</div>
|
|
<div class="tab-content active">
|
|
<label for="language_NL"></label>
|
|
<textarea name="language_NL" id="language_NL" style="min-height: 100vh;"><?=$contents2?></textarea>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</form>
|
|
<script>
|
|
document.querySelectorAll("input[type='checkbox']").forEach(checkbox => {
|
|
checkbox.onclick = () => checkbox.value = checkbox.checked ? 'true' : 'false';
|
|
});
|
|
</script>
|
|
|
|
<?=template_footer()?>
|