Web Interface For Lite Argus Control modules
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

762 lines
32 KiB

​
​
​
​
​
​
​
​
​
10 months ago
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
3 years ago
​
​
​
4 years ago
​
​
​
​
4 years ago
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
3 years ago
​
​
​
4 years ago
​
​
​
​
4 years ago
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
4 years ago
​
3 years ago
2 years ago
​
​
2 years ago
​
​
​
​
​
2 years ago
2 years ago
​
​
​
​
4 years ago
​
​
3 years ago
​
​
​
4 years ago
​
​
​
​
4 years ago
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
2 years ago
​
​
​
2 years ago
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
3 years ago
​
​
​
4 years ago
​
​
​
​
4 years ago
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
3 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
5 months ago
​
5 months ago
​
​
​
​
​
​
​
​
​
  1. <?php
  2. require_once('../ajax_asm.php');
  3. function inject_labels( $TPL ){
  4. global $Labels;
  5. $TPL = str_replace('%%%LABEL%%%TOOLBOX%%%', $Labels->GetLabel('_TOOLBOX_') , $TPL );
  6. $TPL = str_replace('%%%LABEL%%%CLEALARM%%%', $Labels->GetLabel('_CLEAR_ALARM_') , $TPL );
  7. $TPL = str_replace('%%%LABEL%%%DRABACKGROUND%%%', $Labels->GetLabel('_DRAW_BACKGROUND_') , $TPL );
  8. $TPL = str_replace('%%%LABEL%%%STUBACKGROUND%%%', $Labels->GetLabel('_STUDY_BACKGROUND_') , $TPL );
  9. $TPL = str_replace('%%%LABEL%%%MASKEDITOR%%%', $Labels->GetLabel('_MASK_EDITOR_') , $TPL );
  10. $TPL = str_replace('%%%LABEL%%%MASKMNGR%%%', $Labels->GetLabel('_MASK_MANAGER_') , $TPL );
  11. $TPL = str_replace('%%%LABEL%%%ACKNOLAGE%%%', $Labels->GetLabel('_DEV_ACK_BTN_') , $TPL );
  12. $TPL = str_replace('%%%LABEL%%%FREZBUBLE%%%', $Labels->GetLabel('_DEV_FRZ_BBL_BTN_') , $TPL );
  13. $TPL = str_replace('%%%LABEL%%%DELBUBLE%%%', $Labels->GetLabel('_DEV_DEL_BBL_BTN_') , $TPL );
  14. return $TPL;
  15. };
  16. $UID = intval( $CUser->Data['id'] );
  17. $Data = '';
  18. if( $UID > 1 ){
  19. $QS = "SELECT * FROM `system_props` LIMIT 1";
  20. $SPD = $DATABASE->Query( $QS );
  21. if( count( $SPD ) ){
  22. $SP = $SPD[0];
  23. $DUMMY = array();
  24. if( $CUser->Data['access'] > 5 ){
  25. //$CUser->Data['width']
  26. //$CUser->Data['height']
  27. $TABA =<<<_DATA_BOUNDARY
  28. {
  29. xtype: 'panel',
  30. html: '<table id="tbl_ph_ccc_%%ID%%" style="color: black; background-image: url(\'/style/assets/16-9-nocam.png\');" width="100%" border=0><tr><td colspan=3>&nbsp;</td></tr><tr><td>&nbsp;</td><td align="center"><div id="btn_ph_ccc_%%ID%%"></div></td><td>&nbsp;</td></tr><tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr></table>',
  31. listeners:{
  32. afterrender : function( ){
  33. var tb = document.getElementById('tbl_ph_ccc_%%ID%%');
  34. var W = tb.offsetWidth;
  35. var H = (W/16)*9;
  36. tb.setAttribute("height", H );
  37. tb.style.backgroundSize=W+"px "+H+"px";
  38. var p = Ext.getCmp('pan_ph_ccc_%%ID%%');
  39. p.setHeight( H+40 );
  40. var jaja = Ext.create({
  41. xtype: 'panel',
  42. title: '{$Labels->GetLabel('_MSG_CAM_NOT_ASS_')}',
  43. frame: true,
  44. renderTo: 'btn_ph_ccc_%%ID%%',
  45. layout: 'vbox',
  46. width: 500,
  47. height: 120,
  48. items:[{
  49. xtype: 'spacer',
  50. height: 10
  51. },{
  52. width: '100%',
  53. html: '<center>{$Labels->GetLabel('_MSG_CAM_PROC_NOT_ASS_')}</center>'
  54. },{
  55. xtype: 'spacer',
  56. height: 20
  57. },{
  58. xtype: 'button',
  59. width: '100%',
  60. text: 'Open Camera Settings',
  61. handler: function(){
  62. showContent( 2020 );
  63. }
  64. }]
  65. });
  66. jaja.doLayout();
  67. }
  68. }
  69. }
  70. _DATA_BOUNDARY;
  71. $DUMMY['camera']="{xtype:'panel', id:'pan_ph_ccc_%%ID%%', title: 'Camera Placeholder', frame: true, border: true, draggable: false, layouit: 'fit', items:{$TABA}}";
  72. $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);}}}";
  73. } else {
  74. $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);}}}";
  75. $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);}}}";
  76. };
  77. $LOGIO=<<<_DATA_BOUNDARY
  78. {
  79. xtype: 'grid',
  80. id: 'log_grid',
  81. border: false,
  82. frame: false,
  83. autoScroll: true,
  84. //width: '100%',
  85. lazyRender: true,
  86. height: 210,
  87. ds: log_store,
  88. cm: new Ext.grid.ColumnModel( log_ColModel_ops ),
  89. sm: new Ext.grid.RowSelectionModel( log_SelModel_ops ),
  90. viewConfig: {
  91. forceFit: true,
  92. getRowClass: function( record, rowIndex, rowParams, store){
  93. switch( record.get('node_id')%5 ){
  94. case 0: return 'row-level01';
  95. case 1: return 'row-level02';
  96. case 2: return 'row-level03';
  97. case 3: return 'row-level04';
  98. case 4: return 'row-level05';
  99. };
  100. return '';
  101. }
  102. },
  103. listeners:{
  104. afterrender : function( t ){
  105. var papa = Ext.getCmp('main_portal');
  106. var jj = papa.getComponent( 0 ).getHeight();
  107. var zz = t.ownerCt.ownerCt.getHeight();
  108. //alert( PanelW );
  109. //alert( PanelH - zz );
  110. //t.setHeight( PanelH - jj - 20 );
  111. t.setHeight( PanelH - zz - 42 );
  112. }
  113. }
  114. }
  115. _DATA_BOUNDARY;
  116. $MAPIO=<<<_DATA_BOUNDARY
  117. {
  118. id: 'event_map',
  119. height: 200,
  120. html: '&nbsp;',
  121. listeners:{
  122. afterrender : function( t ){
  123. var papa = Ext.getCmp('main_portal');
  124. var jj = papa.getComponent( 0 ).getHeight();
  125. t.setHeight( jj - 40 );
  126. geoMapIsPresent = true;
  127. }
  128. }
  129. }
  130. _DATA_BOUNDARY;
  131. $MH = 9;
  132. if( $SP['app_layout'] == 2 ) $MH = 6;
  133. $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)*{$MH}); initMapMonitoring();}} }";
  134. $DUMMY['log']="{xtype:'panel', id: 'lg_panel', title: '{$Labels->GetLabel('_EVENT_LOG_')}', frame: true, border: true, draggable: false, items:[{$LOGIO}] }";
  135. $STA = array();
  136. $END="]}";
  137. $OUT = array();
  138. switch( $SP['app_layout'] ){
  139. case 0:{
  140. $STA[0]="{ columnWidth: .25, stylse:'padding:10px 0 10px 10px', items:[";
  141. $STA[1]="{ columnWidth: .25, stylse:'padding:10px 0 10px 10px', items:[";
  142. $STA[2]="{ columnWidth: .25, stylse:'padding:10px 0 10px 10px', items:[";
  143. $STA[3]="{ columnWidth: .25, stylse:'padding:10px 0 10px 10px', items:[";
  144. $STA[4]="{ columnWidth: .5, stylde:'padding:10px 0 10px 10px', items:[";
  145. $STA[5]="{ columnWidth: .5, stylde:'padding:10px 0 10px 10px', items:[";
  146. $STA[6]="{ columnWidth: 1.0, stydle:'padding:10px 0 10px 10px', items:[";
  147. $QS = "SELECT * FROM `nodes` WHERE `type`>0 AND `type`< 10 AND `enable`=1";
  148. $R = $DATABASE->Query( $QS );
  149. $idx = 0;
  150. if( count( $R ) ){
  151. foreach( $R as $DD ){
  152. if( $idx < 4 ){
  153. $TFN = 'dash/node_' . $DD['type'] . '.js';
  154. if(!file_exists( $TFN )) continue;
  155. $TPL = file_get_contents( $TFN );
  156. $TPL = inject_labels( $TPL );
  157. $TPL = str_replace('%%%NODEID%%%', ''.$DD['id'] , $TPL );
  158. $TPL = str_replace('%%%NODENAME%%%', ''. urldecode( $DD['name'] ), $TPL );
  159. $TPL = str_replace('%%%USERID%%%', $UserID, $TPL );
  160. $TPL = str_replace('%%%SESSION%%%', $Session, $TPL );
  161. $TPL = str_replace('%%%APPTYPE%%%', $SP['type'], $TPL );
  162. $OUT[]= $STA[$idx] . $TPL . $END;
  163. } else break;
  164. $idx++;
  165. };
  166. if( $idx < 4 ){
  167. for( ;$idx<4;$idx++ ){
  168. $OUT[]= $STA[$idx] . $DUMMY['sensor'] . $END;
  169. };
  170. };
  171. } else {
  172. for( ;$idx<4;$idx++ ){
  173. $OUT[]= $STA[$idx] . $DUMMY['sensor'] . $END;
  174. };
  175. };
  176. $QS = "SELECT * FROM `nodes` WHERE `type`>9 AND `type`< 16 AND `enable`=1";
  177. $R = $DATABASE->Query( $QS );
  178. $idx = 0;
  179. if( count( $R ) ){
  180. foreach( $R as $DD ){
  181. if( $idx < 2 ){
  182. $TFN = 'dash/node_' . $DD['type'] . '.js';
  183. if(!file_exists( $TFN )) continue;
  184. $TPL = file_get_contents( $TFN );
  185. $TPL = inject_labels( $TPL );
  186. $TPL = str_replace('%%%NODEID%%%', ''.$DD['id'] , $TPL );
  187. $TPL = str_replace('%%%NODENAME%%%', ''.urldecode( $DD['name'] ) , $TPL );
  188. $TPL = str_replace('%%%USERID%%%', $UserID, $TPL );
  189. $TPL = str_replace('%%%SESSION%%%', $Session, $TPL );
  190. $TPL = str_replace('%%%APPTYPE%%%', $SP['type'], $TPL );
  191. $QS="SELECT * FROM `nodes` WHERE `id`={$DD['id']}";
  192. $Z=$DATABASE->Query( $QS );
  193. $QS="SELECT * FROM `module_eve` LIMIT 1";
  194. $S=$DATABASE->Query( $QS );
  195. $MODULE_DATA = $S[0];
  196. $TPL = str_replace( '%%%NODENAME%%%', urldecode( $Z[0]['name'] ) , $TPL );
  197. //$FU = 'http://' . $_SERVER['SERVER_ADDR'].':' . $MODULE_DATA['web_port'] .'/stream?id='. $Z[0]['aux_parameter'];
  198. $FU = '/video_feed/stream?id='. $Z[0]['aux_parameter'];
  199. $CS[] = '[' . $Z[0]['aux_parameter'] . ',\'[ 120x120] Video\',\''. $FU .'\']';
  200. $TPL = str_replace( '%%%URLS%%%', '[' . implode( ',', $CS ) . ']' , $TPL );
  201. $TPL = str_replace( '%%%SELID%%%', 'value: '. $Z[0]['aux_parameter'] .',', $TPL );
  202. $TPL = str_replace( '%%%SELURL%%%', $FU, $TPL );
  203. $TPL = str_replace( '%%%STREAMID%%%', $DD['aux_parameter'], $TPL );
  204. if( $DD['type'] == 15 || $DD['type'] == 14 || $DD['type'] == 13 || $DD['type'] == 11 ){
  205. $QS = "SELECT `homing_enable` FROM `cameras` WHERE `id`={$DD['aux_id']}";
  206. $JUA = $DATABASE->Query( $QS );
  207. $CAMDATA = $JUA[0];
  208. if( $CAMDATA['homing_enable'] ){
  209. if( $CUser->Data['access'] > 5 ){
  210. $TPL = str_replace( '%%%HBTN%%%', '<img id="img_btn_0ZZ_'.$DD['aux_id'].'" class="ptz_ctrl_btn" src="/style/png/building/038.png">', $TPL );
  211. $TPL = str_replace('%%%CAM_CTRL_HOME_BTN_BIND%%%', 'document.getElementById(\'img_btn_0ZZ_'.$DD['aux_id'].'\').addEventListener( \'mousedown\', makePtzHome );', $TPL );
  212. } else {
  213. $TPL = str_replace('%%%HBTN%%%', '&nbsp;', $TPL );
  214. $TPL = str_replace('%%%CAM_CTRL_HOME_BTN_BIND%%%', '', $TPL );
  215. };
  216. } else {
  217. $TPL = str_replace('%%%HBTN%%%', '&nbsp;', $TPL );
  218. $TPL = str_replace('%%%CAM_CTRL_HOME_BTN_BIND%%%', '', $TPL );
  219. };
  220. };
  221. $FK = $MODULE_DATA['height'] /$MODULE_DATA['width'];
  222. $W = 244;
  223. $H = $W * $FK;
  224. $TPL = str_replace( '%%%WIDTH%%%', $W, $TPL );
  225. $TPL = str_replace( '%%%HEIGHT%%%', $H, $TPL );
  226. $OUT[]= $STA[4+$idx] . $TPL . $END;
  227. } else break;
  228. $idx++;
  229. };
  230. if( $idx < 2 ){
  231. for( ;$idx<2;$idx++ ){
  232. $T = str_replace( '%%ID%%', 4+$idx , $DUMMY['camera'] );
  233. $OUT[]= $STA[4+$idx] . $T . $END;
  234. };
  235. };
  236. } else {
  237. for( ;$idx<2;$idx++ ){
  238. $T = str_replace( '%%ID%%', 4+$idx , $DUMMY['camera'] );
  239. $OUT[]= $STA[4+$idx] . $T . $END;
  240. };
  241. };
  242. switch( $SP['type'] ){
  243. case 1:{
  244. // LA Metro
  245. $OUT[]= $STA[6] . $DUMMY['log'] . $END;
  246. break;
  247. };
  248. case 2:{
  249. //Togo
  250. $OUT[]= $STA[6] . $DUMMY['map'] . $END;
  251. break;
  252. };
  253. }
  254. break;
  255. };
  256. case 1:{
  257. $STA[0]="{ columnWidth: .33, stylse:'padding:10px 0 10px 10px', items:[";
  258. $STA[1]="{ columnWidth: .33, stylse:'padding:10px 0 10px 10px', items:[";
  259. $STA[2]="{ columnWidth: .33, stylse:'padding:10px 0 10px 10px', items:[";
  260. $STA[3]="{ columnWidth: 1.0, stylse:'padding:10px 0 10px 10px', items:[";
  261. $QS = "SELECT * FROM `nodes` WHERE `type`>0 AND `type`< 10 AND `enable`=1";
  262. $R = $DATABASE->Query( $QS );
  263. $idx = 0;
  264. if( count( $R ) ){
  265. foreach( $R as $DD ){
  266. if( $idx < 2 ){
  267. $TFN = 'dash/node_' . $DD['type'] . '.js';
  268. if(!file_exists( $TFN )) continue;
  269. $TPL = file_get_contents( $TFN );
  270. $TPL = inject_labels( $TPL );
  271. $TPL = str_replace('%%%NODEID%%%', ''.$DD['id'] , $TPL );
  272. $TPL = str_replace('%%%NODENAME%%%', ''.html_entity_decode( $DD['name'] ) , $TPL );
  273. $TPL = str_replace('%%%USERID%%%', $UserID, $TPL );
  274. $TPL = str_replace('%%%SESSION%%%', $Session, $TPL );
  275. $TPL = str_replace('%%%APPTYPE%%%', $SP['type'], $TPL );
  276. $OUT[]= $STA[$idx] . $TPL . $END;
  277. } else break;
  278. $idx++;
  279. };
  280. if( $idx < 2 ){
  281. for( ;$idx<2;$idx++ ){
  282. $OUT[]= $STA[$idx] . $DUMMY['sensor'] . $END;
  283. };
  284. };
  285. } else {
  286. for( ;$idx<2;$idx++ ){
  287. $OUT[]= $STA[$idx] . $DUMMY['sensor'] . $END;
  288. };
  289. };
  290. $QS = "SELECT * FROM `nodes` WHERE `type`>9 AND `type`< 16 AND `enable`=1";
  291. $R = $DATABASE->Query( $QS );
  292. $idx = 0;
  293. if( count( $R ) ){
  294. foreach( $R as $DD ){
  295. if( $idx < 1 ){
  296. $TFN = 'dash/node_' . $DD['type'] . '.js';
  297. if(!file_exists( $TFN )) continue;
  298. $TPL = file_get_contents( $TFN );
  299. $TPL = inject_labels( $TPL );
  300. $TPL = str_replace('%%%NODEID%%%', ''.$DD['id'] , $TPL );
  301. $TPL = str_replace('%%%NODENAME%%%', ''.urldecode($DD['name']) , $TPL );
  302. $TPL = str_replace('%%%USERID%%%', $UserID, $TPL );
  303. $TPL = str_replace('%%%SESSION%%%', $Session, $TPL );
  304. $TPL = str_replace('%%%APPTYPE%%%', $SP['type'], $TPL );
  305. $QS="SELECT * FROM `nodes` WHERE `id`={$DD['id']}";
  306. $Z=$DATABASE->Query( $QS );
  307. $QS="SELECT * FROM `module_eve` LIMIT 1";
  308. $S=$DATABASE->Query( $QS );
  309. $MODULE_DATA = $S[0];
  310. $TPL = str_replace( '%%%NODENAME%%%', urldecode( $Z[0]['name'] ) , $TPL );
  311. //$FU = 'http://' . $_SERVER['SERVER_ADDR'].':' . $MODULE_DATA['web_port'] .'/stream?id='. $Z[0]['aux_parameter'];
  312. $FU = '/video_feed/stream?id='. $Z[0]['aux_parameter'];
  313. $CS[] = '[' . $Z[0]['aux_parameter'] . ',\'[ 120x120] Video\',\''. $FU .'\']';
  314. $TPL = str_replace( '%%%URLS%%%', '[' . implode( ',', $CS ) . ']' , $TPL );
  315. $TPL = str_replace( '%%%SELID%%%', 'value: '. $Z[0]['aux_parameter'] .',', $TPL );
  316. $TPL = str_replace( '%%%SELURL%%%', $FU, $TPL );
  317. $TPL = str_replace( '%%%STREAMID%%%', $DD['aux_parameter'], $TPL );
  318. if( $DD['type'] == 15 || $DD['type'] == 14 || $DD['type'] == 13 || $DD['type'] == 11 ){
  319. $QS = "SELECT `homing_enable` FROM `cameras` WHERE `id`={$DD['aux_id']}";
  320. $JUA = $DATABASE->Query( $QS );
  321. $CAMDATA = $JUA[0];
  322. if( $CAMDATA['homing_enable'] ){
  323. if( $CUser->Data['access'] > 5 ){
  324. $TPL = str_replace( '%%%HBTN%%%', '<img id="img_btn_0ZZ_'.$DD['aux_id'].'" class="ptz_ctrl_btn" src="/style/png/building/038.png">', $TPL );
  325. $TPL = str_replace('%%%CAM_CTRL_HOME_BTN_BIND%%%', 'document.getElementById(\'img_btn_0ZZ_'.$DD['aux_id'].'\').addEventListener( \'mousedown\', makePtzHome );', $TPL );
  326. } else {
  327. $TPL = str_replace('%%%HBTN%%%', '&nbsp;', $TPL );
  328. $TPL = str_replace('%%%CAM_CTRL_HOME_BTN_BIND%%%', '', $TPL );
  329. };
  330. } else {
  331. $TPL = str_replace('%%%HBTN%%%', '&nbsp;', $TPL );
  332. $TPL = str_replace('%%%CAM_CTRL_HOME_BTN_BIND%%%', '', $TPL );
  333. };
  334. };
  335. $FK = $MODULE_DATA['height'] /$MODULE_DATA['width'];
  336. $W = 244;
  337. $H = $W * $FK;
  338. $TPL = str_replace( '%%%WIDTH%%%', $W, $TPL );
  339. $TPL = str_replace( '%%%HEIGHT%%%', $H, $TPL );
  340. $OUT[]= $STA[2+$idx] . $TPL . $END;
  341. } else break;
  342. $idx++;
  343. };
  344. if( $idx < 1 ){
  345. for( ;$idx<1;$idx++ ){
  346. $T = str_replace( '%%ID%%', 2+$idx , $DUMMY['camera'] );
  347. $OUT[]= $STA[2+$idx] . $T . $END;
  348. };
  349. };
  350. } else {
  351. for( ;$idx<1;$idx++ ){
  352. $T = str_replace( '%%ID%%', 4+$idx , $DUMMY['camera'] );
  353. $OUT[]= $STA[2+$idx] . $T . $END;
  354. };
  355. };
  356. switch( $SP['type'] ){
  357. case 1:{
  358. // LA Metro
  359. $OUT[]= $STA[3] . $DUMMY['log'] . $END;
  360. break;
  361. };
  362. case 2:{
  363. //Togo
  364. $OUT[]= $STA[3] . $DUMMY['map'] . $END;
  365. break;
  366. };
  367. }
  368. break;
  369. };
  370. case 2:{
  371. $STA[0]="{ columnWidth: .33, stylse:'padding:10px 0 10px 10px', items:[";//Sen1
  372. $STA[1]="{ columnWidth: .33, stylse:'padding:10px 0 10px 10px', items:[";//Cam1
  373. $STA[2]="{ columnWidth: .33, stylse:'padding:10px 0 10px 10px', items:[";//Cam2
  374. $STA[3]="{ columnWidth: .33, stylse:'padding:10px 0 10px 10px', items:[";//Sen2
  375. $STA[4]="{ columnWidth: .66, stylde:'padding:10px 0 10px 10px', items:[";//Log/Map
  376. $idx = 0;
  377. $QS = "SELECT * FROM `nodes` WHERE `type`>0 AND `type`< 10 AND `enable`=1";
  378. $DEVS = $DATABASE->Query( $QS );
  379. if( count( $DEVS ) ){
  380. $WOU = array();
  381. foreach( $DEVS as $DD ){
  382. if( $idx < 2 ){
  383. $TFN = 'dash/node_' . $DD['type'] . '.js';
  384. if(!file_exists( $TFN )) continue;
  385. $TPL = file_get_contents( $TFN );
  386. $TPL = inject_labels( $TPL );
  387. $TPL = str_replace('%%%NODEID%%%', ''.$DD['id'] , $TPL );
  388. $TPL = str_replace('%%%NODENAME%%%', ''.html_entity_decode( $DD['name'] ) , $TPL );
  389. $TPL = str_replace('%%%USERID%%%', $UserID, $TPL );
  390. $TPL = str_replace('%%%SESSION%%%', $Session, $TPL );
  391. $TPL = str_replace('%%%APPTYPE%%%', $SP['type'], $TPL );
  392. $WOU[]= $TPL;
  393. } else break;
  394. $idx++;
  395. };
  396. if( $idx < 2 ) for( ;$idx<2;$idx++ ) $WOU[]= $DUMMY['sensor'];
  397. $OUT[]= $STA[0] . implode(',', $WOU ) . $END;
  398. } else {
  399. for( ;$idx<3;$idx++ ){
  400. $OUT[]= $STA[$idx] . $DUMMY['sensor'] . $END;
  401. };
  402. };
  403. $QS = "SELECT * FROM `nodes` WHERE `type`>9 AND `type`< 16 AND `enable`=1";
  404. $CAMS = $DATABASE->Query( $QS );
  405. $idx = 0;
  406. if( count( $CAMS ) ){
  407. foreach( $CAMS as $DD ){
  408. if( $idx < 2 ){
  409. $TFN = 'dash/node_' . $DD['type'] . '.js';
  410. if(!file_exists( $TFN )) continue;
  411. $TPL = file_get_contents( $TFN );
  412. $TPL = inject_labels( $TPL );
  413. $TPL = str_replace('%%%NODEID%%%', ''.$DD['id'] , $TPL );
  414. $TPL = str_replace('%%%NODENAME%%%', ''.urldecode($DD['name']) , $TPL );
  415. $TPL = str_replace('%%%USERID%%%', $UserID, $TPL );
  416. $TPL = str_replace('%%%SESSION%%%', $Session, $TPL );
  417. $TPL = str_replace('%%%APPTYPE%%%', $SP['type'], $TPL );
  418. $QS="SELECT * FROM `nodes` WHERE `id`={$DD['id']}";
  419. $Z=$DATABASE->Query( $QS );
  420. $QS="SELECT * FROM `module_eve` LIMIT 1";
  421. $S=$DATABASE->Query( $QS );
  422. $MODULE_DATA = $S[0];
  423. $TPL = str_replace( '%%%NODENAME%%%', urldecode( $Z[0]['name'] ) , $TPL );
  424. //$FU = 'http://' . $_SERVER['SERVER_ADDR'].':' . $MODULE_DATA['web_port'] .'/stream?id='. $Z[0]['aux_parameter'];
  425. $FU = '/video_feed/stream?id='. $Z[0]['aux_parameter'];
  426. $CS[] = '[' . $Z[0]['aux_parameter'] . ',\'[ 120x120] Video\',\''. $FU .'\']';
  427. $TPL = str_replace( '%%%URLS%%%', '[' . implode( ',', $CS ) . ']' , $TPL );
  428. $TPL = str_replace( '%%%SELID%%%', 'value: '. $Z[0]['aux_parameter'] .',', $TPL );
  429. $TPL = str_replace( '%%%SELURL%%%', $FU, $TPL );
  430. $TPL = str_replace( '%%%STREAMID%%%', $DD['aux_parameter'], $TPL );
  431. if( $DD['type'] == 15 || $DD['type'] == 14 || $DD['type'] == 13 || $DD['type'] == 11 ){
  432. $QS = "SELECT `homing_enable` FROM `cameras` WHERE `id`={$DD['aux_id']}";
  433. $JUA = $DATABASE->Query( $QS );
  434. $CAMDATA = $JUA[0];
  435. if( $CAMDATA['homing_enable'] ){
  436. if( $CUser->Data['access'] > 5 ){
  437. $TPL = str_replace( '%%%HBTN%%%', '<img id="img_btn_0ZZ_'.$DD['aux_id'].'" class="ptz_ctrl_btn" src="/style/png/building/038.png">', $TPL );
  438. $TPL = str_replace('%%%CAM_CTRL_HOME_BTN_BIND%%%', 'document.getElementById(\'img_btn_0ZZ_'.$DD['aux_id'].'\').addEventListener( \'mousedown\', makePtzHome );', $TPL );
  439. } else {
  440. $TPL = str_replace('%%%HBTN%%%', '&nbsp;', $TPL );
  441. $TPL = str_replace('%%%CAM_CTRL_HOME_BTN_BIND%%%', '', $TPL );
  442. };
  443. } else {
  444. $TPL = str_replace('%%%HBTN%%%', '&nbsp;', $TPL );
  445. $TPL = str_replace('%%%CAM_CTRL_HOME_BTN_BIND%%%', '', $TPL );
  446. };
  447. };
  448. $FK = $MODULE_DATA['height'] /$MODULE_DATA['width'];
  449. $W = 244;
  450. $H = $W * $FK;
  451. $TPL = str_replace( '%%%WIDTH%%%', $W, $TPL );
  452. $TPL = str_replace( '%%%HEIGHT%%%', $H, $TPL );
  453. $OUT[]= $STA[1+$idx] . $TPL . $END;
  454. } else break;
  455. $idx++;
  456. };
  457. if( $idx < 2 ){
  458. for( ;$idx<2;$idx++ ){
  459. $T = str_replace( '%%ID%%', 2+$idx , $DUMMY['camera'] );
  460. $OUT[]= $STA[1+$idx] . $T . $END;
  461. };
  462. };
  463. } else {
  464. for( ;$idx<2;$idx++ ){
  465. $T = str_replace( '%%ID%%', 4+$idx , $DUMMY['camera'] );
  466. $OUT[]= $STA[1+$idx] . $T . $END;
  467. };
  468. };
  469. $OUT[]= $STA[4] . $DUMMY['map'] .','. $DUMMY['log'] . $END;
  470. //$OUT[]= $STA[4] . . $END;
  471. break;
  472. };
  473. case 3:{
  474. $LOGIO=<<<_DATA_BOUNDARY
  475. {
  476. xtype: 'grid',
  477. id: 'log_grid',
  478. border: false,
  479. frame: false,
  480. autoScroll: true,
  481. //width: '100%',
  482. lazyRender: true,
  483. height: 210,
  484. ds: log_store,
  485. cm: new Ext.grid.ColumnModel( log_ColModel_ops ),
  486. sm: new Ext.grid.RowSelectionModel( log_SelModel_ops ),
  487. viewConfig: {
  488. forceFit: true,
  489. getRowClass: function( record, rowIndex, rowParams, store){
  490. switch( record.get('node_id')%5 ){
  491. case 0: return 'row-level01';
  492. case 1: return 'row-level02';
  493. case 2: return 'row-level03';
  494. case 3: return 'row-level04';
  495. case 4: return 'row-level05';
  496. };
  497. return '';
  498. }
  499. },
  500. listeners:{
  501. afterrender : function( t ){
  502. var papa = Ext.getCmp('main_portal');
  503. var jj = papa.getComponent( 0 ).getHeight();
  504. var zz = t.ownerCt.ownerCt.getHeight();
  505. //alert( PanelW );
  506. //alert( PanelH - zz );
  507. //t.setHeight( PanelH - jj - 20 );
  508. //t.setHeight( PanelH - zz - 42 );
  509. var mama = Ext.getCmp('lg_panel');
  510. var R = papa.getHeight() - papa.getComponent( 1 ).getHeight() - 41;
  511. mama.setHeight( R+40 );
  512. t.setHeight( R );
  513. }
  514. }
  515. }
  516. _DATA_BOUNDARY;
  517. $DUMMY['log']="{xtype:'panel', id: 'lg_panel', title: '{$Labels->GetLabel('_EVENT_LOG_')}', frame: true, border: true, draggable: false, items:[{$LOGIO}] }";
  518. $STA[0]="{ columnWidth: .5, stylse:'padding:10px 0 10px 10px', items:[";
  519. $STA[1]="{ columnWidth: .5, stylse:'padding:10px 0 10px 10px', items:[";
  520. $STA[2]="{ columnWidth: .33, stylse:'padding:10px 0 10px 10px', items:[";
  521. $STA[3]="{ columnWidth: .67, stylse:'padding:10px 0 10px 10px', items:[";
  522. $OUT[]= $STA[0] . $DUMMY['map'] . $END;
  523. $QS = "SELECT * FROM `nodes` WHERE `type`>9 AND `type`< 16 AND `enable`=1";
  524. $R = $DATABASE->Query( $QS );
  525. $idx = 0;
  526. if( count( $R ) ){
  527. foreach( $R as $DD ){
  528. if( $idx < 1 ){
  529. $TFN = 'dash/node_' . $DD['type'] . '.js';
  530. if(!file_exists( $TFN )) continue;
  531. $TPL = file_get_contents( $TFN );
  532. $TPL = inject_labels( $TPL );
  533. $TPL = str_replace('%%%NODEID%%%', ''.$DD['id'] , $TPL );
  534. $TPL = str_replace('%%%NODENAME%%%', ''.urldecode($DD['name']) , $TPL );
  535. $TPL = str_replace('%%%USERID%%%', $UserID, $TPL );
  536. $TPL = str_replace('%%%SESSION%%%', $Session, $TPL );
  537. $TPL = str_replace('%%%APPTYPE%%%', $SP['type'], $TPL );
  538. $QS="SELECT * FROM `nodes` WHERE `id`={$DD['id']}";
  539. $Z=$DATABASE->Query( $QS );
  540. $QS="SELECT * FROM `module_eve` LIMIT 1";
  541. $S=$DATABASE->Query( $QS );
  542. $MODULE_DATA = $S[0];
  543. $TPL = str_replace( '%%%NODENAME%%%', urldecode( $Z[0]['name'] ) , $TPL );
  544. //$FU = 'http://' . $_SERVER['SERVER_ADDR'].':' . $MODULE_DATA['web_port'] .'/stream?id='. $Z[0]['aux_parameter'];
  545. $FU = '/video_feed/stream?id='. $Z[0]['aux_parameter'];
  546. $CS[] = '[' . $Z[0]['aux_parameter'] . ',\'[ 120x120] Video\',\''. $FU .'\']';
  547. $TPL = str_replace( '%%%URLS%%%', '[' . implode( ',', $CS ) . ']' , $TPL );
  548. $TPL = str_replace( '%%%SELID%%%', 'value: '. $Z[0]['aux_parameter'] .',', $TPL );
  549. $TPL = str_replace( '%%%SELURL%%%', $FU, $TPL );
  550. $TPL = str_replace( '%%%STREAMID%%%', $DD['aux_parameter'], $TPL );
  551. if( $DD['type'] == 15 || $DD['type'] == 14 || $DD['type'] == 13 || $DD['type'] == 11 ){
  552. $QS = "SELECT `homing_enable` FROM `cameras` WHERE `id`={$DD['aux_id']}";
  553. $JUA = $DATABASE->Query( $QS );
  554. $CAMDATA = $JUA[0];
  555. if( $CAMDATA['homing_enable'] ){
  556. if( $CUser->Data['access'] > 5 ){
  557. $TPL = str_replace( '%%%HBTN%%%', '<img id="img_btn_0ZZ_'.$DD['aux_id'].'" class="ptz_ctrl_btn" src="/style/png/building/038.png">', $TPL );
  558. $TPL = str_replace('%%%CAM_CTRL_HOME_BTN_BIND%%%', 'document.getElementById(\'img_btn_0ZZ_'.$DD['aux_id'].'\').addEventListener( \'mousedown\', makePtzHome );', $TPL );
  559. } else {
  560. $TPL = str_replace('%%%HBTN%%%', '&nbsp;', $TPL );
  561. $TPL = str_replace('%%%CAM_CTRL_HOME_BTN_BIND%%%', '', $TPL );
  562. };
  563. } else {
  564. $TPL = str_replace('%%%HBTN%%%', '&nbsp;', $TPL );
  565. $TPL = str_replace('%%%CAM_CTRL_HOME_BTN_BIND%%%', '', $TPL );
  566. };
  567. };
  568. $FK = $MODULE_DATA['height'] /$MODULE_DATA['width'];
  569. $W = 244;
  570. $H = $W * $FK;
  571. $TPL = str_replace( '%%%WIDTH%%%', $W, $TPL );
  572. $TPL = str_replace( '%%%HEIGHT%%%', $H, $TPL );
  573. $OUT[]= $STA[1+$idx] . $TPL . $END;
  574. } else break;
  575. $idx++;
  576. };
  577. } else {
  578. for( ;$idx<1;$idx++ ){
  579. $T = str_replace( '%%ID%%', 4+$idx , $DUMMY['camera'] );
  580. $OUT[]= $STA[1+$idx] . $T . $END;
  581. };
  582. };
  583. $QS = "SELECT * FROM `nodes` WHERE `type`>0 AND `type`< 10 AND `enable`=1";
  584. $R = $DATABASE->Query( $QS );
  585. $idx = 0;
  586. if( count( $R ) ){
  587. foreach( $R as $DD ){
  588. if( $idx < 1 ){
  589. $TFN = 'dash/node_' . $DD['type'] . '.js';
  590. if(!file_exists( $TFN )) continue;
  591. $TPL = file_get_contents( $TFN );
  592. $TPL = inject_labels( $TPL );
  593. $TPL = str_replace('%%%NODEID%%%', ''.$DD['id'] , $TPL );
  594. $TPL = str_replace('%%%NODENAME%%%', ''.html_entity_decode( $DD['name'] ) , $TPL );
  595. $TPL = str_replace('%%%USERID%%%', $UserID, $TPL );
  596. $TPL = str_replace('%%%SESSION%%%', $Session, $TPL );
  597. $TPL = str_replace('%%%APPTYPE%%%', $SP['type'], $TPL );
  598. $OUT[]= $STA[2+$idx] . $TPL . $END;
  599. } else break;
  600. $idx++;
  601. };
  602. } else {
  603. for( ;$idx<1;$idx++ ){
  604. $OUT[]= $STA[2+$idx] . $DUMMY['sensor'] . $END;
  605. };
  606. };
  607. $OUT[]= $STA[3] . $DUMMY['log'] . $END;
  608. break;
  609. };
  610. case 4:{
  611. $STA[0]="{ columnWidth: .25, stylse:'padding:10px 0 10px 10px', items:[";
  612. $STA[1]="{ columnWidth: .25, stylse:'padding:10px 0 10px 10px', items:[";
  613. $STA[2]="{ columnWidth: .25, stylse:'padding:10px 0 10px 10px', items:[";
  614. $STA[3]="{ columnWidth: .25, stylse:'padding:10px 0 10px 10px', items:[";
  615. $STA[4]="{ columnWidth: 1, stylse:'padding:10px 0 10px 10px', items:[";
  616. $idx = 0;
  617. $QS = "SELECT * FROM `nodes` WHERE `type`>0 AND `type`< 10 AND `enable`=1";
  618. $R = $DATABASE->Query( $QS );
  619. if( count( $R ) ){
  620. foreach( $R as $DD ){
  621. if( $idx < 3 ){
  622. $TFN = 'dash/node_' . $DD['type'] . '.js';
  623. if(!file_exists( $TFN )) continue;
  624. $TPL = file_get_contents( $TFN );
  625. $TPL = inject_labels( $TPL );
  626. $TPL = str_replace('%%%NODEID%%%', ''.$DD['id'] , $TPL );
  627. $TPL = str_replace('%%%NODENAME%%%', ''.html_entity_decode( $DD['name'] ) , $TPL );
  628. $TPL = str_replace('%%%USERID%%%', $UserID, $TPL );
  629. $TPL = str_replace('%%%SESSION%%%', $Session, $TPL );
  630. $TPL = str_replace('%%%APPTYPE%%%', $SP['type'], $TPL );
  631. $OUT[]= $STA[$idx] . $TPL . $END;
  632. } else break;
  633. $idx++;
  634. };
  635. if( $idx < 3 ){
  636. for( ;$idx<3;$idx++ ){
  637. $OUT[]= $STA[$idx] . $DUMMY['sensor'] . $END;
  638. };
  639. };
  640. } else {
  641. for( ;$idx<3;$idx++ ){
  642. $OUT[]= $STA[$idx] . $DUMMY['sensor'] . $END;
  643. };
  644. };
  645. $QS = "SELECT * FROM `nodes` WHERE `type`>9 AND `type`< 16 AND `enable`=1";
  646. $R = $DATABASE->Query( $QS );
  647. $idx = 0;
  648. if( count( $R ) ){
  649. foreach( $R as $DD ){
  650. if( $idx < 2 ){
  651. $TFN = 'dash/node_' . $DD['type'] . '.js';
  652. if(!file_exists( $TFN )) continue;
  653. $TPL = file_get_contents( $TFN );
  654. $TPL = inject_labels( $TPL );
  655. $TPL = str_replace('%%%NODEID%%%', ''.$DD['id'] , $TPL );
  656. $TPL = str_replace('%%%NODENAME%%%', ''.urldecode($DD['name']) , $TPL );
  657. $TPL = str_replace('%%%USERID%%%', $UserID, $TPL );
  658. $TPL = str_replace('%%%SESSION%%%', $Session, $TPL );
  659. $TPL = str_replace('%%%APPTYPE%%%', $SP['type'], $TPL );
  660. $QS="SELECT * FROM `nodes` WHERE `id`={$DD['id']}";
  661. $Z=$DATABASE->Query( $QS );
  662. $QS="SELECT * FROM `module_eve` LIMIT 1";
  663. $S=$DATABASE->Query( $QS );
  664. $MODULE_DATA = $S[0];
  665. $TPL = str_replace( '%%%NODENAME%%%', urldecode( $Z[0]['name'] ) , $TPL );
  666. //$FU = 'http://' . $_SERVER['SERVER_ADDR'].':' . $MODULE_DATA['web_port'] .'/stream?id='. $Z[0]['aux_parameter'];
  667. $FU = '/video_feed/stream?id='. $Z[0]['aux_parameter'];
  668. $CS[] = '[' . $Z[0]['aux_parameter'] . ',\'[ 120x120] Video\',\''. $FU .'\']';
  669. $TPL = str_replace( '%%%URLS%%%', '[' . implode( ',', $CS ) . ']' , $TPL );
  670. $TPL = str_replace( '%%%SELID%%%', 'value: '. $Z[0]['aux_parameter'] .',', $TPL );
  671. $TPL = str_replace( '%%%SELURL%%%', $FU, $TPL );
  672. $TPL = str_replace( '%%%STREAMID%%%', $DD['aux_parameter'], $TPL );
  673. if( $DD['type'] == 15 || $DD['type'] == 14 || $DD['type'] == 13 || $DD['type'] == 11 ){
  674. $QS = "SELECT `homing_enable` FROM `cameras` WHERE `id`={$DD['aux_id']}";
  675. $JUA = $DATABASE->Query( $QS );
  676. $CAMDATA = $JUA[0];
  677. if( $CAMDATA['homing_enable'] ){
  678. if( $CUser->Data['access'] > 5 ){
  679. $TPL = str_replace( '%%%HBTN%%%', '<img id="img_btn_0ZZ_'.$DD['aux_id'].'" class="ptz_ctrl_btn" src="/style/png/building/038.png">', $TPL );
  680. $TPL = str_replace('%%%CAM_CTRL_HOME_BTN_BIND%%%', 'document.getElementById(\'img_btn_0ZZ_'.$DD['aux_id'].'\').addEventListener( \'mousedown\', makePtzHome );', $TPL );
  681. } else {
  682. $TPL = str_replace('%%%HBTN%%%', '&nbsp;', $TPL );
  683. $TPL = str_replace('%%%CAM_CTRL_HOME_BTN_BIND%%%', '', $TPL );
  684. };
  685. } else {
  686. $TPL = str_replace('%%%HBTN%%%', '&nbsp;', $TPL );
  687. $TPL = str_replace('%%%CAM_CTRL_HOME_BTN_BIND%%%', '', $TPL );
  688. };
  689. };
  690. $FK = $MODULE_DATA['height'] /$MODULE_DATA['width'];
  691. $W = 244;
  692. $H = $W * $FK;
  693. $TPL = str_replace( '%%%WIDTH%%%', $W, $TPL );
  694. $TPL = str_replace( '%%%HEIGHT%%%', $H, $TPL );
  695. $OUT[]= $STA[3+$idx] . $TPL . $END;
  696. } else break;
  697. $idx++;
  698. };
  699. } else {
  700. for( ;$idx<1;$idx++ ){
  701. $T = str_replace( '%%ID%%', 4+$idx , $DUMMY['camera'] );
  702. $OUT[]= $STA[3+$idx] . $T . $END;
  703. };
  704. };
  705. $OUT[]= $STA[4] . $DUMMY['log'] . $END;
  706. break;
  707. };
  708. case 6:{
  709. $STA[0]="{ columnWidth: 1.0, stydle:'padding:10px 0 10px 10px', items:[";
  710. //$STA[1]="{ columnWidth: .25, stylse:'padding:10px 0 10px 10px', items:[";
  711. //$STA[2]="{ columnWidth: .75, stylse:'padding:10px 0 10px 10px', items:[";
  712. $STA[1]="{ columnWidth: 1.0, stylse:'padding:10px 0 10px 10px', items:[";
  713. $MH = 4;
  714. if( $CUser->Data['access'] > 2 ){
  715. $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)*{$MH}); initMapMonitoring();}} }";
  716. $DUMMY['log']="{xtype:'panel', id: 'lg_panel', title: '{$Labels->GetLabel('_EVENT_LOG_')}', frame: true, border: true, draggable: false, items:[{$LOGIO}] }";
  717. $OUT[]= $STA[0] . $DUMMY['map'] . $END;
  718. //$OUT[]= $STA[1] . $DUMMY['sensor'] . $END;
  719. $OUT[]= $STA[1] . $DUMMY['log'] . $END;
  720. } else {
  721. $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();}} }";
  722. $OUT[]= $STA[0] . $DUMMY['map'] . $END;
  723. };
  724. break;
  725. };
  726. default:
  727. };
  728. //$OUT[0]='{columnWidth: 1, items:{html:"Sys Layout:'.$SP['app_layout'].'"}}';
  729. $Data = '[' . implode( ',' , $OUT ) . ']';
  730. } else {
  731. $Data = '[{columnWidth: 1, items:{html:"NO SYSTEM PROPS"}} ]';
  732. };
  733. };
  734. if( $Data != '' ) {
  735. echo $Data;
  736. } else {
  737. echo '[]';
  738. };
  739. ?>