Data['id'] > 1 ){ $PID = intval( $_POST['PID'] ); $QS = "SELECT * FROM `metro_tracks` WHERE `platform_id`={$PID}"; $RR = $DATABASE->Query( $QS, false ); if( count( $RR ) ){ $MODS = array(); $ATN = ''; $ATS = ''; $BTN = ''; $BTS = ''; foreach( $RR as $CT ){ if( $CT['side'] == 'U' ){ $FID = intval( $CT['far_module_id'] ); $NID = intval( $CT['near_module_id'] ); if( !$FID ) $MODS['UL']=$CT['id']; if( !$NID ) $MODS['UR']=$CT['id']; $ATN = $CT['name']; $ATS = $CT['short']; } else { $FID = intval( $CT['far_module_id'] ); $NID = intval( $CT['near_module_id'] ); if( !$FID ) $MODS['BR']=$CT['id']; if( !$NID ) $MODS['BL']=$CT['id']; $BTN = $CT['name']; $BTS = $CT['short']; }; }; //If no mods = all are defined if( count( $MODS ) ){ $PAPA = array(); $LOCK = count( $MODS ); $CVAL = ''; foreach( $MODS as $KEY=>$VALUE ){ $PAPA[] = "['".$KEY . "','" .$Labels->GetLabel( 'MOD_LOC_'.$KEY ) . "','" .'/style/assets/ms_'.strtolower( $KEY ).".png']"; if( $CVAL == '' ) $CVAL = $KEY; }; $CDATA = implode(',', $PAPA ); $WTPL =<<GetLabel( '_ADD_MODULE_' )}", modal: true, resizable: false, width: 450, height: 290, items:[{ xtype: 'form', labelWidth: 150, labelAlign: 'right', items: [{ xtype: 'textfield', fieldLabel: "{$Labels->GetLabel( 'MOD_NAME' )}", id: 'mod_name', width: 200, },{ xtype: 'textfield', fieldLabel: "{$Labels->GetLabel( 'MOD_IP' )}", id: 'mod_ip', width: 200, },{ xtype: 'textfield', fieldLabel: "{$Labels->GetLabel( 'MOD_IDENT' )}", id: 'mod_id', width: 200, },{ xtype: 'combo', fieldLabel: "{$Labels->GetLabel( 'MOD_LOCATION' )}", id: 'mod_loc', width: 200, lazyRender: true, mode: 'local', forceSelection: true, triggerAction: 'all', editable: false, readOnly: ({$LOCK}==1), disableKeyFilter: true, tpl:'
 {name}
', store: new Ext.data.ArrayStore({ fields: ['abbr','name','icon'], data: [{$CDATA}] }), valueField: 'abbr', displayField: 'name', value: '{$CVAL}', listeners:{ select: function( t, r, i ){ t.getEl().setStyle({ 'background-image': 'url(' + r.data.icon + ')', 'background-repeat': 'no-repeat', 'background-position': '3px center', 'background-size': '16px 16px', 'padding-left': '25px' }); }, afterrender: function( t ){ t.getEl().setStyle({ 'background-image': 'url(' + t.store.data.items[t.store.findExact( 'abbr', t.value )].data.icon + ')', 'background-repeat': 'no-repeat', 'background-position': '3px center', 'background-size': '16px 16px', 'padding-left': '25px' }); } } },{ xtype: 'panel', id: 'infopan', html: '
{$ATN}[{$ATS}]
{$BTN}[{$BTS}]
' }] }], bbar:[{ text: '{$Labels->GetLabel( '_CANCEL_' )}', handler: function(){ var tt = Ext.getCmp('huba_buba'); tt.close(); } },{ text: '{$Labels->GetLabel( '_ADD_' )}', handler: function(){ var mtyp = Ext.getCmp('mod_type').getValue(); Ext.Ajax.request({ url: '/lib/controller/addModule.php', params: { SERVID: 1, TYPE: mtyp, UID: {$UserID}, SID: '{$Session}' }, success: function( response, opts ){ // If the response is JSON, you have to decode it var data = Ext.decode(response.responseText); if( data.status == 'ok' ){ addModuleWindow.close(); loadModules(); } else { Ext.Msg.show({ title: "{$Labels->GetLabel("_INFO_MSG_")}", msg: data.message, buttons: Ext.Msg.OK,//YESNOCANCEL, fn: function(){ //SettingsLidar3D.hide(); }, icon: Ext.MessageBox.INFO //QUESTION }); } }, failure: failureAJAXFunction }); } }] } DATA_BOUNDARY; }; echo $WTPL; } else { echo '{ xtype: \'panel\', html: \'Node '.$_POST['NODE'].' Loadded\'}'; }; } else { header('location: /'); }; ?>