minor fix in templates due to new Language class + other minor language fixes
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -27,7 +27,6 @@ const AREA = 'admin';
|
||||
require __DIR__ . '/lib/init.php';
|
||||
|
||||
use Froxlor\Database\Database;
|
||||
use Froxlor\FileDir;
|
||||
use Froxlor\FroxlorLogger;
|
||||
use Froxlor\Language;
|
||||
use Froxlor\PhpHelper;
|
||||
@@ -63,6 +62,8 @@ $file_templates = [
|
||||
'index_html'
|
||||
];
|
||||
|
||||
$languages = Language::getLanguages();
|
||||
|
||||
if ($action == '') {
|
||||
// email templates
|
||||
$log->logAction(FroxlorLogger::ADM_ACTION, LOG_NOTICE, "viewed admin_templates");
|
||||
@@ -165,6 +166,13 @@ if ($action == '') {
|
||||
'pagination' => []
|
||||
];
|
||||
|
||||
if ($mail_actions_links === false) {
|
||||
$mail_actions_links = [];
|
||||
}
|
||||
if ($file_actions_links === false) {
|
||||
$file_actions_links = [];
|
||||
}
|
||||
|
||||
UI::view('user/table-tpl.html.twig', [
|
||||
'maillisting' => Listing::formatFromArray($collection_mail, $mailtpl_list_data['mailtpl_list']),
|
||||
'filelisting' => Listing::formatFromArray($collection_file, $filetpl_list_data['filetpl_list']),
|
||||
|
||||
@@ -55,6 +55,24 @@ class Listing
|
||||
];
|
||||
}
|
||||
|
||||
public static function formatFromArray(array $collection, array $tabellisting): array
|
||||
{
|
||||
return [
|
||||
'title' => $tabellisting['title'],
|
||||
'icon' => $tabellisting['icon'],
|
||||
'description' => $tabellisting['description'] ?? null,
|
||||
'icon' => $tabellisting['icon'] ?? null,
|
||||
'table' => [
|
||||
'th' => self::generateTableHeadings($tabellisting),
|
||||
'tr' => self::generateTableRows($collection['data'], $tabellisting),
|
||||
],
|
||||
'pagination' => $collection['pagination'],
|
||||
'empty_msg' => $tabellisting['empty_msg'] ?? null,
|
||||
'self_overview' => $tabellisting['self_overview'] ?? [],
|
||||
'available_columns' => self::getAvailableColumnsForListing($tabellisting)
|
||||
];
|
||||
}
|
||||
|
||||
private static function generateTableHeadings(array $tabellisting): array
|
||||
{
|
||||
$heading = [];
|
||||
@@ -213,20 +231,6 @@ class Listing
|
||||
return $result;
|
||||
}
|
||||
|
||||
public static function formatFromArray(array $collection, array $tabellisting): array
|
||||
{
|
||||
return [
|
||||
'title' => $tabellisting['title'],
|
||||
'icon' => $tabellisting['icon'],
|
||||
'table' => [
|
||||
'th' => self::generateTableHeadings($tabellisting),
|
||||
'tr' => self::generateTableRows($collection['data'], $tabellisting),
|
||||
],
|
||||
'pagination' => $collection['pagination'],
|
||||
'empty_msg' => $tabellisting['empty_msg'] ?? null
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* store column listing selection of user to database
|
||||
* the selection array should look like this:
|
||||
|
||||
@@ -33,7 +33,7 @@ return [
|
||||
'icon' => 'fa-solid fa-circle-check',
|
||||
'columns' => [
|
||||
'displayid' => [
|
||||
'label' => lng('admin.integrityid'),
|
||||
'label' => 'ID',
|
||||
'field' => 'displayid'
|
||||
],
|
||||
'checkdesc' => [
|
||||
|
||||
@@ -380,7 +380,6 @@ return [
|
||||
],
|
||||
'cronsettings' => 'Cronjob-Einstellungen',
|
||||
'integritycheck' => 'Datenbankprüfung',
|
||||
'integrityid' => '#',
|
||||
'integrityname' => 'Name',
|
||||
'integrityresult' => 'Ergebnis',
|
||||
'integrityfix' => 'Probleme automatisch beheben',
|
||||
|
||||
@@ -384,7 +384,6 @@ return [
|
||||
],
|
||||
'cronsettings' => 'Cronjob settings',
|
||||
'integritycheck' => 'Database validation',
|
||||
'integrityid' => '#',
|
||||
'integrityname' => 'Name',
|
||||
'integrityresult' => 'Result',
|
||||
'integrityfix' => 'Fix problems automatically',
|
||||
|
||||
Reference in New Issue
Block a user