function test_display_councillor_correction_link() { $display_link = cobrand_display_councillor_correction_link(''); $this->assertEqual(true, $display_link, 'Should return true if no cobrand is set'); $display_link = cobrand_display_councillor_correction_link('mysite'); $this->assertEqual(false, $display_link, 'Should return the value of the cobrand display_councillor_correction_link function if one exists'); $display_link = cobrand_display_councillor_correction_link('nosite'); $this->assertEqual(true, $display_link, 'Should return true if the cobrand does not define a display_councillor_correction_link function'); }
$text .= 'one MEP'; $text .= ' dealing with constituent correspondence per area, so we only show '; if (count($meps_hidden)==1) $text .= 'them'; else $text .= 'that MEP'; $text .= ' above; you can contact the '; if (count($meps_hidden)==1) $text .= 'other'; else $text .= 'others'; $text .= ' here:</small></p>'; $text .= display_reps($va_type, $meps_hidden, $va_info, array('small' => true)); } global $va_council_child_types; if (in_array($va_type, $va_council_child_types) && cobrand_display_councillor_correction_link($cobrand)) { $text .= '<p style="font-size: 80%"><a href="corrections?id='.$va_specificid.'">Have you spotted a mistake in the above list?</a></p>'; } } if ($disabled) { if ($status == "boundary_changes" || $parent_status == "boundary_changes") { $text = "<p>There have been boundary changes at the last election that means we can't yet say who your representative is. We hope to get our boundary database updated as soon as we can.</p>"; } elseif ($status == "recent_election" || $parent_status == "recent_election") { $text = "<p>Due to the recent election, we don't yet have details for this representative. We'll be adding them as soon as we can.</p>"; } elseif ($status == "pending_election" || $parent_status == "pending_election") { $text = "<p>There's an upcoming election. We'll be adding your new representative as soon as we can after the election.</p>";
function display_reps_one_type($va_type, $va_area, $representatives, $rep_count, $meps_hidden) { global $representatives_info, $cobrand, $va_council_child_types; $text = ''; // a string of html containing the main rep names and links $col_after = ''; // a string of html containing extra links, like help and TWFY if ($rep_count > 1) { if ($va_type == 'EUR' && count($meps_hidden)) { $rep_count += count($meps_hidden); } } if ($rep_count > 1 && !skip_write_all()) { // $text .= '<p>' . write_all_link($va_type, $va_area['rep_name_plural']) . '</p>'; $col_after .= '<p>' . write_all_link($va_type, $va_area['rep_name_plural']) . '</p>'; } if ($va_type == 'WMC' && $rep_count > 0 && file_exists('mpphotos/' . $representatives[0] . '.jpg')) { $representatives_info[$representatives[0]]['image'] = "/mpphotos/" . $representatives[0] . ".jpg"; } $text .= display_reps($va_type, $representatives, $va_area, array()); if ($va_type == 'WMC') { $col_after .= extra_mp_text($rep_count, $va_area, $representatives); } elseif ($va_type == 'EUR' && count($meps_hidden)) { $col_after .= hidden_meps_list($meps_hidden, $va_type, $va_area); } if (in_array($va_type, $va_council_child_types) && cobrand_display_councillor_correction_link($cobrand)) { // $text .= '<p><small><a href="corrections?id='.$va_area['id'].'">Correct a mistake in this list</a></small></p>'; $col_after .= '<p><a href="corrections?id=' . $va_area['id'] . '">Correct a mistake in this list</a></p>'; } return array($text, $col_after); }