-
-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add support for rtl languages
- Loading branch information
Showing
29 changed files
with
220 additions
and
121 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
require_once 'includes/header.php'; | ||
|
||
$settings = []; | ||
$settings['registrations'] = false; | ||
?> | ||
|
||
<section class="contain settings"> | ||
|
||
<section class="account-section"> | ||
<header> | ||
<h2><?= translate('backup_and_restore', $i18n) ?></h2> | ||
</header> | ||
<div class="form-group-inline"> | ||
<div> | ||
<input type="button" class="button thin" value="<?= translate('backup', $i18n) ?>" id="backupDB" onClick="backupDB()"/> | ||
</div> | ||
<div> | ||
<input type="button" class="secondary-button thin" value="<?= translate('restore', $i18n) ?>" id="restoreDB" onClick="openRestoreDBFileSelect()" /> | ||
<input type="file" name="restoreDBFile" id="restoreDBFile" style="display: none;" onChange="restoreDB()" accept=".zip"> | ||
</div> | ||
</div> | ||
<div class="settings-notes"> | ||
<p> | ||
<i class="fa-solid fa-circle-info"></i> | ||
<?= translate('restore_info', $i18n) ?> | ||
</p> | ||
</div> | ||
</section> | ||
|
||
</section> | ||
<script src="scripts/admin.js?<?= $version ?>"></script> | ||
|
||
<?php | ||
require_once 'includes/footer.php'; | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,25 @@ | ||
<?php | ||
|
||
// File Name => Language Name | ||
// File Name => Language Name | ||
$languages = [ | ||
// English first | ||
"en" => "English", | ||
"en" => ["name" => "English", "dir" => "ltr"], | ||
// Remaining sorted alphabetically by language code | ||
"de" => "Deutsch", | ||
"el" => "Ελληνικά", | ||
"es" => "Español", | ||
"fr" => "Français", | ||
"it" => "Italiano", | ||
"jp" => "日本語", | ||
"ko" => "한국어", | ||
"pl" => "Polski", | ||
"pt" => "Português", | ||
"pt_br" => "Português Brasileiro", | ||
"ru" => "Русский", | ||
"sr_lat" => "Srpski", | ||
"sr" => "Српски", | ||
"tr" => "Türkçe", | ||
"zh_cn" => "简体中文", | ||
"zh_tw" => "繁體中文", | ||
"de" => ["name" => "Deutsch", "dir" => "ltr"], | ||
"el" => ["name" => "Ελληνικά", "dir" => "ltr"], | ||
"es" => ["name" => "Español", "dir" => "ltr"], | ||
"fr" => ["name" => "Français", "dir" => "ltr"], | ||
"it" => ["name" => "Italiano", "dir" => "ltr"], | ||
"jp" => ["name" => "日本語", "dir" => "ltr"], | ||
"ko" => ["name" => "한국어", "dir" => "ltr"], | ||
"pl" => ["name" => "Polski", "dir" => "ltr"], | ||
"pt" => ["name" => "Português", "dir" => "ltr"], | ||
"pt_br" => ["name" => "Português Brasileiro", "dir" => "ltr"], | ||
"ru" => ["name" => "Русский", "dir" => "ltr"], | ||
"sr_lat" => ["name" => "Srpski", "dir" => "ltr"], | ||
"sr" => ["name" => "Српски", "dir" => "ltr"], | ||
"tr" => ["name" => "Türkçe", "dir" => "ltr"], | ||
"zh_cn" => ["name" => "简体中文", "dir" => "ltr"], | ||
"zh_tw" => ["name" => "繁體中文", "dir" => "ltr"], | ||
] | ||
|
||
?> | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
function backupDB() { | ||
const button = document.getElementById("backupDB"); | ||
button.disabled = true; | ||
|
||
fetch('endpoints/db/backup.php') | ||
.then(response => response.json()) | ||
.then(data => { | ||
if (data.success) { | ||
const link = document.createElement('a'); | ||
const filename = data.file; | ||
link.href = '.tmp/' + filename; | ||
link.download = 'backup.zip'; | ||
document.body.appendChild(link); | ||
link.click(); | ||
document.body.removeChild(link); | ||
|
||
button.disabled = false; | ||
} else { | ||
showErrorMessage(data.errorMessage); | ||
button.disabled = false; | ||
} | ||
}) | ||
.catch(error => { | ||
showErrorMessage(error); | ||
button.disabled = false; | ||
}); | ||
} | ||
|
||
function openRestoreDBFileSelect() { | ||
document.getElementById('restoreDBFile').click(); | ||
}; | ||
|
||
function restoreDB() { | ||
const input = document.getElementById('restoreDBFile'); | ||
const file = input.files[0]; | ||
|
||
if (!file) { | ||
console.error('No file selected'); | ||
return; | ||
} | ||
|
||
const formData = new FormData(); | ||
formData.append('file', file); | ||
|
||
fetch('endpoints/db/restore.php', { | ||
method: 'POST', | ||
body: formData | ||
}) | ||
.then(response => response.json()) | ||
.then(data => { | ||
if (data.success) { | ||
showSuccessMessage(data.message) | ||
window.location.href = 'logout.php'; | ||
} else { | ||
showErrorMessage(data.message); | ||
} | ||
}) | ||
.catch(error => showErrorMessage('Error:', error)); | ||
} |
Oops, something went wrong.