Skip to content

Commit

Permalink
#554: Limit number of events on start page
Browse files Browse the repository at this point in the history
  • Loading branch information
mattimaier committed Feb 1, 2025
1 parent 783afc6 commit bd5a180
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion BNote/lang/lang_de.php
Original file line number Diff line number Diff line change
Expand Up @@ -932,7 +932,7 @@ class Translation extends BNoteTranslation {
"KonfigurationData_construct.rehearsal_show_length" => "Probenlänge anzeigen",
"KonfigurationData_construct.allow_participation_maybe" => "Vielleicht-Teilname zugelassen",
"KonfigurationData_construct.allow_zip_download" => "Zip-Download für Ordner zulassen",
"KonfigurationData_construct.appointments_show_max" => "Anzahl der Ernennungen auf Startseite",
"KonfigurationData_construct.appointments_show_max" => "Anzahl der Termine auf Startseite",
"KonfigurationData_construct.rehearsal_show_max" => "Anzahl Proben auf Startseite",
"KonfigurationData_construct.discussion_on" => "Diskussionen erlauben",
"KonfigurationData_construct.updates_show_max" => "Anzahl Updates auf Startseite",
Expand Down
17 changes: 15 additions & 2 deletions BNote/src/data/modules/startdata.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,10 @@ function getUsersRehearsals($uid = -1) {
array_push($result, $row);
}
}

$maxLen = intval($this->getSysdata()->getDynamicConfigParameter("rehearsal_show_max"));
if($maxLen > 0) {
return array_slice($result, 0, $maxLen+1);
}
return $result;
}

Expand Down Expand Up @@ -254,7 +257,12 @@ private function getRehearsalsForPhases($phases) {

function getUsersConcerts($uid = -1) {
if($uid == -1) $uid = $this->getUserId();
return $this->adp()->getFutureConcerts($uid);
$concerts = $this->adp()->getFutureConcerts($uid);
$maxLen = intval($this->getSysdata()->getDynamicConfigParameter("concert_show_max"));
if($maxLen > 0) {
return array_slice($concerts, 0, $maxLen+1);
}
return $concerts;
}

function getProgramTitles($pid) {
Expand Down Expand Up @@ -447,6 +455,11 @@ function getAppointments($withCustomData = true) {
$this->appendCustomDataToSelection('a', $appointments);
}

$maxLen = intval($this->getSysdata()->getDynamicConfigParameter("appointments_show_max"));
if($maxLen > 0) {
return array_slice($appointments, 0, $maxLen+1);
}

return $appointments;
}

Expand Down

0 comments on commit bd5a180

Please sign in to comment.