Zusätzliche Link-Parameter für Menüeinträge "Allgemeine Inhalte"

This commit is contained in:
Jürgen Meyer
2026-08-27 15:03:45 +02:00
parent e8051bbcf6
commit a953ebf130
4 changed files with 22 additions and 1 deletions
@@ -30,6 +30,8 @@ COM_SPORTSMANAGER_LAYOUT_GENERAL_CONTENT_OPTION_DESCRIPTION="Beschreibung"
COM_SPORTSMANAGER_LAYOUT_GENERAL_CONTENT_OPTION_DESCRIPTION_DESC="Beschreibung, die unterhalb des Titels angezeigt wird (WICHTIG: Werden HTML-Tags verwendet, müssen auch Umlaute in HTML-Code angeben werden)"
COM_SPORTSMANAGER_LAYOUT_GENERAL_CONTENT_OPTION_CATEGORIES="Kategorien"
COM_SPORTSMANAGER_LAYOUT_GENERAL_CONTENT_OPTION_CATEGORIES_DESC="Eine optionale Auswahl von Kategorienummern durch Kommata oder Spiegelstrich getrennt"
COM_SPORTSMANAGER_LAYOUT_GENERAL_CONTENT_OPTION_EXTRA_PARAMS="Zusätzliche Parameter"
COM_SPORTSMANAGER_LAYOUT_GENERAL_CONTENT_OPTION_EXTRA_PARAMS_DESC="Optionale zusätzliche Parameter für den Link in der Form Name1=Wert1&Name2=Wert2, die bei Aufruf dieses Menüpunkts wie GET-Parameter zur Verfügung stehen"
COM_SPORTSMANAGER_LAYOUT_ELO_RANKING_TITLE="Layout: Elo-Rangliste"
COM_SPORTSMANAGER_LAYOUT_ELO_RANKING_DESC="Auflistung der Spieler sortiert nach Elo-Wertung"
COM_SPORTSMANAGER_LAYOUT_ELO_RANKING_OPTION_ELO_RANKING="Elo-Rangliste"
@@ -30,6 +30,8 @@ COM_SPORTSMANAGER_LAYOUT_GENERAL_CONTENT_OPTION_DESCRIPTION="Description"
COM_SPORTSMANAGER_LAYOUT_GENERAL_CONTENT_OPTION_DESCRIPTION_DESC="Description that will be shows below the titel (IMPORTANT: if html tags are used, special characters must be maskeraded)"
COM_SPORTSMANAGER_LAYOUT_GENERAL_CONTENT_OPTION_CATEGORIES="Categories"
COM_SPORTSMANAGER_LAYOUT_GENERAL_CONTENT_OPTION_CATEGORIES_DESC="An optional selection of category numbers seperated by commas or bullet point"
COM_SPORTSMANAGER_LAYOUT_GENERAL_CONTENT_OPTION_EXTRA_PARAMS="Additional parameters"
COM_SPORTSMANAGER_LAYOUT_GENERAL_CONTENT_OPTION_EXTRA_PARAMS_DESC="Optional additional parameters for the link in the form name1=value1&name2=value2, made available as GET parameters whenever this menu item is called"
COM_SPORTSMANAGER_LAYOUT_ELO_RANKING_TITLE="Layout: elo ranking"
COM_SPORTSMANAGER_LAYOUT_ELO_RANKING_DESC="Listing of players sorted by elo rating"
COM_SPORTSMANAGER_LAYOUT_ELO_RANKING_OPTION_ELO_RANKING="Elo ranking"
@@ -61,8 +61,20 @@ global $params;
$app = Factory::getContainer()->get(SiteApplication::class);
$jInput = $app->input;
$task = $jInput->getCmd('task');
$params = $app->getParams('com_sportsmanager');
// zusätzliche, im Menüpunkt hinterlegte Parameter (z.B. "test=test&foo=bar") wie GET-Parameter verfügbar machen;
// tatsächlich in der URL übergebene Werte haben weiterhin Vorrang (def() setzt nur, wenn noch nicht vorhanden);
// muss vor dem Auslesen von task/content erfolgen, damit diese die Zusatzparameter berücksichtigen
$zusatzparameter = trim((string) $params->get('zusatzparameter', ''));
if ($zusatzparameter !== '') {
parse_str($zusatzparameter, $zusatzparameterWerte);
foreach ($zusatzparameterWerte as $zusatzparameterName => $zusatzparameterWert) {
$jInput->def($zusatzparameterName, $zusatzparameterWert);
}
}
$task = $jInput->getCmd('task');
$content = isJson() && $jInput->getCmd('content', NULL) != NULL ? $jInput->getCmd('content') : $params->get('content');
if (berechnungen())
@@ -45,6 +45,11 @@
default=""
label="COM_SPORTSMANAGER_LAYOUT_GENERAL_CONTENT_OPTION_CATEGORIES"
description="COM_SPORTSMANAGER_LAYOUT_GENERAL_CONTENT_OPTION_CATEGORIES_DESC" />
<field name="zusatzparameter"
type="text"
default=""
label="COM_SPORTSMANAGER_LAYOUT_GENERAL_CONTENT_OPTION_EXTRA_PARAMS"
description="COM_SPORTSMANAGER_LAYOUT_GENERAL_CONTENT_OPTION_EXTRA_PARAMS_DESC" />
</fieldset>
</fields>
</metadata>