mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
lang in db
This commit is contained in:
@@ -8,11 +8,9 @@
|
||||
# Puche 2021 / 2022+ jokob jokob@duck.com GNU GPLv3
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
require '/home/pi/pialert/front/php/templates/timezone.php';
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// DB File Path
|
||||
$DBFILE = '/home/pi/pialert/db/pialert.db';
|
||||
$DBFILE = dirname(__FILE__).'/../../../db/pialert.db';
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Connect DB
|
||||
@@ -74,6 +72,3 @@ function OpenDB (...$DBPath) {
|
||||
// # Open DB once and keep open
|
||||
// # Opening / closing DB frequently actually casues more issues
|
||||
OpenDB (); // main
|
||||
|
||||
|
||||
?>
|
||||
@@ -9,10 +9,7 @@
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
// External files
|
||||
require '/home/pi/pialert/front/php/templates/timezone.php';
|
||||
require '/home/pi/pialert/front/php/templates/language/lang.php';
|
||||
require '/home/pi/pialert/front/php/server/db.php';
|
||||
require '/home/pi/pialert/front/php/server/util.php';
|
||||
require dirname(__FILE__).'/init.php';
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Action selector
|
||||
|
||||
@@ -9,8 +9,7 @@
|
||||
//------------------------------------------------------------------------------
|
||||
//------------------------------------------------------------------------------
|
||||
// External files
|
||||
require 'db.php';
|
||||
require 'util.php';
|
||||
require dirname(__FILE__).'/init.php';
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
5
front/php/server/init.php
Normal file
5
front/php/server/init.php
Normal file
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
require dirname(__FILE__).'/../templates/timezone.php';
|
||||
require dirname(__FILE__).'/db.php';
|
||||
require dirname(__FILE__).'/util.php';
|
||||
require dirname(__FILE__).'/../templates/language/lang.php';
|
||||
@@ -33,4 +33,3 @@ if(filter_var($PIA_HOST_IP, FILTER_VALIDATE_IP)) // Vulnerability fix v22.12.20
|
||||
{
|
||||
echo '<h4>Internal error.</h4>';
|
||||
}
|
||||
?>
|
||||
@@ -11,8 +11,7 @@
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// External files
|
||||
require 'db.php';
|
||||
require 'util.php';
|
||||
require dirname(__FILE__).'/init.php';
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
# Puche 2021 / 2022+ jokob jokob@duck.com GNU GPLv3
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
require '/home/pi/pialert/front/php/templates/timezone.php';
|
||||
require '/home/pi/pialert/front/php/templates/skinUI.php';
|
||||
require dirname(__FILE__).'/../templates/timezone.php';
|
||||
require dirname(__FILE__).'/../templates/skinUI.php';
|
||||
|
||||
$FUNCTION = [];
|
||||
$SETTINGS = [];
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
<?php
|
||||
|
||||
require 'php/server/db.php';
|
||||
|
||||
global $db;
|
||||
|
||||
$Pia_Graph_Device_Time = array();
|
||||
@@ -27,6 +25,3 @@ function pia_graph_devices_data($Pia_Graph_Array) {
|
||||
echo ",";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
@@ -8,10 +8,8 @@
|
||||
#--------------------------------------------------------------------------- -->
|
||||
|
||||
<?php
|
||||
|
||||
require '/home/pi/pialert/front/php/templates/timezone.php';
|
||||
require '/home/pi/pialert/front/php/templates/language/lang.php';
|
||||
require '/home/pi/pialert/front/php/templates/security.php';
|
||||
require dirname(__FILE__).'/../server/init.php';
|
||||
require dirname(__FILE__).'/security.php';
|
||||
|
||||
?>
|
||||
|
||||
@@ -169,8 +167,8 @@ if ($ENABLED_DARKMODE === True) {
|
||||
<li class="user-header" style=" height: 100px;">
|
||||
<img src="img/pialertLogoWhite.png" class="img-circle" alt="Pi.Alert Logo" style="border-color:transparent; height: 50px; width: 50px; margin-top:15px;">
|
||||
<p style="float: right; width: 200px">
|
||||
<?php echo lang('About_Title');?>
|
||||
<small><?php echo lang('About_Design');?> Raspberry Pi</small>
|
||||
<?= lang('About_Title');?>
|
||||
<small><?= lang('About_Design');?> Raspberry Pi</small>
|
||||
</p>
|
||||
</li>
|
||||
|
||||
@@ -178,7 +176,7 @@ if ($ENABLED_DARKMODE === True) {
|
||||
|
||||
<li class="user-footer">
|
||||
<div class="pull-right">
|
||||
<a href="index.php?action=logout" class="btn btn-danger"><?php echo lang('About_Exit');?></a>
|
||||
<a href="index.php?action=logout" class="btn btn-danger"><?= lang('About_Exit');?></a>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -209,31 +207,31 @@ if ($ENABLED_DARKMODE === True) {
|
||||
<ul class="sidebar-menu" data-widget="tree">
|
||||
|
||||
<li class=" <?php if (in_array (basename($_SERVER['SCRIPT_NAME']), array('devices.php', 'deviceDetails.php') ) ){ echo 'active'; } ?>">
|
||||
<a href="devices.php"><span><?php echo lang('Navigation_Devices');?></span></a>
|
||||
<a href="devices.php"><span><i class="fa fa-laptop"></i> <?= lang('Navigation_Devices');?></span></a>
|
||||
</li>
|
||||
|
||||
<li class=" <?php if (in_array (basename($_SERVER['SCRIPT_NAME']), array('presence.php') ) ){ echo 'active'; } ?>">
|
||||
<a href="presence.php"><?php echo lang('Navigation_Presence');?></span></a>
|
||||
<a href="presence.php"><i class="fa fa-calendar"></i> <?= lang('Navigation_Presence');?></span></a>
|
||||
</li>
|
||||
|
||||
<li class=" <?php if (in_array (basename($_SERVER['SCRIPT_NAME']), array('events.php') ) ){ echo 'active'; } ?>">
|
||||
<a href="events.php"><i class="fa fa-bolt"></i> <span><?php echo lang('Navigation_Events');?></span></a>
|
||||
<a href="events.php"><i class="fa fa-bolt"></i> <span><?= lang('Navigation_Events');?></span></a>
|
||||
</li>
|
||||
|
||||
<li class=" <?php if (in_array (basename($_SERVER['SCRIPT_NAME']), array('network.php') ) ){ echo 'active'; } ?>">
|
||||
<a href="network.php"><span><?php echo lang('Navigation_Network');?></span></a>
|
||||
<a href="network.php"><span><i class="fa fa-fw fa-network-wired"></i> <?= lang('Navigation_Network');?></span></a>
|
||||
</li>
|
||||
|
||||
<li class=" <?php if (in_array (basename($_SERVER['SCRIPT_NAME']), array('maintenance.php') ) ){ echo 'active'; } ?>">
|
||||
<div class="new-version myhidden" id="version" data-build-time="<?php echo file_get_contents( "buildtimestamp.txt");?>">🆕</div>
|
||||
<a href="maintenance.php"><i class="fa fa-wrench "></i> <span><?php echo lang('Navigation_Maintenance');?></span></a>
|
||||
<a href="maintenance.php"><i class="fa fa-wrench "></i> <span><?= lang('Navigation_Maintenance');?></span></a>
|
||||
</li>
|
||||
<li class=" <?php if (in_array (basename($_SERVER['SCRIPT_NAME']), array('settings.php') ) ){ echo 'active'; } ?>">
|
||||
<a href="settings.php"><i class="fa fa-cog"></i> <span><?php echo lang('Navigation_Settings');?></span></a>
|
||||
<a href="settings.php"><i class="fa fa-cog"></i> <span><?= lang('Navigation_Settings');?></span></a>
|
||||
</li>
|
||||
|
||||
<li class=" <?php if (in_array (basename($_SERVER['SCRIPT_NAME']), array('help_faq.php') ) ){ echo 'active'; } ?>">
|
||||
<a href="help_faq.php"><i class="fa fa-question"></i> <span><?php echo lang('Navigation_HelpFAQ');?></span></a>
|
||||
<a href="help_faq.php"><i class="fa fa-question"></i> <span><?= lang('Navigation_HelpFAQ');?></span></a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -47,12 +47,12 @@ $lang['en_us'] = array(
|
||||
// Device Page
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
'Navigation_Devices' => '<i class="fa fa-laptop"></i> Devices',
|
||||
'Navigation_Presence' => '<i class="fa fa-calendar"></i> Presence',
|
||||
'Navigation_Devices' => 'Devices',
|
||||
'Navigation_Presence' => 'Presence',
|
||||
'Navigation_Events' => 'Events',
|
||||
'Navigation_Maintenance' => 'Maintenance',
|
||||
'Navigation_Settings' => 'Settings',
|
||||
'Navigation_Network' => '<i class="fa fa-fw fa-network-wired"></i> Network',
|
||||
'Navigation_Network' => 'Network',
|
||||
'Navigation_HelpFAQ' => 'Help / FAQ',
|
||||
'Device_Title' => 'Devices',
|
||||
'Device_Shortcut_AllDevices' => 'All Devices',
|
||||
@@ -513,6 +513,8 @@ the arp-scan will take hours to complete instead of seconds.
|
||||
'REPORT_DASHBOARD_URL_description' => 'This URL is used as the base for generating links in the emails. Enter full URL starting with <code>http://</code> including the port number (no trailig slash <code>/</code>).',
|
||||
'DIG_GET_IP_ARG_name' => 'Internet IP discovery',
|
||||
'DIG_GET_IP_ARG_description' => 'Change the <a href="https://linux.die.net/man/1/dig" target="_blank">dig utility</a> arguments if you have issues resolving your Internet IP. Arguments are added at the end of the following command: <code>dig +short </code>.',
|
||||
'UI_LANG_name' => 'Select Language',
|
||||
'UI_LANG_description' => '',
|
||||
|
||||
//Email
|
||||
'Email_settings_group' => '<i class="fa fa-at"></i> Email',
|
||||
|
||||
@@ -46,7 +46,7 @@ $lang['es_es'] = array(
|
||||
'Navigation_Devices' => 'Dispositivos',
|
||||
'Navigation_Presence' => 'Historial',
|
||||
'Navigation_Events' => 'Eventos',
|
||||
'Navigation_Maintenance' => 'Cantenimiento',
|
||||
'Navigation_Maintenance' => 'Mantenimiento',
|
||||
'Navigation_Settings' => 'Configuración',
|
||||
'Navigation_Network' => 'Red',
|
||||
'Navigation_HelpFAQ' => 'Ayuda / FAQ',
|
||||
|
||||
@@ -6,18 +6,21 @@
|
||||
|
||||
$defaultLang = "en_us";
|
||||
|
||||
if(!isset($_COOKIE["language"])) {
|
||||
$pia_lang_selected = $defaultLang;
|
||||
} else {
|
||||
$pia_lang_selected = $_COOKIE["language"];
|
||||
global $db;
|
||||
|
||||
$result = $db->querySingle("SELECT Value FROM Settings WHERE Code_Name = 'UI_LANG'");
|
||||
switch($result){
|
||||
case 'Spanish': $pia_lang_selected = 'es_es'; break;
|
||||
case 'German': $pia_lang_selected = 'de_de'; break;
|
||||
default: $pia_lang_selected = 'en_us'; break;
|
||||
}
|
||||
|
||||
if (isset($pia_lang_selected) == FALSE or (strlen($pia_lang_selected) == 0)) {$pia_lang_selected = defaultLang;}
|
||||
if (isset($pia_lang_selected) == FALSE or (strlen($pia_lang_selected) == 0)) {$pia_lang_selected = $defaultLang;}
|
||||
|
||||
require '/home/pi/pialert/front/php/templates/skinUI.php';
|
||||
require 'en_us.php';
|
||||
require 'de_de.php';
|
||||
require 'es_es.php';
|
||||
require dirname(__FILE__).'/../skinUI.php';
|
||||
require dirname(__FILE__).'/en_us.php';
|
||||
require dirname(__FILE__).'/de_de.php';
|
||||
require dirname(__FILE__).'/es_es.php';
|
||||
|
||||
function lang($key)
|
||||
{
|
||||
@@ -45,4 +48,3 @@ function lang($key)
|
||||
|
||||
return $temp;
|
||||
}
|
||||
?>
|
||||
@@ -4,9 +4,9 @@
|
||||
// ## TimeZone processing start
|
||||
// ###################################
|
||||
|
||||
$configFolderPath = "/home/pi/pialert/config/";
|
||||
$configFolderPath = dirname(__FILE__)."/../../../config/";
|
||||
$config_file = "pialert.conf";
|
||||
$logFolderPath = "/home/pi/pialert/front/log/";
|
||||
$logFolderPath = dirname(__FILE__)."/../../log/";
|
||||
$log_file = "pialert_front.log";
|
||||
|
||||
|
||||
@@ -40,5 +40,3 @@ $timestamp = $date->format('Y-m-d_H-i-s');
|
||||
// ###################################
|
||||
// ## TimeZone processing end
|
||||
// ###################################
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user