chore: add return types to methods

This commit is contained in:
Marvin Flock
2025-08-28 20:01:58 +02:00
parent 1aa9b924d7
commit f27b87a0d8
@@ -14,7 +14,8 @@ require_once JPATH_SITE . '/components/com_sportsmanager/util/image.php';
class HTML_sportsmanager_admin class HTML_sportsmanager_admin
{ {
static function formatTimediff( $timestamp1, $timestamp2, $verbose ) { static function formatTimediff( $timestamp1, $timestamp2, $verbose ): string
{
if (empty($timestamp1) || empty($timestamp2)) { if (empty($timestamp1) || empty($timestamp2)) {
return ""; return "";
} else { } else {
@@ -29,16 +30,17 @@ class HTML_sportsmanager_admin
} }
} }
static function formatTeamName( $team_name, $team_id, $highlight_team_id ) { static function formatTeamName( $team_name, $team_id, $highlight_team_id ): string
{
if ($team_id == $highlight_team_id) { if ($team_id == $highlight_team_id) {
return "<b><i>" . htmlentities_utf8($team_name) . "</i></b>"; return "<b><i>" . htmlentities_utf8($team_name) . "</i></b>";
} else { } else {
return htmlentities_utf8($team_name); return htmlentities_utf8($team_name);
} }
} }
static function checkZeilenumbruch($Spalte_Nr, $max_Spalten) static function checkZeilenumbruch($Spalte_Nr, $max_Spalten): int
{ {
$Spalte_Nr++; $Spalte_Nr++;
if ($Spalte_Nr >= $max_Spalten){ if ($Spalte_Nr >= $max_Spalten){
echo "</tr>\n<tr>\n"; echo "</tr>\n<tr>\n";
@@ -46,10 +48,10 @@ class HTML_sportsmanager_admin
} }
return $Spalte_Nr; return $Spalte_Nr;
} }
static function adminUebersicht($veranstaltungen, $spielerstatistiken, $turniere, $ranglisten, $individualwettbewerbe, $statistik, $saisons, $filter_saison_id, $externe_datenbank): void static function adminUebersicht($veranstaltungen, $spielerstatistiken, $turniere, $ranglisten, $individualwettbewerbe, $statistik, $saisons, $filter_saison_id, $externe_datenbank): void
{ {
global $params; global $params;
?> ?>
<div class="componentheading<?php echo $params->get('pageclass_sfx'); ?>" style='font-weight: bold;'> <div class="componentheading<?php echo $params->get('pageclass_sfx'); ?>" style='font-weight: bold;'>
@@ -606,7 +608,7 @@ class HTML_sportsmanager_admin
static function adminEinstellungen($einstellungen): void static function adminEinstellungen($einstellungen): void
{ {
global $params; global $params;
?> ?>
<style> <style>
@@ -4948,7 +4950,7 @@ class HTML_sportsmanager_admin
static function adminKategorien($kategorien): void static function adminKategorien($kategorien): void
{ {
global $params; global $params;
?> ?>
<div <div
class="componentheading<?php echo $params->get('pageclass_sfx'); ?>"><?php echo Text::_('COM_SPORTSMANAGER_CATEGORIES'); ?></div> class="componentheading<?php echo $params->get('pageclass_sfx'); ?>"><?php echo Text::_('COM_SPORTSMANAGER_CATEGORIES'); ?></div>
@@ -7436,7 +7438,7 @@ class HTML_sportsmanager_admin
<input type="hidden" name="task" value="admin_veranstaltung_save"/> <input type="hidden" name="task" value="admin_veranstaltung_save"/>
<input type="hidden" name="id" value="<?php echo($row != null ? $row->veranstaltung_id : "0"); ?>"/> <input type="hidden" name="id" value="<?php echo($row != null ? $row->veranstaltung_id : "0"); ?>"/>
</form> </form>
<script> <script>
// Auswahlfeld Direkter Vergleich in Abhaengigkeit von Tabellenwertung anzeigen // Auswahlfeld Direkter Vergleich in Abhaengigkeit von Tabellenwertung anzeigen
const dropdown = document.getElementById("table_evaluation"); const dropdown = document.getElementById("table_evaluation");
@@ -7595,7 +7597,7 @@ class HTML_sportsmanager_admin
:</label> :</label>
</td> </td>
<td nowrap> <td nowrap>
<input class="uk-select uk-form-width-medium" type="text" name="teamname" id="team_name" <input class="uk-select uk-form-width-medium" type="text" name="teamname" id="team_name"
size="50" maxlength="50" style="height: 34px; width: 370px;" size="50" maxlength="50" style="height: 34px; width: 370px;"
value="<?php if ($row != null) echo htmlentities_utf8($row->teamname); ?>"/> value="<?php if ($row != null) echo htmlentities_utf8($row->teamname); ?>"/>
</td> </td>
@@ -7606,7 +7608,7 @@ class HTML_sportsmanager_admin
:</label> :</label>
</td> </td>
<td nowrap> <td nowrap>
<input class="uk-select uk-form-width-medium" type="text" name="teamname_kurz" id="team_name_kurz" <input class="uk-select uk-form-width-medium" type="text" name="teamname_kurz" id="team_name_kurz"
size="50" maxlength="24" style="height: 34px; width: 370px;" size="50" maxlength="24" style="height: 34px; width: 370px;"
value="<?php if ($row != null) echo htmlentities_utf8($row->teamname_kurz); ?>"/> value="<?php if ($row != null) echo htmlentities_utf8($row->teamname_kurz); ?>"/>
</td> </td>
@@ -7673,7 +7675,7 @@ class HTML_sportsmanager_admin
:</label> :</label>
</td> </td>
<td nowrap> <td nowrap>
<input class="uk-select uk-form-width-medium" type="text" name="tischeigenschaften" id="table_characteristics" <input class="uk-select uk-form-width-medium" type="text" name="tischeigenschaften" id="table_characteristics"
size="24" maxlength="50" style="height: 34px; width: 370px;" size="24" maxlength="50" style="height: 34px; width: 370px;"
value="<?php if ($row != null) echo htmlentities_utf8($row->tischeigenschaften); ?>"/> value="<?php if ($row != null) echo htmlentities_utf8($row->tischeigenschaften); ?>"/>
</td> </td>
@@ -8686,7 +8688,7 @@ class HTML_sportsmanager_admin
<?php echo Text::_('COM_SPORTSMANAGER_ENCOUNTERS'); ?> <?php echo Text::_('COM_SPORTSMANAGER_ENCOUNTERS'); ?>
'<?php echo htmlentities_utf8($veranstaltung->bezeichnung); ?> '<?php echo htmlentities_utf8($veranstaltung->bezeichnung); ?>
': <?php echo Text::_('COM_SPORTSMANAGER_JOOMLA_MANAGEMENT'); ?></div> ': <?php echo Text::_('COM_SPORTSMANAGER_JOOMLA_MANAGEMENT'); ?></div>
<table style="border-spacing: 10px; width: 100%;"> <table style="border-spacing: 10px; width: 100%;">
<tr> <tr>
<td colspan="3" nowrap> <td colspan="3" nowrap>
@@ -8697,7 +8699,7 @@ class HTML_sportsmanager_admin
<a href="<?php echo SportsManagerURL('&task=admin_begegnung_edit&veranstaltungid=' . $veranstaltung->veranstaltung_id); ?>"><?php echo Text::_('COM_SPORTSMANAGER_ADD_MEETING'); ?></a> <a href="<?php echo SportsManagerURL('&task=admin_begegnung_edit&veranstaltungid=' . $veranstaltung->veranstaltung_id); ?>"><?php echo Text::_('COM_SPORTSMANAGER_ADD_MEETING'); ?></a>
</td> </td>
<?php $Spalte_Nr = self::checkZeilenumbruch($Spalte_Nr, $max_Spalten); ?> <?php $Spalte_Nr = self::checkZeilenumbruch($Spalte_Nr, $max_Spalten); ?>
<?php if ($veranstaltung->tabellenwertung == -3 || $veranstaltung->tabellenwertung == -4){ ?> <?php if ($veranstaltung->tabellenwertung == -3 || $veranstaltung->tabellenwertung == -4){ ?>
<td nowrap> <td nowrap>
<a href="<?php echo SportsManagerURL('&task=admin_begegnungen_pokalrunde_auslosen_form&veranstaltungid=' . $veranstaltung->veranstaltung_id); ?>"><?php echo Text::_('COM_SPORTSMANAGER_CUP_ROUND_GENERATION'); ?></a> <a href="<?php echo SportsManagerURL('&task=admin_begegnungen_pokalrunde_auslosen_form&veranstaltungid=' . $veranstaltung->veranstaltung_id); ?>"><?php echo Text::_('COM_SPORTSMANAGER_CUP_ROUND_GENERATION'); ?></a>
</td> </td>
@@ -8806,11 +8808,11 @@ class HTML_sportsmanager_admin
<td nowrap <td nowrap
style="text-align: center"><?php if ($ergebnis_vorhanden) echo $row->heim_spielpunkte . " : " . $row->gast_spielpunkte; else echo "_ : _" ?><?php if ($row->unbestaetigtes_ergebnis_id != null) echo "<br /><small>" . ($row->zwischenergebnis ? "live" : "unbest&auml;tigt") . "</small>"; ?></td> style="text-align: center"><?php if ($ergebnis_vorhanden) echo $row->heim_spielpunkte . " : " . $row->gast_spielpunkte; else echo "_ : _" ?><?php if ($row->unbestaetigtes_ergebnis_id != null) echo "<br /><small>" . ($row->zwischenergebnis ? "live" : "unbest&auml;tigt") . "</small>"; ?></td>
<td nowrap align="center"> <td nowrap align="center">
<?php echo <?php echo
self::formatTimediff($row->termin_spiel, $row->ergebnis_vorgeschlagen, false) self::formatTimediff($row->termin_spiel, $row->ergebnis_vorgeschlagen, false)
. " / " . " / "
. self::formatTimediff($row->ergebnis_vorgeschlagen, $row->ergebnis_akzeptiert, false); . self::formatTimediff($row->ergebnis_vorgeschlagen, $row->ergebnis_akzeptiert, false);
?> ?>
</td> </td>
<td nowrap><small><a <td nowrap><small><a
href="<?php echo SportsManagerURL('&task=admin_begegnung_heimtausch&veranstaltungid=' . $veranstaltung->veranstaltung_id . '&id=' . $row->begegnung_id); ?>"><?php echo Text::_('COM_SPORTSMANAGER_HOME_EXCHANGE'); ?></a></small> href="<?php echo SportsManagerURL('&task=admin_begegnung_heimtausch&veranstaltungid=' . $veranstaltung->veranstaltung_id . '&id=' . $row->begegnung_id); ?>"><?php echo Text::_('COM_SPORTSMANAGER_HOME_EXCHANGE'); ?></a></small>
@@ -9880,7 +9882,7 @@ class HTML_sportsmanager_admin
<?php <?php
} }
static function adminBegegnungenImportieren($veranstaltung): void static function adminBegegnungenImportieren($veranstaltung): void
{ {
global $params; global $params;
@@ -10175,7 +10177,7 @@ class HTML_sportsmanager_admin
global $params; global $params;
$sperren = false; $sperren = false;
$Fehlertext = ""; $Fehlertext = "";
if ($veranstaltung->tabellenwertung == -3) if ($veranstaltung->tabellenwertung == -3)
$task = "admin_begegnungen_pokalrunde_auslosen"; $task = "admin_begegnungen_pokalrunde_auslosen";
if ($veranstaltung->tabellenwertung == -4) if ($veranstaltung->tabellenwertung == -4)
@@ -10307,7 +10309,7 @@ class HTML_sportsmanager_admin
: :
</td> </td>
<td nowrap> <td nowrap>
<input class="uk-select uk-form-width-xsmall" style="height: 34px; text-align: left;" <input class="uk-select uk-form-width-xsmall" style="height: 34px; text-align: left;"
name="runde" type="text" readonly value="<?php echo $veranstaltung->naechsteRunde; ?>"/> name="runde" type="text" readonly value="<?php echo $veranstaltung->naechsteRunde; ?>"/>
</td> </td>
</tr> </tr>
@@ -10317,8 +10319,8 @@ class HTML_sportsmanager_admin
: :
</td> </td>
<td nowrap> <td nowrap>
<input list="auswahl_rundentitel" class="uk-select uk-form-width-large" <input list="auswahl_rundentitel" class="uk-select uk-form-width-large"
style="height: 34px; text-align: left;" type="text" name="rundentitel" size="32" maxlength="32" style="height: 34px; text-align: left;" type="text" name="rundentitel" size="32" maxlength="32"
value="<?php echo $veranstaltung->titelVorschlag; ?>"/> value="<?php echo $veranstaltung->titelVorschlag; ?>"/>
<datalist id="auswahl_rundentitel" > <datalist id="auswahl_rundentitel" >
<?php if ($auswahl_rundentitel){ ?> <?php if ($auswahl_rundentitel){ ?>
@@ -10352,7 +10354,7 @@ class HTML_sportsmanager_admin
</tr> </tr>
</table> </table>
</div> </div>
<?php if (!$sperren){ ?> <?php if (!$sperren){ ?>
<input type="submit" name="save" value="<?php echo Text::_('COM_SPORTSMANAGER_SAVE'); ?>" class="button"/> <input type="submit" name="save" value="<?php echo Text::_('COM_SPORTSMANAGER_SAVE'); ?>" class="button"/>
<?php } ?> <?php } ?>
@@ -10362,7 +10364,7 @@ class HTML_sportsmanager_admin
</form> </form>
<?php <?php
if ($sperren == true) if ($sperren == true)
echo "<span style='display: inline-block; height: 30px; background: red; color: white;vertical-align: middle;'> echo "<span style='display: inline-block; height: 30px; background: red; color: white;vertical-align: middle;'>
$Fehlertext</span>\n"; $Fehlertext</span>\n";
} }