Browse Source

MultiLang Translation

master
Evgeny Gagua 3 years ago
parent
commit
20041ef09d
  1. 1
      lib/1.json
  2. 1
      lib/2.json
  3. 1
      lib/3.json
  4. 1
      lib/4.json
  5. 1
      lib/5.json
  6. 1
      lib/6.json
  7. 1
      lib/7.json
  8. 10
      lib/ajax_asm.php
  9. 14
      lib/assembler.php
  10. 12
      lib/controller/dash/node_1.js
  11. 12
      lib/controller/dash/node_3.js
  12. 9
      lib/controller/doSensorOperation.php
  13. 78
      lib/controller/getCameraEditor.php
  14. 32
      lib/controller/getDashBoardItems.php
  15. 263
      lib/controller/getSensorDetectionEditor.php
  16. 86
      lib/controller/getSensorEditor.php
  17. 12
      lib/defines.php
  18. 80
      lib/javascript/jsapi_dynamic/mojo_dashboard.js
  19. 6
      lib/javascript/jsapi_dynamic/mojo_logs.js
  20. 4
      lib/javascript/jsapi_dynamic/mojo_main.js
  21. 18
      lib/javascript/jsapi_dynamic/mojo_map.js
  22. 271
      lib/javascript/jsapi_dynamic/mojo_settings.js
  23. 20
      lib/javascript/jsapi_dynamic/mojo_users.js
  24. 11
      lib/js_asm.php
  25. 24
      lib/php/db/language_json_class.php
  26. BIN
      style/assets/20f21b4f01f1b7587f728b05dfc9f4aa.png

1
lib/1.json
File diff suppressed because it is too large
View File

1
lib/2.json
File diff suppressed because it is too large
View File

1
lib/3.json
File diff suppressed because it is too large
View File

1
lib/4.json
File diff suppressed because it is too large
View File

1
lib/5.json
File diff suppressed because it is too large
View File

1
lib/6.json
File diff suppressed because it is too large
View File

1
lib/7.json
File diff suppressed because it is too large
View File

10
lib/ajax_asm.php

@ -25,7 +25,8 @@ require_once('php/db/logio_class.php');
$LOG = new Logio( LOG_LVL_ALL );
require_once('php/db/user_class.php');
require_once('php/auth/web.php');
require_once('php/db/language_class.php');
//require_once('php/db/language_class.php');
require_once('php/db/language_json_class.php');
require_once('php/sys/r-goose_sys.php');
require_once('php/argus/mojo.php');
@ -36,11 +37,12 @@ if( isset($_GET['Lang'])){
if ($UCL) $_SESSION['userlang']=$UCL; else $_SESSION['userlang']=$UserLang;
}
$LDB = new SQLite_DB( '/srv/www/web/lib/controller/data/lang_en_US.db');
//$LDB = new SQLite_DB( '/srv/www/web/lib/controller/data/lang_en_US.db');
if( isset($_SESSION['userlang']) ){
$Labels=new Language( $_SESSION['userlang'],'', $LDB );
$Labels=new Language_json( '/srv/www/web/lib/'.$_SESSION['userlang'].'.json');//$_SESSION['userlang'],'', $LDB );
} else {
$Labels=new Language( $UserLang ,'', $LDB );
//$Labels=new Language( $UserLang ,'', $LDB );
$Labels=new Language_json( '/srv/www/web/lib/'.$UserLang.'.json');
};
if( $UserLang == 3 || $UserLang == 255 ){

14
lib/assembler.php

@ -40,7 +40,8 @@ require_once('php/db/logio_class.php');
$LOG = new Logio( LOG_LVL_ALL );
require_once('php/db/user_class.php');
require_once('php/auth/web.php');
require_once('php/db/language_class.php');
//require_once('php/db/language_class.php');
require_once('php/db/language_json_class.php');
//require_once('php/sys/SYSTEM_functions.php');
require_once('php/ui/UI_functions.php');
//require_once('php/web/WEB_functions.php');
@ -52,11 +53,16 @@ if( isset($_GET['Lang'])){
if ($UCL) $_SESSION['userlang']=$UCL; else $_SESSION['userlang']=$UserLang;
}
$LDB = new SQLite_DB( 'lib/controller/data/lang_en_US.db');
//$LDB = new SQLite_DB( 'lib/controller/data/lang_en_US.db');
if( isset($_SESSION['userlang']) ){
$Labels=new Language( $_SESSION['userlang'],'', $LDB );
$UserLang = $Site_Languages[$_SESSION['userlang']]['id'];
//$Labels=new Language( $_SESSION['userlang'],'', $LDB );
$Labels=new Language_json( '/srv/www/web/lib/'.$_SESSION['userlang'].'.json');
} else {
$Labels=new Language( $UserLang ,'', $LDB );
$UserLang = $Site_Languages[$UserLang]['id'];
//$Labels=new Language( $UserLang ,'', $LDB );
$Labels=new Language_json( '/srv/www/web/lib/'.$UserLang.'.json');
};
if( $UserLang == 3 || $UserLang == 255 ){

12
lib/controller/dash/node_1.js

@ -74,7 +74,7 @@
border: false,
collapsed: true,
collapseMode: 'mini',
title: 'Toolbox',
title: '%%%LABEL%%%TOOLBOX%%%',
floatable: true,
animFloat: false,
autoHide: true,
@ -91,7 +91,7 @@
id: 'cp_clear_btn_%%%NODEID%%%',
width: '100%',
disabled: true,
text: 'Clear Alarm',
text: '%%%LABEL%%%CLEALARM%%%',
iconCls: 'ctrl_panel_clean_sm',
iconAlign: 'left',
handler: function(){
@ -104,7 +104,7 @@
xtype: 'button',
id: 'cp_draw_btn_%%%NODEID%%%',
width: '100%',
text: 'Draw Background',
text: '%%%LABEL%%%DRABACKGROUND%%%',
iconCls: 'ctrl_panel_drawscan_sm',
iconAlign: 'left',
disabled: true,
@ -118,7 +118,7 @@
xtype: 'button',
id: 'cp_study_btn_%%%NODEID%%%',
width: '100%',
text: 'Study Background',
text: '%%%LABEL%%%STUBACKGROUND%%%',
iconCls: 'ctrl_panel_study_sm',
iconAlign: 'left',
disabled: true,
@ -130,7 +130,7 @@
height: 3
},{
xtype: 'button',
text: 'Mask Editor',
text: '%%%LABEL%%%MASKEDITOR%%%',
id: 'DMED_%%%NODEID%%%',
width: '100%',
disabled: true,
@ -143,7 +143,7 @@
height: 3
},{
xtype: 'panel',
title: 'Masking Management',
title: '%%%LABEL%%%MASKMNGR%%%',
height: 70,
frame: true,
flex: 1,

12
lib/controller/dash/node_3.js

@ -74,7 +74,7 @@
border: false,
collapsed: true,
collapseMode: 'mini',
title: 'Toolbox',
title: '%%%LABEL%%%TOOLBOX%%%',
floatable: true,
animFloat: false,
autoHide: true,
@ -91,7 +91,7 @@
id: 'cp_clear_btn_%%%NODEID%%%',
width: '100%',
disabled: true,
text: 'Clear Alarm',
text: '%%%LABEL%%%CLEALARM%%%',
iconCls: 'ctrl_panel_clean_sm',
iconAlign: 'left',
handler: function(){
@ -104,7 +104,7 @@
xtype: 'button',
id: 'cp_draw_btn_%%%NODEID%%%',
width: '100%',
text: 'Draw Background',
text: '%%%LABEL%%%DRABACKGROUND%%%',
iconCls: 'ctrl_panel_drawscan_sm',
iconAlign: 'left',
disabled: true,
@ -118,7 +118,7 @@
xtype: 'button',
id: 'cp_study_btn_%%%NODEID%%%',
width: '100%',
text: 'Study Background',
text: '%%%LABEL%%%STUBACKGROUND%%%',
iconCls: 'ctrl_panel_study_sm',
iconAlign: 'left',
disabled: true,
@ -130,7 +130,7 @@
height: 3
},{
xtype: 'button',
text: 'Mask Editor',
text: '%%%LABEL%%%MASKEDITOR%%%',
id: 'DMED_%%%NODEID%%%',
width: '100%',
disabled: true,
@ -143,7 +143,7 @@
height: 3
},{
xtype: 'panel',
title: 'Masking Management',
title: '%%%LABEL%%%MASKMNGR%%%',
height: 70,
frame: true,
flex: 1,

9
lib/controller/doSensorOperation.php

@ -230,6 +230,15 @@
$QS ='';
break;
};
case 25:{
// Create Ack Masking
// Clear ACK Masking
// Select Current Events Targets
// Create Polygone
// Update Device masks
break;
};
case 255:{
// Delete Sensor
$NID = $CN['id'];

78
lib/controller/getCameraEditor.php

@ -95,7 +95,7 @@ kskjhiiuwye;
loadDetectedCameras();
} else {
Ext.Msg.show({
title:'Error!',
title:'{$Labels->GetLabel('_ERROR_')}',
msg: tData.msg,
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.ERROR
@ -300,7 +300,7 @@ CHUPAKABRA;
items:[{
xtype: 'checkbox',
id: 'cam_manassign',
fieldLabel: 'Static Connection',
fieldLabel: '{$Labels->GetLabel('_STATIC_CONNECTION_')}',
width: 200,
checked: {$Cam['manual']},
listeners:{
@ -375,7 +375,7 @@ CHUPAKABRA;
}
}],
},{
title: 'Lens Settings',
title: '{$Labels->GetLabel('_CAM_LENS_SETTINGS_')}',
id: 'lens_tab',
frame: false,
border: false,
@ -393,10 +393,10 @@ CHUPAKABRA;
},
items:[{
width: 200,
html: 'Sensor Size'
html: '{$Labels->GetLabel('_CAM_SENS_SIZE_')}'
},{
xtype: 'combo',
fieldLabel: 'Sensor Size',
fieldLabel: '{$Labels->GetLabel('_CAM_SENS_SIZE_')}',
lazyRender: true,
id: 'sens_size',
mode: 'local',
@ -432,10 +432,10 @@ CHUPAKABRA;
},{
html: ' '
},{
html: 'Focal Length'
html: '{$Labels->GetLabel('_CAM_FOCALL_')}'
},{
xtype: 'combo',
fieldLabel: 'Lens Focal Length',
fieldLabel: '{$Labels->GetLabel('_CAM_FOCALL_')}',
lazyRender: true,
id: 'lens_fl',
mode: 'local',
@ -508,7 +508,7 @@ CHUPAKABRA;
},{
html: ' '
},{
html: 'Fixed Zoom'
html: '{$Labels->GetLabel('_CAM_FIXEDZ_')}'
},{
xtype: 'radio',
id: 'no_zoom',
@ -525,12 +525,12 @@ CHUPAKABRA;
},{
html: ' '
},{
html: 'Variable Zoom'
html: '{$Labels->GetLabel('_CAM_VARIOZ_')}'
},{
xtype: 'radio',
id: 'on_zoom',
hideLabel: false,
fieldLabel: 'Variable Zoom',
fieldLabel: '{$Labels->GetLabel('_CAM_VARIOZ_')}',
name: 'zoom_ena',
value: ({$Cam['zoom']}>0.0),
checked: ({$Cam['zoom']}>0.0),
@ -556,7 +556,7 @@ CHUPAKABRA;
},{
html: ' '
},{
html: 'Zoom Ratio'
html: '{$Labels->GetLabel('_CAM_ZOOMR_')}'
},{
xtype: 'slider',
id: 'zoom_val',
@ -692,10 +692,10 @@ CHUPAKABRA;
},{
html: ' '
},{
html: 'Pan Model'
html: '{$Labels->GetLabel('_CAM_PANMOD_')}'
},{
xtype: 'combo',
fieldLabel: 'Pan Model',
fieldLabel: '{$Labels->GetLabel('_CAM_PANMOD_')}',
lazyRender: true,
id: 'pan_mode',
disabled: ({$Cam['protocol']} == 0),
@ -707,8 +707,8 @@ CHUPAKABRA;
store: new Ext.data.ArrayStore({
fields: ['pm','pm_txt'],
data: [
[0,'Regular'],
[1,'Reversed']
[0,'{$Labels->GetLabel('_CAM_TM_REGULAR_')}'],
[1,'{$Labels->GetLabel('_CAM_TM_REVERSED_')}']
]
}),
valueField: 'pm',
@ -722,7 +722,7 @@ CHUPAKABRA;
},{
html: ' '
},{
html: 'Tottal Pan Angles'
html: '{$Labels->GetLabel('_CAM_PANANGS_')}'
},{
xtype: 'numberfield',
id: 'pan_ang',
@ -739,10 +739,10 @@ CHUPAKABRA;
},{
html: ' '
},{
html: 'Tilt Model'
html: '{$Labels->GetLabel('_CAM_TILTMOD_')}'
},{
xtype: 'combo',
fieldLabel: 'Tilt Model',
fieldLabel: '{$Labels->GetLabel('_CAM_TILTMOD_')}',
lazyRender: true,
id: 'tilt_mode',
disabled: ({$Cam['protocol']} == 0),
@ -754,10 +754,10 @@ CHUPAKABRA;
store: new Ext.data.ArrayStore({
fields: ['tm','tm_txt'],
data: [
[0,'Regular'],
[1,'Reversed'],
[2,'Shifted 90°'],
[3,'Rev-Shifted 90°']
[0,'{$Labels->GetLabel('_CAM_TM_REGULAR_')}'],
[1,'{$Labels->GetLabel('_CAM_TM_REVERSED_')}'],
[2,'{$Labels->GetLabel('_CAM_TM_SHIFTED_')} 90°'],
[3,'{$Labels->GetLabel('_CAM_TM_RSHIFTED_')} 90°']
]
}),
valueField: 'tm',
@ -771,7 +771,7 @@ CHUPAKABRA;
},{
html: ' '
},{
html: 'Tottal Tilt Angles'
html: '{$Labels->GetLabel('_CAM_TILTANGS_')}'
},{
xtype: 'numberfield',
id: 'tilt_ang',
@ -788,7 +788,7 @@ CHUPAKABRA;
},{
html: ' '
},{
html: 'PTZ Auto Axeleration'
html: '{$Labels->GetLabel('_CAM_PTZ_AAC_')}'
},{
xtype: 'checkbox',
id: 'ptz_axel_c',
@ -818,7 +818,7 @@ CHUPAKABRA;
},{
html: ' '
},{
html: 'PTZ Manual Axeleration'
html: '{$Labels->GetLabel('_CAM_PTZ_MAC_')}'
},{
xtype: 'slider',
id: 'ptz_axel',
@ -837,7 +837,7 @@ CHUPAKABRA;
id: 'ptz_axel_d',
html: '<p>X&nbsp;'+ {$Cam['ptz_axel']} + '</p>'
},{
html: '<table ><tr><td>Axis Rotation</td><td><img width="32" src="/style/wicons/rotate-axis-x-512.png"></td></tr></table>'
html: '<table ><tr><td>{$Labels->GetLabel('_AXIS_ROT_')}</td><td><img width="32" src="/style/wicons/rotate-axis-x-512.png"></td></tr></table>'
},{
xtype: 'numberfield',
decimalPrecision: 3,
@ -850,7 +850,7 @@ CHUPAKABRA;
},{
html: '&nbsp;'
},{
html: '<table ><tr><td>Axis Rotation</td><td><img width="32" src="/style/wicons/rotate-axis-y-512.png"></td></tr></table>'
html: '<table ><tr><td>{$Labels->GetLabel('_AXIS_ROT_')}</td><td><img width="32" src="/style/wicons/rotate-axis-y-512.png"></td></tr></table>'
},{
xtype: 'numberfield',
decimalPrecision: 3,
@ -863,7 +863,7 @@ CHUPAKABRA;
},{
html: '&nbsp;'
},{
html: '<table ><tr><td>Axis Rotation</td><td><img width="32" src="/style/wicons/rotate-axis-z-512.png"></td></tr></table>'
html: '<table ><tr><td>{$Labels->GetLabel('_AXIS_ROT_')}</td><td><img width="32" src="/style/wicons/rotate-axis-z-512.png"></td></tr></table>'
},{
xtype: 'numberfield',
decimalPrecision: 3,
@ -876,7 +876,7 @@ CHUPAKABRA;
},{
html: '&nbsp;'
},{
html: '<table ><tr><td>Δ from Anchor</td><td><img width="32" src="/style/wicons/rotate-position-x-512.png"></td></tr></table>'
html: '<table ><tr><td>Δ {$Labels->GetLabel('_FROM_ANCH_')}</td><td><img width="32" src="/style/wicons/rotate-position-x-512.png"></td></tr></table>'
},{
xtype: 'numberfield',
decimalPrecision: 3,
@ -889,7 +889,7 @@ CHUPAKABRA;
},{
html: '&nbsp;'
},{
html: '<table ><tr><td>Δ from Anchor</td><td><img width="32" src="/style/wicons/rotate-position-y-512.png"></td></tr></table>'
html: '<table ><tr><td>Δ {$Labels->GetLabel('_FROM_ANCH_')}</td><td><img width="32" src="/style/wicons/rotate-position-y-512.png"></td></tr></table>'
},{
xtype: 'numberfield',
decimalPrecision: 3,
@ -902,7 +902,7 @@ CHUPAKABRA;
},{
html: '&nbsp;'
},{
html: '<table ><tr><td>Δ from Anchor</td><td><img width="32" src="/style/wicons/rotate-position-z-512.png"></td></tr></table>'
html: '<table ><tr><td>Δ {$Labels->GetLabel('_FROM_ANCH_')}</td><td><img width="32" src="/style/wicons/rotate-position-z-512.png"></td></tr></table>'
},{
xtype: 'numberfield',
decimalPrecision: 3,
@ -935,7 +935,7 @@ CHUPAKABRA;
},
items:[{
width: 200,
html: 'Camera Label'
html: '{$Labels->GetLabel('_CAM_LABEL_')}'
},{
xtype: 'textfield',
id: 'cam_label',
@ -963,10 +963,10 @@ CHUPAKABRA;
store: new Ext.data.ArrayStore({
fields: ['type','type_txt'],
data: [
[0,'Strict Visible Targets'],
[1,'All Near'],
[2,'ALL Far'],
[3,'All Targets']
[0,'{$Labels->GetLabel('_CAM_TM_STRICT_VISIBLE_')}'],
[1,'{$Labels->GetLabel('_CAM_TM_ALL_NEAR_')}'],
[2,'{$Labels->GetLabel('_CAM_TM_ALL_FAR_')}'],
[3,'{$Labels->GetLabel('_CAM_TM_ALL_')}']
]
}),
value: {$Cam['trigger_mode']},
@ -981,7 +981,7 @@ CHUPAKABRA;
xtype: 'spacer'
},{
width: 200,
html: 'Enable Automatic Home Return'
html: '{$Labels->GetLabel('_CAM_AUTO_HOMING_')}'
},{
xtype: 'checkbox',
id: 'cam_horeten',
@ -1001,7 +1001,7 @@ CHUPAKABRA;
xtype: 'spacer'
},{
width: 200,
html: 'Time After Alarm'
html: '{$Labels->GetLabel('_CAM_AH_TIME_')}'
},{
xtype: 'numberfield',
id: 'cam_horetto',
@ -1016,7 +1016,7 @@ CHUPAKABRA;
xtype: 'spacer'
},{
width: 200,
html: 'Home Preset Token'
html: '{$Labels->GetLabel('_CAM_AH_TOKEN_')}'
},{
xtype: 'textfield',
id: 'cam_horettk',

32
lib/controller/getDashBoardItems.php

@ -1,5 +1,19 @@
<?php
require_once('../ajax_asm.php');
function inject_labels( $TPL ){
global $Labels;
$TPL = str_replace('%%%LABEL%%%TOOLBOX%%%', $Labels->GetLabel('_TOOLBOX_') , $TPL );
$TPL = str_replace('%%%LABEL%%%CLEALARM%%%', $Labels->GetLabel('_CLEAR_ALARM_') , $TPL );
$TPL = str_replace('%%%LABEL%%%DRABACKGROUND%%%', $Labels->GetLabel('_DRAW_BACKGROUND_') , $TPL );
$TPL = str_replace('%%%LABEL%%%STUBACKGROUND%%%', $Labels->GetLabel('_STUDY_BACKGROUND_') , $TPL );
$TPL = str_replace('%%%LABEL%%%MASKEDITOR%%%', $Labels->GetLabel('_MASK_EDITOR_') , $TPL );
$TPL = str_replace('%%%LABEL%%%MASKMNGR%%%', $Labels->GetLabel('_MASK_MANAGER_') , $TPL );
//$TPL = str_replace('%%%LABEL%%%MASKMNGR%%%', $Labels->GetLabel('_MASK_MANAGER_') , $TPL );
return $TPL;
};
$UID = intval( $CUser->Data['id'] );
$Data = '';
if( $UID > 1 ){
@ -24,7 +38,7 @@
p.setHeight( H+40 );
var jaja = Ext.create({
xtype: 'panel',
title: 'Camera is Not Assigned to the System',
title: '{$Labels->GetLabel('_MSG_CAM_NOT_ASS_')}',
frame: true,
renderTo: 'btn_ph_ccc_%%ID%%',
layout: 'vbox',
@ -35,7 +49,7 @@
height: 10
},{
width: '100%',
html: '<center>Proceed to Cameras Settings to Assign One</center>'
html: '<center>{$Labels->GetLabel('_MSG_CAM_PROC_NOT_ASS_')}</center>'
},{
xtype: 'spacer',
height: 20
@ -106,9 +120,9 @@ $MAPIO=<<<_DATA_BOUNDARY
_DATA_BOUNDARY;
$DUMMY['camera']="{xtype:'panel', id:'pan_ph_ccc_%%ID%%', title: 'Camera Placeholder', frame: true, border: true, draggable: false, layouit: 'fit', items:{$TABA}}";
$DUMMY['sensor']="{xtype:'panel', title: 'Sensor Placeholder', frame: true, border: true, draggable: false, html:'NO SENSOR', listeners:{ afterrender: function(p){ var W=p.getWidth(); p.setHeight( 32+(W/16)*9);}}}";
$DUMMY['map']="{xtype:'panel', title: 'Map', frame: true, border: true, draggable: false, collapsible: false, tools: [{ id:'toggle', handler: function( a, b, p ){ fullScreen( 'event_map' ); }}], items:[{$MAPIO}],listeners:{ afterrender: function(p){ var W=p.getWidth(); p.setHeight( 32+(W/16)*9); initMapMonitoring();}} }";
$DUMMY['log']="{xtype:'panel', id: 'lg_panel', title: 'Event Log', frame: true, border: true, draggable: false, items:[{$LOGIO}] }";
$DUMMY['sensor']="{xtype:'panel', title: '{$Labels->GetLabel('_SENSOR_PLACE_')}', frame: true, border: true, draggable: false, html:'NO SENSOR', listeners:{ afterrender: function(p){ var W=p.getWidth(); p.setHeight( 32+(W/16)*9);}}}";
$DUMMY['map']="{xtype:'panel', title: '{$Labels->GetLabel('_MAP_')}', frame: true, border: true, draggable: false, collapsible: false, tools: [{ id:'toggle', handler: function( a, b, p ){ fullScreen( 'event_map' ); }}], items:[{$MAPIO}],listeners:{ afterrender: function(p){ var W=p.getWidth(); p.setHeight( 32+(W/16)*9); initMapMonitoring();}} }";
$DUMMY['log']="{xtype:'panel', id: 'lg_panel', title: '{$Labels->GetLabel('_EVENT_LOG_')}', frame: true, border: true, draggable: false, items:[{$LOGIO}] }";
} else {
$DUMMY['camera']="{xtype:'panel', title: false, frame: true, draggable: false, html: '&nbsp;', listeners:{ afterrender: function(p){ var W=p.getWidth(); p.setHeight( 32+(W/16)*9);}}}";
$DUMMY['sensor']="{xtype:'panel', title: false, frame: true, draggable: false, html: '&nbsp;', listeners:{ afterrender: function(p){ var W=p.getWidth(); p.setHeight( 32+(W/16)*9);}}}";
@ -136,6 +150,7 @@ _DATA_BOUNDARY;
$TFN = 'dash/node_' . $DD['type'] . '.js';
if(!file_exists( $TFN )) continue;
$TPL = file_get_contents( $TFN );
$TPL = inject_labels( $TPL );
$TPL = str_replace('%%%NODEID%%%', ''.$DD['id'] , $TPL );
$TPL = str_replace('%%%NODENAME%%%', ''. urldecode( $DD['name'] ), $TPL );
$TPL = str_replace('%%%USERID%%%', $UserID, $TPL );
@ -163,6 +178,7 @@ _DATA_BOUNDARY;
$TFN = 'dash/node_' . $DD['type'] . '.js';
if(!file_exists( $TFN )) continue;
$TPL = file_get_contents( $TFN );
$TPL = inject_labels( $TPL );
$TPL = str_replace('%%%NODEID%%%', ''.$DD['id'] , $TPL );
$TPL = str_replace('%%%NODENAME%%%', ''.urldecode( $DD['name'] ) , $TPL );
$TPL = str_replace('%%%USERID%%%', $UserID, $TPL );
@ -248,6 +264,7 @@ _DATA_BOUNDARY;
$TFN = 'dash/node_' . $DD['type'] . '.js';
if(!file_exists( $TFN )) continue;
$TPL = file_get_contents( $TFN );
$TPL = inject_labels( $TPL );
$TPL = str_replace('%%%NODEID%%%', ''.$DD['id'] , $TPL );
$TPL = str_replace('%%%NODENAME%%%', ''.html_entity_decode( $DD['name'] ) , $TPL );
$TPL = str_replace('%%%USERID%%%', $UserID, $TPL );
@ -275,6 +292,7 @@ _DATA_BOUNDARY;
$TFN = 'dash/node_' . $DD['type'] . '.js';
if(!file_exists( $TFN )) continue;
$TPL = file_get_contents( $TFN );
$TPL = inject_labels( $TPL );
$TPL = str_replace('%%%NODEID%%%', ''.$DD['id'] , $TPL );
$TPL = str_replace('%%%NODENAME%%%', ''.urldecode($DD['name']) , $TPL );
$TPL = str_replace('%%%USERID%%%', $UserID, $TPL );
@ -361,6 +379,7 @@ _DATA_BOUNDARY;
$TFN = 'dash/node_' . $DD['type'] . '.js';
if(!file_exists( $TFN )) continue;
$TPL = file_get_contents( $TFN );
$TPL = inject_labels( $TPL );
$TPL = str_replace('%%%NODEID%%%', ''.$DD['id'] , $TPL );
$TPL = str_replace('%%%NODENAME%%%', ''.html_entity_decode( $DD['name'] ) , $TPL );
$TPL = str_replace('%%%USERID%%%', $UserID, $TPL );
@ -388,6 +407,7 @@ _DATA_BOUNDARY;
$TFN = 'dash/node_' . $DD['type'] . '.js';
if(!file_exists( $TFN )) continue;
$TPL = file_get_contents( $TFN );
$TPL = inject_labels( $TPL );
$TPL = str_replace('%%%NODEID%%%', ''.$DD['id'] , $TPL );
$TPL = str_replace('%%%NODENAME%%%', ''.urldecode($DD['name']) , $TPL );
$TPL = str_replace('%%%USERID%%%', $UserID, $TPL );
@ -466,6 +486,7 @@ _DATA_BOUNDARY;
$TFN = 'dash/node_' . $DD['type'] . '.js';
if(!file_exists( $TFN )) continue;
$TPL = file_get_contents( $TFN );
$TPL = inject_labels( $TPL );
$TPL = str_replace('%%%NODEID%%%', ''.$DD['id'] , $TPL );
$TPL = str_replace('%%%NODENAME%%%', ''.urldecode($DD['name']) , $TPL );
$TPL = str_replace('%%%USERID%%%', $UserID, $TPL );
@ -526,6 +547,7 @@ _DATA_BOUNDARY;
$TFN = 'dash/node_' . $DD['type'] . '.js';
if(!file_exists( $TFN )) continue;
$TPL = file_get_contents( $TFN );
$TPL = inject_labels( $TPL );
$TPL = str_replace('%%%NODEID%%%', ''.$DD['id'] , $TPL );
$TPL = str_replace('%%%NODENAME%%%', ''.html_entity_decode( $DD['name'] ) , $TPL );
$TPL = str_replace('%%%USERID%%%', $UserID, $TPL );

263
lib/controller/getSensorDetectionEditor.php

@ -0,0 +1,263 @@
<?php
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
$SI = 0;
$SOK = false;
$FOK = false;
if( isset( $_POST['SEN'] ) ) $SI = intval( $_POST['SEN'] );
if( $SI ){
$FOK = true;
$QS = "SELECT * FROM `lrf_sensors` WHERE `id`={$SI}";
$JJR = $DATABASE->Query( $QS, false );
if( count( $JJR ) ){
$DD = $JJR[0];
//$QS = "SELECT * FROM `lrf_detection_profiles` WHERE `aux_id`={$SI} AND `profile_id`=0 AND `lrf_id`=0 AND `master`=1";
$QS = "SELECT * FROM `lrf_detection_profiles` WHERE `aux_id`={$SI} AND `profile_id`=0 AND `lrf_id`=0 ORDER BY `master` DESC";
$JJR = $DATABASE->Query( $QS, false );
$SD = $JJR[0];
if( $DD['type'] == 1 ){
// Dual LRF Device (ALS)
$AD = $JJR[1];
};
$SOK = true;
} else {
$MSG = 'The Sensor ID is Wrong!';
};
} else {
$MSG = 'The Sensor ID not Set!';
};
$LILI=<<<_DATA_BOUNDARY
,listeners:{
afterrender: function(){
Ext.Msg.show({
title: '{$Labels->GetLabel('_INFO_')}',
msg: '{$MSG}',
buttons: Ext.Msg.OK,
fn: function(){
var tt = Ext.getCmp('up_se_popanel');
tt.removeAll( true );
tt.doLayout();
},
icon: Ext.MessageBox.INFO
});
}
}
_DATA_BOUNDARY;
$TPL=<<<_DATA_BOUNDARY
{
xtype: 'tabpanel',
activeTab: 0,
frame: true,
border: true,
bbar:[{
text: 'Apply Settings',
handler: function(){
var oder = Ext.getCmp('ups_order').getValue();
var oset = Ext.getCmp('ups_offset').getValue();
var odel = Ext.getCmp('ups_delta').getValue();
var ofli = Ext.getCmp('ups_flip').getValue();
var owid = Ext.getCmp('ups_width').getValue();
var osst = Ext.getCmp('ups_sst').getValue();
var osun = Ext.getCmp('ups_sun').getValue();
Ext.Ajax.request({
url: '/lib/controller/doSensorOperation.php',
params: {
UID: {$UserID},
SID: '{$Session}',
SNID: '{$SI}',
OPID: 19,
OFF: oset,
ORD: oder,
DEL: odel,
FLI: ofli,
WIZ: owid,
SST: osst,
SUN: osun
},
success: function( response, opts ){
Ext.Msg.show({
title: 'Information',
msg: 'Settings are Saved',
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.INFO
});
},
failure: failureAJAXFunction
});
}
}],
items:[{
xtype: 'panel',
id: 'up_se_popanel',
border: true,
title: '{$Labels->GetLabel('_MAS_LRF_DET_SET_')}',
frame: false,
labelWidth: 150,
labelAlign: 'right',
layout: 'form',
height: PanelH-42,
items:[{
xtype: 'numberfield',
id: 'm_order',
fieldLabel: 'Order',
value: '{$SD['order']}'
},{
xtype: 'numberfield',
id: 'm_offset',
fieldLabel: 'Offset',
value: '{$SD['offset']}'
},{
xtype: 'numberfield',
id: 'm_delta',
fieldLabel: 'Delta',
value: '{$SD['delta']}'
},{
xtype: 'numberfield',
id: 'm_flip',
fieldLabel: 'Flip',
value: '{$SD['flip']}'
},{
xtype: 'numberfield',
id: 'm_width',
fieldLabel: 'Width',
value: '{$SD['width']}'
},{
xtype: 'numberfield',
id: 'm_sst',
fieldLabel: 'SST',
value: '{$SD['sst']}'
},{
xtype: 'numberfield',
id: 'm_sun',
fieldLabel: 'Sun',
value: '{$SD['sun']}'
}]
},{
xtype: 'panel',
id: 'up_sse_popanel',
border: true,
title: '{$Labels->GetLabel('_SLV_LRF_DET_SET_')}',
frame: false,
labelWidth: 150,
labelAlign: 'right',
layout: 'form',
height: PanelH-42,
items:[{
xtype: 'numberfield',
id: 's_order',
fieldLabel: 'Order',
value: '{$SD['order']}'
},{
xtype: 'numberfield',
id: 's_offset',
fieldLabel: 'Offset',
value: '{$SD['offset']}'
},{
xtype: 'numberfield',
id: 's_delta',
fieldLabel: 'Delta',
value: '{$SD['delta']}'
},{
xtype: 'numberfield',
id: 's_flip',
fieldLabel: 'Flip',
value: '{$SD['flip']}'
},{
xtype: 'numberfield',
id: 's_width',
fieldLabel: 'Width',
value: '{$SD['width']}'
},{
xtype: 'numberfield',
id: 's_sst',
fieldLabel: 'SST',
value: '{$SD['sst']}'
},{
xtype: 'numberfield',
id: 's_sun',
fieldLabel: 'Sun',
value: '{$SD['sun']}'
}]
},{
title: '{$Labels->GetLabel('_DET_SET_WIDTH_T_')}',
height: PanelH-42,
tbar:[{
text: '{$Labels->GetLabel('__ADD__')}',
id: 'add_btn_width_table',
handler: function(){
addWidthTableRecord({$SI});
}
},{
text: '{$Labels->GetLabel('_DEL_SELECTED_')}',
disabled: true,
id: 'del_btn_width_table',
handler: function(){
}
}],
layout:'fit',
items:{
xtype: 'grid',
border: false,
frame: false,
autoScroll: true,
//width: '100%',
lazyRender: true,
//height: 210,
ds: targetWidthTable_store,
cm: new Ext.grid.ColumnModel( targetWidthTableColModel_ops ),
sm: new Ext.grid.RowSelectionModel( fileUploadsSelModel_ops ),
viewConfig: {
// forceFit: true
},
}
},{
title: '{$Labels->GetLabel('_DC_CONTROL_SET_')}',
height: PanelH-42,
labelWidth: 200,
labelAlign: 'right',
layout: 'form',
items:[{
xtype: 'checkbox',
id: 'dc_ena',
fieldLabel: '{$Labels->GetLabel('_DC_AUTO_ENA_')}',
checked: true,
},{
xtype: 'combo',
fieldLabel: '{$Labels->GetLabel('_DC_WORK_MODE_')}',
id: 'dc_mode',
editable: false,
typeAhead: true,
triggerAction: 'all',
width: '100%',
lazyRender:true,
mode: 'local',
store: new Ext.data.ArrayStore({
fields: ['sid', 'snam'],
data: [[0,'{$Labels->GetLabel('_DC_WM_NO_')}'], [1,'{$Labels->GetLabel('_DC_WM_NC_')}']]
}),
value: 0,
valueField: 'sid',
displayField: 'snam'
},{
xtype: 'numberfield',
id: 'dc_window',
fieldLabel: '{$Labels->GetLabel('_DC_TIME_WINDOW_')}',
value: 2
}]
}]
%%%JUMPAPA%%%
}
_DATA_BOUNDARY;
if( $FOK && $SOK ){
$TPL = str_replace('%%%JUMPAPA%%%', '', $TPL );
} else {
$TPL = str_replace('%%%JUMPAPA%%%', $LILI, $TPL );
};
echo $TPL;
} else {
header('location: /');
};
?>

86
lib/controller/getSensorEditor.php

@ -24,7 +24,7 @@ JOJOKA;
default: $NAME = '<b>'.$CR['name'].'</b><br/>Unknown Sensor';
};
$NAME .='<br/>communication errors per minute: '.$CR['com_epm'];
$INFO = '<table width="100%" border=0 style="font-weight: bold;"><tr><td width="130px" align="right">Serial:</td><td>'.(($CR['serial']!='')?$CR['serial']:'No Serial Defined').'</td></tr><tr><td align="right">Version:</td><td>'.(($CR['version']!='')?$CR['version']:'No Version Info').'</td></tr></table>';
$INFO = '<table width="100%" border=0 style="font-weight: bold;"><tr><td width="130px" align="right">'.$Labels->GetLabel('_SERIAL_').':</td><td>'.(($CR['serial']!='')?$CR['serial']:'No Serial Defined').'</td></tr><tr><td align="right">'.$Labels->GetLabel('_VERSION_').':</td><td>'.(($CR['version']!='')?$CR['version']:'No Version Info').'</td></tr></table>';
$ITEMS[0]="{ xtype:'panel', border: false, frame: false, html: '<table width=\"100%\" border=0 class=\"setEd_infoPanel\" id=\"SENSOR_".(($CR['enable']==1)?'A':'N')."\"><tr><td width=\"200px\"><div class=\"node_".$CR['type']."_img_sset\"></div></td><td valign=\"middle\">{$NAME}</td></tr><tr><td colspan=2>{$INFO}</td></tr></table><br/>'}";
$QS="SELECT aux_id, device FROM resources WHERE ( type=1 OR type=129 )";
$RR=$DATABASE->Query( $QS );
@ -75,7 +75,7 @@ JOJOKA;
if( stripos( $CR['version'], 'FD' )!== false ){
$THF_OPERATION = ",{
xtype: 'button',
text: 'Enable Frozen Threshold',
text: '{$Labels->GetLabel('_SENS_ENA_FROTH_')}',
width: '100%',
iconCls: 'srv_op_fth_ble',
scale: 'large',
@ -87,7 +87,7 @@ JOJOKA;
if( stripos( $CR['version'], 'FS' )!== false ){
$THF_OPERATION = ",{
xtype: 'button',
text: 'Finish Frozen Threshold Study',
text: '{$Labels->GetLabel('_SENS_FIN_FROTH_')}',
width: '100%',
iconCls: 'srv_op_fth_study',
scale: 'large',
@ -99,7 +99,7 @@ JOJOKA;
if( stripos( $CR['version'], 'FF' )!== false ){
$THF_OPERATION = ",{
xtype: 'button',
text: 'Delete Frozen Threshold',
text: '{$Labels->GetLabel('_SENS_DEL_FROTH_')}',
width: '100%',
iconCls: 'srv_op_fth_frozen',
scale: 'large',
@ -110,7 +110,7 @@ JOJOKA;
};
$THF_OPERATION .= ",{
xtype: 'button',
text: 'Disable Frozen Threshold',
text: '{$Labels->GetLabel('_SENS_DIS_FROTH_')}',
width: '100%',
iconCls: 'srv_op_fth_ble',
scale: 'large',
@ -128,7 +128,7 @@ JOJOKA;
activeTab: 0,
items:[{
xtype: 'form',
title: 'General',
title: '{$Labels->GetLabel('_GENERAL_')}',
labelWidth: 200,
border: false,
frame: false,
@ -173,15 +173,15 @@ JOJOKA;
store: new Ext.data.ArrayStore({
fields: ['range','range_txt'],
data: [
[15,'15 Meters'],
[35,'35 Meters'],
[45,'45 Meters'],
[65,'65 Meters'],
[75,'75 Meters'],
[150,'150 Meters'],
[200,'200 Meters'],
[300,'300 Meters'],
[350,'350 Meters']
[15,'15 {$Labels->GetLabel('_METERS_')}'],
[35,'35 {$Labels->GetLabel('_METERS_')}'],
[45,'45 {$Labels->GetLabel('_METERS_')}'],
[65,'65 {$Labels->GetLabel('_METERS_')}'],
[75,'75 {$Labels->GetLabel('_METERS_')}'],
[150,'150 {$Labels->GetLabel('_METERS_')}'],
[200,'200 {$Labels->GetLabel('_METERS_')}'],
[300,'300 {$Labels->GetLabel('_METERS_')}'],
[350,'350 {$Labels->GetLabel('_METERS_')}']
]
}),
valueField: 'range',
@ -271,7 +271,7 @@ JOJOKA;
}]
},{
xtype: 'form',
title: 'Hardware',
title: '{$Labels->GetLabel('_HARDWARE_')}',
labelWidth: 200,
border: false,
frame: false,
@ -280,7 +280,7 @@ JOJOKA;
items:[{
xtype: 'checkbox',
id: 'autores_ena',
fieldLabel: 'Auto Reset Enabled',
fieldLabel: '{$Labels->GetLabel('_SENS_AUTOR_ENA_')}',
width: 200,
checked: {$INI_S['AUTORESET_ENABLE']},
listeners:{
@ -295,7 +295,7 @@ JOJOKA;
},{
xtype: 'numberfield',
id: 'autores_il',
fieldLabel: 'Auto Reset Interleave',
fieldLabel: '{$Labels->GetLabel('_SENS_AUTOR_INTER_')}',
width: 200,
value: {$INI_S['AUTORESET_INTERLEAVE']},
listeners:{
@ -306,7 +306,7 @@ JOJOKA;
},{
xtype: 'numberfield',
id: 'autores_to',
fieldLabel: 'Auto Timeout',
fieldLabel: '{$Labels->GetLabel('_SENS_AUTOR_TO_')}',
width: 200,
value: {$INI_S['AUTORESET_TIMEOUT']},
listeners:{
@ -317,7 +317,7 @@ JOJOKA;
},{
xtype: 'numberfield',
id: 'board_zsh',
fieldLabel: 'Board Zero Shift',
fieldLabel: '{$Labels->GetLabel('_SENS_BZSHIFT_')}',
width: 200,
value: {$INI_S['BOARD_ZEROSHIFT']},
listeners:{
@ -328,7 +328,7 @@ JOJOKA;
},{
xtype: 'numberfield',
id: 'board_temp',
fieldLabel: 'Heater Temperature',
fieldLabel: '{$Labels->GetLabel('_SENS_HTEMP_')}',
width: 200,
value: {$INI_S['BOARD_TEMPERATURE']},
listeners:{
@ -339,7 +339,7 @@ JOJOKA;
},{
xtype: 'combo',
id: 'board_spd',
fieldLabel: "Scan Speed",
fieldLabel: "{$Labels->GetLabel('_SENS_SCANSPEED_')}",
lazyRender: true,
mode: 'local',
forceSelection: true,
@ -369,7 +369,7 @@ JOJOKA;
},{
xtype: 'checkbox',
id: 'nbt_ena',
fieldLabel: 'No Black Targets',
fieldLabel: '{$Labels->GetLabel('_SENS_NOBLA_')}',
width: 200,
checked: {$INI_S['NO_BLACK_TARGETS']},
listeners:{
@ -384,7 +384,7 @@ JOJOKA;
},{
xtype: 'checkbox',
id: 'jmt_ena',
fieldLabel: 'Just Moving Targets',
fieldLabel: '{$Labels->GetLabel('_SENS_JUMOTA_')}',
width: 200,
checked: {$INI_S['JUST_MOVING_TARGETS']},
listeners:{
@ -399,7 +399,7 @@ JOJOKA;
},{
xtype: 'checkbox',
id: 'jmt_rad',
fieldLabel: 'Just Moving Radial',
fieldLabel: '{$Labels->GetLabel('_SENS_JUMORA_')}',
width: 200,
checked: {$INI_S['JUST_MOVING_RADIAL']},
listeners:{
@ -414,7 +414,7 @@ JOJOKA;
},{
xtype: 'checkbox',
id: 'jmt_range',
fieldLabel: 'Just Moving Distance',
fieldLabel: '{$Labels->GetLabel('_SENS_JUMODI_')}',
width: 200,
checked: {$INI_S['JUST_MOVING_DISTANCE']},
listeners:{
@ -429,7 +429,7 @@ JOJOKA;
},{
xtype: 'checkbox',
id: 'fth_freeze',
fieldLabel: 'Freeze First Threshold',
fieldLabel: '{$Labels->GetLabel('_SENS_FFTH_')}',
width: 200,
checked: {$INI_S['FREEZ_FIRST_TH']},
listeners:{
@ -444,7 +444,7 @@ JOJOKA;
},{
xtype: 'checkbox',
id: 'fth_save',
fieldLabel: 'Save First Threshold',
fieldLabel: '{$Labels->GetLabel('_SENS_SFTH_')}',
width: 200,
checked: {$INI_S['SAVE_FIRST_TH']},
listeners:{
@ -458,7 +458,7 @@ JOJOKA;
}
},{
xtype: 'button',
text: 'Apply To Device and Reset',
text: '{$Labels->GetLabel('_SENS_APPLY_RES_')}',
width: '100%',
iconCls: 'srv_op_download',
scale: 'large',
@ -468,7 +468,7 @@ JOJOKA;
}]
},{
xtype: 'panel',
title: 'Position',
title: '{$Labels->GetLabel('_POSITION_')}',
height: PanelH - 283,
items:[{
xtype: 'panel',
@ -485,11 +485,11 @@ JOJOKA;
}]
},{
xtype: 'panel',
title: 'Maintenence',
title: '{$Labels->GetLabel('_MAINTENENCE_')}',
height: PanelH - 283,
items:[{
xtype: 'button',
text: 'Issue Sensor Full Reset',
text: '{$Labels->GetLabel('_SENS_DO_FULLR_')}',
width: '100%',
iconCls: 'srv_op_restart',
scale: 'large',
@ -498,7 +498,7 @@ JOJOKA;
}
},{
xtype: 'button',
text: 'Read All Settings from Sensor',
text: '{$Labels->GetLabel('_SENS_DO_READALL_')}',
width: '100%',
iconCls: 'srv_op_upload',
scale: 'large',
@ -507,7 +507,7 @@ JOJOKA;
}
},{
xtype: 'button',
text: 'Save All Settings to Sensor',
text: '{$Labels->GetLabel('_SENS_DO_SAVEALL_')}',
width: '100%',
iconCls: 'srv_op_download',
scale: 'large',
@ -531,7 +531,7 @@ JOJOKA;
xtype:'button',
id: 'pickfiles_3',
width: '100%',
text: 'Choose File',
text: '{$Labels->GetLabel('_CHOOSEF_')}',
listeners:{
afterrender: function(){
muploader = new plupload.Uploader({
@ -603,7 +603,7 @@ JOJOKA;
forceFit: true
},
bbar: [{
text: 'Clear',
text: '{$Labels->GetLabel('_CLEAR_')}',
id: 'uploads_clr_btn',
disabled: true,
handler: function(){
@ -617,7 +617,7 @@ JOJOKA;
xtype:'button',
id: 'upload_files_btn',
disabled: true,
text: 'Upload to Module',
text: '{$Labels->GetLabel('_UPLOA2MODULE_')}',
handler: function(){
if( muploader!= null ){
muploader.start();
@ -629,7 +629,7 @@ JOJOKA;
xtype: 'panel',
height: 20
},{
title: 'Files Saved on Module',
title: '{$Labels->GetLabel('_FISONMODULE_')}',
height: 200,
xtype: 'grid',
id: 'uploaded_grid',
@ -647,7 +647,7 @@ JOJOKA;
forceFit: true
},
bbar: [{
text: 'Clear',
text: '{$Labels->GetLabel('_CLEAR_')}',
id: 'oploaded_clr_btn',
disabled: false,
handler: function(){
@ -657,7 +657,7 @@ JOJOKA;
uploaded_store_id = 0;
}
},{
text: 'Reset Status',
text: '{$Labels->GetLabel('_RESETSTATUS_')}',
id: 'oploaded_rst_btn',
disabled: true,
handler: function(){
@ -666,7 +666,7 @@ JOJOKA;
//uploaded_store_id = 0;
}
},{
text: 'Issue Reset',
text: '{$Labels->GetLabel('_ISSURES_')}',
id: 'oploaded_sres_btn',
disabled: true,
handler: function(){
@ -678,7 +678,7 @@ JOJOKA;
xtype:'button',
//disabled: true,
id: 'oploaded_snd_btn',
text: 'Send to Sensor',
text: '{$Labels->GetLabel('_SENDTOSENS_')}',
handler: function(){
doDeviceOperation( {$CR['node_id']}, 120,'', true );
Ext.getCmp('uploaded_grid').hide();
@ -708,7 +708,7 @@ JOJOKA;
}]
}],
bbar:[{
text: 'Remove Sensor',
text: '{$Labels->GetLabel('_REMOVE_SENSOR_')}',
handler: function(){
doSensorOperation( {$CR['id']}, 255,'', true );
}

12
lib/defines.php

@ -32,4 +32,16 @@ function microtime_float(){
$Script_Start_Time = microtime_float();
$Site_Languages = array(
array( 'id'=>1, 'name'=>'English', 'rtl'=>false ),
array( 'id'=>1, 'name'=>'English', 'rtl'=>false ),
array( 'id'=>2, 'name'=>'Русский', 'rtl'=>false ),
array( 'id'=>3, 'name'=>'עברית', 'rtl'=>true ),
array( 'id'=>4, 'name'=>'Français', 'rtl'=>false ),
array( 'id'=>5, 'name'=>'日本語', 'rtl'=>false ),
array( 'id'=>6, 'name'=>'中国人', 'rtl'=>false ),
array( 'id'=>7, 'name'=>'Română', 'rtl'=>false ),
);
?>

80
lib/javascript/jsapi_dynamic/mojo_dashboard.js

@ -48,45 +48,45 @@ function log_sn_Renderer( value, meta, record ){
function log_et_Renderer( value, meta, record ){
var kaka = record.data.node_id % 3;
switch( value ){
case 6: ov = 'Device Enters Into Study Mode'; break;
case 7: ov = 'Device Is BUSY'; break;
case 8: ov = 'Flip Complete'; break;
case 9: ov = 'Scan Complete'; break;
case 12: ov = 'Black 2D Target'; break;
case 13: ov = 'White 2D Target'; break;
case 36: ov = 'Region Of Interest'; break;
case 39: ov = '[Train Filter] Check Target'; break;
case 40: ov = '[Train Filter] Upper Sensor Detection'; break;
case 41: ov = '[Train Filter] Bottom Sensor Detection'; break;
case 42: ov = '[Train Filter] Train Detected'; break;
case 43: ov = '[Train Filter] Train Updated'; break;
case 44: ov = '[Train Filter] Suspicious Activity'; break;
case 45: ov = '[Train Filter] Suspicious NACK'; break;
case 46: ov = '[Train Filter] Regular Detection'; break;
case 47: ov = '[Train Filter] Detection Disabled'; break;
case 48: ov = '[Train Filter] Suspicious Detection'; break;
case 49: ov = '[Train Filter] Differential Detection'; break;
case 52: ov = 'Event Started'; break;
case 53: ov = 'Event Ended'; break;
case 54: ov = 'Event Closed Manual'; break;
case 55: ov = 'Connected'; break;
case 56: ov = 'Disconnection'; break;
case 57: ov = 'Communication Jamed'; break;
case 58: ov = 'Video Framerate Decreased'; break;
case 59: ov = 'Video Framerate Increased'; break;
default: ov = 'Event ['+value+']';
case 6: ov = '<?=$Labels->GetLabel('_EVT_MSG_STUMO_');?>'; break;
case 7: ov = '<?=$Labels->GetLabel('_EVT_MSG_BUMO_');?>'; break;
case 8: ov = '<?=$Labels->GetLabel('_EVT_MSG_FLIPO_');?>'; break;
case 9: ov = '<?=$Labels->GetLabel('_EVT_MSG_SCANC_');?>'; break;
case 12: ov = '<?=$Labels->GetLabel('_EVT_MSG_B2DTRG_');?>'; break;
case 13: ov = '<?=$Labels->GetLabel('_EVT_MSG_W2DTRG_');?>'; break;
case 36: ov = '<?=$Labels->GetLabel('_EVT_MSG_ROI_');?>'; break;
case 39: ov = '<?=$Labels->GetLabel('_EVT_MSG_TF_CT_');?>'; break;
case 40: ov = '<?=$Labels->GetLabel('_EVT_MSG_TF_USD_');?>'; break;
case 41: ov = '<?=$Labels->GetLabel('_EVT_MSG_TF_BSD_');?>'; break;
case 42: ov = '<?=$Labels->GetLabel('_EVT_MSG_TF_TD_');?>'; break;
case 43: ov = '<?=$Labels->GetLabel('_EVT_MSG_TF_TUPD_');?>'; break;
case 44: ov = '<?=$Labels->GetLabel('_EVT_MSG_TF_SUSPA_');?>'; break;
case 45: ov = '<?=$Labels->GetLabel('_EVT_MSG_TF_SUSPN_');?>'; break;
case 46: ov = '<?=$Labels->GetLabel('_EVT_MSG_TF_RD_');?>'; break;
case 47: ov = '<?=$Labels->GetLabel('_EVT_MSG_TF_DD_');?>'; break;
case 48: ov = '<?=$Labels->GetLabel('_EVT_MSG_TF_SUSPD_');?>'; break;
case 49: ov = '<?=$Labels->GetLabel('_EVT_MSG_TF_DIFD_');?>'; break;
case 52: ov = '<?=$Labels->GetLabel('_EVT_MSG_EVT_START_');?>'; break;
case 53: ov = '<?=$Labels->GetLabel('_EVT_MSG_EVT_END_');?>'; break;
case 54: ov = '<?=$Labels->GetLabel('_EVT_MSG_EVT_CLOMA_');?>'; break;
case 55: ov = '<?=$Labels->GetLabel('_EVT_MSG_CONNECTED_');?>'; break;
case 56: ov = '<?=$Labels->GetLabel('_EVT_MSG_DISCONNECTED_');?>'; break;
case 57: ov = '<?=$Labels->GetLabel('_EVT_MSG_COM_JAMED_');?>'; break;
case 58: ov = '<?=$Labels->GetLabel('_EVT_MSG_VIFDEC_');?>'; break;
case 59: ov = '<?=$Labels->GetLabel('_EVT_MSG_VIFINC_');?>'; break;
default: ov = '<?=$Labels->GetLabel('_EVENT_');?> ['+value+']';
};
return '<div class="log_line_' + kaka + '">'+ov+'</div>';
};
var log_ColModel_ops = {
columns: [
{header: "Time", width: 100, fixed: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'dts' },
{header: "Source", width: 100, renderer: log_sn_Renderer, align: 'left', css: 'vertical-align: middle;', dataIndex: 'node_name' },
{header: "Type", width: 180, renderer: log_et_Renderer, fixed: false, align: 'center', css: 'vertical-align: middle;', dataIndex: 'type' },
{header: "Range", width: 100, dataIndex: 'range' },
{header: "Azimuth", width: 100, dataIndex: 'az' },
{header: "Width", width: 100, dataIndex: 'width' },
{header: "<?=$Labels->GetLabel('_TIME_');?>", width: 100, fixed: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'dts' },
{header: "<?=$Labels->GetLabel('_SOURCE_');?>", width: 100, renderer: log_sn_Renderer, align: 'left', css: 'vertical-align: middle;', dataIndex: 'node_name' },
{header: "<?=$Labels->GetLabel('_TYPE_');?>", width: 180, renderer: log_et_Renderer, fixed: false, align: 'center', css: 'vertical-align: middle;', dataIndex: 'type' },
{header: "<?=$Labels->GetLabel('_RANGE_');?>", width: 100, dataIndex: 'range' },
{header: "<?=$Labels->GetLabel('_AZIMUTH_');?>", width: 100, dataIndex: 'az' },
{header: "<?=$Labels->GetLabel('_WIDTH_');?>", width: 100, dataIndex: 'width' },
],
defaults: {
sortable: false,
@ -1157,7 +1157,7 @@ function setStatus2D( a, status, masksE = 0, masks = 0 ){
masks_exist[a] = 0;
};
var stat = Ext.getCmp('status_'+a );
if( stat != undefined ) stat.update('<div class="status_2d_div" id="OFFLINE">Connection is Unavailable</div>');
if( stat != undefined ) stat.update('<div class="status_2d_div" id="OFFLINE"><?=$Labels->GetLabel('_DB_STAT_CON_UNA_');?></div>');
break;
};
case 1:{
@ -1185,7 +1185,7 @@ function setStatus2D( a, status, masksE = 0, masks = 0 ){
masks_exist[a] = 0;
};
var stat = Ext.getCmp('status_'+a );
if( stat != undefined ) stat.update('<div class="status_2d_div" id="NOCONECT">Disconnected</div>');
if( stat != undefined ) stat.update('<div class="status_2d_div" id="NOCONECT"><?=$Labels->GetLabel('_DISCONNECTED_');?></div>');
break;
};
case 2:{
@ -1222,7 +1222,7 @@ function setStatus2D( a, status, masksE = 0, masks = 0 ){
masks_exist[a] = masksE;
};
var stat = Ext.getCmp('status_'+a );
if( stat != undefined ) stat.update('<div class="status_2d_div" id="CONNECT">Connected ... Geting Info</div>');
if( stat != undefined ) stat.update('<div class="status_2d_div" id="CONNECT"><?=$Labels->GetLabel('_DB_STAT_CON_0_');?></div>');
break;
};
case 3:{
@ -1259,7 +1259,7 @@ function setStatus2D( a, status, masksE = 0, masks = 0 ){
masks_exist[a] = masksE;
};
var stat = Ext.getCmp('status_'+a );
if( stat != undefined ) stat.update('<div class="status_2d_div" id="STUDY">Studing</div>');
if( stat != undefined ) stat.update('<div class="status_2d_div" id="STUDY"><?=$Labels->GetLabel('_DB_STAT_STUDY_');?></div>');
break;
};
case 4:{
@ -1296,7 +1296,7 @@ function setStatus2D( a, status, masksE = 0, masks = 0 ){
masks_exist[a] = masksE;
};
var stat = Ext.getCmp('status_'+a );
if( stat != undefined ) stat.update('<div class="status_2d_div" id="READY">Ready</div>');
if( stat != undefined ) stat.update('<div class="status_2d_div" id="READY"><?=$Labels->GetLabel('_READY_');?></div>');
break;
};
case 5:{
@ -1333,7 +1333,7 @@ function setStatus2D( a, status, masksE = 0, masks = 0 ){
masks_exist[a] = masksE;
};
var stat = Ext.getCmp('status_'+a );
if( stat != undefined ) stat.update('<div class="status_2d_div" id="DETECTIONS">Alarmed</div>');
if( stat != undefined ) stat.update('<div class="status_2d_div" id="DETECTIONS"><?=$Labels->GetLabel('_ALARMED_');?></div>');
break;
};
case 6:{
@ -1370,7 +1370,7 @@ function setStatus2D( a, status, masksE = 0, masks = 0 ){
masks_exist[a] = masksE;
};
var stat = Ext.getCmp('status_'+a );
if( stat != undefined ) stat.update('<div class="status_2d_div" id="BUSY">Busy</div>');
if( stat != undefined ) stat.update('<div class="status_2d_div" id="BUSY"><?=$Labels->GetLabel('_BUSY_');?></div>');
break;
};
};

6
lib/javascript/jsapi_dynamic/mojo_logs.js

@ -97,9 +97,9 @@ var um_access_log_store = new Ext.data.JsonStore({
function um_action_renderer( val ){
switch( val ){
case 1: return 'login';
case 13: return 'Access Denied';
case 145: return 'resize screen';
case 1: return '<?=$Labels->GetLabel("_LOGIN_");?>';
case 13: return '<?=$Labels->GetLabel("_ACCESS_DENIED_");?>';
case 145: return '<?=$Labels->GetLabel("_SCREEN_RESIZE_");?>';
};
return 'unknown action';
};

4
lib/javascript/jsapi_dynamic/mojo_main.js

@ -430,7 +430,7 @@ Ext.onReady(function(){
?>{
xtype: 'button',
id: 'snd_mode_btn',
text: 'Sound',
text: '<?=$Labels->GetLabel('_SOUND_');?>',
iconCls: 'snd'+SoundMode,
scale: 'large',
style:'text-align: right;',
@ -449,7 +449,7 @@ Ext.onReady(function(){
},{
xtype: 'button',
id: 'logout_btn',
text: 'Logout',
text: '<?=$Labels->GetLabel('_LOGOUT_');?>',
iconCls: 'lout',
scale: 'large',
style:'text-align: right;',

18
lib/javascript/jsapi_dynamic/mojo_map.js

@ -759,7 +759,7 @@ function orientationEditor(){
if( orientationEditorWindow == null ){
orientationEditorWindow = new Ext.Window({
modal: true,
title: 'Orientation',
title: '<?=$Labels->GetLabel('_ORIENTATION_');?>',
closeAction: 'hide',
width: 640,
height: 500,
@ -1312,14 +1312,14 @@ function createNewMap(){
activeTab: 0,
items:[{
xtype: 'form',
title: 'Internet Map',
title: '<?=$Labels->GetLabel('_INTER_MAP_');?>',
id: 'map_map_frm',
labelWidth: 250,
labelAlign: 'right',
height: 350,
items:[{
xtype: 'textfield',
fieldLabel: 'Map Name',
fieldLabel: '<?=$Labels->GetLabel('_NAME_MAP_');?>',
name: 'map_name',
width: 540,
},{
@ -1328,22 +1328,22 @@ function createNewMap(){
value: 1
},{
xtype: 'textfield',
fieldLabel: 'Tiles URL Pattern',
fieldLabel: '<?=$Labels->GetLabel('_TILE_URL_MAP_');?>',
name: 'map_url',
width: 540,
},{
xtype: 'textfield',
fieldLabel: 'Layer Attribution',
fieldLabel: '<?=$Labels->GetLabel('_LAYER_ATTRIB_');?>',
name: 'map_attr',
width: 540,
},{
xtype: 'textarea',
fieldLabel: 'Description',
fieldLabel: '<?=$Labels->GetLabel('_DESCRIPTION_');?>',
name: 'map_desc',
width: 540,
},{
xtype: 'combo',
fieldLabel: 'Max Zoom',
fieldLabel: '<?=$Labels->GetLabel('_MAX_ZOOM_');?>',
name: 'map_maxz',
editable: false,
typeAhead: true,
@ -1360,7 +1360,7 @@ function createNewMap(){
displayField: 'zoom_l'
},{
xtype: 'combo',
fieldLabel: 'Max Native Zoom',
fieldLabel: '<?=$Labels->GetLabel('_MAX_NATURAL_ZOOM_');?>',
name: 'map_maxnz',
editable: false,
typeAhead: true,
@ -1378,7 +1378,7 @@ function createNewMap(){
}]
},{
xtype: 'form',
title: 'Local Picture Map',
title: '<?=$Labels->GetLabel('_LOCAL_PIC_MAP_');?>',
id: 'map_pic_frm',
fileUpload: true,
height: 350,

271
lib/javascript/jsapi_dynamic/mojo_settings.js

@ -48,9 +48,9 @@ function progressRenderer( value, meta, record ){
var fileUploadsColModel_ops = {
columns: [
{header: "ID", width: 50, align: 'center', css: 'vertical-align: middle;', dataIndex: 'id' },
{header: "File Name", width: 280, fixed: false, align: 'left', css: 'vertical-align: middle;', dataIndex: 'file_name' },
{header: "Size", width: 80, align: 'left', css: 'vertical-align: middle;', dataIndex: 'size' },
{header: "Progress", width: 150, renderer: progressRenderer, dataIndex: 'progress' },
{header: "<?=$Labels->GetLabel('_FILE_NAME_');?>", width: 280, fixed: false, align: 'left', css: 'vertical-align: middle;', dataIndex: 'file_name' },
{header: "<?=$Labels->GetLabel('_SIZE_');?>", width: 80, align: 'left', css: 'vertical-align: middle;', dataIndex: 'size' },
{header: "<?=$Labels->GetLabel('_PROGRESS_');?>", width: 150, renderer: progressRenderer, dataIndex: 'progress' },
{header: " ", width: 50, dataIndex: 'status3' }
],
defaults: {
@ -62,12 +62,12 @@ var fileUploadsColModel_ops = {
};
function onModuleFileRenderer( value, meta, record ){
if( value == 0 ){
rv = '<img title="Ready to Upload" alt="Ready to Upload" src="/style/assets/bul_green.png">';
rv = '<img title="<?=$Labels->GetLabel('_READY_TO_UPLO_');?>" alt="<?=$Labels->GetLabel('_READY_TO_UPLO_');?>" src="/style/assets/bul_green.png">';
} else {
if( value < 101 ){
rv = '<img title="Uploading" alt="Uploading" src="/style/assets/bul_gray.png">';
rv = '<img title="<?=$Labels->GetLabel('_UPLO_IN_PROGRESS_');?>" alt="<?=$Labels->GetLabel('_UPLO_IN_PROGRESS_');?>" src="/style/assets/bul_gray.png">';
} else {
rv = '<img title="Already Uploaded" alt="Already Uploaded" src="/style/assets/bul_blue.png">';
rv = '<img title="<?=$Labels->GetLabel('_UPLO_DONE_');?>" alt="<?=$Labels->GetLabel('_UPLO_DONE_');?>" src="/style/assets/bul_blue.png">';
};
};
return rv;
@ -75,11 +75,11 @@ function onModuleFileRenderer( value, meta, record ){
var fileModuleColModel_ops = {
columns: [
{header: "ID", width: 50, align: 'center', css: 'vertical-align: middle;', dataIndex: 'id' },
{header: "File Name", width: 60, fixed: false, align: 'left', css: 'vertical-align: middle;', dataIndex: 'file_name' },
{header: "Size", width: 80, renderer: plupload.formatSize, align: 'left', css: 'vertical-align: middle;', dataIndex: 'size' },
{header: "Time", width: 150, align: 'left', css: 'vertical-align: middle;', dataIndex: 'ts' },
{header: "Status", width: 50, renderer: onModuleFileRenderer, dataIndex: 'status' },
{header: "Memo", dataIndex: 'memo' }
{header: "<?=$Labels->GetLabel('_FILE_NAME_');?>", width: 60, fixed: false, align: 'left', css: 'vertical-align: middle;', dataIndex: 'file_name' },
{header: "<?=$Labels->GetLabel('_SIZE_');?>", width: 80, renderer: plupload.formatSize, align: 'left', css: 'vertical-align: middle;', dataIndex: 'size' },
{header: "<?=$Labels->GetLabel('_TIME_');?>", width: 150, align: 'left', css: 'vertical-align: middle;', dataIndex: 'ts' },
{header: "<?=$Labels->GetLabel('_STATUS_');?>", width: 50, renderer: onModuleFileRenderer, dataIndex: 'status' },
{header: "<?=$Labels->GetLabel('_MEMO_');?>", dataIndex: 'memo' }
],
defaults: {
sortable: false,
@ -91,6 +91,78 @@ var fileModuleColModel_ops = {
var fileUploadsSelModel_ops = {
singleSelect: true
};
var targetWidthTable_store = new Ext.data.ArrayStore({
autoDestroy: false,
storeId: 'width_table_store',
idIndex: 0,
fields: [
{name: 'id', type: 'int' },
{name: 'file_name', type: 'string'},
{name: 'size', type: 'int'},
{name: 'status', type: 'int'},
{name: 'ts', type: 'string' },
{name: 'memo', type: 'string' }
]
});
var targetWidthTableColModel_ops = {
columns: [
{header: "<?=$Labels->GetLabel('_WIDTH_CORRECT_');?>", width: 250, align: 'left', css: 'vertical-align: middle;', dataIndex: 'width' },
{header: "<?=$Labels->GetLabel('_RANGE_');?>", width: 150, align: 'center', css: 'vertical-align: middle;', dataIndex: 'range' },
],
defaults: {
sortable: false,
fixed: true,
menuDisabled: true
}
};
var widthTableAddDialog = null;
function addWidthTableRecord( sensid ){
if( widthTableAddDialog == null ){
widthTableAddDialog = new Ext.Window({
title: '<?=$Labels->GetLabel('_ADD_NEW_WTR_');?>',
modal: true,
layout: 'form',
labelWidth: 150,
labelAlign: 'right',
items:[{
xtype: 'numberfield',
id: 'wt_ad_range_val',
fieldLabel: '<?=$Labels->GetLabel('_RANGE_');?> (%)',
value: '100'
},{
xtype: 'numberfield',
id: 'wt_ad_width_val',
fieldLabel: '<?=$Labels->GetLabel('_WIDTH_');?> (%)',
value: '100'
},{
xtype: 'button',
width: '100%',
text: '<?=$Labels->GetLabel('_ADD_');?>',
handler: function(){
var tRange = Ext.getCmp('wt_ad_range_val').getValue();
var tWidth = Ext.getCmp('wt_ad_width_val').getValue();
Ext.Ajax.request({
url: '/lib/controller/getDeviceWidthTable.php',
params: {
UID: <?=$UserID;?>,
SID: '<?=$Session;?>',
DID: sensid,
NWR: tRange,
NWW: tWidth
},
success: function( response, opts ){
var data = Ext.decode( response.responseText );
targetWidthTable_store.removeAll();
targetWidthTable_store.loadData( data.table );
},
failure: failureAJAXFunction
});
}
}]
});
};
widthTableAddDialog.show();
};
function loadModuleFiles( sensorID ){
Ext.Ajax.request({
url: '/lib/controller/getDeviceFiles.php',
@ -234,7 +306,7 @@ var addNPNWindow = null;
function addNewPhoneNumber(){
if( addNPNWindow == null ){
addNPNWindow = new Ext.Window({
title: 'Add New Phone Number',
title: '<?=$Labels->GetLabel('_ADD_NEW_PHN_');?>',
modal: true,
closeAction: 'hide',
resizable: false,
@ -246,13 +318,13 @@ function addNewPhoneNumber(){
labelAlign: 'right',
items: [{
xtype: 'textfield',
fieldLabel: 'Name/Label',
fieldLabel: '<?=$Labels->GetLabel('_NAME_LABEL_');?>',
id: 'ph_name',
width: 220,
value: ''
},{
xtype: 'textfield',
fieldLabel: 'Phone Number',
fieldLabel: '<?=$Labels->GetLabel('_PHONE_NUMBER_');?>',
id: 'ph_number',
width: 220,
validator: function( a ){
@ -262,19 +334,19 @@ function addNewPhoneNumber(){
},{
xtype: 'radio',
id: 'r_ph_call',
fieldLabel: 'Call Only',
fieldLabel: '<?=$Labels->GetLabel('_CALL_ONLY_');?>',
name: 'ph_cam',
checked: true,
value: '1'
},{
xtype: 'radio',
id: 'r_ph_msg',
fieldLabel: 'SMS Only',
fieldLabel: '<?=$Labels->GetLabel('_SMS_ONLY_');?>',
name: 'ph_cam',
value: '0'
},{
xtype: 'textarea',
fieldLabel: 'Custom Message',
fieldLabel: '<?=$Labels->GetLabel('_CUSTOM_MSG_');?>',
width: 220,
height: 130,
id: 'cus_sms',
@ -303,7 +375,7 @@ function addNewPhoneNumber(){
if( data.success ){
} else {
Ext.Msg.show({
title:'Error',
title:'<?=$Labels->GetLabel('_ERROR_');?>',
msg: data.msg,
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.ERROR//,
@ -1038,10 +1110,10 @@ function addSensor(){
store: new Ext.data.ArrayStore({
fields: ['mode','mode_txt'],
data: [
[1,'ALS Sensor'],
[2,'LFS Sensor'],
[3,'PLS 200 Sensor'],
[4,'PLS 360 Sensor']
[1,'ALS <?=$Labels->GetLabel('_SENSOR_');?>'],
[2,'LFS <?=$Labels->GetLabel('_SENSOR_');?>'],
[3,'PLS 200 <?=$Labels->GetLabel('_SENSOR_');?>'],
[4,'PLS 360 <?=$Labels->GetLabel('_SENSOR_');?>']
]
}),
valueField: 'mode',
@ -1067,14 +1139,14 @@ function addSensor(){
store: new Ext.data.ArrayStore({
fields: ['range','range_txt'],
data: [
[15,'15 Meters'],
[35,'35 Meters'],
[65,'65 Meters'],
[75,'75 Meters'],
[150,'150 Meters'],
[200,'200 Meters'],
[300,'300 Meters'],
[350,'350 Meters']
[15,'15 <?=$Labels->GetLabel('_METERS_RANGE_');?>'],
[35,'35 <?=$Labels->GetLabel('_METERS_RANGE_');?>'],
[65,'65 <?=$Labels->GetLabel('_METERS_RANGE_');?>'],
[75,'75 <?=$Labels->GetLabel('_METERS_RANGE_');?>'],
[150,'150 <?=$Labels->GetLabel('_METERS_RANGE_');?>'],
[200,'200 <?=$Labels->GetLabel('_METERS_RANGE_');?>'],
[300,'300 <?=$Labels->GetLabel('_METERS_RANGE_');?>'],
[350,'350 <?=$Labels->GetLabel('_METERS_RANGE_');?>']
]
}),
valueField: 'range',
@ -1188,18 +1260,18 @@ function addDetectedIPCam(){
},{
xtype: 'textfield',
id: 'ncam_ip',
fieldLabel: 'Camera IP Address',
fieldLabel: '<?=$Labels->GetLabel('_CAM_IP_ADDRESS_');?>',
value: ''
},{
xtype: 'textfield',
id: 'ncam_user',
fieldLabel: 'Access Login',
fieldLabel: '<?=$Labels->GetLabel('_ACCESS_LOGIN_');?>',
value: ''
},{
xtype: 'textfield',
id: 'ncam_pwd',
inputType: 'password',
fieldLabel: 'Access Password',
fieldLabel: '<?=$Labels->GetLabel('_ACCESS_PASSWORD_');?>',
value: ''
},{
xtype: 'combo',
@ -1346,7 +1418,7 @@ tPanel.add({
items: [{
xtype: 'panel',
id: 'gi_tab',
title: 'General Info',
title: '<?=$Labels->GetLabel( '_GENERAL_NFO_' );?>',
layout: 'hbox',
items:[{
xtype: 'panel',
@ -1523,7 +1595,7 @@ tPanel.add({
}]
},{
xtype: 'panel',
title: 'Resources',
title: '<?=$Labels->GetLabel( '_RESOURCES_' );?>',
id: 'res_tab',
layout: 'hbox',
items:[{
@ -1551,7 +1623,7 @@ tPanel.add({
}]
},{
xtype: 'panel',
title: 'Modules',
title: '<?=$Labels->GetLabel( '_SERVER_MODULES_' );?>',
id: 'mod_tab',
layout: 'hbox',
items:[{
@ -1561,11 +1633,11 @@ tPanel.add({
height: PanelH-15,
autoScroll: 'auto',
tbar:[{
text: 'Add Module',
text: '<?=$Labels->GetLabel( '_ADD_MODULE_' );?>',
handler: function(){
var addModuleWindow = new Ext.Window({
id: 'huha_boa',
title: 'Add Server Module',
title: '<?=$Labels->GetLabel( '_AS_MODULE_' );?>',
modal: true,
width: 400,
height: 300,
@ -1617,12 +1689,12 @@ tPanel.add({
}]
}],
bbar:[{
text: 'Cancel',
text: '<?=$Labels->GetLabel( '_CANCEL_' );?>',
handler: function(){
addModuleWindow.close();
}
},{
text: 'Add Module',
text: '<?=$Labels->GetLabel( '_ADD_' );?>',
handler: function(){
var mtyp = Ext.getCmp('mod_type').getValue();
Ext.Ajax.request({
@ -1672,7 +1744,7 @@ tPanel.add({
}]
},{
xtype: 'panel',
title: 'Filters',
title: '<?=$Labels->GetLabel( '_TARGET_FILTERS_' );?>',
id: 'flt_tab',
layout: 'hbox',
items:[{
@ -1682,11 +1754,11 @@ tPanel.add({
height: PanelH-15,
autoScroll: 'auto',
tbar:[{
text: 'Add Filter',
text: '<?=$Labels->GetLabel( '_ADD_FILTER_' );?>',
handler: function(){
var addFilterWindow = new Ext.Window({
id: 'fulu_boa',
title: 'Add Event Filter',
title: '<?=$Labels->GetLabel( '_ADD_EVT_FILTER_' );?>',
modal: true,
width: 400,
height: 300,
@ -1738,12 +1810,12 @@ tPanel.add({
}]
}],
bbar:[{
text: 'Cancel',
text: '<?=$Labels->GetLabel( '_CANCEL_' );?>',
handler: function(){
addFilterWindow.close();
}
},{
text: 'Add Filter',
text: '<?=$Labels->GetLabel( '_ADD_' );?>',
handler: function(){
var mtyp = Ext.getCmp('flt_type').getValue();
Ext.Ajax.request({
@ -1883,6 +1955,45 @@ function showSettingsSensors(){
loadAttachedSensors();
};
function showSettingsDetection(){
stopStatusUpdater();
content_lvl1 = 1;
content_lvl2 = 4;
var tPanel = Ext.getCmp('main_content');
tPanel.removeAll( true );
tPanel.add({
xtype: 'panel',
id: 'sen_set',
layout: 'hbox',
tbar:[{
text: '<?=$Labels->GetLabel( '_SMM_ADD_LSEN_' );?>',
handler: function(){
addSensor();
}
}],
items:[{
xtype: 'panel',
id: 'sens_container',
flex: 1,
height: PanelH-15,
autoScroll: 'auto',
items:[]
},{
xtype: 'panel',
id: 'sens_op_small',
flex: 1,
height: PanelH-15,
layout: 'fit',
items:[{
html:'<div class="setEd_infoPanel" id="NUNU"><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>'
}]
}]
});
tPanel.doLayout();
loadAttachedSensors();
};
function editSensorHW( cid ){
SelectedSensor = cid;
Ext.Ajax.request({
@ -1968,7 +2079,7 @@ function showSettingsVideo(){
activeTab: content_lvl3,
items: [{
xtype: 'panel',
title: 'Detected Cameras',
title: '<?=$Labels->GetLabel('_CAM_DET_LIST_');?>',
id: 'cam_det_tab',
layout: 'hbox',
items:[{
@ -1997,7 +2108,7 @@ function showSettingsVideo(){
},{
xtype: 'panel',
id: 'cam_ass_tab',
title: 'Assigned Cameras',
title: '<?=$Labels->GetLabel('_CAM_ASS_LIST_');?>',
layout: 'hbox',
items:[{
xtype: 'panel',
@ -2094,7 +2205,7 @@ function showSettingsApplication(){
height: 10
},{
xtype: 'textfield',
fieldLabel: 'Instance Identity',
fieldLabel: '<?=$Labels->GetLabel( '_INSTANCE_ID_' );?>',
width: 300,
value: '<?php
$QS = "SELECT `identity` FROM `servers` LIMIT 1";
@ -2110,7 +2221,7 @@ function showSettingsApplication(){
height: 10
},{
xtype: 'button',
text: 'Generate New Identity',
text: '<?=$Labels->GetLabel( '_GEN_INSTANCE_ID_' );?>',
width: 500,
handler: function(){
doApplicationOperation( 3, 0 );
@ -2263,7 +2374,7 @@ function showSettingsApplication(){
html: '<img width="43px" src="/style/assets/ed-5.png" />'
}]
},{
title: 'Geo Locations',
title: '<?=$Labels->GetLabel('_GEO_LOCATION_');?>',
layout: 'column',
items:[{
columnWidth: 0.83,
@ -2689,6 +2800,38 @@ function showSettingsUpgrade(){
tlInterval = window.setInterval( updateTaskStatus, 333 );
};
function loadSensorDetectionSettings( sensid ){
Ext.Ajax.request({
url: '/lib/controller/getSensorDetectionEditor.php',
params: {
UID: <?=$UserID;?>,
SID: '<?=$Session;?>',
SEN: sensid
},
success: function( response, opts ){
var data = Ext.decode( response.responseText );
var tComp = Ext.getCmp('main_content');
if( data.status == 'ok' ){
if( tComp!= null ){
var content = Ext.decode( data.content );
tComp.removeAll( true );
tComp.add( content );
tComp.doLayout();
};
} else {
if( tComp!= null ){
tComp.removeAll( true );
tComp.add( data );
tComp.doLayout();
};
};
},
failure: function(){
}
});
};
function initSettingsView(){
if( tlInterval!= null ){
window.clearInterval( tlInterval );
@ -2806,28 +2949,38 @@ function initSettingsView(){
}<?php
} else {
if( 0 && intval( $CUser->Data['sipi_enable'] ) ){
$QS = "SELECT `name`, `aux_id` FROM `nodes` WHERE `type`>0 AND `type`<5";
$RR = $DATABASE->Query( $QS );
if( count( $RR ) ){
foreach( $RR as $CR ){
?>
{
xtype: 'button',
width: '100%',
id:'go_singleIpi',
text: '<?=$Labels->GetLabel('_EVT_MONITOR_IPI_');?>',
text: '<?=$CR['name'];?>',//'<?=$Labels->GetLabel('_EVT_MONITOR_IPI_');?>',
enableToggle: true,
pressed: ( content_lvl2 == 0 && content_lvl1 == 1 ),
allowDepress: false,
toggleGroup: 'det_settings',
handler: loadSingleIPI
handler: function(){
loadSensorDetectionSettings( <?=$CR['aux_id'];?> );
}
},
<?php
};
} else {
?>
{
xtype: 'spacer',
html: '<?=$Labels->GetLabel('_NO_SENSORS_DEF_');?>',
height: 32
},
<?php
};
?>
{
xtype: 'button',
width: '100%',
id:'go_out',
text: '<?=$Labels->GetLabel('_LOGOUT_');?>',
handler: doLogout
xtype: 'spacer',
height: 10
}<?php
};
?>]

20
lib/javascript/jsapi_dynamic/mojo_users.js

@ -147,14 +147,14 @@ function addNewUser(){
},
items: [{
border: false,
html: 'User Login:'
html: '<?=$Labels->GetLabel("_USER_LOGIN_");?>:'
},{
xtype: 'textfield',
id: 'um_ua_login',
width: 200
},{
border: false,
html: 'New Password:'
html: '<?=$Labels->GetLabel("_NEW_PASSWORD_");?>:'
},{
xtype: 'textfield',
id: 'um_ua_pwd1',
@ -162,7 +162,7 @@ function addNewUser(){
width: 200
},{
border: false,
html: 'Repeate Password:'
html: '<?=$Labels->GetLabel("_REP_PASSWORD_");?>:'
},{
xtype: 'textfield',
id: 'um_ua_pwd2',
@ -170,7 +170,7 @@ function addNewUser(){
width: 200
},{
border: false,
html: 'Access Level:'
html: '<?=$Labels->GetLabel("_ACCESS_LEVEL_");?>:'
},{
xtype: 'combo',
id: 'um_ua_access',
@ -184,7 +184,7 @@ function addNewUser(){
store: new Ext.data.ArrayStore({
id: 0,
fields: ['acc_lvl', 'displayText' ],
data: [[2,'Minimal Access'],[4,'Operator'],[6,'Admin']]
data: [[2,'<?=$Labels->GetLabel("_ACCESS_MINIMAL_");?>'],[4,'<?=$Labels->GetLabel("_ACCESS_OPERATOR_");?>'],[6,'<?=$Labels->GetLabel("_ACCESS_ADMIN_");?>']]
}),
valueField: 'acc_lvl',
displayField: 'displayText'
@ -359,14 +359,14 @@ function editSelectedUser(){
},
items: [{
border: false,
html: 'User Login:'
html: '<?=$Labels->GetLabel("_USER_LOGIN_");?>:'
},{
xtype: 'textfield',
id: 'um_ue_login',
width: 200
},{
border: false,
html: 'New Password:'
html: '<?=$Labels->GetLabel("_NEW_PASSWORD_");?>:'
},{
xtype: 'textfield',
id: 'um_ue_pwd1',
@ -374,7 +374,7 @@ function editSelectedUser(){
width: 200
},{
border: false,
html: 'Repeate Password:'
html: '<?=$Labels->GetLabel("_REP_PASSWORD_");?>:'
},{
xtype: 'textfield',
id: 'um_ue_pwd2',
@ -382,7 +382,7 @@ function editSelectedUser(){
width: 200
},{
border: false,
html: 'Access Level:'
html: '<?=$Labels->GetLabel("_ACCESS_LEVEL_");?>:'
},{
xtype: 'combo',
id: 'um_ue_access',
@ -396,7 +396,7 @@ function editSelectedUser(){
store: new Ext.data.ArrayStore({
id: 0,
fields: ['acc_lvl', 'displayText' ],
data: [[2,'Minimal Access'],[4,'Operator'],[6,'Admin'],[10,'Factory Defined']]
data: [[2,'<?=$Labels->GetLabel("_ACCESS_MINIMAL_");?>'],[4,'<?=$Labels->GetLabel("_ACCESS_OPERATOR_");?>'],[6,'<?=$Labels->GetLabel("_ACCESS_ADMIN_");?>'],[10,'<?=$Labels->GetLabel("_ACCESS_FACTORY_");?>']]
}),
valueField: 'acc_lvl',
displayField: 'displayText'

11
lib/js_asm.php

@ -50,7 +50,8 @@ require_once('php/db/logio_class.php');
$LOG = new Logio( LOG_LVL_ALL );
require_once('php/db/user_class.php');
require_once('php/auth/web.php');
require_once('php/db/language_class.php');
//require_once('php/db/language_class.php');
require_once('php/db/language_json_class.php');
//require_once('php/sys/SYSTEM_functions.php');
require_once('php/ui/UI_functions.php');
//require_once('php/web/WEB_functions.php');
@ -62,11 +63,13 @@ if( isset($_GET['Lang'])){
if ($UCL) $_SESSION['userlang']=$UCL; else $_SESSION['userlang']=$UserLang;
}
$LDB = new SQLite_DB( '/srv/www/web/lib/controller/data/lang_en_US.db');
//$LDB = new SQLite_DB( '/srv/www/web/lib/controller/data/lang_en_US.db');
if( isset($_SESSION['userlang']) ){
$Labels=new Language( $_SESSION['userlang'],'', $LDB );
//$Labels=new Language( $_SESSION['userlang'],'', $LDB );
$Labels=new Language_json( '/srv/www/web/lib/'.$_SESSION['userlang'].'.json');
} else {
$Labels=new Language( $UserLang ,'', $LDB );
//$Labels=new Language( $UserLang ,'', $LDB );
$Labels=new Language_json( '/srv/www/web/lib/'.$UserLang.'.json');
};
if( $UserLang == 3 || $UserLang == 255 ){

24
lib/php/db/language_json_class.php

@ -0,0 +1,24 @@
<?php
class Language_json{
var $Labels;
var $FileName;
function Language_json( $FN ){
$this->FileName = $FN;
$DOP = file_get_contents( $FN );
$this->Labels = json_decode( $DOP, true );
}
function GetLabel($LabelKey){
if (isset($this->Labels[$LabelKey])){
return $this->Labels[$LabelKey];
} else return $LabelKey;
}
function AddLabel($LabelKey, $LabelText ){
$this->Labels[$LabelKey] = $LabelText;
$FD = fopen( $this->FileName, "w+" );
fprintf( $FD, json_encode( $this->Labels ) );
fclose( $FD );
}
};
?>

BIN
style/assets/20f21b4f01f1b7587f728b05dfc9f4aa.png

Binary file not shown.

Before

Width: 1843  |  Height: 781  |  Size: 75 KiB

After

Width: 3300  |  Height: 895  |  Size: 84 KiB

Loading…
Cancel
Save