Extract recent QSO count in QSO widget to a constant

This commit is contained in:
Filip Melík
2025-01-09 07:43:26 +01:00
parent 7bffac1a60
commit 9b55aab3e2

View File

@@ -8,13 +8,15 @@
class Widgets extends CI_Controller {
const LAST_QSOS_COUNT = 15; // number of of qsos to be displayed in the last qsos widget
public function index()
{
// Show a help page
}
// Can be used to embed last 11 QSOs in a iframe or javascript include.
// Can be used to embed last self::LAST_QSOS_COUNT QSOs in a iframe or javascript include.
public function qsos($logbook_slug = null) {
if($logbook_slug == null) {
@@ -40,7 +42,10 @@ class Widgets extends CI_Controller {
show_404(__("Unknown Public Page."));
}
$data['last_qsos_list'] = $this->logbook_model->get_last_qsos(15, $logbooks_locations_array);
$data['last_qsos_list'] = $this->logbook_model->get_last_qsos(
self::LAST_QSOS_COUNT,
$logbooks_locations_array,
);
$this->load->view('widgets/qsos', $data);
}