@@ -21,12 +21,12 @@ |
||
| 21 | 21 | <p>It seems we already have <?= ngettext('a definition', 'some definitions', $glossary->num_search_matches) ?> for that. Would you care to see <?= ngettext('it', 'them', $glossary->num_search_matches) ?>?</p> |
| 22 | 22 | <ul class="glossary"> |
| 23 | 23 | <?php |
| 24 | - foreach ($glossary->search_matches as $match) { |
|
| 25 | - $URL = new \MySociety\TheyWorkForYou\Url('glossary'); |
|
| 26 | - $URL->insert(['gl' => $match['glossary_id']]); |
|
| 27 | - $URL->remove(['g']); |
|
| 28 | - $term_link = $URL->generate('url'); |
|
| 29 | - ?> |
|
| 24 | + foreach ($glossary->search_matches as $match) { |
|
| 25 | + $URL = new \MySociety\TheyWorkForYou\Url('glossary'); |
|
| 26 | + $URL->insert(['gl' => $match['glossary_id']]); |
|
| 27 | + $URL->remove(['g']); |
|
| 28 | + $term_link = $URL->generate('url'); |
|
| 29 | + ?> |
|
| 30 | 30 | <li> |
| 31 | 31 | <a href="<?= $term_link ?>"><?= $match['title']?></a> |
| 32 | 32 | </li> |
@@ -1,16 +1,16 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | include_once '../../includes/easyparliament/init.php'; |
| 4 | -include_once INCLUDESPATH."easyparliament/glossary.php"; |
|
| 5 | -include_once INCLUDESPATH."easyparliament/glossarylist.php"; |
|
| 4 | +include_once INCLUDESPATH . "easyparliament/glossary.php"; |
|
| 5 | +include_once INCLUDESPATH . "easyparliament/glossarylist.php"; |
|
| 6 | 6 | |
| 7 | 7 | $this_page = "glossary_addlink"; |
| 8 | 8 | |
| 9 | -$args = array( 'action' => $this_page); |
|
| 9 | +$args = array('action' => $this_page); |
|
| 10 | 10 | |
| 11 | 11 | // First things first... |
| 12 | 12 | |
| 13 | -if ((get_http_var('g') != '') && (get_http_var('previewterm') == '') ) { |
|
| 13 | +if ((get_http_var('g') != '') && (get_http_var('previewterm') == '')) { |
|
| 14 | 14 | // We're searching for something. |
| 15 | 15 | $args['s'] = filter_user_input(get_http_var('g'), 'strict'); |
| 16 | 16 | $GLOSSARY = new GLOSSARY($args); |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | |
| 26 | 26 | $PAGE->stripe_start(); |
| 27 | 27 | |
| 28 | -$data = array ( |
|
| 28 | +$data = array( |
|
| 29 | 29 | 'title' => get_http_var('g'), |
| 30 | 30 | 'body' => get_http_var('definition') |
| 31 | 31 | ); |
@@ -115,8 +115,8 @@ discard block |
||
| 115 | 115 | |
| 116 | 116 | $PAGE->glossary_atoz($GLOSSARY); |
| 117 | 117 | |
| 118 | - $PAGE->stripe_end(array ( |
|
| 119 | - array ( |
|
| 118 | + $PAGE->stripe_end(array( |
|
| 119 | + array( |
|
| 120 | 120 | 'type' => 'include', |
| 121 | 121 | 'content' => 'glossary_add' |
| 122 | 122 | ) |
@@ -14,8 +14,7 @@ discard block |
||
| 14 | 14 | // We're searching for something. |
| 15 | 15 | $args['s'] = filter_user_input(get_http_var('g'), 'strict'); |
| 16 | 16 | $GLOSSARY = new GLOSSARY($args); |
| 17 | -} |
|
| 18 | -else { |
|
| 17 | +} else { |
|
| 19 | 18 | $args['sort'] = "regexp_replace"; |
| 20 | 19 | $GLOSSARY = new GLOSSARY($args); |
| 21 | 20 | $args['s'] = filter_user_input(get_http_var('g'), 'strict'); |
@@ -86,13 +85,11 @@ discard block |
||
| 86 | 85 | if ($args['count']) { |
| 87 | 86 | // Display the Add definition form |
| 88 | 87 | $PAGE->glossary_add_link_form($args); |
| 89 | - } |
|
| 90 | - else { |
|
| 88 | + } else { |
|
| 91 | 89 | print "<h4>No dice!</h4><p>Much as we'd love you to add a definition for <strong></strong>, it doesn't seem to appear in hansard at all...</p>"; |
| 92 | 90 | $PAGE->glossary_links(); |
| 93 | 91 | } |
| 94 | - } |
|
| 95 | - else { |
|
| 92 | + } else { |
|
| 96 | 93 | print "<h4>Humdinger!</h4><p>it would appear that you aren't allowed to add glossary terms. How odd...</p>"; |
| 97 | 94 | $PAGE->glossary_links(); |
| 98 | 95 | } |