@@ -52,7 +52,7 @@ function display_information() {
5252 db_execute_prepared ('INSERT INTO plugin_intropage_user_auth
5353 (user_id)
5454 VALUES (?) ' ,
55- array ( $ _SESSION ['sess_user_id ' ]) );
55+ [ $ _SESSION ['sess_user_id ' ]] );
5656
5757 $ user_panels = 0 ;
5858 }
@@ -82,19 +82,19 @@ function display_information() {
8282 $ number_of_dashboards = db_fetch_cell_prepared ('SELECT COUNT(*)
8383 FROM plugin_intropage_dashboard
8484 WHERE user_id = ? ' ,
85- array ( $ _SESSION ['sess_user_id ' ]) );
85+ [ $ _SESSION ['sess_user_id ' ]] );
8686
8787 // console access
8888 $ console_access = api_plugin_user_realm_auth ('index.php ' );
8989
9090 // remove admin prohibited panels
91- $ panels = db_fetch_assoc_prepared ('SELECT pd.panel_id AS panel_name, pd.id AS id
91+ $ panels = db_fetch_assoc_prepared ('SELECT pd.panel_id AS panel_name, pd.id AS id
9292 FROM plugin_intropage_panel_data AS pd
9393 INNER JOIN plugin_intropage_panel_dashboard AS pda
9494 ON pd.id = pda.panel_id
9595 WHERE pda.user_id = ?
9696 AND pda.dashboard_id = ? ' ,
97- array ( $ _SESSION ['sess_user_id ' ], $ dashboard_id) );
97+ [ $ _SESSION ['sess_user_id ' ], $ dashboard_id] );
9898
9999 if (cacti_sizeof ($ panels )) {
100100 $ removed = 0 ;
@@ -107,12 +107,12 @@ function display_information() {
107107 WHERE user_id = ?
108108 AND dashboard_id = ?
109109 AND panel_id = ? ' ,
110- array ( $ _SESSION ['sess_user_id ' ], $ dashboard_id , $ one ['id ' ]) );
110+ [ $ _SESSION ['sess_user_id ' ], $ dashboard_id , $ one ['id ' ]] );
111111
112112 db_execute_prepared ('DELETE FROM plugin_intropage_panel_data
113113 WHERE user_id = ?
114114 AND panel_id = ? ' ,
115- array ( $ _SESSION ['sess_user_id ' ], $ one ['id ' ]) );
115+ [ $ _SESSION ['sess_user_id ' ], $ one ['id ' ]] );
116116
117117 $ removed ++;
118118 }
@@ -148,12 +148,12 @@ function display_information() {
148148 AND t3.panel_id = 'favourite_graph'
149149 AND t3.fav_graph_id IS NOT NULL
150150 $ sql_order " ,
151- array (
151+ [
152152 $ _SESSION ['sess_user_id ' ],
153153 $ dashboard_id ,
154154 $ _SESSION ['sess_user_id ' ],
155155 $ dashboard_id
156- )
156+ ]
157157 );
158158
159159 // remove prohibited panels (for common panels (user_id=0))
@@ -162,18 +162,18 @@ function display_information() {
162162 $ allowed = is_panel_allowed ($ value ['panel_id ' ]);
163163
164164 if (!$ allowed ) {
165- unset ($ panels [$ key ]);
165+ unset($ panels [$ key ]);
166166 } else {
167167 // user has permission but no active panel
168168 $ upanels = db_fetch_cell_prepared ('SELECT COUNT(*)
169169 FROM plugin_intropage_panel_dashboard
170170 WHERE user_id = ?
171171 AND dashboard_id = ?
172172 AND panel_id = ? ' ,
173- array ( $ _SESSION ['sess_user_id ' ], $ dashboard_id , $ value ['id ' ]) );
173+ [ $ _SESSION ['sess_user_id ' ], $ dashboard_id , $ value ['id ' ]] );
174174
175175 if ($ upanels == 0 ) {
176- unset ($ panels [$ key ]);
176+ unset($ panels [$ key ]);
177177 }
178178 }
179179 }
@@ -182,15 +182,15 @@ function display_information() {
182182 // Notice about disable cacti dashboard
183183 if (read_config_option ('hide_console ' ) != 'on ' ) {
184184 print '<table class="cactiTable"><tr><td class="textAreaNotes"> ' . __ ('You can disable rows above in <b>Configure > Settings > General > Hide Cacti Dashboard</b> and use the whole page for Intropage ' , 'intropage ' );
185- print '<a class="pic" href=" ' . $ config ['url_path ' ] . 'settings.php?tab=general&filter=hide"><i class="intro_glyph fas fa-link"></i></a></td></tr></table></br> ' ;
185+ print '<a class="pic" href=" ' . $ config ['url_path ' ] . 'settings.php?tab=general&filter=hide"><i class="intro_glyph fas fa-link"></i></a></td></tr></table></br> ' ;
186186 }
187187
188188 $ dashboards = array_rekey (
189- db_fetch_assoc_prepared ('SELECT dashboard_id, name
189+ db_fetch_assoc_prepared ('SELECT dashboard_id, name
190190 FROM plugin_intropage_dashboard
191191 WHERE user_id = ?
192192 ORDER BY dashboard_id ' ,
193- array ( $ _SESSION ['sess_user_id ' ]) ),
193+ [ $ _SESSION ['sess_user_id ' ]] ),
194194 'dashboard_id ' , 'name '
195195 );
196196
@@ -203,18 +203,18 @@ function display_information() {
203203 db_execute_prepared ('INSERT INTO plugin_intropage_dashboard
204204 (user_id, dashboard_id, name)
205205 VALUES (?, ?, ?) ' ,
206- array ( $ _SESSION ['sess_user_id ' ], $ dashboard_id , $ dashboards [1 ]) );
206+ [ $ _SESSION ['sess_user_id ' ], $ dashboard_id , $ dashboards [1 ]] );
207207 }
208208
209209 // wide or normal number of panels on line
210210 if ($ display_wide == 'on ' ) {
211211 $ width_quarter = 'calc(25% - 1em) ' ;
212- $ width_third = 'calc(33% - 1em) ' ;
213- $ width_half = 'calc(50% - 1em) ' ;
212+ $ width_third = 'calc(33% - 1em) ' ;
213+ $ width_half = 'calc(50% - 1em) ' ;
214214 } else {
215215 $ width_quarter = 'calc(33% - 1em) ' ;
216- $ width_third = 'calc(50% - 1em) ' ;
217- $ width_half = 'calc(66% - 1em) ' ;
216+ $ width_third = 'calc(50% - 1em) ' ;
217+ $ width_half = 'calc(66% - 1em) ' ;
218218 }
219219
220220 // Intropage Display ----------------------------------
@@ -234,7 +234,7 @@ function display_information() {
234234 }
235235 }
236236
237- print " </ul></nav></div> " ;
237+ print ' </ul></nav></div> ' ;
238238 print '</div> ' ;
239239 print '<div class="float_right"> ' ;
240240
@@ -254,15 +254,15 @@ function display_information() {
254254
255255 print "<select id='intropage_action_timespan'> " ;
256256
257- foreach ($ trend_timespans as $ key => $ value ) {
257+ foreach ($ trend_timespans as $ key => $ value ) {
258258 if ($ timespan == $ key ) {
259259 print "<option value='timespan_ $ key' selected='selected'> " . $ value . '</option> ' ;
260260 } else {
261261 print "<option value='timespan_ $ key'> " . $ value . '</option> ' ;
262262 }
263263 }
264264
265- print " </select> " ;
265+ print ' </select> ' ;
266266 print ' ' ;
267267
268268 print "<select id='intropage_action'> " ;
@@ -364,7 +364,6 @@ function display_information() {
364364
365365 print '<option value="" disabled="disabled">─────────────────────────</option> ' ;
366366
367-
368367 if ($ display_important_first == 'on ' ) {
369368 print "<option value='important_first' disabled='disabled'> " . __ ('Sort by Severity ' , 'intropage ' ) . '</option> ' ;
370369 print "<option value='important_no'> " . __ ('Sort by User Preference ' , 'intropage ' ) . '</option> ' ;
@@ -412,7 +411,7 @@ function display_information() {
412411 (SELECT COUNT(panel_id) FROM plugin_intropage_panel_dashboard WHERE dashboard_id = t2.dashboard_id AND user_id = ?) as panels
413412 FROM plugin_intropage_dashboard AS t2
414413 WHERE user_id = ? AND dashboard_id = ? ' ,
415- array ( $ _SESSION ['sess_user_id ' ], $ _SESSION ['sess_user_id ' ], $ _SESSION ['dashboard_id ' ]) );
414+ [ $ _SESSION ['sess_user_id ' ], $ _SESSION ['sess_user_id ' ], $ _SESSION ['dashboard_id ' ]] );
416415
417416 if (!empty ($ actual )) {
418417 if ($ actual ['shared ' ]) {
@@ -432,17 +431,16 @@ function display_information() {
432431
433432 $ shared_dashboards = db_fetch_assoc_prepared ('SELECT dashboard_id,name,user_id FROM plugin_intropage_dashboard
434433 WHERE shared = 1 AND user_id != ? ' ,
435- array ( $ _SESSION ['sess_user_id ' ]) );
434+ [ $ _SESSION ['sess_user_id ' ]] );
436435
437436 if (cacti_sizeof ($ shared_dashboards ) > 0 ) {
438-
439- foreach ($ shared_dashboards as $ sd ) {
440- $ text = ' ( ' . get_username ($ sd ['user_id ' ]) . ' - ' . $ sd ['name ' ] . ') ' ;
437+ foreach ($ shared_dashboards as $ sd ) {
438+ $ text = ' ( ' . get_username ($ sd ['user_id ' ]) . ' - ' . $ sd ['name ' ] . ') ' ;
441439
442440 if ($ number_of_dashboards < 9 ) {
443- print "<option value='useshared_ " . $ sd ['dashboard_id ' ] . " _ " . $ sd ['user_id ' ] . "'> " . __ ('Use shared dashboard ' , 'intropage ' ) . $ text . '</option> ' ;
441+ print "<option value='useshared_ " . $ sd ['dashboard_id ' ] . ' _ ' . $ sd ['user_id ' ] . "'> " . __ ('Use shared dashboard ' , 'intropage ' ) . $ text . '</option> ' ;
444442 } else {
445- print "<option value='useshared_ " . $ sd ['dashboard_id ' ] . " _ " . $ sd ['user_id ' ] . "' disabled='disabled'> " . __ ('Cannot use shared dashboard - dashboard limit reached. ' , 'intropage ' ) . $ text . '</option> ' ;
443+ print "<option value='useshared_ " . $ sd ['dashboard_id ' ] . ' _ ' . $ sd ['user_id ' ] . "' disabled='disabled'> " . __ ('Cannot use shared dashboard - dashboard limit reached. ' , 'intropage ' ) . $ text . '</option> ' ;
446444 }
447445 }
448446 } else {
@@ -508,16 +506,15 @@ function display_information() {
508506 $ first_db = db_fetch_cell_prepared ('SELECT MIN(IFNULL(dashboard_id, 1))
509507 FROM plugin_intropage_dashboard
510508 WHERE user_id = ? ' ,
511- array ( $ _SESSION ['sess_user_id ' ]) );
509+ [ $ _SESSION ['sess_user_id ' ]] );
512510
513511 // extra maint plugin panel - always first
514512 if (api_plugin_is_enabled ('maint ' ) && (read_config_option ('intropage_maint_plugin_days_before ' ) >= 0 )) {
515-
516513 $ row = db_fetch_row_prepared ("SELECT id, data
517514 FROM plugin_intropage_panel_data
518515 WHERE panel_id = 'maint'
519516 AND user_id = ? " ,
520- array ( $ _SESSION ['sess_user_id ' ]) );
517+ [ $ _SESSION ['sess_user_id ' ]] );
521518
522519 if (isset ($ row ['data ' ]) && $ row ['data ' ] != null && $ dashboard_id == $ first_db ) {
523520 intropage_create_panel ($ row ['id ' ], $ dashboard_id );
@@ -550,32 +547,32 @@ function display_information() {
550547
551548 var refresh;
552549 var pollerRefresh;
553- var intropage_autorefresh = <?php print $ autorefresh ;?> ;
550+ var intropage_autorefresh = <?php print $ autorefresh ; ?> ;
554551 var intropage_drag = true;
555552 var intropage_square = true;
556553 var callbackPage = '';
557554 var redirectPage = '';
558- var fullPage = <?php print $ display_important_first == 'on ' ? 'true ' : 'false ' ;?> ;
559- var dashboard_id = <?php print $ dashboard_id ;?> ;
560- var intropage_text_panel_details = '<?php print __ ('Panel Details ' , 'intropage ' );?> ';
561- var intropage_text_panel_disable = '<?php print __esc ('Disable panel move/Enable copy text from panel ' , 'intropage ' );?> ';
562- var intropage_text_panel_enable = '<?php print __esc ('Enable panel move/Disable copy text from panel ' , 'intropage ' );?> ';
563- var intropage_text_square_disable = '<?php print __esc ('Hide red/yellow/green square notifications ' , 'intropage ' );?> ';
564- var intropage_text_square_enable = '<?php print __esc ('Show red/yellow/green square notifications ' , 'intropage ' );?> ';
555+ var fullPage = <?php print $ display_important_first == 'on ' ? 'true ' : 'false ' ; ?> ;
556+ var dashboard_id = <?php print $ dashboard_id ; ?> ;
557+ var intropage_text_panel_details = '<?php print __ ('Panel Details ' , 'intropage ' ); ?> ';
558+ var intropage_text_panel_disable = '<?php print __esc ('Disable panel move/Enable copy text from panel ' , 'intropage ' ); ?> ';
559+ var intropage_text_panel_enable = '<?php print __esc ('Enable panel move/Disable copy text from panel ' , 'intropage ' ); ?> ';
560+ var intropage_text_square_disable = '<?php print __esc ('Hide red/yellow/green square notifications ' , 'intropage ' ); ?> ';
561+ var intropage_text_square_enable = '<?php print __esc ('Show red/yellow/green square notifications ' , 'intropage ' ); ?> ';
565562
566- var intropage_text_data_error = '<?php print __ ('Error reading new data ' , 'intropage ' );?> ';
567- var intropage_text_close = '<?php print __ ('Close ' , 'intropage ' );?> ';
563+ var intropage_text_data_error = '<?php print __ ('Error reading new data ' , 'intropage ' ); ?> ';
564+ var intropage_text_close = '<?php print __ ('Close ' , 'intropage ' ); ?> ';
568565
569566 var panels = {};
570567
571- var intropage_panel_quarter_width = '<?php echo $ width_quarter ; ?> ';
572- var intropage_panel_third_width = '<?php echo $ width_third ; ?> ';
573- var intropage_panel_half_width = '<?php echo $ width_half ; ?> ';
568+ var intropage_panel_quarter_width = '<?php print $ width_quarter ; ?> ';
569+ var intropage_panel_third_width = '<?php print $ width_third ; ?> ';
570+ var intropage_panel_half_width = '<?php print $ width_half ; ?> ';
574571
575572 </script>
576573
577574 <?php
578- print get_md5_include_js ($ config ['base_path ' ]. '/plugins/intropage/include/intropage.js ' );
575+ print get_md5_include_js ($ config ['base_path ' ] . '/plugins/intropage/include/intropage.js ' );
579576
580577 return true ;
581578}
0 commit comments