more language migrations
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -67,11 +67,6 @@ if ($page == 'overview' || $page == 'mysqls') {
|
|||||||
Response::dynamicError($e->getMessage());
|
Response::dynamicError($e->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
Database::needSqlData();
|
|
||||||
$sql = Database::getSqlData();
|
|
||||||
// FIXME: setting translation on the fly is currently not supported; do we want this; alternatives
|
|
||||||
// $lng['mysql']['description'] = str_replace('<SQL_HOST>', $sql['host'], lng('mysql.description'));
|
|
||||||
|
|
||||||
$actions_links = false;
|
$actions_links = false;
|
||||||
if ($userinfo['mysqls_used'] < $userinfo['mysqls'] || $userinfo['mysqls'] == '-1') {
|
if ($userinfo['mysqls_used'] < $userinfo['mysqls'] || $userinfo['mysqls'] == '-1') {
|
||||||
$actions_links = [
|
$actions_links = [
|
||||||
|
|||||||
@@ -113,13 +113,12 @@ class ConfigDaemon
|
|||||||
if (preg_match('/^settings\.(.*)$/', $matches[1], $match)) {
|
if (preg_match('/^settings\.(.*)$/', $matches[1], $match)) {
|
||||||
return Settings::Get($match[1]);
|
return Settings::Get($match[1]);
|
||||||
} elseif (preg_match('/^lng\.(.*)(?:\.(.*)(?:\.(.*)))$/U', $matches[1], $match)) {
|
} elseif (preg_match('/^lng\.(.*)(?:\.(.*)(?:\.(.*)))$/U', $matches[1], $match)) {
|
||||||
global $lng;
|
|
||||||
if (isset($match[1]) && $match[1] != '' && isset($match[2]) && $match[2] != '' && isset($match[3]) && $match[3] != '') {
|
if (isset($match[1]) && $match[1] != '' && isset($match[2]) && $match[2] != '' && isset($match[3]) && $match[3] != '') {
|
||||||
return $lng[$match[1]][$match[2]][$match[3]];
|
return lng($match[1] . '.' . $match[2] . '.' . $match[3]);
|
||||||
} elseif (isset($match[1]) && $match[1] != '' && isset($match[2]) && $match[2] != '') {
|
} elseif (isset($match[1]) && $match[1] != '' && isset($match[2]) && $match[2] != '') {
|
||||||
return $lng[$match[1]][$match[2]];
|
return lng($match[1] . '.' . $match[2]);
|
||||||
} elseif (isset($match[1]) && $match[1] != '') {
|
} elseif (isset($match[1]) && $match[1] != '') {
|
||||||
return $lng[$match[1]];
|
return lng($match[1]);
|
||||||
}
|
}
|
||||||
return '';
|
return '';
|
||||||
} elseif (preg_match('/^const\.(.*)$/', $matches[1], $match)) {
|
} elseif (preg_match('/^const\.(.*)$/', $matches[1], $match)) {
|
||||||
|
|||||||
@@ -93,13 +93,12 @@ class ConfigService
|
|||||||
if (preg_match('/^settings\.(.*)$/', $matches[1], $match)) {
|
if (preg_match('/^settings\.(.*)$/', $matches[1], $match)) {
|
||||||
return Settings::Get($match[1]);
|
return Settings::Get($match[1]);
|
||||||
} elseif (preg_match('/^lng\.(.*)(?:\.(.*)(?:\.(.*)))$/U', $matches[1], $match)) {
|
} elseif (preg_match('/^lng\.(.*)(?:\.(.*)(?:\.(.*)))$/U', $matches[1], $match)) {
|
||||||
global $lng;
|
|
||||||
if (isset($match[1]) && $match[1] != '' && isset($match[2]) && $match[2] != '' && isset($match[3]) && $match[3] != '') {
|
if (isset($match[1]) && $match[1] != '' && isset($match[2]) && $match[2] != '' && isset($match[3]) && $match[3] != '') {
|
||||||
return $lng[$match[1]][$match[2]][$match[3]];
|
return lng($match[1] . '.' . $match[2] . '.' . $match[3]);
|
||||||
} elseif (isset($match[1]) && $match[1] != '' && isset($match[2]) && $match[2] != '') {
|
} elseif (isset($match[1]) && $match[1] != '' && isset($match[2]) && $match[2] != '') {
|
||||||
return $lng[$match[1]][$match[2]];
|
return lng($match[1] . '.' . $match[2]);
|
||||||
} elseif (isset($match[1]) && $match[1] != '') {
|
} elseif (isset($match[1]) && $match[1] != '') {
|
||||||
return $lng[$match[1]];
|
return lng($match[1]);
|
||||||
}
|
}
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -209,6 +209,7 @@ class MasterCron extends FroxlorCron
|
|||||||
unset($sql['root_password']);
|
unset($sql['root_password']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
require Froxlor::getInstallDir() . '/lib/functions.php';
|
||||||
// Includes the MySQL-Tabledefinitions etc.
|
// Includes the MySQL-Tabledefinitions etc.
|
||||||
require Froxlor::getInstallDir() . '/lib/tables.inc.php';
|
require Froxlor::getInstallDir() . '/lib/tables.inc.php';
|
||||||
fwrite(self::$debugHandler, 'Table definitions included' . "\n");
|
fwrite(self::$debugHandler, 'Table definitions included' . "\n");
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ use Froxlor\PhpHelper;
|
|||||||
use Froxlor\Settings;
|
use Froxlor\Settings;
|
||||||
use Froxlor\System\Mailer;
|
use Froxlor\System\Mailer;
|
||||||
use Froxlor\User;
|
use Froxlor\User;
|
||||||
|
use Froxlor\Language;
|
||||||
use PDO;
|
use PDO;
|
||||||
|
|
||||||
class ReportsCron extends FroxlorCron
|
class ReportsCron extends FroxlorCron
|
||||||
@@ -98,29 +99,8 @@ class ReportsCron extends FroxlorCron
|
|||||||
'MAX_PERCENT' => Settings::Get('system.report_trafficmax')
|
'MAX_PERCENT' => Settings::Get('system.report_trafficmax')
|
||||||
];
|
];
|
||||||
|
|
||||||
$lngfile_stmt = Database::prepare("
|
// set target user language
|
||||||
SELECT `file` FROM `" . TABLE_PANEL_LANGUAGE . "`
|
Language::setLanguage($row['def_language']);
|
||||||
WHERE `language` = :deflang
|
|
||||||
");
|
|
||||||
$lngfile = Database::pexecute_first($lngfile_stmt, [
|
|
||||||
'deflang' => $row['def_language']
|
|
||||||
]);
|
|
||||||
|
|
||||||
if ($lngfile !== null) {
|
|
||||||
$langfile = $lngfile['file'];
|
|
||||||
} else {
|
|
||||||
$lngfile = Database::pexecute_first($lngfile_stmt, [
|
|
||||||
'deflang' => Settings::Get('panel.standardlanguage')
|
|
||||||
]);
|
|
||||||
$langfile = $lngfile['file'];
|
|
||||||
}
|
|
||||||
|
|
||||||
// include english language file (fallback)
|
|
||||||
include FileDir::makeCorrectFile(Froxlor::getInstallDir() . '/lng/english.lng.php');
|
|
||||||
// include admin/customer language file
|
|
||||||
if ($lngfile != 'lng/english.lng.php') {
|
|
||||||
include FileDir::makeCorrectFile(Froxlor::getInstallDir() . '/' . $langfile);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get mail templates from database; the ones from 'admin' are fetched for fallback
|
// Get mail templates from database; the ones from 'admin' are fetched for fallback
|
||||||
$result2_stmt = Database::prepare("
|
$result2_stmt = Database::prepare("
|
||||||
@@ -135,11 +115,11 @@ class ReportsCron extends FroxlorCron
|
|||||||
'varname' => 'trafficmaxpercent_subject'
|
'varname' => 'trafficmaxpercent_subject'
|
||||||
];
|
];
|
||||||
$result2 = Database::pexecute_first($result2_stmt, $result2_data);
|
$result2 = Database::pexecute_first($result2_stmt, $result2_data);
|
||||||
$mail_subject = html_entity_decode(PhpHelper::replaceVariables((($result2 !== false && $result2['value'] != '') ? $result2['value'] : $lng['mails']['trafficmaxpercent']['subject']), $replace_arr));
|
$mail_subject = html_entity_decode(PhpHelper::replaceVariables((($result2 !== false && $result2['value'] != '') ? $result2['value'] : lng('mails.trafficmaxpercent.subject')), $replace_arr));
|
||||||
|
|
||||||
$result2_data['varname'] = 'trafficmaxpercent_mailbody';
|
$result2_data['varname'] = 'trafficmaxpercent_mailbody';
|
||||||
$result2 = Database::pexecute_first($result2_stmt, $result2_data);
|
$result2 = Database::pexecute_first($result2_stmt, $result2_data);
|
||||||
$mail_body = html_entity_decode(PhpHelper::replaceVariables((($result2 !== false && $result2['value'] != '') ? $result2['value'] : $lng['mails']['trafficmaxpercent']['mailbody']), $replace_arr));
|
$mail_body = html_entity_decode(PhpHelper::replaceVariables((($result2 !== false && $result2['value'] != '') ? $result2['value'] : lng('mails.trafficmaxpercent.mailbody')), $replace_arr));
|
||||||
|
|
||||||
$_mailerror = false;
|
$_mailerror = false;
|
||||||
$mailerr_msg = "";
|
$mailerr_msg = "";
|
||||||
@@ -241,11 +221,11 @@ class ReportsCron extends FroxlorCron
|
|||||||
'varname' => 'trafficmaxpercent_subject'
|
'varname' => 'trafficmaxpercent_subject'
|
||||||
];
|
];
|
||||||
$result2 = Database::pexecute_first($result2_stmt, $result2_data);
|
$result2 = Database::pexecute_first($result2_stmt, $result2_data);
|
||||||
$mail_subject = html_entity_decode(PhpHelper::replaceVariables((($result2 !== false && $result2['value'] != '') ? $result2['value'] : $lng['mails']['trafficmaxpercent']['subject']), $replace_arr));
|
$mail_subject = html_entity_decode(PhpHelper::replaceVariables((($result2 !== false && $result2['value'] != '') ? $result2['value'] : lng('mails.trafficmaxpercent.subject')), $replace_arr));
|
||||||
|
|
||||||
$result2_data['varname'] = 'trafficmaxpercent_mailbody';
|
$result2_data['varname'] = 'trafficmaxpercent_mailbody';
|
||||||
$result2 = Database::pexecute_first($result2_stmt, $result2_data);
|
$result2 = Database::pexecute_first($result2_stmt, $result2_data);
|
||||||
$mail_body = html_entity_decode(PhpHelper::replaceVariables((($result2 !== false && $result2['value'] != '') ? $result2['value'] : $lng['mails']['trafficmaxpercent']['mailbody']), $replace_arr));
|
$mail_body = html_entity_decode(PhpHelper::replaceVariables((($result2 !== false && $result2['value'] != '') ? $result2['value'] : lng('mails.trafficmaxpercent.mailbody')), $replace_arr));
|
||||||
|
|
||||||
$_mailerror = false;
|
$_mailerror = false;
|
||||||
$mailerr_msg = "";
|
$mailerr_msg = "";
|
||||||
@@ -447,11 +427,11 @@ class ReportsCron extends FroxlorCron
|
|||||||
'varname' => 'diskmaxpercent_subject'
|
'varname' => 'diskmaxpercent_subject'
|
||||||
];
|
];
|
||||||
$result2 = Database::pexecute_first($result2_stmt, $result2_data);
|
$result2 = Database::pexecute_first($result2_stmt, $result2_data);
|
||||||
$mail_subject = html_entity_decode(PhpHelper::replaceVariables((($result2 !== false && $result2['value'] != '') ? $result2['value'] : $lng['mails']['diskmaxpercent']['subject']), $replace_arr));
|
$mail_subject = html_entity_decode(PhpHelper::replaceVariables((($result2 !== false && $result2['value'] != '') ? $result2['value'] : lng('mails.diskmaxpercent.subject')), $replace_arr));
|
||||||
|
|
||||||
$result2_data['varname'] = 'diskmaxpercent_mailbody';
|
$result2_data['varname'] = 'diskmaxpercent_mailbody';
|
||||||
$result2 = Database::pexecute_first($result2_stmt, $result2_data);
|
$result2 = Database::pexecute_first($result2_stmt, $result2_data);
|
||||||
$mail_body = html_entity_decode(PhpHelper::replaceVariables((($result2 !== false && $result2['value'] != '') ? $result2['value'] : $lng['mails']['diskmaxpercent']['mailbody']), $replace_arr));
|
$mail_body = html_entity_decode(PhpHelper::replaceVariables((($result2 !== false && $result2['value'] != '') ? $result2['value'] : lng('mails.diskmaxpercent.mailbody')), $replace_arr));
|
||||||
|
|
||||||
$_mailerror = false;
|
$_mailerror = false;
|
||||||
$mailerr_msg = "";
|
$mailerr_msg = "";
|
||||||
@@ -544,11 +524,11 @@ class ReportsCron extends FroxlorCron
|
|||||||
'varname' => 'diskmaxpercent_subject'
|
'varname' => 'diskmaxpercent_subject'
|
||||||
];
|
];
|
||||||
$result2 = Database::pexecute_first($result2_stmt, $result2_data);
|
$result2 = Database::pexecute_first($result2_stmt, $result2_data);
|
||||||
$mail_subject = html_entity_decode(PhpHelper::replaceVariables((($result2 !== false && $result2['value'] != '') ? $result2['value'] : $lng['mails']['diskmaxpercent']['subject']), $replace_arr));
|
$mail_subject = html_entity_decode(PhpHelper::replaceVariables((($result2 !== false && $result2['value'] != '') ? $result2['value'] : lng('mails.diskmaxpercent.subject')), $replace_arr));
|
||||||
|
|
||||||
$result2_data['varname'] = 'diskmaxpercent_mailbody';
|
$result2_data['varname'] = 'diskmaxpercent_mailbody';
|
||||||
$result2 = Database::pexecute_first($result2_stmt, $result2_data);
|
$result2 = Database::pexecute_first($result2_stmt, $result2_data);
|
||||||
$mail_body = html_entity_decode(PhpHelper::replaceVariables((($result2 !== false && $result2['value'] != '') ? $result2['value'] : $lng['mails']['diskmaxpercent']['mailbody']), $replace_arr));
|
$mail_body = html_entity_decode(PhpHelper::replaceVariables((($result2 !== false && $result2['value'] != '') ? $result2['value'] : lng('mails.diskmaxpercent.mailbody')), $replace_arr));
|
||||||
|
|
||||||
$_mailerror = false;
|
$_mailerror = false;
|
||||||
$mailerr_msg = "";
|
$mailerr_msg = "";
|
||||||
@@ -580,8 +560,6 @@ class ReportsCron extends FroxlorCron
|
|||||||
Database::pexecute($upd_stmt, [
|
Database::pexecute($upd_stmt, [
|
||||||
'adminid' => $row['adminid']
|
'adminid' => $row['adminid']
|
||||||
]);
|
]);
|
||||||
|
|
||||||
unset($lng);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // webmax > 0
|
} // webmax > 0
|
||||||
|
|||||||
@@ -135,8 +135,6 @@ class Domain
|
|||||||
*/
|
*/
|
||||||
public static function getRedirectCodes($add_desc = true)
|
public static function getRedirectCodes($add_desc = true)
|
||||||
{
|
{
|
||||||
global $lng;
|
|
||||||
|
|
||||||
$sql = "SELECT * FROM `" . TABLE_PANEL_REDIRECTCODES . "` WHERE `enabled` = '1' ORDER BY `id` ASC";
|
$sql = "SELECT * FROM `" . TABLE_PANEL_REDIRECTCODES . "` WHERE `enabled` = '1' ORDER BY `id` ASC";
|
||||||
$result_stmt = Database::query($sql);
|
$result_stmt = Database::query($sql);
|
||||||
|
|
||||||
@@ -144,7 +142,7 @@ class Domain
|
|||||||
while ($rc = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
while ($rc = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
|
||||||
$codes[$rc['id']] = $rc['code'];
|
$codes[$rc['id']] = $rc['code'];
|
||||||
if ($add_desc) {
|
if ($add_desc) {
|
||||||
$codes[$rc['id']] .= ' (' . $lng['redirect_desc'][$rc['desc']] . ')';
|
$codes[$rc['id']] .= ' (' . lng('redirect_desc.' . $rc['desc']) . ')';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -53,9 +53,8 @@ class IpAddr
|
|||||||
|
|
||||||
public static function getSslIpPortCombinations()
|
public static function getSslIpPortCombinations()
|
||||||
{
|
{
|
||||||
global $lng;
|
|
||||||
return [
|
return [
|
||||||
'' => $lng['panel']['none_value']
|
'' => lng('panel.none_value')
|
||||||
] + self::getIpPortCombinations(true);
|
] + self::getIpPortCombinations(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -424,8 +424,6 @@ class FileDir
|
|||||||
*/
|
*/
|
||||||
public static function makePathfield($path, $uid, $gid, $value = '', $dom = false)
|
public static function makePathfield($path, $uid, $gid, $value = '', $dom = false)
|
||||||
{
|
{
|
||||||
global $lng;
|
|
||||||
|
|
||||||
$value = str_replace($path, '', $value);
|
$value = str_replace($path, '', $value);
|
||||||
$field = [];
|
$field = [];
|
||||||
|
|
||||||
@@ -471,20 +469,17 @@ class FileDir
|
|||||||
// remove starting slash we added
|
// remove starting slash we added
|
||||||
// for the Dropdown, #225
|
// for the Dropdown, #225
|
||||||
$value = substr($value, 1);
|
$value = substr($value, 1);
|
||||||
// $field = $lng['panel']['toomanydirs'];
|
|
||||||
$field = [
|
$field = [
|
||||||
'type' => 'text',
|
'type' => 'text',
|
||||||
'value' => htmlspecialchars($value),
|
'value' => htmlspecialchars($value),
|
||||||
'note' => $lng['panel']['toomanydirs']
|
'note' => lng('panel.toomanydirs')
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// $field = $lng['panel']['dirsmissing'];
|
|
||||||
// $field = '<input type="hidden" name="path" value="/" />';
|
|
||||||
$field = [
|
$field = [
|
||||||
'type' => 'hidden',
|
'type' => 'hidden',
|
||||||
'value' => '/',
|
'value' => '/',
|
||||||
'note' => $lng['panel']['dirsmissing']
|
'note' => lng('panel.dirsmissing')
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -89,11 +89,9 @@ class Crypt
|
|||||||
*/
|
*/
|
||||||
public static function getAvailablePasswordHashes()
|
public static function getAvailablePasswordHashes()
|
||||||
{
|
{
|
||||||
global $lng;
|
|
||||||
|
|
||||||
// get available pwd-hases
|
// get available pwd-hases
|
||||||
$available_pwdhashes = [
|
$available_pwdhashes = [
|
||||||
PASSWORD_DEFAULT => $lng['serversettings']['systemdefault']
|
PASSWORD_DEFAULT => lng('serversettings.systemdefault')
|
||||||
];
|
];
|
||||||
if (defined('PASSWORD_BCRYPT')) {
|
if (defined('PASSWORD_BCRYPT')) {
|
||||||
$available_pwdhashes[PASSWORD_BCRYPT] = 'Bcrypt/Blowfish';
|
$available_pwdhashes[PASSWORD_BCRYPT] = 'Bcrypt/Blowfish';
|
||||||
|
|||||||
@@ -93,8 +93,6 @@ class Form
|
|||||||
|
|
||||||
public static function getFormOverviewGroupOutput($groupname, $groupdetails)
|
public static function getFormOverviewGroupOutput($groupname, $groupdetails)
|
||||||
{
|
{
|
||||||
global $lng;
|
|
||||||
|
|
||||||
$activated = true;
|
$activated = true;
|
||||||
if (isset($groupdetails['fields'])) {
|
if (isset($groupdetails['fields'])) {
|
||||||
foreach ($groupdetails['fields'] as $fielddetails) {
|
foreach ($groupdetails['fields'] as $fielddetails) {
|
||||||
@@ -125,7 +123,7 @@ class Form
|
|||||||
if (isset($groupdetails['websrv_avail']) && is_array($groupdetails['websrv_avail'])) {
|
if (isset($groupdetails['websrv_avail']) && is_array($groupdetails['websrv_avail'])) {
|
||||||
$websrv = Settings::Get('system.webserver');
|
$websrv = Settings::Get('system.webserver');
|
||||||
if (!in_array($websrv, $groupdetails['websrv_avail'])) {
|
if (!in_array($websrv, $groupdetails['websrv_avail'])) {
|
||||||
$item['info'] = sprintf($lng['serversettings']['option_unavailable_websrv'], implode(", ", $groupdetails['websrv_avail']));
|
$item['info'] = lng('serversettings.option_unavailable_websrv', [implode(", ", $groupdetails['websrv_avail'])]);
|
||||||
$item['visible'] = false;
|
$item['visible'] = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -135,8 +133,6 @@ class Form
|
|||||||
|
|
||||||
public static function getFormFieldOutput($fieldname, $fielddata): array
|
public static function getFormFieldOutput($fieldname, $fielddata): array
|
||||||
{
|
{
|
||||||
global $lng;
|
|
||||||
|
|
||||||
$returnvalue = [];
|
$returnvalue = [];
|
||||||
if (is_array($fielddata) && isset($fielddata['type']) && $fielddata['type'] != '') {
|
if (is_array($fielddata) && isset($fielddata['type']) && $fielddata['type'] != '') {
|
||||||
if (!isset($fielddata['value'])) {
|
if (!isset($fielddata['value'])) {
|
||||||
@@ -170,7 +166,7 @@ class Form
|
|||||||
$websrv = Settings::Get('system.webserver');
|
$websrv = Settings::Get('system.webserver');
|
||||||
if (!in_array($websrv, $fielddata['websrv_avail'])) {
|
if (!in_array($websrv, $fielddata['websrv_avail'])) {
|
||||||
$do_show = false;
|
$do_show = false;
|
||||||
$fielddata['note'] = sprintf($lng['serversettings']['option_unavailable_websrv'], implode(", ", $fielddata['websrv_avail']));
|
$fielddata['note'] = lng('serversettings.option_unavailable_websrv', [implode(", ", $fielddata['websrv_avail'])]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -180,7 +176,7 @@ class Form
|
|||||||
if (isset($fielddata['visible']) && $do_show) {
|
if (isset($fielddata['visible']) && $do_show) {
|
||||||
$do_show = $fielddata['visible'];
|
$do_show = $fielddata['visible'];
|
||||||
if (!$do_show) {
|
if (!$do_show) {
|
||||||
$fielddata['note'] = $lng['serversettings']['option_unavailable'];
|
$fielddata['note'] = lng('serversettings.option_unavailable');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -186,15 +186,7 @@ class HTML
|
|||||||
*/
|
*/
|
||||||
public static function askYesNo(string $text, string $yesfile, array $params = [], string $replacer = '', array $back_link = [])
|
public static function askYesNo(string $text, string $yesfile, array $params = [], string $replacer = '', array $back_link = [])
|
||||||
{
|
{
|
||||||
global $lng;
|
$text = lng('question.' . $text, [htmlspecialchars($replacer)]);
|
||||||
|
|
||||||
if (isset($lng['question'][$text])) {
|
|
||||||
$text = $lng['question'][$text];
|
|
||||||
}
|
|
||||||
|
|
||||||
$text = strtr($text, [
|
|
||||||
'%s' => htmlspecialchars($replacer)
|
|
||||||
]);
|
|
||||||
|
|
||||||
Panel\UI::view('form/yesnoquestion.html.twig', [
|
Panel\UI::view('form/yesnoquestion.html.twig', [
|
||||||
'action' => $yesfile,
|
'action' => $yesfile,
|
||||||
@@ -207,18 +199,8 @@ class HTML
|
|||||||
|
|
||||||
public static function askYesNoWithCheckbox(string $text, string $chk_text, string $yesfile, array $params = [], string $replacer = '', bool $show_checkbox = true)
|
public static function askYesNoWithCheckbox(string $text, string $chk_text, string $yesfile, array $params = [], string $replacer = '', bool $show_checkbox = true)
|
||||||
{
|
{
|
||||||
global $lng;
|
$text = lng('question.' . $text, [htmlspecialchars($replacer)]);
|
||||||
|
$chk_text = lng('question.' . $chk_text);
|
||||||
if (isset($lng['question'][$text])) {
|
|
||||||
$text = $lng['question'][$text];
|
|
||||||
}
|
|
||||||
$text = strtr($text, [
|
|
||||||
'%s' => htmlspecialchars($replacer)
|
|
||||||
]);
|
|
||||||
|
|
||||||
if (isset($lng['question'][$chk_text])) {
|
|
||||||
$chk_text = $lng['question'][$chk_text];
|
|
||||||
}
|
|
||||||
|
|
||||||
Panel\UI::view('form/yesnoquestion.html.twig', [
|
Panel\UI::view('form/yesnoquestion.html.twig', [
|
||||||
'action' => $yesfile,
|
'action' => $yesfile,
|
||||||
|
|||||||
@@ -98,8 +98,6 @@ class Response
|
|||||||
*/
|
*/
|
||||||
public static function standardError($errors = '', $replacer = '', $throw_exception = false)
|
public static function standardError($errors = '', $replacer = '', $throw_exception = false)
|
||||||
{
|
{
|
||||||
global $lng;
|
|
||||||
|
|
||||||
$_SESSION['requestData'] = $_POST;
|
$_SESSION['requestData'] = $_POST;
|
||||||
$replacer = htmlentities($replacer);
|
$replacer = htmlentities($replacer);
|
||||||
|
|
||||||
@@ -130,7 +128,7 @@ class Response
|
|||||||
UI::view('misc/alert.html.twig', [
|
UI::view('misc/alert.html.twig', [
|
||||||
'type' => 'danger',
|
'type' => 'danger',
|
||||||
'btntype' => 'light',
|
'btntype' => 'light',
|
||||||
'heading' => $lng['error']['error'],
|
'heading' => lng('error.error'),
|
||||||
'alert_msg' => $error,
|
'alert_msg' => $error,
|
||||||
'redirect_link' => $link_ref
|
'redirect_link' => $link_ref
|
||||||
]);
|
]);
|
||||||
@@ -139,7 +137,6 @@ class Response
|
|||||||
|
|
||||||
public static function dynamicError($message)
|
public static function dynamicError($message)
|
||||||
{
|
{
|
||||||
global $lng;
|
|
||||||
$_SESSION['requestData'] = $_POST;
|
$_SESSION['requestData'] = $_POST;
|
||||||
$link_ref = '';
|
$link_ref = '';
|
||||||
if (isset($_SERVER['HTTP_REFERER']) && strpos($_SERVER['HTTP_REFERER'], $_SERVER['HTTP_HOST']) !== false) {
|
if (isset($_SERVER['HTTP_REFERER']) && strpos($_SERVER['HTTP_REFERER'], $_SERVER['HTTP_HOST']) !== false) {
|
||||||
@@ -149,7 +146,7 @@ class Response
|
|||||||
UI::view('misc/alert.html.twig', [
|
UI::view('misc/alert.html.twig', [
|
||||||
'type' => 'danger',
|
'type' => 'danger',
|
||||||
'btntype' => 'light',
|
'btntype' => 'light',
|
||||||
'heading' => $lng['error']['error'],
|
'heading' => lng('error.error'),
|
||||||
'alert_msg' => $message,
|
'alert_msg' => $message,
|
||||||
'redirect_link' => $link_ref
|
'redirect_link' => $link_ref
|
||||||
]);
|
]);
|
||||||
@@ -170,8 +167,6 @@ class Response
|
|||||||
*/
|
*/
|
||||||
public static function standardSuccess($success_message = '', $replacer = '', $params = [], $throw_exception = false)
|
public static function standardSuccess($success_message = '', $replacer = '', $params = [], $throw_exception = false)
|
||||||
{
|
{
|
||||||
global $lng;
|
|
||||||
|
|
||||||
$success_message = lng('success.' . $success_message, [htmlentities($replacer)]);
|
$success_message = lng('success.' . $success_message, [htmlentities($replacer)]);
|
||||||
|
|
||||||
if ($throw_exception) {
|
if ($throw_exception) {
|
||||||
@@ -198,7 +193,7 @@ class Response
|
|||||||
UI::view('misc/alert.html.twig', [
|
UI::view('misc/alert.html.twig', [
|
||||||
'type' => 'success',
|
'type' => 'success',
|
||||||
'btntype' => 'light',
|
'btntype' => 'light',
|
||||||
'heading' => $lng['success']['success'],
|
'heading' => lng('success.success'),
|
||||||
'alert_msg' => $success_message,
|
'alert_msg' => $success_message,
|
||||||
'redirect_link' => $redirect_url
|
'redirect_link' => $redirect_url
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -247,12 +247,12 @@ if (AREA == 'admin' || AREA == 'customer') {
|
|||||||
$navigation_data = [
|
$navigation_data = [
|
||||||
'admin' => [
|
'admin' => [
|
||||||
'server' => [
|
'server' => [
|
||||||
'label' => $lng['admin']['server'],
|
'label' => lng('admin.server'),
|
||||||
'required_resources' => 'change_serversettings',
|
'required_resources' => 'change_serversettings',
|
||||||
'elements' => [
|
'elements' => [
|
||||||
[
|
[
|
||||||
'url' => 'admin_updates.php?page=overview',
|
'url' => 'admin_updates.php?page=overview',
|
||||||
'label' => $lng['update']['update'],
|
'label' => lng('update.update'),
|
||||||
'required_resources' => 'change_serversettings'
|
'required_resources' => 'change_serversettings'
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user