diff --git a/application/controllers/Widgets.php b/application/controllers/Widgets.php index 868defa4f..e9984816b 100644 --- a/application/controllers/Widgets.php +++ b/application/controllers/Widgets.php @@ -48,7 +48,8 @@ class Widgets extends CI_Controller { // Embeddable "on air" status widget - pass a callsign to get current radio/satellite status. // Embed via: - public function on_air($callsign = null) { + // Optionally override the displayed callsign: + public function on_air($callsign = null, $display_callsign = null) { if ($callsign == null) { show_error('Please provide a callsign. Usage: widgets/on_air/YOURCALL'); } @@ -64,14 +65,17 @@ class Widgets extends CI_Controller { $this->load->model('cat'); $data['radio_status'] = $this->cat->recent_status_by_user_id($user->user_id); - $data['callsign'] = strtoupper($this->security->xss_clean($callsign)); + $data['callsign'] = strtoupper($this->security->xss_clean( + $display_callsign !== null ? $display_callsign : $callsign + )); $this->load->view('widgets/on_air', $data); } // Embeddable "on air" status badge as an SVG image. // Embed via: M0ABC on air status - public function on_air_image($callsign = null) { + // Optionally override the displayed callsign: + public function on_air_image($callsign = null, $display_callsign = null) { if ($callsign == null) { show_error('Please provide a callsign. Usage: widgets/on_air_image/YOURCALL'); } @@ -84,7 +88,9 @@ class Widgets extends CI_Controller { } $user = $user_result->row(); - $callsign = strtoupper($this->security->xss_clean($callsign)); + $callsign = strtoupper($this->security->xss_clean( + $display_callsign !== null ? $display_callsign : $callsign + )); $this->load->model('cat'); $radio_status = $this->cat->recent_status_by_user_id($user->user_id);