Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fix checkstyle warnings

  • Loading branch information...
commit cce4f2cd2f1186c714b78ee92f61f28104d1077d 1 parent 161a5a9
authored April 29, 2012
15  libraries/config/FormDisplay.tpl.php
@@ -190,7 +190,8 @@ function display_input($path, $name, $description = '', $type, $value, $value_is
190 190
     <th>
191 191
         <label for="<?php echo htmlspecialchars($path) ?>"><?php
192 192
             echo $name ?></label>
193  
-        <?php if (!empty($opts['doc']) || !empty($opts['wiki'])) { ?>
  193
+        <?php
  194
+    if (!empty($opts['doc']) || !empty($opts['wiki'])) { ?>
194 195
         <span class="doc">
195 196
             <?php if (!empty($opts['doc'])) {
196 197
                 ?><a href="<?php echo $base_dir . $opts['doc']  ?>"
@@ -201,17 +202,17 @@ function display_input($path, $name, $description = '', $type, $value, $value_is
201 202
             } ?>
202 203
         </span>
203 204
         <?php
204  
-        }
205  
-        if ($option_is_disabled) {
  205
+    }
  206
+    if ($option_is_disabled) {
206 207
             ?>
207 208
             <span class="disabled-notice" title="<?php echo __(
208 209
             'This setting is disabled, it will not be applied to your configuration')
209 210
             ?>"><?php echo __('Disabled') ?></span>
210 211
         <?php
211  
-        }
212  
-        if (!empty($description)) {
213  
-            ?><small><?php echo $description ?></small><?php
214  
-        } ?>
  212
+    }
  213
+    if (!empty($description)) {
  214
+        ?><small><?php echo $description ?></small><?php
  215
+    } ?>
215 216
     </th>
216 217
     <td>
217 218
     <?php
107  libraries/display_tbl.lib.php
@@ -111,9 +111,10 @@ function PMA_setDisplayMode(&$the_disp_mode, &$the_total)
111 111
                 '@^SHOW[[:space:]]+(VARIABLES|(FULL[[:space:]]+)?'
112 112
                 . 'PROCESSLIST|STATUS|TABLE|GRANTS|CREATE|LOGS|DATABASES|FIELDS)@i',
113 113
                 $GLOBALS['sql_query'], $which
114  
-                );
  114
+            );
115 115
             if (isset($which[1])
116  
-                && strpos(' ' . strtoupper($which[1]), 'PROCESSLIST') > 0) {
  116
+                && strpos(' ' . strtoupper($which[1]), 'PROCESSLIST') > 0
  117
+                ) {
117 118
                 $do_display['edit_lnk'] = 'nn'; // no edit link
118 119
                 $do_display['del_lnk']  = 'kp'; // "kill process" type edit link
119 120
             } else {
@@ -142,7 +143,7 @@ function PMA_setDisplayMode(&$the_disp_mode, &$the_total)
142 143
                 // 2.3.2 Displays edit/delete/sort/insert links?
143 144
                 if ($is_link
144 145
                     && ($fields_meta[$i]->table == ''
145  
-                        || $fields_meta[$i]->table != $prev_table)
  146
+                    || $fields_meta[$i]->table != $prev_table)
146 147
                 ) {
147 148
                     $do_display['edit_lnk'] = 'nn'; // don't display links
148 149
                     $do_display['del_lnk']  = 'nn';
@@ -182,7 +183,8 @@ function PMA_setDisplayMode(&$the_disp_mode, &$the_total)
182 183
         //   of sorting VIEW results.
183 184
         if (isset($unlim_num_rows)
184 185
             && $unlim_num_rows < 2
185  
-            && ! PMA_Table::isView($db, $table)) {
  186
+            && ! PMA_Table::isView($db, $table)
  187
+        ) {
186 188
             // force display of navbar for vertical/horizontal display-choice.
187 189
             // $do_display['nav_bar']  = (string) '0';
188 190
             $do_display['sort_lnk'] = (string) '0';
@@ -249,7 +251,8 @@ function PMA_displayTableNavigationOneButton($caption, $title, $pos, $html_sql_q
249 251
     }
250 252
     // for false or 'both'
251 253
     if (false === $GLOBALS['cfg']['NavigationBarIconic']
252  
-        || 'both' === $GLOBALS['cfg']['NavigationBarIconic']) {
  254
+        || 'both' === $GLOBALS['cfg']['NavigationBarIconic']
  255
+    ) {
253 256
         $caption_output .= '&nbsp;' . $title;
254 257
     }
255 258
     $title_output = ' title="' . $title . '"';
@@ -296,8 +299,7 @@ function PMA_displayTableNavigationOneButton($caption, $title, $pos, $html_sql_q
296 299
  * @see     PMA_displayTable()
297 300
  */
298 301
 function PMA_displayTableNavigation($pos_next, $pos_prev, $sql_query,
299  
-    $id_for_direction_dropdown)
300  
-{
  302
+    $id_for_direction_dropdown) {
301 303
     global $db, $table, $goto;
302 304
     global $num_rows, $unlim_num_rows;
303 305
     global $is_innodb;
@@ -322,14 +324,15 @@ function PMA_displayTableNavigation($pos_next, $pos_prev, $sql_query,
322 324
     <?php
323 325
     // Move to the beginning or to the previous page
324 326
     if ($_SESSION['tmp_user_values']['pos']
325  
-        && $_SESSION['tmp_user_values']['max_rows'] != 'all') {
  327
+        && $_SESSION['tmp_user_values']['max_rows'] != 'all'
  328
+        ) {
326 329
         PMA_displayTableNavigationOneButton(
327 330
             '&lt;&lt;', _pgettext('First page', 'Begin'), 0, $html_sql_query
328  
-            );
  331
+        );
329 332
         PMA_displayTableNavigationOneButton(
330 333
             '&lt;', _pgettext('Previous page', 'Previous'), $pos_prev,
331 334
             $html_sql_query
332  
-            );
  335
+        );
333 336
 
334 337
     } // end move back
335 338
 
@@ -340,11 +343,11 @@ function PMA_displayTableNavigation($pos_next, $pos_prev, $sql_query,
340 343
         $pageNow = @floor(
341 344
             $_SESSION['tmp_user_values']['pos']
342 345
             / $_SESSION['tmp_user_values']['max_rows']
343  
-            ) + 1;
  346
+        ) + 1;
344 347
         $nbTotalPage = @ceil(
345 348
             $unlim_num_rows
346 349
             / $_SESSION['tmp_user_values']['max_rows']
347  
-            );
  350
+        );
348 351
 
349 352
         if ($nbTotalPage > 1) { //if2
350 353
        ?>
@@ -380,7 +383,8 @@ function PMA_displayTableNavigation($pos_next, $pos_prev, $sql_query,
380 383
     // Display the "Show all" button if allowed
381 384
     if (($num_rows < $unlim_num_rows)
382 385
         && ($GLOBALS['cfg']['ShowAll']
383  
-            || ($GLOBALS['cfg']['MaxRows'] * 5 >= $unlim_num_rows))) {
  386
+        || ($GLOBALS['cfg']['MaxRows'] * 5 >= $unlim_num_rows))
  387
+    ) {
384 388
         echo "\n";
385 389
         ?>
386 390
     <td>
@@ -399,8 +403,7 @@ function PMA_displayTableNavigation($pos_next, $pos_prev, $sql_query,
399 403
     } // end show all
400 404
 
401 405
     // Move to the next page or to the last one
402  
-    if (($_SESSION['tmp_user_values']['pos']
403  
-            + $_SESSION['tmp_user_values']['max_rows'] < $unlim_num_rows)
  406
+    if (($_SESSION['tmp_user_values']['pos'] + $_SESSION['tmp_user_values']['max_rows'] < $unlim_num_rows)
404 407
         && $num_rows >= $_SESSION['tmp_user_values']['max_rows']
405 408
         && $_SESSION['tmp_user_values']['max_rows'] != 'all'
406 409
     ) {
@@ -494,12 +497,12 @@ class="textfield" onfocus="this.select()" />
494 497
                 'horizontal'        => __('horizontal'),
495 498
                 'horizontalflipped' => __('horizontal (rotated headers)'),
496 499
                 'vertical'          => __('vertical')
497  
-                );
  500
+            );
498 501
             echo PMA_generate_html_dropdown(
499 502
                 'disp_direction', $choices,
500 503
                 $_SESSION['tmp_user_values']['disp_direction'],
501 504
                 $id_for_direction_dropdown
502  
-                );
  505
+            );
503 506
             unset($choices);
504 507
         }
505 508
 
@@ -550,8 +553,8 @@ class="textfield" onfocus="this.select()" />
550 553
  */
551 554
 function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0,
552 555
     $analyzed_sql = '', $sort_expression = '', $sort_expression_nodirection = '',
553  
-    $sort_direction = '')
554  
-{
  556
+    $sort_direction = '') {
  557
+
555 558
     global $db, $table, $goto;
556 559
     global $sql_query, $num_rows;
557 560
     global $vertical_display, $highlight_columns;
@@ -561,6 +564,10 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0,
561 564
     $sql_md5 = md5($GLOBALS['sql_query']);
562 565
     $session_max_rows = $_SESSION['tmp_user_values']['query'][$sql_md5]['max_rows'];
563 566
 
  567
+    $direction = isset($_SESSION['tmp_user_values']['disp_direction'])
  568
+        ? $_SESSION['tmp_user_values']['disp_direction']
  569
+        : '';
  570
+
564 571
     if ($analyzed_sql == '') {
565 572
         $analyzed_sql = array();
566 573
     }
@@ -593,8 +600,8 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0,
593 600
             // do we have any index?
594 601
             if ($indexes) {
595 602
 
596  
-                if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
597  
-                    || $_SESSION['tmp_user_values']['disp_direction']
  603
+                if ($direction == 'horizontal'
  604
+                    || $direction
598 605
                         == 'horizontalflipped'
599 606
                 ) {
600 607
                     $span = $fields_cnt;
@@ -852,15 +859,15 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0,
852 859
         echo ' ajax';
853 860
     }
854 861
     echo '">' . "\n";
855  
-    if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
856  
-        || $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped'
  862
+    if ($direction == 'horizontal'
  863
+        || $direction == 'horizontalflipped'
857 864
     ) {
858 865
         echo '<thead><tr>' . "\n";
859 866
     }
860 867
 
861 868
     // 1. Displays the full/partial text button (part 1)...
862  
-    if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
863  
-        || $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped'
  869
+    if ($direction == 'horizontal'
  870
+        || $direction == 'horizontalflipped'
864 871
     ) {
865 872
         $colspan  = ($is_display['edit_lnk'] != 'nn'
866 873
             && $is_display['del_lnk'] != 'nn')
@@ -879,8 +886,8 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0,
879 886
     ) {
880 887
         $vertical_display['emptypre'] = ($is_display['edit_lnk'] != 'nn'
881 888
             && $is_display['del_lnk'] != 'nn') ? 4 : 0;
882  
-        if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
883  
-            || $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped'
  889
+        if ($direction == 'horizontal'
  890
+            || $direction == 'horizontalflipped'
884 891
         ) {
885 892
             ?>
886 893
     <th colspan="<?php echo $fields_cnt; ?>"></th>
@@ -906,8 +913,8 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0,
906 913
 
907 914
         $vertical_display['emptypre'] = ($is_display['edit_lnk'] != 'nn'
908 915
             && $is_display['del_lnk'] != 'nn') ? 4 : 0;
909  
-        if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
910  
-            || $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped'
  916
+        if ($direction == 'horizontal'
  917
+            || $direction == 'horizontalflipped'
911 918
         ) {
912 919
             ?>
913 920
                 <th <?php echo $colspan; ?>><?php
@@ -928,8 +935,8 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0,
928 935
 
929 936
         $vertical_display['emptypre'] = ($is_display['edit_lnk'] != 'nn'
930 937
             && $is_display['del_lnk'] != 'nn') ? 4 : 0;
931  
-        if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
932  
-            || $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped'
  938
+        if ($direction == 'horizontal'
  939
+            || $direction == 'horizontalflipped'
933 940
         ) {
934 941
             ?>
935 942
     <td<?php echo $colspan; ?>></td>
@@ -940,8 +947,8 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0,
940 947
         } // end vertical mode
941 948
 
942 949
     } elseif ($GLOBALS['cfg']['RowActionLinks'] == 'none'
943  
-        && ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
944  
-            || $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped')
  950
+        && ($direction == 'horizontal'
  951
+            || $direction == 'horizontalflipped')
945 952
     ) {
946 953
         //     ... elseif display an empty column if the actions links are disabled to
947 954
         //         match the rest of the table
@@ -958,7 +965,7 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0,
958 965
     //       Do not show comments, if using horizontalflipped mode,
959 966
     //       because of space usage
960 967
     if ($GLOBALS['cfg']['ShowBrowseComments']
961  
-        && $_SESSION['tmp_user_values']['disp_direction'] != 'horizontalflipped'
  968
+        && $direction != 'horizontalflipped'
962 969
     ) {
963 970
         $comments_map = array();
964 971
         if (isset($analyzed_sql[0]) && is_array($analyzed_sql[0])) {
@@ -1164,13 +1171,13 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0,
1164 1171
                     $GLOBALS['cfg']['HeaderFlipType'] = 'fake';
1165 1172
                 }
1166 1173
             }
1167  
-            if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped'
  1174
+            if ($direction == 'horizontalflipped'
1168 1175
                 && $GLOBALS['cfg']['HeaderFlipType'] == 'css'
1169 1176
             ) {
1170 1177
                 $order_link_params['style'] = 'direction: ltr; writing-mode: tb-rl;';
1171 1178
             }
1172 1179
             $order_link_params['title'] = __('Sort');
1173  
-            $order_link_content = ($_SESSION['tmp_user_values']['disp_direction']
  1180
+            $order_link_content = ($direction
1174 1181
                 == 'horizontalflipped'
1175 1182
                 && $GLOBALS['cfg']['HeaderFlipType'] == 'fake'
1176 1183
                 ? PMA_flipstring(htmlspecialchars($fields_meta[$i]->name),
@@ -1179,8 +1186,8 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0,
1179 1186
             $order_link = PMA_linkOrButton($order_url,
1180 1187
                 $order_link_content . $order_img, $order_link_params, false, true);
1181 1188
 
1182  
-            if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
1183  
-                || $_SESSION['tmp_user_values']['disp_direction']
  1189
+            if ($direction == 'horizontal'
  1190
+                || $direction
1184 1191
                     == 'horizontalflipped'
1185 1192
             ) {
1186 1193
                 echo '<th';
@@ -1201,7 +1208,7 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0,
1201 1208
                 }
1202 1209
                 echo ' class="' . implode(' ', $th_class);
1203 1210
 
1204  
-                if ($_SESSION['tmp_user_values']['disp_direction']
  1211
+                if ($direction
1205 1212
                         == 'horizontalflipped') {
1206 1213
                     echo ' vbottom';
1207 1214
                 }
@@ -1217,8 +1224,8 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0,
1217 1224
 
1218 1225
         // 2.2 Results can't be sorted
1219 1226
         else {
1220  
-            if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
1221  
-                || $_SESSION['tmp_user_values']['disp_direction']
  1227
+            if ($direction == 'horizontal'
  1228
+                || $direction
1222 1229
                     == 'horizontalflipped'
1223 1230
             ) {
1224 1231
                 echo '<th';
@@ -1231,12 +1238,12 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0,
1231 1238
                     $th_class[] = 'condition';
1232 1239
                 }
1233 1240
                 echo ' class="' . implode(' ', $th_class);
1234  
-                if ($_SESSION['tmp_user_values']['disp_direction']
  1241
+                if ($direction
1235 1242
                         == 'horizontalflipped') {
1236 1243
                     echo ' vbottom';
1237 1244
                 }
1238 1245
                 echo '"';
1239  
-                if ($_SESSION['tmp_user_values']['disp_direction']
  1246
+                if ($direction
1240 1247
                         == 'horizontalflipped'
1241 1248
                     && $GLOBALS['cfg']['HeaderFlipType'] == 'css'
1242 1249
                 ) {
@@ -1244,7 +1251,7 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0,
1244 1251
                 }
1245 1252
                 echo ' data-column="' . htmlspecialchars($fields_meta[$i]->name)
1246 1253
                     . '">';
1247  
-                if ($_SESSION['tmp_user_values']['disp_direction']
  1254
+                if ($direction
1248 1255
                         == 'horizontalflipped'
1249 1256
                     && $GLOBALS['cfg']['HeaderFlipType'] == 'fake'
1250 1257
                 ) {
@@ -1275,8 +1282,8 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0,
1275 1282
             ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn')
1276 1283
             ? 4
1277 1284
             : 1;
1278  
-        if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
1279  
-            || $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped'
  1285
+        if ($direction == 'horizontal'
  1286
+            || $direction == 'horizontalflipped'
1280 1287
         ) {
1281 1288
             echo "\n";
1282 1289
             ?>
@@ -1303,8 +1310,8 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0,
1303 1310
             ($is_display['edit_lnk'] != 'nn' && $is_display['del_lnk'] != 'nn')
1304 1311
             ? 4
1305 1312
             : 1;
1306  
-        if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
1307  
-            || $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped'
  1313
+        if ($direction == 'horizontal'
  1314
+            || $direction == 'horizontalflipped'
1308 1315
         ) {
1309 1316
             echo "\n";
1310 1317
             ?>
@@ -1316,8 +1323,8 @@ function PMA_displayTableHeaders(&$is_display, &$fields_meta, $fields_cnt = 0,
1316 1323
         } // end vertical mode
1317 1324
     }
1318 1325
 
1319  
-    if ($_SESSION['tmp_user_values']['disp_direction'] == 'horizontal'
1320  
-        || $_SESSION['tmp_user_values']['disp_direction'] == 'horizontalflipped'
  1326
+    if ($direction == 'horizontal'
  1327
+        || $direction == 'horizontalflipped'
1321 1328
     ) {
1322 1329
         ?>
1323 1330
 </tr>
1  libraries/zip_extension.lib.php
@@ -2,6 +2,7 @@
2 2
 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 3
 /**
4 4
  * Interface for the zip extension
  5
+ *
5 6
  * @package PhpMyAdmin
6 7
  */
7 8
 if (! defined('PHPMYADMIN')) {

0 notes on commit cce4f2c

Please sign in to comment.
Something went wrong with that request. Please try again.