@@ -55,14 +55,14 @@ |
||
55 | 55 | |
56 | 56 | // TODO: create a function for this in forum_banishment_vote.inc to make it more flexible |
57 | 57 | switch (post_int("category", true)) { |
58 | - case 1: |
|
59 | - $mod_category = tra("Obscene"); |
|
60 | - case 2: |
|
61 | - $mod_category = tra("Flame/Hate mail"); |
|
62 | - case 3: |
|
63 | - $mod_category = tra("User Request"); |
|
64 | - default: |
|
65 | - $mod_category = tra("Other"); |
|
58 | +case 1: |
|
59 | + $mod_category = tra("Obscene"); |
|
60 | +case 2: |
|
61 | + $mod_category = tra("Flame/Hate mail"); |
|
62 | +case 3: |
|
63 | + $mod_category = tra("User Request"); |
|
64 | +default: |
|
65 | + $mod_category = tra("Other"); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | if (post_str('reason', true)){ |
@@ -36,12 +36,12 @@ |
||
36 | 36 | |
37 | 37 | function hide_explanation() { |
38 | 38 | switch (post_int("category", true)) { |
39 | - case 1: $c = "Obscene"; break; |
|
40 | - case 2: $c = "Flame/Hate mail"; break; |
|
41 | - case 3: $c = "Commercial spam"; break; |
|
42 | - case 4: $c = "Double post"; break; |
|
43 | - case 5: $c = "User Request"; break; |
|
44 | - default: $c = "Other"; break; |
|
39 | + case 1: $c = "Obscene"; break; |
|
40 | + case 2: $c = "Flame/Hate mail"; break; |
|
41 | + case 3: $c = "Commercial spam"; break; |
|
42 | + case 4: $c = "Double post"; break; |
|
43 | + case 5: $c = "User Request"; break; |
|
44 | + default: $c = "Other"; break; |
|
45 | 45 | } |
46 | 46 | $x = "\nYour post was categorized as ".$c; |
47 | 47 | $x .= mod_comment(); |
@@ -35,63 +35,63 @@ |
||
35 | 35 | start_table(); |
36 | 36 | |
37 | 37 | switch($table){ |
38 | - case "platform": |
|
39 | - break; |
|
40 | - case "app": |
|
41 | - break; |
|
42 | - case "app_version": |
|
43 | - print_detail_field(); |
|
44 | - print_query_field(); |
|
45 | - break; |
|
46 | - case "host": |
|
47 | - echo " |
|
38 | +case "platform": |
|
39 | + break; |
|
40 | +case "app": |
|
41 | + break; |
|
42 | +case "app_version": |
|
43 | + print_detail_field(); |
|
44 | + print_query_field(); |
|
45 | + break; |
|
46 | +case "host": |
|
47 | + echo " |
|
48 | 48 | <tr> |
49 | 49 | <td align=\"right\">Show Aggregate Information</td> |
50 | 50 | <td> |
51 | 51 | "; |
52 | - print_checkbox("", "show_aggregate", $show_aggregate); |
|
53 | - echo " |
|
52 | + print_checkbox("", "show_aggregate", $show_aggregate); |
|
53 | + echo " |
|
54 | 54 | </td> |
55 | 55 | </tr> |
56 | 56 | "; |
57 | - print_detail_field(); |
|
58 | - print_query_field(); |
|
59 | - break; |
|
60 | - case "workunit": |
|
61 | - print_detail_field(); |
|
62 | - print_query_field(); |
|
63 | - echo "<input type=\"hidden\" name=\"sort_by\" value=\"id\">\n"; |
|
64 | - break; |
|
65 | - case "result": |
|
66 | - echo "<tr><td align=\"right\">Server state</td><td> "; |
|
67 | - server_state_select(); |
|
68 | - echo "</td></tr>\n"; |
|
69 | - //print_text_field( "Batch number:", "batch", $batch ); |
|
70 | - echo "<tr><td align=\"right\">Outcome</td><td>"; |
|
71 | - outcome_select(); |
|
72 | - echo "</td></tr>\n"; |
|
73 | - echo "<tr><td align=\"right\">Client state</td><td>"; |
|
74 | - client_state_select(); |
|
75 | - echo "</td></tr>\n"; |
|
76 | - echo "<tr><td align=\"right\">Validate state</td><td>"; |
|
77 | - validate_state_select(); |
|
78 | - echo "</td></tr>\n"; |
|
79 | - echo "<tr><td align=\"right\">Sort by</td><td>"; |
|
80 | - result_sort_select(); |
|
81 | - sort_order_select(); |
|
82 | - echo "</td></tr>\n"; |
|
83 | - print_detail_field(); |
|
84 | - print_query_field(); |
|
85 | - break; |
|
86 | - case "team": |
|
87 | - print_query_field(); |
|
88 | - break; |
|
89 | - case "user": |
|
90 | - print_query_field(); |
|
91 | - break; |
|
92 | - default: |
|
93 | - echo "Unknown table name\n"; |
|
94 | - exit(); |
|
57 | + print_detail_field(); |
|
58 | + print_query_field(); |
|
59 | + break; |
|
60 | +case "workunit": |
|
61 | + print_detail_field(); |
|
62 | + print_query_field(); |
|
63 | + echo "<input type=\"hidden\" name=\"sort_by\" value=\"id\">\n"; |
|
64 | + break; |
|
65 | +case "result": |
|
66 | + echo "<tr><td align=\"right\">Server state</td><td> "; |
|
67 | + server_state_select(); |
|
68 | + echo "</td></tr>\n"; |
|
69 | + //print_text_field( "Batch number:", "batch", $batch ); |
|
70 | + echo "<tr><td align=\"right\">Outcome</td><td>"; |
|
71 | + outcome_select(); |
|
72 | + echo "</td></tr>\n"; |
|
73 | + echo "<tr><td align=\"right\">Client state</td><td>"; |
|
74 | + client_state_select(); |
|
75 | + echo "</td></tr>\n"; |
|
76 | + echo "<tr><td align=\"right\">Validate state</td><td>"; |
|
77 | + validate_state_select(); |
|
78 | + echo "</td></tr>\n"; |
|
79 | + echo "<tr><td align=\"right\">Sort by</td><td>"; |
|
80 | + result_sort_select(); |
|
81 | + sort_order_select(); |
|
82 | + echo "</td></tr>\n"; |
|
83 | + print_detail_field(); |
|
84 | + print_query_field(); |
|
85 | + break; |
|
86 | +case "team": |
|
87 | + print_query_field(); |
|
88 | + break; |
|
89 | +case "user": |
|
90 | + print_query_field(); |
|
91 | + break; |
|
92 | +default: |
|
93 | + echo "Unknown table name\n"; |
|
94 | + exit(); |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | row2("Number of entries to show", "<input name=\"nresults\" value=\"20\">"); |
@@ -86,14 +86,14 @@ |
||
86 | 86 | function _mysql_field_attrs($r, $i) { |
87 | 87 | $x = mysqli_fetch_field_direct($r, $i); |
88 | 88 | switch ($x->type) { |
89 | - case 1: $x->type = 'tinyint'; break; |
|
90 | - case 2: $x->type = 'smallint'; break; |
|
91 | - case 3: $x->type = 'int'; break; |
|
92 | - case 5: $x->type = 'double'; break; |
|
93 | - case 7: $x->type = 'timestamp'; break; |
|
94 | - case 252: $x->type = 'blob'; break; |
|
95 | - case 253: $x->type = 'varchar'; break; |
|
96 | - case 254: $x->type = 'char'; break; |
|
89 | + case 1: $x->type = 'tinyint'; break; |
|
90 | + case 2: $x->type = 'smallint'; break; |
|
91 | + case 3: $x->type = 'int'; break; |
|
92 | + case 5: $x->type = 'double'; break; |
|
93 | + case 7: $x->type = 'timestamp'; break; |
|
94 | + case 252: $x->type = 'blob'; break; |
|
95 | + case 253: $x->type = 'varchar'; break; |
|
96 | + case 254: $x->type = 'char'; break; |
|
97 | 97 | } |
98 | 98 | return $x; |
99 | 99 | } |
@@ -551,12 +551,12 @@ discard block |
||
551 | 551 | */ |
552 | 552 | function boinccore_locale($op = 'groups', $group = NULL) { |
553 | 553 | switch ($op) { |
554 | - case 'groups': |
|
555 | - return array('boinc' => bts('BOINC')); |
|
556 | - case 'info': |
|
557 | - //$info['boinc']['refresh callback'] = 'boinccore_locale_refresh'; |
|
558 | - $info['boinc']['format'] = FALSE; |
|
559 | - return $info; |
|
554 | + case 'groups': |
|
555 | + return array('boinc' => bts('BOINC')); |
|
556 | + case 'info': |
|
557 | + //$info['boinc']['refresh callback'] = 'boinccore_locale_refresh'; |
|
558 | + $info['boinc']['format'] = FALSE; |
|
559 | + return $info; |
|
560 | 560 | } |
561 | 561 | } |
562 | 562 | |
@@ -1885,19 +1885,19 @@ discard block |
||
1885 | 1885 | // Transform arguments before inserting them. |
1886 | 1886 | foreach ($args as $key => $value) { |
1887 | 1887 | switch ($key [0]) { |
1888 | - case '@': |
|
1889 | - // Escaped only. |
|
1890 | - $args [$key] = check_plain($value); |
|
1891 | - break; |
|
1892 | - |
|
1893 | - case '%': |
|
1894 | - default: |
|
1895 | - // Escaped and placeholder. |
|
1896 | - $args [$key] = theme('placeholder', $value); |
|
1897 | - break; |
|
1898 | - |
|
1899 | - case '!': |
|
1900 | - // Pass-through. |
|
1888 | + case '@': |
|
1889 | + // Escaped only. |
|
1890 | + $args [$key] = check_plain($value); |
|
1891 | + break; |
|
1892 | + |
|
1893 | + case '%': |
|
1894 | + default: |
|
1895 | + // Escaped and placeholder. |
|
1896 | + $args [$key] = theme('placeholder', $value); |
|
1897 | + break; |
|
1898 | + |
|
1899 | + case '!': |
|
1900 | + // Pass-through. |
|
1901 | 1901 | } |
1902 | 1902 | } |
1903 | 1903 | return strtr($string, $args); |
@@ -1398,72 +1398,72 @@ |
||
1398 | 1398 | |
1399 | 1399 | switch ($op) { |
1400 | 1400 | // Return stored strings |
1401 | - case 'mem-report': |
|
1402 | - return $strings; |
|
1403 | - |
|
1404 | - // Store string in memory (only supports single strings) |
|
1405 | - case 'mem-store': |
|
1406 | - $strings[$value['msgid']] = $value['msgstr']; |
|
1407 | - return; |
|
1408 | - |
|
1409 | - // Called at end of import to inform the user |
|
1410 | - case 'db-report': |
|
1411 | - return array( |
|
1412 | - $headerdone, |
|
1413 | - $report['additions'], |
|
1414 | - $report['updates'], |
|
1415 | - $report['deletes'], |
|
1416 | - $report['skips'], |
|
1417 | - ); |
|
1401 | + case 'mem-report': |
|
1402 | + return $strings; |
|
1403 | + |
|
1404 | + // Store string in memory (only supports single strings) |
|
1405 | + case 'mem-store': |
|
1406 | + $strings[$value['msgid']] = $value['msgstr']; |
|
1407 | + return; |
|
1408 | + |
|
1409 | + // Called at end of import to inform the user |
|
1410 | + case 'db-report': |
|
1411 | + return array( |
|
1412 | + $headerdone, |
|
1413 | + $report['additions'], |
|
1414 | + $report['updates'], |
|
1415 | + $report['deletes'], |
|
1416 | + $report['skips'], |
|
1417 | + ); |
|
1418 | 1418 | |
1419 | - // Store the string we got in the database. |
|
1420 | - case 'db-store': |
|
1421 | - // We got header information. |
|
1422 | - if ($value['msgid'] == '') { |
|
1423 | - $languages = language_list(); |
|
1424 | - if (($mode != LOCALE_IMPORT_KEEP) || empty($languages[$lang]->plurals)) { |
|
1425 | - // Since we only need to parse the header if we ought to update the |
|
1426 | - // plural formula, only run this if we don't need to keep existing |
|
1427 | - // data untouched or if we don't have an existing plural formula. |
|
1428 | - $header = _locale_import_parse_header($value['msgstr']); |
|
1429 | - |
|
1430 | - // Get and store the plural formula if available. |
|
1431 | - if (isset($header["Plural-Forms"]) && $p = _locale_import_parse_plural_forms($header["Plural-Forms"], $file->filename)) { |
|
1432 | - list($nplurals, $plural) = $p; |
|
1433 | - db_query("UPDATE {languages} SET plurals = %d, formula = '%s' WHERE language = '%s'", $nplurals, $plural, $lang); |
|
1434 | - } |
|
1419 | + // Store the string we got in the database. |
|
1420 | + case 'db-store': |
|
1421 | + // We got header information. |
|
1422 | + if ($value['msgid'] == '') { |
|
1423 | + $languages = language_list(); |
|
1424 | + if (($mode != LOCALE_IMPORT_KEEP) || empty($languages[$lang]->plurals)) { |
|
1425 | + // Since we only need to parse the header if we ought to update the |
|
1426 | + // plural formula, only run this if we don't need to keep existing |
|
1427 | + // data untouched or if we don't have an existing plural formula. |
|
1428 | + $header = _locale_import_parse_header($value['msgstr']); |
|
1429 | + |
|
1430 | + // Get and store the plural formula if available. |
|
1431 | + if (isset($header["Plural-Forms"]) && $p = _locale_import_parse_plural_forms($header["Plural-Forms"], $file->filename)) { |
|
1432 | + list($nplurals, $plural) = $p; |
|
1433 | + db_query("UPDATE {languages} SET plurals = %d, formula = '%s' WHERE language = '%s'", $nplurals, $plural, $lang); |
|
1435 | 1434 | } |
1436 | - $headerdone = TRUE; |
|
1437 | 1435 | } |
1436 | + $headerdone = TRUE; |
|
1437 | + } |
|
1438 | 1438 | |
1439 | - else { |
|
1440 | - // Some real string to import. |
|
1441 | - $comments = _locale_import_shorten_comments(empty($value['#']) ? array() : $value['#']); |
|
1442 | - |
|
1443 | - if (strpos($value['msgid'], "\0")) { |
|
1444 | - // This string has plural versions. |
|
1445 | - $english = explode("\0", $value['msgid'], 2); |
|
1446 | - $entries = array_keys($value['msgstr']); |
|
1447 | - for ($i = 3; $i <= count($entries); $i++) { |
|
1448 | - $english[] = $english[1]; |
|
1449 | - } |
|
1450 | - $translation = array_map('_locale_import_append_plural', $value['msgstr'], $entries); |
|
1451 | - $english = array_map('_locale_import_append_plural', $english, $entries); |
|
1452 | - foreach ($translation as $key => $trans) { |
|
1453 | - if ($key == 0) { |
|
1454 | - $plid = 0; |
|
1455 | - } |
|
1456 | - $plid = _boinctranslate_locale_import_one_string_db($report, $lang, $english[$key], $trans, $group, $comments, $mode, $plid, $key); |
|
1439 | + else { |
|
1440 | + // Some real string to import. |
|
1441 | + $comments = _locale_import_shorten_comments(empty($value['#']) ? array() : $value['#']); |
|
1442 | + |
|
1443 | + if (strpos($value['msgid'], "\0")) { |
|
1444 | + // This string has plural versions. |
|
1445 | + $english = explode("\0", $value['msgid'], 2); |
|
1446 | + $entries = array_keys($value['msgstr']); |
|
1447 | + for ($i = 3; $i <= count($entries); $i++) { |
|
1448 | + $english[] = $english[1]; |
|
1449 | + } |
|
1450 | + $translation = array_map('_locale_import_append_plural', $value['msgstr'], $entries); |
|
1451 | + $english = array_map('_locale_import_append_plural', $english, $entries); |
|
1452 | + foreach ($translation as $key => $trans) { |
|
1453 | + if ($key == 0) { |
|
1454 | + $plid = 0; |
|
1457 | 1455 | } |
1456 | + $plid = _boinctranslate_locale_import_one_string_db($report, $lang, $english[$key], $trans, $group, $comments, $mode, $plid, $key); |
|
1458 | 1457 | } |
1458 | + } |
|
1459 | 1459 | |
1460 | - else { |
|
1461 | - // A simple string to import. |
|
1462 | - $english = $value['msgid']; |
|
1463 | - $translation = $value['msgstr']; |
|
1464 | - _boinctranslate_locale_import_one_string_db($report, $lang, $english, $translation, $group, $comments, $mode); |
|
1465 | - } |
|
1460 | + else { |
|
1461 | + // A simple string to import. |
|
1462 | + $english = $value['msgid']; |
|
1463 | + $translation = $value['msgstr']; |
|
1464 | + _boinctranslate_locale_import_one_string_db($report, $lang, $english, $translation, $group, $comments, $mode); |
|
1466 | 1465 | } |
1466 | + } |
|
1467 | 1467 | } // end of db-store operation |
1468 | 1468 | } |
1469 | 1469 |