|
6 | 6 | <?php |
7 | 7 | // Include the common simple search form |
8 | 8 | include __DIR__ . '/simplesearchform.php'; |
| 9 | + |
9 | 10 | ?> |
10 | | -<p>Click on each checkbox below to show/hide the corresponding column.</p> |
11 | | -<fieldset id="grpChkBox"> |
12 | | - <legend>Locales</legend> |
13 | | - <?php foreach ($all_locales as $locale) : ?> |
14 | | - <label><input type="checkbox" name="<?=$locale?>" /> <?=$locale?></label> |
15 | | - <?php endforeach ?> |
16 | | -</fieldset> |
17 | | -<table class="collapsable results_table sortable" id="words"> |
| 11 | +<table class='collapsable results_table sortable'> |
18 | 12 | <thead> |
19 | | - <tr class="column_headers"> |
20 | | - <th>Word</th> |
21 | | - <?php foreach ($all_locales as $locale) : ?> |
22 | | - <th class="<?=$locale?> hide"><?=$locale?></th> |
23 | | - <?php endforeach ?> |
24 | | - </tr> |
25 | | - </thead> |
26 | | - <tbody> |
27 | | -<?php foreach ($unlocalized_words as $english_term => $locales) : ?> |
28 | | - <tr><td><?=$english_term?></td><?php |
29 | | - foreach ($all_locales as $locale) { |
30 | | - $count = 0; |
31 | | - if (in_array($locale, array_keys($locales))) { |
32 | | - $count = $locales[$locale]; |
33 | | - } |
| 13 | + <tr class='column_headers'> |
| 14 | + <th>English</th> |
| 15 | + <th>Occurrences</th> |
| 16 | + </tr> |
| 17 | + </thead> |
| 18 | + <tbody> |
34 | 19 |
|
35 | | - $link = "/?recherche={$english_term}&repo={$repo}&sourcelocale={$locale}" . |
36 | | - "&locale={$ref_locale}&search_type=strings&whole_word=whole_word"; |
| 20 | +<?php foreach ($unlocalized_words as $english_term => $locales) : |
| 21 | + $string_count = $locales[$all_locales[0]]; |
| 22 | + $link = "/?recherche={$english_term}&repo={$repo}&sourcelocale={$locale}" . |
| 23 | + "&locale={$ref_locale}&search_type=strings&whole_word=whole_word"; |
37 | 24 |
|
38 | | - if ($count > 0) { |
39 | | - print "<td><a href='{$link}'>{$count}</a></td>"; |
40 | | - } else { |
41 | | - print "<td></td>"; |
42 | | - } |
43 | | - } |
44 | | - ?></tr> |
45 | | -<?php endforeach ?> |
| 25 | + $link_title = $string_count == 1 |
| 26 | + ? 'Search for this occurrence' |
| 27 | + : 'Search for these occurrences'; |
| 28 | +?> |
| 29 | + <tr> |
| 30 | + <td><a href='<?=$link?>' title='<?=$link_title?>'><?=$english_term?></a></td> |
| 31 | + <td><?=$string_count?></td> |
| 32 | + </tr> |
| 33 | +<?php endforeach; ?> |
46 | 34 | </tbody> |
47 | 35 | </table> |
48 | | -<?php unset($unlocalized_words);?> |
| 36 | + |
| 37 | +<?php |
| 38 | +unset($unlocalized_words); |
0 commit comments