File tree 1 file changed +16
-8
lines changed
1 file changed +16
-8
lines changed Original file line number Diff line number Diff line change 284
284
$ height = 500 ;
285
285
}
286
286
287
-
288
287
if (!is_array ($ _GET ['p ' ])) {
289
- $ code = ' <iframe allowfullscreen="true" src=" ' . ROOTHTML . ' module/charts.html?id=config&enable_fullscreen=1&period= ' . $ _GET [ ' subop ' ] . ' &chart_type= ' . urlencode ($ _GET ['chart_type ' ]) . ' &group= ' . $ group . ' &property= ' . urlencode ( $ _GET [ ' p ' ]) . ' &height= ' . $ height . ' &theme=grid-light" width=100% height= ' . ( $ height ) . ' frameBorder=0></iframe> ' ;
288
+ $ properties = array ($ _GET ['p ' ]);
290
289
} else {
291
- $ p_url = '' ;
292
- foreach ($ _GET ['p ' ] as $ p ) {
293
- $ p_url .= '&properties[]= ' . urlencode ($ p );
294
- }
290
+ $ properties = $ _GET ['p ' ];
295
291
$ p_url .= '&height= ' . $ height ;
296
- $ code = '<iframe allowfullscreen="true" src=" ' . ROOTHTML . 'module/charts.html?id=config&enable_fullscreen=1&period= ' . $ _GET ['subop ' ] . '&chart_type= ' . urlencode ($ _GET ['chart_type ' ]) . '&group= ' . $ group . $ p_url . '&theme=grid-light&frameBorder=0" width=100% height= ' . $ height . '></iframe> ' ;
297
292
}
293
+ $ p_url = '' ;
294
+ foreach ($ properties as $ p ) {
295
+ $ p_url .= '&properties[]= ' . urlencode ($ p );
296
+ if (preg_match ('/^(\w+)\.(\w+)$/ ' ,$ p ,$ m )) {
297
+ $ object = getObject ($ m [1 ]);
298
+ if ($ object ->description ) {
299
+ $ p_url .= '&legend[]= ' . urlencode ($ object ->description .' ( ' .$ m [2 ].') ' );
300
+ } else {
301
+ $ p_url .= '&legend[]= ' . urlencode ($ p );
302
+ }
303
+ }
304
+ }
305
+ $ code = ' <iframe allowfullscreen="true" border="0" frameborder="0" src=" ' . ROOTHTML . 'module/charts.html?id=config&enable_fullscreen=1&period= ' . $ _GET ['subop ' ] . '&chart_type= ' . urlencode ($ _GET ['chart_type ' ]) . '&group= ' . $ group . $ p_url . '&theme=grid-light&frameBorder=0" width=100% height= ' . $ height . '></iframe> ' ;
298
306
} else {
299
- $ code = '<img src=" ' . ROOTHTML . '3rdparty/jpgraph/?p= ' . $ p . '&type= ' . $ _GET ['subop ' ] . '&width=500&"/> ' ;
307
+ $ code = ' <img src=" ' . ROOTHTML . '3rdparty/jpgraph/?p= ' . $ p . '&type= ' . $ _GET ['subop ' ] . '&width=500&"/> ' ;
300
308
}
301
309
echo $ code ;
302
310
/*
You can’t perform that action at this time.
0 commit comments