fix: resolve merge conflicts of joomla_6 branch

This commit is contained in:
Marvin Flock
2025-04-21 22:07:45 +02:00
32 changed files with 50820 additions and 52055 deletions
+8
View File
@@ -32,3 +32,11 @@ Deployment can only be done manually right now (sad)
To do this go to To do this go to
[Testserver Extension Installer Site](http://localhost:8080/administrator/index.php?option=com_installer&view=install) [Testserver Extension Installer Site](http://localhost:8080/administrator/index.php?option=com_installer&view=install)
and upload the zip file found in `./package/packages` and upload the zip file found in `./package/packages`
### Development Tools
If you are using Intellij, there is a plugin named Joomla! which helps with resolving
joomla specific database prefixes like #__
To set it up, insert into the configuration popup which follows after you enable the framework support:
Joomla install path: `./data/joomla_data`
JConfig: `./data/joomla_data/configuration.php`
+4
View File
@@ -71,6 +71,10 @@ export const config = {
src: './releasefiles/administrator/language/**/**', src: './releasefiles/administrator/language/**/**',
dest: 'sourcefiles/com_sportsmanager/admin/language' dest: 'sourcefiles/com_sportsmanager/admin/language'
}, },
{
src: './releasefiles/administrator/services/**/**',
dest: 'sourcefiles/com_sportsmanager/admin/services'
},
{ {
src: './releasefiles/sportsmanager.xml', src: './releasefiles/sportsmanager.xml',
dest: 'sourcefiles/com_sportsmanager/' dest: 'sourcefiles/com_sportsmanager/'
@@ -1,23 +0,0 @@
<?php
// no direct access
defined('_JEXEC') or die('Restricted access');
// Require the base controller
require_once (JPATH_COMPONENT.DS.'controller.php');
// Require specific controller if requested
//if($controller = JRequest::getVar('controller')) {
// require_once (JPATH_COMPONENT.DS.'controllers'.DS.$controller.'.php');
//}
// Create the controller
//$classname = 'AutosController'.$controller;
//$controller = new $classname( );
// Perform the Request task
//$controller->execute( JRequest::getVar('task'));
// Redirect if set by the controller
//$controller->redirect();
?>
@@ -1,31 +0,0 @@
<?php
/*
* Sports Manager (C) 2006-2020, Sven Nickel
*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla controller library
jimport('joomla.application.component.controller');
/**
* General Controller of SportsManager component
*/
class SportsManagerController extends JControllerLegacy
{
/**
* display task
*
* @return void
*/
function display($cachable = false, $urlparams = false)
{
// set default view if not set
$input = JFactory::getApplication()->input;
$input->set('view', $input->getCmd('view', 'SportsManager'));
// call parent behavior
parent::display($cachable);
}
}
@@ -0,0 +1,61 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_inlinecontact
*
* @copyright (C) Alexander Niklaus. All rights reserved.
* @license GNU General Public License version 2 or later
* @link https://an-software.net
*/
defined('_JEXEC') or die;
use Dtfb\Component\com_sportsmanager\Administrator\Extension\SportsmanagerComponent;
use Joomla\CMS\Dispatcher\ComponentDispatcherFactoryInterface;
use Joomla\CMS\Extension\ComponentInterface;
use Joomla\CMS\Extension\Service\Provider\ComponentDispatcherFactory;
use Joomla\CMS\Extension\Service\Provider\MVCFactory;
use Joomla\CMS\Log\Log;
use Joomla\CMS\MVC\Factory\MVCFactoryInterface;
use Joomla\DI\Container;
use Joomla\DI\ServiceProviderInterface;
/**
* The contact service provider.
*
* @since 1.0.0
*/
return new class implements ServiceProviderInterface {
/**
* Registers the service provider with a DI container.
*
* @param Container $container The DI container.
*
* @return void
*
* @since 1.0.0
*/
public function register(Container $container): void
{
Log::addLogger(
[
'text_file' => 'com_sportsmanager.php',
],
Log::ALL,
['com_sportsmanager']
);
$container->registerServiceProvider(new MVCFactory('\\Dtfb\\Component\\com_sportsmanager'));
$container->registerServiceProvider(new ComponentDispatcherFactory('\\Dtfb\\Component\\com_sportsmanager'));
$container->set(
ComponentInterface::class,
function (Container $container) {
$component = new SportsmanagerComponent($container->get(ComponentDispatcherFactoryInterface::class));
$component->setMVCFactory($container->get(MVCFactoryInterface::class));
return $component;
}
);
}
};
@@ -1,19 +0,0 @@
<?php
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import joomla controller library
jimport('joomla.application.component.controller');
// Get an instance of the controller prefixed by HelloWorld
$controller = JControllerLegacy::getInstance('SportsManager');
// Get the task
$jinput = JFactory::getApplication()->input;
$task = $jinput->get('task', "", 'STR' );
// Perform the Request task
$controller->execute($task);
// Redirect if set by the controller
$controller->redirect();
@@ -0,0 +1,20 @@
<?php
/*
* Sports Manager (C) 2006-2020, Sven Nickel
*/
namespace Dtfb\Component\com_sportsmanager\Administrator\Controller;
// No direct access to this file
use Joomla\CMS\MVC\Controller\BaseController;
defined('_JEXEC') or die('Restricted access');
/**
* General Controller of SportsManager component
* @since 1.0.0
*/
class DisplayController extends BaseController
{
protected $default_view = 'sportsmanager';
}
@@ -0,0 +1,15 @@
<?php
namespace Dtfb\Component\com_sportsmanager\Administrator\Extension;
defined('JPATH_PLATFORM') or die;
use Joomla\CMS\Extension\MVCComponent;
use function defined;
/**
* Component class for com_sportsmanager
*
* @since 2.0.0
*/
class SportsmanagerComponent extends MVCComponent {}
@@ -0,0 +1,32 @@
<?php
/*
* Sports Manager (C) 2006-2020, Sven Nickel
*/
namespace Dtfb\Component\com_sportsmanager\Administrator\View\Sportsmanager;
// No direct access to this file
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
use Joomla\CMS\Toolbar\ToolbarHelper;
defined('_JEXEC') or die('Restricted access');
/**
* SportsManager View
* @since 1.0.0
*/
class HtmlView extends BaseHtmlView
{
function display($tpl = null): void
{
ToolbarHelper::title(Text::_('COM_SPORTSMANAGER'));
?>
<h2><?php echo Text::_('COM_SPORTSMANAGER'); ?> Copyright &copy; 2006 &#8211; 2014 Sven Nickel</h2>
<?php
// Display the template
parent::display($tpl);
}
}
@@ -1 +0,0 @@
<html><body bgcolor="#FFFFFF"></body></html>
@@ -1 +0,0 @@
<html><body bgcolor="#FFFFFF"></body></html>
@@ -1 +0,0 @@
<html><body bgcolor="#FFFFFF"></body></html>
@@ -1,34 +0,0 @@
<?php
/*
* Sports Manager (C) 2006-2020, Sven Nickel
*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
// import Joomla view library
jimport('joomla.application.component.view');
/**
* SportsManager View
*/
class SportsManagerViewSportsManager extends JViewLegacy
{
/**
* SportsManager view display method
* @return void
*/
function display($tpl = null)
{
JToolbarHelper::title(JText::_('COM_SPORTSMANAGER'));
?>
<h3><?php echo JText::_('COM_SPORTSMANAGER'); ?> &#8211; Created by Sven Nickel | Maintained by DTFB</h3>
<?php
// Display the template
parent::display($tpl);
}
}
File diff suppressed because it is too large Load Diff
+214 -179
View File
@@ -2,84 +2,98 @@
/* /*
* Sports Manager API Extension * Sports Manager API Extension
*/ */
use JetBrains\PhpStorm\NoReturn;
use Joomla\CMS\Application\SiteApplication;
use Joomla\CMS\Factory;
use Joomla\CMS\User\UserFactory;
use Joomla\Input\Input;
use Joomla\Registry\Registry;
defined("_JEXEC") or die(); defined("_JEXEC") or die();
//$secret = JFactory::$config['secret']; require_once JPATH_SITE . '/components/com_sportsmanager/database/init.php';
$secret = \Joomla\CMS\Factory::getConfig(); Factory::getContainer()->set(Registry::class, function () {
return new Registry();
});
$secret = $secret->get("secret"); $secret = Factory::getContainer()->get(Registry::class)->get("secret");
function abortWithError($error) #[NoReturn] function abortWithError($error): void
{ {
if (isJson()) { if (isJson()) {
header("content-type: application/json"); header("content-type: application/json");
die(json_encode(["error" => $error])); die(json_encode(["error" => $error]));
} else { } else {
die($error); die($error);
} }
} }
function isJson() { function isJson(): bool
$jinput = JFactory::getApplication()->input; {
$jInput = Factory::getContainer()->get(SiteApplication::class)->getInput();
return $jinput->get('format') === 'json'; return $jInput->get('format') === 'json';
} }
function notifyChange($data) { function notifyChange($data): void
{
try { try {
$db = &getDatabase(); $db = getDatabase();
$query = "SELECT wert from #__sportsmanager_einstellungen WHERE name='api_push_key'"; $query = "SELECT wert from #__sportsmanager_einstellungen WHERE name='api_push_key'";
$db->setQuery($query); $db->setQuery($query);
$push_key = $db->loadResult(); $push_key = $db->loadResult();
$push_server = !empty($push_key) && isset(_payload($push_key)->aud) ? _payload($push_key)->aud : ''; $push_server = !empty($push_key) && isset(_payload($push_key)->aud) ? _payload($push_key)->aud : '';
if ($push_server != '' && $push_key != '') { if ($push_server != '' && $push_key != '') {
$url = $push_server . (substr($push_server, -1) == '/' ? '' : '/') . 'v1/notifications/send'; $url = $push_server . (str_ends_with($push_server, '/') ? '' : '/') . 'v1/notifications/send';
$key = 'key=' . $push_key; $key = 'key=' . $push_key;
$ch = curl_init($url); $ch = curl_init($url);
curl_setopt_array($ch, array( curl_setopt_array($ch, array(
CURLOPT_POST => TRUE, CURLOPT_POST => TRUE,
CURLOPT_RETURNTRANSFER => TRUE, CURLOPT_RETURNTRANSFER => TRUE,
CURLOPT_HEADER => TRUE, CURLOPT_HEADER => TRUE,
CURLOPT_HTTPHEADER => array( CURLOPT_HTTPHEADER => array(
'Authorization: ' . $key, 'Authorization: ' . $key,
'Content-Type: application/json', 'Content-Type: application/json',
), ),
CURLOPT_TIMEOUT => 2, CURLOPT_TIMEOUT => 2,
CURLOPT_POSTFIELDS => json_encode($data), CURLOPT_POSTFIELDS => json_encode($data),
)); ));
$resp = curl_exec($ch); $resp = curl_exec($ch);
if ($resp == FALSE) { if (!$resp) {
error_log("failed to send notification"); error_log("failed to send notification");
}
} }
} } catch (Exception $ex) {
} catch (Exception $ex) { error_log($ex);
error_log($ex); }
}
} }
function begegnungChanged($begegnung, $begegnung_vorher, $modus, $heim_team, $gast_team, $spiele) { function begegnungChanged($begegnung, $begegnung_vorher, $modus, $heim_team, $gast_team, $spiele): void
notifyChange(['payload' => [ {
'begegnung' => $begegnung, notifyChange(['payload' => [
'begegnung_vorher' => $begegnung_vorher, 'begegnung' => $begegnung,
'$modus' => $modus, 'begegnung_vorher' => $begegnung_vorher,
'heim_team' => $heim_team, '$modus' => $modus,
'gast_team' => $gast_team, 'heim_team' => $heim_team,
'spiele' => $spiele, 'gast_team' => $gast_team,
], 'type' => 'FIXTURE_RESULT_CHANGED']); 'spiele' => $spiele,
], 'type' => 'FIXTURE_RESULT_CHANGED']);
} }
function begegnungTischChanged($begegnung, $heim_team, $gast_team) { function begegnungTischChanged($begegnung, $heim_team, $gast_team): void
notifyChange(['payload' => [ {
'begegnung' => $begegnung, notifyChange(['payload' => [
'heim_team' => $heim_team, 'begegnung' => $begegnung,
'gast_team' => $gast_team, 'heim_team' => $heim_team,
], 'type' => 'TABLE_CHANGED']); 'gast_team' => $gast_team,
], 'type' => 'TABLE_CHANGED']);
} }
function begegnungVerlegenNotify($begegnung, $users, $vorschlagendes_team_id, $heim_team, $gast_team) { function begegnungVerlegenNotify($begegnung, $users, $vorschlagendes_team_id, $heim_team, $gast_team): void
{
notifyChange([ notifyChange([
'payload' => [ 'payload' => [
'begegnung' => $begegnung, 'begegnung' => $begegnung,
@@ -97,41 +111,50 @@ function begegnungVerlegenNotify($begegnung, $users, $vorschlagendes_team_id, $h
* @reponse body * @reponse body
* { data: { token: "reqest_token", access_for_team: ["team_id_1", "team_id_2"]}, expires: 1520013747000} * { data: { token: "reqest_token", access_for_team: ["team_id_1", "team_id_2"]}, expires: 1520013747000}
*/ */
function userToken() { #[NoReturn] function userToken(): void
{
global $secret; global $secret;
if (!isJson()) { if (!isJson()) {
abortWithError("JSON Request only"); abortWithError("JSON Request only");
}
if (isExternalDatabase()) {
abortWithError("Local Database only");
} }
$jinput = JFactory::getApplication()->input->json; if (isExternalDatabase()) {
$access_key = $jinput->getString('access_key'); abortWithError("Local Database only");
$user_id = _payload($access_key)->sub;
$user = JFactory::getUser($user_id);
if (!jwt_validate($access_key, $secret.$user->password)) {
abortWithError('Access Key is invalid');
}
$expires = new DateTime();
$expires->modify('+16 hours');
$db = &getDatabase();
$query = "SELECT berechtigt_team_id from #__sportsmanager_berechtigt_fuer_team where berechtigt_user_id = $user_id";
$db->setQuery($query);
if (!$db->execute()) {
abortWithError($db->stderr(true));
} }
$team_id = $db->loadObjectList(); $container = Factory::getContainer();
JSON_sportsmanager::JSON([ $jInput = $container->get(SiteApplication::class)->getInput()->json;
'token' => jwt_token([ $access_key = $jInput->getString('access_key');
'sub' => $user_id,
'exp' => $expires->getTimestamp(), $user_id = _payload($access_key)->sub;
], $secret), $user = $container->get(UserFactory::class)->loadUserById($user_id);
'access_for_teams' => array_map(function($item) { return $item->berechtigt_team_id; }, $team_id),
'expires' => $expires->getTimestamp() * 1000, // if (!jwt_validate($access_key, $secret . $user->password)) {
]); abortWithError('Access Key is invalid');
}
try {
$expires = new DateTime();
$expires->modify('+16 hours');
$db = getDatabase();
$query = "SELECT berechtigt_team_id from #__sportsmanager_berechtigt_fuer_team where berechtigt_user_id = $user_id";
$db->setQuery($query);
if (!$db->execute()) {
abortWithError($db->stderr(true));
}
$team_id = $db->loadObjectList();
JSON_sportsmanager::JSON([
'token' => jwt_token([
'sub' => $user_id,
'exp' => $expires->getTimestamp(),
], $secret),
'access_for_teams' => array_map(function ($item) {
return $item->berechtigt_team_id;
}, $team_id),
'expires' => $expires->getTimestamp() * 1000, //
]);
} catch (Exception $ex) {
error_log($ex);
}
} }
/* /*
@@ -139,124 +162,134 @@ function userToken() {
* @response body * @response body
* { data: { token: "api_acccess_token" }} * { data: { token: "api_acccess_token" }}
*/ */
function userAuth() { #[NoReturn] function userAuth(): void
{
global $secret; global $secret;
if (!isJson()) { if (!isJson()) {
die(); die();
}
if (isExternalDatabase()) {
abortWithError("Local Database only");
} }
$jinput = JFactory::getApplication()->input->json; if (isExternalDatabase()) {
$username = $jinput->getString('username'); abortWithError("Local Database only");
$password = $jinput->getString('password'); }
$container = Factory::getContainer();
$jInput = $container->get(SiteApplication::class)->getInput()->json;
$username = $jInput->getString('username');
$password = $jInput->getString('password');
$db = &getDatabase(); $db = getDatabase();
$query = $db->getQuery(true); $query = $db->getQuery(true);
$query->select('id')->from('#__users')->where('username = "' . $username . '"')->limit(1); $query->select('id')->from('#__users')->where('username = "' . $username . '"')->limit(1);
$db->setQuery($query); $db->setQuery($query);
$user_id = $db->loadResult(); $user_id = $db->loadResult();
$user = JFactory::getUser($user_id); $user = $container->get(UserFactory::class)->loadUserById($user_id);
if (JUserHelper::verifyPassword($password, $user->password, $user->id)) { //TODO: pw verification modernising: use php native methods, however this also needs new pw hashing. maybe force a pw reset on all accounts
if (password_verify($password, $user->password)) {
JSON_sportsmanager::JSON([ JSON_sportsmanager::JSON([
'token' => jwt_token([ 'token' => jwt_token([
'sub' => $user_id, 'sub' => $user_id,
'iat' => (new DateTime())->getTimestamp(), 'iat' => (new DateTime())->getTimestamp(),
], $secret.$user->password) ], $secret . $user->password)
]); ]);
return; }
} abortWithError('Wrong credentials');
abortWithError('Wrong credentials');
} }
function getUserID() { function getUserID(): int
{
global $secret; global $secret;
$token = JFactory::getApplication()->input->server->getString('HTTP_SECRET', NULL); $container = Factory::getContainer();
$input = $container->get(Input::class);
$token = $input->server->getString('HTTP_SECRET', NULL);
return $token != NULL && jwt_validate($token, $secret) && isset(_payload($token)->sub) return $token != NULL && jwt_validate($token, $secret) && isset(_payload($token)->sub)
? (int) _payload($token)->sub ? (int)_payload($token)->sub
: 0; : 0;
} }
function getColorOfImage($image) { function getColorOfImage($image)
if ($image != NULL) { {
if ($image != NULL) {
if (strpos($image, '.png') !== false) { if (str_contains($image, '.png')) {
$img = imagecreatefrompng($image); $img = imagecreatefrompng($image);
} else { } else {
$img = imagecreatefromjpeg($image); $img = imagecreatefromjpeg($image);
} }
$width = imagesx($img); $width = imagesx($img);
$height = imagesx($img); $height = imagesx($img);
$colorMap = []; $colorMap = [];
$colors = []; $colors = [];
for ($x = 0; $x < $width; $x++) { for ($x = 0; $x < $width; $x++) {
for ($y = 0; $y < $height; $y++) { for ($y = 0; $y < $height; $y++) {
$color = imagecolorsforindex($img, imagecolorat($img, $x, $y)); $color = imagecolorsforindex($img, imagecolorat($img, $x, $y));
if ($color['alpha'] < 20) { if ($color['alpha'] < 20) {
$c = colorKey($color); $c = colorKey($color);
$hex = hex($color); $hex = hex($color);
if ($hex != NULL) { if ($hex != NULL) {
if (!isset($colors[$c])) { if (!isset($colors[$c])) {
$colors[$c] = 0; $colors[$c] = 0;
$colorMap[$c] = $hex; $colorMap[$c] = $hex;
} }
$colors[$c] += 1; $colors[$c] += 1;
} }
} }
} }
} }
arsort($colors); arsort($colors);
$result = array_keys($colors); $result = array_keys($colors);
return sizeof($result) > 1 && $result[0] === '0-0-0' ? $colorMap[$result[1]] : $colorMap[$result[0]]; return sizeof($result) > 1 && $result[0] === '0-0-0' ? $colorMap[$result[1]] : $colorMap[$result[0]];
} }
return NULL; return NULL;
} }
function colorKey($rgb) { function colorKey($rgb): string
{
$r = (int)($rgb['red'] / 100); $r = (int)($rgb['red'] / 100);
$g = (int)($rgb['green'] / 100); $g = (int)($rgb['green'] / 100);
$b = (int)($rgb['blue'] / 100); $b = (int)($rgb['blue'] / 100);
return $r . '-' . $g . '-' . $b; return $r . '-' . $g . '-' . $b;
} }
function hex($rgb) { function hex($rgb): ?string
$r = $rgb['red']; {
$g = $rgb['green']; $r = $rgb['red'];
$b = $rgb['blue']; $g = $rgb['green'];
if (($r + $g + $b) / 3 > 125) { $b = $rgb['blue'];
return NULL; if (($r + $g + $b) / 3 > 125) {
} return NULL;
$r = dechex($r); }
if (strlen($r) < 2) { $r = dechex($r);
$r = '0' . $r; if (strlen($r) < 2) {
} $r = '0' . $r;
$g = dechex($g); }
if (strlen($g) < 2) { $g = dechex($g);
$g = '0' . $g; if (strlen($g) < 2) {
} $g = '0' . $g;
$b = dechex($b); }
if (strlen($b) < 2) { $b = dechex($b);
$b = '0' . $b; if (strlen($b) < 2) {
} $b = '0' . $b;
return '#' . $r . $g . $b; }
return '#' . $r . $g . $b;
} }
/* /*
* sign string with secret * sign string with secret
*/ */
function _sign($data, $secret, $algo = 'sha256') { function _sign($data, $secret): string
{
return base64_encode(hash_hmac('sha256', $data, $secret)); return base64_encode(hash_hmac('sha256', $data, $secret));
} }
/* /*
* get payload from jwt token * get payload from jwt token
*/ */
function _payload($token) { function _payload($token)
{
$jwt = explode('.', $token); $jwt = explode('.', $token);
return json_decode(base64_decode($jwt[0])); return json_decode(base64_decode($jwt[0]));
} }
@@ -264,7 +297,8 @@ function _payload($token) {
/* /*
* headless signed jwt token * headless signed jwt token
*/ */
function jwt_token($payload, $secret) { function jwt_token($payload, $secret): string
{
$data = base64_encode(json_encode($payload)); $data = base64_encode(json_encode($payload));
return $data . '.' . _sign($data, $secret); return $data . '.' . _sign($data, $secret);
@@ -273,7 +307,8 @@ function jwt_token($payload, $secret) {
/* /*
* validate token * validate token
*/ */
function jwt_validate($token, $secret) { function jwt_validate($token, $secret): bool
{
$jwt = explode('.', $token); $jwt = explode('.', $token);
if (sizeof($jwt) == 2 && $jwt[1] == _sign($jwt[0], $secret)) { if (sizeof($jwt) == 2 && $jwt[1] == _sign($jwt[0], $secret)) {
if (isset(_payload($token)->exp)) { if (isset(_payload($token)->exp)) {
@@ -0,0 +1,120 @@
<?php
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Uri\Uri;
use Joomla\Database\DatabaseInterface;
use Joomla\Database\Mysql\MysqlDriver;
use Joomla\Database\Mysqli\MysqliDriver;
function initDatabase(): void
{
global $sportsmanager_database_local;
global $sportsmanager_database_external;
global $sportsmanager_joomla_path;
global $sportsmanager_joomla_url;
$sportsmanager_database_local = NULL;
$sportsmanager_database_external = NULL;
$sportsmanager_joomla_path = JPATH_ROOT;
$sportsmanager_joomla_url = Uri::base();
$sportsmanager_database_local = Factory::getContainer()->get(DatabaseInterface::class);
$query = "SELECT * FROM #__sportsmanager_einstellungen";
$sportsmanager_database_local->setQuery($query);
if (!$sportsmanager_database_local->execute()) {
die($sportsmanager_database_local->stderr(true));
}
$rows = $sportsmanager_database_local->loadObjectList();
$database_driver = "mysql";
$database_host = "";
$database_user = "";
$database_password = "";
$database_database = "";
$database_prefix = "jos_";
$joomla_path = "";
$joomla_url = "";
foreach ($rows as $row) {
$name = mb_strtolower($row->name);
if ($name == "database_driver")
$database_driver = $row->wert;
else if ($name == "database_host")
$database_host = $row->wert;
else if ($name == "database_user")
$database_user = $row->wert;
else if ($name == "database_password")
$database_password = $row->wert;
else if ($name == "database_database")
$database_database = $row->wert;
else if ($name == "database_prefix")
$database_prefix = $row->wert;
else if ($name == "joomla_path")
$joomla_path = $row->wert;
else if ($name == "joomla_url")
$joomla_url = $row->wert;
}
if (!empty($database_driver) && !empty($database_host) && !empty($database_user) && !empty($database_database) && !empty($database_prefix) && !empty($joomla_path) && !empty($joomla_url)) {
$option = array(); //prevent problems
$option['driver'] = $database_driver; // Database driver name
$option['host'] = $database_host; // Database host name
$option['user'] = $database_user; // User for database authentication
$option['password'] = $database_password; // Password for database authentication
$option['database'] = $database_database; // Database name
$option['prefix'] = $database_prefix; // Database prefix (may be empty)
$sportsmanager_database_external = match ($option['driver']) {
'mysql' => new MysqlDriver($option),
'mysqli' => new MysqliDriver($option),
default => NULL,
};
if ($sportsmanager_database_external === NULL) {
echo "<strong>" . Text::_('COM_SPORTSMANAGER_CONNECTION_EXTERNAL_DB_FAILURE') . "</strong><br><br>";
} else {
$query = "SELECT wert FROM #__sportsmanager_einstellungen WHERE name = 'datenbank_version'";
$sportsmanager_database_external->setQuery($query);
try {
if (!$sportsmanager_database_external->execute()) {
echo "<strong>" . Text::_('COM_SPORTSMANAGER_EXTERNAL_DB_NO_SM_TABLES') . "</strong><br><br>";
$sportsmanager_database_external = NULL;
} else {
$db_version = $sportsmanager_database_external->loadResult();
if ($db_version < 38) {
echo "<strong>" . Text::_('COM_SPORTSMANAGER_EXTERNAL_DB_NO_SM_VERSION') . "</strong><br><br>";
$sportsmanager_database_external = NULL;
} else if (!is_dir($joomla_path . DIRECTORY_SEPARATOR . "images" . DIRECTORY_SEPARATOR . "sportsmanager")) {
echo "<strong>" . Text::_('COM_SPORTSMANAGER_EXTERNAL_NO_IMAGES_FOLDER') . " '/images/sportsmanager'!</strong><br><br>";
$sportsmanager_database_external = NULL;
} else {
$sportsmanager_joomla_path = $joomla_path;
$sportsmanager_joomla_url = $joomla_url;
}
}
} catch (Exception $e) {
error_log($e->getMessage());
}
}
}
}
function isExternalDatabase(): bool
{
global $sportsmanager_database_external;
return $sportsmanager_database_external != NULL;
}
function getDatabase($forceLocalDB = FALSE)
{
global $sportsmanager_database_local;
global $sportsmanager_database_external;
if ($forceLocalDB || $sportsmanager_database_external == NULL)
$db = $sportsmanager_database_local;
else
$db = $sportsmanager_database_external;
return $db;
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -3,10 +3,10 @@
* Sports Manager (C) 2006-2020, Sven Nickel * Sports Manager (C) 2006-2020, Sven Nickel
*/ */
namespace Dtfb\Component\com_sportsmanager\Site\Controller;
// Check to ensure this file is included in Joomla! // Check to ensure this file is included in Joomla!
defined('_JEXEC') or die(); defined('_JEXEC') or die();
jimport('joomla.application.component.controller');
use Joomla\CMS\Factory; use Joomla\CMS\Factory;
use Joomla\CMS\MVC\Controller\BaseController; use Joomla\CMS\MVC\Controller\BaseController;
@@ -32,26 +32,15 @@ class DisplayController extends BaseController {
* *
* @param bool $cachable Whether the view can be cached or not. Default is false. * @param bool $cachable Whether the view can be cached or not. Default is false.
* @param array $urlparams The URL parameters to be passed to the view. Default is an empty array. * @param array $urlparams The URL parameters to be passed to the view. Default is an empty array.
* @param array $safeurlparams An associative array of 'safe' URL parameters and their variable types. * @param array|null $safeurlparams An associative array of 'safe' URL parameters and their variable types.
* *
* @return void * @return void
* @throws Exception * @throws Exception
* @since 2.0.0 * @since 2.0.0
*/ */
public function display($cachable = false, $urlparams = array(), $safeurlparams = null) { public function display($cachable = false, $urlparams = array(), array $safeurlparams = null): void
{
$document = Factory::getDocument(); require_once JPATH_SITE . '/components/com_sportsmanager/sportsmanager.php';
$viewName = $this->input->getCmd('view', 'default'); }
$viewFormat = $document->getType();
$view = $this->getView($viewName, $viewFormat);
$view->document = $document;
$app = JFactory::getApplication();
$input = $app->input;
$layout = $input->get('layout', '', 'STRING');
//var_dump($layout);
$view->display($layout);
}
} }
@@ -4,392 +4,407 @@
*/ */
// kein direkter Zugriff // kein direkter Zugriff
use JetBrains\PhpStorm\NoReturn;
use Joomla\CMS\Application\SiteApplication;
use Joomla\CMS\Factory;
use Joomla\CMS\Log\Log;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Uri\Uri;
use Joomla\CMS\User\User;
use Joomla\CMS\Version;
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
require_once (JPATH_COMPONENT.DIRECTORY_SEPARATOR.'mathparser.php'); require_once JPATH_SITE . '/components/com_sportsmanager/mathparser.php';
require_once JPATH_SITE . '/components/com_sportsmanager/database/init.php';
function mathParserVerteilung($rohpunkte, $platz, $teilnehmer, $multiplikator) { class MathParserSM extends MathParser
return max(round($multiplikator * round(((($rohpunkte - 1) * (-log($platz / $teilnehmer) * (1 - ($platz / $teilnehmer)))) / (-log(1 / $teilnehmer) * (1 - (1 / $teilnehmer)))) + 1)), 1); {
// Verteilung nach Klostermann/Wahle
public function __construct()
{
parent::__construct();
try {
$this->createFunc("ROUND", 'round', 1);
$this->createFunc("VERTEILUNG", 'mathParserVerteilung', 4);
$this->createFunc("VERTEILUNGR", 'mathParserVerteilungR', 4);
} catch (Exception $e) {
Log::add('an error occurred: ' . $e->getMessage(), Log::ERROR, 'com_sportsmanager');
throw new RuntimeException('An error occurred.', 500);
}
}
} }
function mathParserVerteilungR($rohpunkte, $platz, $teilnehmer, $multiplikator) { #[NoReturn] function keinZugriff($login = FALSE): void
return max(round(((($multiplikator * $rohpunkte - 1) * (-log($platz / $teilnehmer) * (1 - ($platz / $teilnehmer)))) / (-log(1 / $teilnehmer) * (1 - (1 / $teilnehmer)))) + 1), 1); {
if (isJson()) {
abortWithError(401 . ' Unauthorized');
}
if (!$login || Factory::getContainer()->get(SiteApplication::class)->getIdentity()->id) {
Log::add('Unauthorized user with id ' . Factory::getContainer()->get(SiteApplication::class)->getIdentity()->id, Log::WARNING, 'com_sportsmanager');
throw new RuntimeException('Not authorized!', 401);
}
$version = new Version();
$joomla = $version->getShortVersion();
$u = Uri::getInstance();
$redirectUrl = urlencode(base64_encode($u->toString()));
$redirectUrl = '&return=' . $redirectUrl;
$joomlaLoginUrl = 'index.php?option=' . (!str_starts_with($joomla, '1.5') ? 'com_users' : 'com_user') . '&view=login';
$finalUrl = $joomlaLoginUrl . $redirectUrl;
$app = Factory::getContainer()->get(SiteApplication::class);
$app->redirect(Route::_($finalUrl));
jexit();
} }
class MathParserSM extends MathParser { function bereinigterDateiname($dateiname): array|string
// Verteilung nach Klostermann/Wahle {
public function __construct() { $_convertTable = array(
MathParser::__construct(); '&amp;' => 'and', '@' => 'at', '©' => 'c', '®' => 'r', 'À' => 'a',
$this->createFunc("ROUND", 'round', 1); 'Á' => 'a', 'Â' => 'a', 'Ä' => 'a', 'Å' => 'a', 'Æ' => 'ae', 'Ç' => 'c',
$this->createFunc("VERTEILUNG", 'mathParserVerteilung', 4); 'È' => 'e', 'É' => 'e', 'Ë' => 'e', 'Ì' => 'i', 'Í' => 'i', 'Î' => 'i',
$this->createFunc("VERTEILUNGR", 'mathParserVerteilungR', 4); 'Ï' => 'i', 'Ò' => 'o', 'Ó' => 'o', 'Ô' => 'o', 'Õ' => 'o', 'Ö' => 'o',
} 'Ø' => 'o', 'Ù' => 'u', 'Ú' => 'u', 'Û' => 'u', 'Ü' => 'u', 'Ý' => 'y',
} 'ß' => 'ss', 'à' => 'a', 'á' => 'a', 'â' => 'a', 'ä' => 'a', 'å' => 'a',
'æ' => 'ae', 'ç' => 'c', 'è' => 'e', 'é' => 'e', 'ê' => 'e', 'ë' => 'e',
function keinZugriff($login = FALSE) { 'ì' => 'i', 'í' => 'i', 'î' => 'i', 'ï' => 'i', 'ò' => 'o', 'ó' => 'o',
if (isJson()) { 'ô' => 'o', 'õ' => 'o', 'ö' => 'o', 'ø' => 'o', 'ù' => 'u', 'ú' => 'u',
abortWithError(401 . ' Unauthorized'); 'û' => 'u', 'ü' => 'u', 'ý' => 'y', 'þ' => 'p', 'ÿ' => 'y', 'Ā' => 'a',
} 'ā' => 'a', 'Ă' => 'a', 'ă' => 'a', 'Ą' => 'a', 'ą' => 'a', 'Ć' => 'c',
if (!$login || JFactory::getUser()->id) { 'ć' => 'c', 'Ĉ' => 'c', 'ĉ' => 'c', 'Ċ' => 'c', 'ċ' => 'c', 'Č' => 'c',
JError::raiseError(500, JText::_('JERROR_ALERTNOAUTHOR')); 'č' => 'c', 'Ď' => 'd', 'ď' => 'd', 'Đ' => 'd', 'đ' => 'd', 'Ē' => 'e',
jexit(); 'ē' => 'e', 'Ĕ' => 'e', 'ĕ' => 'e', 'Ė' => 'e', 'ė' => 'e', 'Ę' => 'e',
} 'ę' => 'e', 'Ě' => 'e', 'ě' => 'e', 'Ĝ' => 'g', 'ĝ' => 'g', 'Ğ' => 'g',
$version = new JVersion; 'ğ' => 'g', 'Ġ' => 'g', 'ġ' => 'g', 'Ģ' => 'g', 'ģ' => 'g', 'Ĥ' => 'h',
$joomla = $version->getShortVersion(); 'ĥ' => 'h', 'Ħ' => 'h', 'ħ' => 'h', 'Ĩ' => 'i', 'ĩ' => 'i', 'Ī' => 'i',
//$u =& JFactory::getURI(); 'ī' => 'i', 'Ĭ' => 'i', 'ĭ' => 'i', 'Į' => 'i', 'į' => 'i', 'İ' => 'i',
$u = JURI::getInstance(); 'ı' => 'i', 'IJ' => 'ij', 'ij' => 'ij', 'Ĵ' => 'j', 'ĵ' => 'j', 'Ķ' => 'k',
$redirectUrl = urlencode(base64_encode($u->toString())); 'ķ' => 'k', 'ĸ' => 'k', 'Ĺ' => 'l', 'ĺ' => 'l', 'Ļ' => 'l', 'ļ' => 'l',
$redirectUrl = '&return='.$redirectUrl; 'Ľ' => 'l', 'ľ' => 'l', 'Ŀ' => 'l', 'ŀ' => 'l', 'Ł' => 'l', 'ł' => 'l',
$joomlaLoginUrl = 'index.php?option=' . (substr($joomla, 0, 3) != '1.5' ? 'com_users' : 'com_user') . '&view=login'; 'Ń' => 'n', 'ń' => 'n', 'Ņ' => 'n', ' => 'n', ' => 'n', 'ň' => 'n',
$finalUrl = $joomlaLoginUrl . $redirectUrl; 'ʼn' => 'n', 'Ŋ' => 'n', 'ŋ' => 'n', 'Ō' => 'o', 'ō' => 'o', 'Ŏ' => 'o',
$app = JFactory::getApplication(); 'ŏ' => 'o', 'Ő' => 'o', 'ő' => 'o', 'Œ' => 'oe', 'œ' => 'oe', 'Ŕ' => 'r',
$app->redirect(JRoute::_($finalUrl)); 'ŕ' => 'r', 'Ŗ' => 'r', 'ŗ' => 'r', 'Ř' => 'r', 'ř' => 'r', 'Ś' => 's',
jexit(); 'ś' => 's', 'Ŝ' => 's', 'ŝ' => 's', 'Ş' => 's', 'ş' => 's', 'Š' => 's',
} 'š' => 's', 'Ţ' => 't', 'ţ' => 't', 'Ť' => 't', 'ť' => 't', 'Ŧ' => 't',
'ŧ' => 't', 'Ũ' => 'u', 'ũ' => 'u', 'Ū' => 'u', 'ū' => 'u', 'Ŭ' => 'u',
function bereinigterDateiname($dateiname) { 'ŭ' => 'u', 'Ů' => 'u', 'ů' => 'u', 'Ű' => 'u', 'ű' => 'u', 'Ų' => 'u',
$_convertTable = array( 'ų' => 'u', 'Ŵ' => 'w', 'ŵ' => 'w', 'Ŷ' => 'y', 'ŷ' => 'y', 'Ÿ' => 'y',
'&amp;' => 'and', '@' => 'at', '©' => 'c', '®' => 'r', 'À' => 'a', ' => 'z', 'ź' => 'z', 'Ż' => 'z', 'ż' => 'z', 'Ž' => 'z', 'ž' => 'z',
'Á' => 'a', 'Â' => 'a', 'Ä' => 'a', 'Å' => 'a', 'Æ' => 'ae','Ç' => 'c', 'ſ' => 'z', 'Ə' => 'e', 'ƒ' => 'f', 'Ơ' => 'o', 'ơ' => 'o', 'Ư' => 'u',
'È' => 'e', 'É' => 'e', 'Ë' => 'e', 'Ì' => 'i', 'Í' => 'i', 'Î' => 'i', 'ư' => 'u', 'Ǎ' => 'a', 'ǎ' => 'a', 'Ǐ' => 'i', 'ǐ' => 'i', 'Ǒ' => 'o',
'Ï' => 'i', 'Ò' => 'o', 'Ó' => 'o', 'Ô' => 'o', 'Õ' => 'o', 'Ö' => 'o', 'ǒ' => 'o', 'Ǔ' => 'u', 'ǔ' => 'u', 'Ǖ' => 'u', 'ǖ' => 'u', 'Ǘ' => 'u',
'Ø' => 'o', 'Ù' => 'u', 'Ú' => 'u', 'Û' => 'u', 'Ü' => 'u', 'Ý' => 'y', 'ǘ' => 'u', 'Ǚ' => 'u', 'ǚ' => 'u', 'Ǜ' => 'u', 'ǜ' => 'u', 'Ǻ' => 'a',
'ß' => 'ss','à' => 'a', 'á' => 'a', 'â' => 'a', 'ä' => 'a', 'å' => 'a', 'ǻ' => 'a', 'Ǽ' => 'ae', 'ǽ' => 'ae', 'Ǿ' => 'o', 'ǿ' => 'o', 'ə' => 'e',
'æ' => 'ae','ç' => 'c', 'è' => 'e', 'é' => 'e', 'ê' => 'e', 'ë' => 'e', 'Ё' => 'jo', 'Є' => 'e', 'І' => 'i', 'Ї' => 'i', 'А' => 'a', 'Б' => 'b',
'ì' => 'i', 'í' => 'i', 'î' => 'i', 'ï' => 'i', 'ò' => 'o', 'ó' => 'o', 'В' => 'v', 'Г' => 'g', 'Д' => 'd', 'Е' => 'e', 'Ж' => 'zh', 'З' => 'z',
'ô' => 'o', 'õ' => 'o', 'ö' => 'o', 'ø' => 'o', 'ù' => 'u', 'ú' => 'u', 'И' => 'i', 'Й' => 'j', 'К' => 'k', 'Л' => 'l', 'М' => 'm', 'Н' => 'n',
'û' => 'u', 'ü' => 'u', 'ý' => 'y', 'þ' => 'p', 'ÿ' => 'y', 'Ā' => 'a', 'О' => 'o', 'П' => 'p', 'Р' => 'r', 'С' => 's', 'Т' => 't', 'У' => 'u',
'ā' => 'a', 'Ă' => 'a', 'ă' => 'a', 'Ą' => 'a', 'ą' => 'a', 'Ć' => 'c', 'Ф' => 'f', 'Х' => 'h', 'Ц' => 'c', 'Ч' => 'ch', 'Ш' => 'sh', 'Щ' => 'sch',
'ć' => 'c', 'Ĉ' => 'c', 'ĉ' => 'c', 'Ċ' => 'c', 'ċ' => 'c', 'Č' => 'c', 'Ъ' => '-', 'Ы' => 'y', 'Ь' => '-', 'Э' => 'je', 'Ю' => 'ju', 'Я' => 'ja',
'č' => 'c', 'Ď' => 'd', 'ď' => 'd', 'Đ' => 'd', 'đ' => 'd', 'Ē' => 'e', 'а' => 'a', 'б' => 'b', 'в' => 'v', 'г' => 'g', 'д' => 'd', 'е' => 'e',
'ē' => 'e', 'Ĕ' => 'e', 'ĕ' => 'e', 'Ė' => 'e', 'ė' => 'e', 'Ę' => 'e', 'ж' => 'zh', 'з' => 'z', 'и' => 'i', 'й' => 'j', 'к' => 'k', 'л' => 'l',
'ę' => 'e', 'Ě' => 'e', 'ě' => 'e', 'Ĝ' => 'g', 'ĝ' => 'g', 'Ğ' => 'g', 'м' => 'm', 'н' => 'n', 'о' => 'o', 'п' => 'p', 'р' => 'r', 'с' => 's',
'ğ' => 'g', 'Ġ' => 'g', 'ġ' => 'g', 'Ģ' => 'g', 'ģ' => 'g', 'Ĥ' => 'h', 'т' => 't', 'у' => 'u', 'ф' => 'f', 'х' => 'h', 'ц' => 'c', 'ч' => 'ch',
'ĥ' => 'h', 'Ħ' => 'h', 'ħ' => 'h', 'Ĩ' => 'i', 'ĩ' => 'i', 'Ī' => 'i', 'ш' => 'sh', 'щ' => 'sch', 'ъ' => '-', 'ы' => 'y', 'ь' => '-', 'э' => 'je',
'ī' => 'i', 'Ĭ' => 'i', 'ĭ' => 'i', 'Į' => 'i', 'į' => 'i', 'İ' => 'i', 'ю' => 'ju', 'я' => 'ja', 'ё' => 'jo', 'є' => 'e', 'і' => 'i', 'ї' => 'i',
'ı' => 'i', 'IJ' => 'ij','ij' => 'ij','Ĵ' => 'j', 'ĵ' => 'j', 'Ķ' => 'k', 'Ґ' => 'g', 'ґ' => 'g', 'א' => 'a', 'ב' => 'b', 'ג' => 'g', 'ד' => 'd',
'ķ' => 'k', 'ĸ' => 'k', 'Ĺ' => 'l', 'ĺ' => 'l', 'Ļ' => 'l', 'ļ' => 'l', 'ה' => 'h', 'ו' => 'v', 'ז' => 'z', 'ח' => 'h', 'ט' => 't', 'י' => 'i',
'Ľ' => 'l', 'ľ' => 'l', 'Ŀ' => 'l', 'ŀ' => 'l', 'Ł' => 'l', 'ł' => 'l', 'ך' => 'k', 'כ' => 'k', 'ל' => 'l', 'ם' => 'm', 'מ' => 'm', 'ן' => 'n',
'Ń' => 'n', 'ń' => 'n', 'Ņ' => 'n', 'ņ' => 'n', 'Ň' => 'n', 'ň' => 'n', 'נ' => 'n', 'ס' => 's', 'ע' => 'e', 'ף' => 'p', 'פ' => 'p', 'ץ' => 'C',
'ʼn' => 'n', 'Ŋ' => 'n', 'ŋ' => 'n', 'Ō' => 'o', 'ō' => 'o', 'Ŏ' => 'o', 'צ' => 'c', 'ק' => 'q', 'ר' => 'r', 'ש' => 'w', 'ת' => 't', '' => 'tm',
'ŏ' => 'o', 'Ő' => 'o', 'ő' => 'o', 'Œ' => 'oe','œ' => 'oe','Ŕ' => 'r', );
'ŕ' => 'r', 'Ŗ' => 'r', 'ŗ' => 'r', 'Ř' => 'r', 'ř' => 'r', 'Ś' => 's', $bad = array_merge(
'ś' => 's', 'Ŝ' => 's', 'ŝ' => 's', 'Ş' => 's', 'ş' => 's', 'Š' => 's', array_map('chr', range(0, 31)),
'š' => 's', 'Ţ' => 't', 'ţ' => 't', 'Ť' => 't', 'ť' => 't', 'Ŧ' => 't',
'ŧ' => 't', 'Ũ' => 'u', 'ũ' => 'u', 'Ū' => 'u', 'ū' => 'u', 'Ŭ' => 'u',
'ŭ' => 'u', 'Ů' => 'u', 'ů' => 'u', 'Ű' => 'u', 'ű' => 'u', 'Ų' => 'u',
'ų' => 'u', 'Ŵ' => 'w', 'ŵ' => 'w', 'Ŷ' => 'y', 'ŷ' => 'y', 'Ÿ' => 'y',
'Ź' => 'z', 'ź' => 'z', 'Ż' => 'z', 'ż' => 'z', 'Ž' => 'z', 'ž' => 'z',
'ſ' => 'z', 'Ə' => 'e', 'ƒ' => 'f', 'Ơ' => 'o', 'ơ' => 'o', 'Ư' => 'u',
'ư' => 'u', 'Ǎ' => 'a', 'ǎ' => 'a', 'Ǐ' => 'i', 'ǐ' => 'i', 'Ǒ' => 'o',
'ǒ' => 'o', 'Ǔ' => 'u', 'ǔ' => 'u', 'Ǖ' => 'u', 'ǖ' => 'u', 'Ǘ' => 'u',
'ǘ' => 'u', 'Ǚ' => 'u', 'ǚ' => 'u', 'Ǜ' => 'u', 'ǜ' => 'u', 'Ǻ' => 'a',
'ǻ' => 'a', 'Ǽ' => 'ae','ǽ' => 'ae','Ǿ' => 'o', 'ǿ' => 'o', 'ə' => 'e',
'Ё' => 'jo','Є' => 'e', 'І' => 'i', 'Ї' => 'i', 'А' => 'a', 'Б' => 'b',
'В' => 'v', 'Г' => 'g', 'Д' => 'd', 'Е' => 'e', 'Ж' => 'zh','З' => 'z',
'И' => 'i', 'Й' => 'j', 'К' => 'k', 'Л' => 'l', 'М' => 'm', 'Н' => 'n',
'О' => 'o', 'П' => 'p', 'Р' => 'r', 'С' => 's', 'Т' => 't', 'У' => 'u',
'Ф' => 'f', 'Х' => 'h', 'Ц' => 'c', 'Ч' => 'ch','Ш' => 'sh','Щ' => 'sch',
'Ъ' => '-', 'Ы' => 'y', 'Ь' => '-', 'Э' => 'je','Ю' => 'ju','Я' => 'ja',
'а' => 'a', 'б' => 'b', 'в' => 'v', 'г' => 'g', 'д' => 'd', 'е' => 'e',
'ж' => 'zh','з' => 'z', 'и' => 'i', 'й' => 'j', 'к' => 'k', 'л' => 'l',
'м' => 'm', 'н' => 'n', 'о' => 'o', 'п' => 'p', 'р' => 'r', 'с' => 's',
'т' => 't', 'у' => 'u', 'ф' => 'f', 'х' => 'h', 'ц' => 'c', 'ч' => 'ch',
'ш' => 'sh','щ' => 'sch','ъ' => '-','ы' => 'y', 'ь' => '-', 'э' => 'je',
'ю' => 'ju','я' => 'ja','ё' => 'jo','є' => 'e', 'і' => 'i', 'ї' => 'i',
'Ґ' => 'g', 'ґ' => 'g', 'א' => 'a', 'ב' => 'b', 'ג' => 'g', 'ד' => 'd',
'ה' => 'h', 'ו' => 'v', 'ז' => 'z', 'ח' => 'h', 'ט' => 't', 'י' => 'i',
'ך' => 'k', 'כ' => 'k', 'ל' => 'l', 'ם' => 'm', 'מ' => 'm', 'ן' => 'n',
'נ' => 'n', 'ס' => 's', 'ע' => 'e', 'ף' => 'p', 'פ' => 'p', 'ץ' => 'C',
'צ' => 'c', 'ק' => 'q', 'ר' => 'r', 'ש' => 'w', 'ת' => 't', '™' => 'tm',
);
$bad = array_merge(
array_map('chr', range(0,31)),
array("<", ">", ":", '"', "/", "\\", "|", "?", "*")); array("<", ">", ":", '"', "/", "\\", "|", "?", "*"));
return str_replace($bad, "", strtr($dateiname, $_convertTable)); return str_replace($bad, "", strtr($dateiname, $_convertTable));
} }
function setMinMemoryLimit($memDestSize) { function setMinMemoryLimit($memDestSize): void
if (getBytes(ini_get('memory_limit')) < getBytes($memDestSize)) {
ini_set('memory_limit', $memDestSize); if (getBytes(ini_get('memory_limit')) < getBytes($memDestSize))
ini_set('memory_limit', $memDestSize);
} }
function getBytes($val) { function getBytes($val): int|string
$val = trim($val); {
$numeric = substr($val, 0, strlen($val) -1); $val = trim($val);
$last = strtolower($val[strlen($val) - 1]); $numeric = substr($val, 0, strlen($val) - 1);
switch($last) { $last = strtolower($val[strlen($val) - 1]);
// The 'G' modifier is available since PHP 5.1.0 switch ($last) {
case 'g': // The 'G' modifier is available since PHP 5.1.0
$numeric *= 1024; case 'm':
case 'm': case 'g':
$numeric *= 1024; case 'k':
case 'k': $numeric *= 1024;
$numeric *= 1024; break;
} }
return $numeric; return $numeric;
} }
function encrypt($str, $key){ function encrypt($str, $key): string
$result=""; {
for($i=0; $i<strlen($str); $i++) { $result = "";
$char = substr($str, $i, 1); for ($i = 0; $i < strlen($str); $i++) {
$keychar = substr($key, ($i % strlen($key))-1, 1); $char = substr($str, $i, 1);
$char = chr(ord($char)+ord($keychar)); $keychar = substr($key, ($i % strlen($key)) - 1, 1);
$result.=$char; $char = chr(ord($char) + ord($keychar));
} $result .= $char;
return base64_encode($result); }
return base64_encode($result);
} }
function decrypt($str, $key){ function decrypt($str, $key): string
$str = base64_decode($str); {
$result=""; $str = base64_decode($str);
for($i=0; $i<strlen($str); $i++) { $result = "";
$char = substr($str, $i, 1); for ($i = 0; $i < strlen($str); $i++) {
$keychar = substr($key, ($i % strlen($key))-1, 1); $char = substr($str, $i, 1);
$char = chr(ord($char)-ord($keychar)); $keychar = substr($key, ($i % strlen($key)) - 1, 1);
$result.=$char; $char = chr(ord($char) - ord($keychar));
} $result .= $char;
return $result; }
return $result;
} }
function individualwettbewerbFilter($prefix) { function individualwettbewerbFilter($prefix): string
$db =& getDatabase(); {
$user_id = isExternalDatabase() ? 0 : JFactory::getUser()->id; $user_id = isExternalDatabase() ? 0 : Factory::getContainer()->get(SiteApplication::class)->getIdentity()->id;
return " " . $prefix . " (SELECT berechtigt_individualwettbewerb_id FROM #__sportsmanager_berechtigt_fuer_individualwettbewerb INNER JOIN #__sportsmanager_individualwettbewerb ON individualwettbewerb_id = berechtigt_individualwettbewerb_id WHERE berechtigt_user_id = $user_id) "; return " " . $prefix . " (SELECT berechtigt_individualwettbewerb_id FROM #__sportsmanager_berechtigt_fuer_individualwettbewerb INNER JOIN #__sportsmanager_individualwettbewerb ON individualwettbewerb_id = berechtigt_individualwettbewerb_id WHERE berechtigt_user_id = $user_id) ";
} }
function kategorieFilter($prefix, $suffix = "") { function kategorieFilter($prefix, $suffix = ""): string
global $params; {
$kategorien = explode(",", $params->get( 'kategorien' )); global $params;
$filter = ""; $kategorien = explode(",", $params->get('kategorien'));
foreach ($kategorien as $s) { $filter = "";
$kategorie = intval(trim($s)); foreach ($kategorien as $s) {
if ($kategorie == 0) $kategorie = intval(trim($s));
continue; if ($kategorie == 0)
if (!empty($filter)) continue;
$filter .= ", "; if (!empty($filter))
$filter .= $kategorie; $filter .= ", ";
} $filter .= $kategorie;
return empty($filter) ? "" : (" " . $prefix . " (" . $filter . ") " . $suffix); }
return empty($filter) ? "" : (" " . $prefix . " (" . $filter . ") " . $suffix);
} }
function turnierFilter($prefix) { function turnierFilter($prefix): string
$db =& getDatabase(); {
$user_id = isExternalDatabase() ? 0 : JFactory::getUser()->id; $user_id = isExternalDatabase() ? 0 : Factory::getContainer()->get(SiteApplication::class)->getIdentity()->id;
return " " . $prefix . " (SELECT berechtigt_turnier_id FROM #__sportsmanager_berechtigt_fuer_turnier WHERE berechtigt_user_id = $user_id AND DATEDIFF(letzter_tag, NOW()) >= -14) "; return " " . $prefix . " (SELECT berechtigt_turnier_id FROM #__sportsmanager_berechtigt_fuer_turnier WHERE berechtigt_user_id = $user_id AND DATEDIFF(letzter_tag, NOW()) >= -14) ";
} }
function vereinFilter($prefix) { function vereinFilter($prefix): string
$db =& getDatabase(); {
$user_id = isExternalDatabase() ? 0 : JFactory::getUser()->id; $user_id = isExternalDatabase() ? 0 : Factory::getContainer()->get(SiteApplication::class)->getIdentity()->id;
return " " . $prefix . " (SELECT berechtigt_verein_id FROM #__sportsmanager_berechtigt_fuer_verein INNER JOIN #__sportsmanager_verein ON berechtigt_verein_id = verein_id WHERE berechtigt_user_id = $user_id AND NOT ausgetreten) "; return " " . $prefix . " (SELECT berechtigt_verein_id FROM #__sportsmanager_berechtigt_fuer_verein INNER JOIN #__sportsmanager_verein ON berechtigt_verein_id = verein_id WHERE berechtigt_user_id = $user_id AND NOT ausgetreten) ";
} }
function veranstalterFilter($prefix) { function veranstalterFilter($prefix): string
$db =& getDatabase(); {
$user_id = isExternalDatabase() ? 0 : JFactory::getUser()->id; $user_id = isExternalDatabase() ? 0 : Factory::getContainer()->get(SiteApplication::class)->getIdentity()->id;
return " " . $prefix . " (SELECT berechtigt_veranstalter_id FROM #__sportsmanager_berechtigt_fuer_veranstalter WHERE berechtigt_user_id = $user_id) "; return " " . $prefix . " (SELECT berechtigt_veranstalter_id FROM #__sportsmanager_berechtigt_fuer_veranstalter WHERE berechtigt_user_id = $user_id) ";
} }
function veranstaltungFilter($prefix) { function veranstaltungFilter($prefix): string
$db =& getDatabase(); {
$user_id = isExternalDatabase() ? 0 : JFactory::getUser()->id; $user_id = isExternalDatabase() ? 0 : Factory::getContainer()->get(SiteApplication::class)->getIdentity()->id;
return " " . $prefix . " (SELECT berechtigt_veranstaltung_id FROM #__sportsmanager_berechtigt_fuer_veranstaltung INNER JOIN #__sportsmanager_veranstaltung ON veranstaltung_id = berechtigt_veranstaltung_id WHERE berechtigt_user_id = $user_id AND DATEDIFF(letzter_tag, NOW()) >= -14) "; return " " . $prefix . " (SELECT berechtigt_veranstaltung_id FROM #__sportsmanager_berechtigt_fuer_veranstaltung INNER JOIN #__sportsmanager_veranstaltung ON veranstaltung_id = berechtigt_veranstaltung_id WHERE berechtigt_user_id = $user_id AND DATEDIFF(letzter_tag, NOW()) >= -14) ";
} }
// Berechnet Datum zum Montag der ersten Kalenderwoche eines Jahres // Berechnet Datum zum Montag der ersten Kalenderwoche eines Jahres
function firstkw($jahr) { function firstkw($jahr): bool|int
$erster = mktime(0,0,0,1,1,$jahr); {
$wtag = date('w',$erster); $erster = mktime(0, 0, 0, 1, 1, $jahr);
if ($wtag <= 4) { $wtag = date('w', $erster);
/** if ($wtag <= 4) {
* Donnerstag oder kleiner: auf den Montag zurückrechnen. /**
*/ * Donnerstag oder kleiner: auf den Montag zurückrechnen.
$montag = mktime(0,0,0,1,1-($wtag-1),$jahr); */
} $montag = mktime(0, 0, 0, 1, 1 - ($wtag - 1), $jahr);
else { } else {
/** /**
* auf den Montag nach vorne rechnen. * auf den Montag nach vorne rechnen.
*/ */
$montag = mktime(0,0,0,1,1+(7-$wtag+1),$jahr); $montag = mktime(0, 0, 0, 1, 1 + (7 - $wtag + 1), $jahr);
} }
return $montag; return $montag;
} }
// Berechnet Wochentag über Kalenderwoche, Jahr und Wochentag (0 = Montag, ..., 6 = Sonntag) // Berechnet Wochentag über Kalenderwoche, Jahr und Wochentag (0 = Montag, ..., 6 = Sonntag)
function mondaykw($kw, $jahr, $weekday) { function mondaykw($kw, $jahr, $weekday): bool|int
$firstmonday = firstkw($jahr); {
$mon_monat = date('m',$firstmonday); $firstmonday = firstkw($jahr);
$mon_jahr = date('Y',$firstmonday); $mon_monat = date('m', $firstmonday);
$mon_tage = date('d',$firstmonday); $mon_jahr = date('Y', $firstmonday);
$tage = ($kw-1)*7; $mon_tage = (int)date('d', $firstmonday);
$daykw = mktime(0,0,0,$mon_monat,$mon_tage+$tage+$weekday,$mon_jahr); $tage = ($kw - 1) * 7;
return $daykw; return mktime(0, 0, 0, $mon_monat, $mon_tage + $tage + $weekday, $mon_jahr);
} }
// Berechnet Termin am Wochentag (0 = Montag, ..., 6 = Sonntag) in Kalenderwoche zum Datum // Berechnet Termin am Wochentag (0 = Montag, ..., 6 = Sonntag) in Kalenderwoche zum Datum
function geaenderterWochentag($datum, $wochentag) { function geaenderterWochentag($datum, $wochentag): bool|int
$wtag = date('w', $datum); {
if ($wtag == 0) // Sonntag $wtag = date('w', $datum);
$wtag = 7; if ($wtag == 0) // Sonntag
$mon_monat = date('m', $datum); $wtag = 7;
$mon_jahr = date('Y', $datum); $mon_monat = date('m', $datum);
$mon_tage = date('d', $datum); $mon_jahr = date('Y', $datum);
return mktime(0,0,0, $mon_monat, $mon_tage + 1 - $wtag + $wochentag, $mon_jahr); $mon_tage = (int)date('d', $datum);
return mktime(0, 0, 0, $mon_monat, $mon_tage + 1 - $wtag + $wochentag, $mon_jahr);
} }
function normalisiertesDatum($datum) { function normalisiertesDatum($datum): ?string
if ($datum == NULL) {
return NULL; if ($datum == NULL)
return NULL;
if (strpos($datum, "-") !== false) if (str_contains($datum, "-"))
$trennzeichen = "-"; $trennzeichen = "-";
else else
$trennzeichen = "."; $trennzeichen = ".";
$t = explode($trennzeichen, $datum); $t = explode($trennzeichen, $datum);
$n = count($t); $n = count($t);
if ($n == 1) { if ($n == 1) {
$s = $t[0]; $s = $t[0];
if (strlen($s) < 8) if (strlen($s) < 8)
return NULL; return NULL;
$jahr = intval(substr($s, 0, 4)); $jahr = intval(substr($s, 0, 4));
$monat = intval(substr($s, 4, 2)); $monat = intval(substr($s, 4, 2));
$tag = intval(substr($s, 6, 2)); $tag = intval(substr($s, 6, 2));
} } else if ($n == 3) {
else if ($n == 3) { if ($trennzeichen != ".") {
if ($trennzeichen != ".") { $jahr = intval($t[0]);
$jahr = intval($t[0]); if (strlen($t[0]) <= 2)
if (strlen($t[0]) <= 2) $jahr += 1900;
$jahr += 1900; $monat = intval($t[1]);
$monat = intval($t[1]); $tag = intval($t[2]);
$tag = intval($t[2]); } else {
} $tag = intval($t[0]);
else { $monat = intval($t[1]);
$tag = intval($t[0]); $jahr = intval($t[2]);
$monat = intval($t[1]); if (strlen($t[2]) <= 2)
$jahr = intval($t[2]); $jahr += 1900;
if (strlen($t[2]) <= 2) }
$jahr += 1900; } else
} return NULL;
}
else
return NULL;
if (!checkdate($monat, $tag, $jahr)) if (!checkdate($monat, $tag, $jahr))
return NULL; return NULL;
return sprintf("%04d-%02d-%02d", $jahr, $monat, $tag);; return sprintf("%04d-%02d-%02d", $jahr, $monat, $tag);
} }
function normalisierteUhrzeit($uhrzeit) { function normalisierteUhrzeit($uhrzeit): ?string
if ($uhrzeit == NULL) {
return NULL; if ($uhrzeit == NULL)
return NULL;
if (strpos($uhrzeit, "-") !== FALSE) if (str_contains($uhrzeit, "-"))
$trennzeichen = "-"; $trennzeichen = "-";
else else
$trennzeichen = ":"; $trennzeichen = ":";
$t = explode($trennzeichen, $uhrzeit); $t = explode($trennzeichen, $uhrzeit);
$n = count($t); $n = count($t);
if ($n == 1) { if ($n == 1) {
$s = $t[0]; $s = $t[0];
$len = strlen($s); $len = strlen($s);
if ($len != 4 && $len != 6) if ($len != 4 && $len != 6)
return NULL; return NULL;
$stunden = intval(substr($s, 0, 2)); $stunden = intval(substr($s, 0, 2));
$minuten = intval(substr($s, 2, 2)); $minuten = intval(substr($s, 2, 2));
$sekunden = $len != 6 ? 0 : intval(substr($s, 4, 2)); $sekunden = $len != 6 ? 0 : intval(substr($s, 4, 2));
} } else if ($n == 2 || $n == 3) {
else if ($n == 2 || $n == 3) { $stunden = intval($t[0]);
$stunden = intval($t[0]); $minuten = intval($t[1]);
$minuten = intval($t[1]); $sekunden = $n != 3 ? 0 : intval($t[2]);
$sekunden = $n != 3 ? 0 : intval($t[2]); } else
} return NULL;
else
return NULL;
if ($stunden < 0 || $stunden > 23 || $minuten < 0 || $minuten > 59 || $sekunden < 0 || $sekunden > 59) if ($stunden < 0 || $stunden > 23 || $minuten < 0 || $minuten > 59 || $sekunden < 0 || $sekunden > 59)
return NULL; return NULL;
return sprintf("%02d:%02d:%02d", $stunden, $minuten, $sekunden);; return sprintf("%02d:%02d:%02d", $stunden, $minuten, $sekunden);
} }
function runden_detailliert_invers($runden) { function runden_detailliert_invers($runden): ?string
if ($runden == null) {
return null; if ($runden == null)
$runden_invers = ""; return null;
$saetze = explode(" ", $runden); $runden_invers = "";
foreach ($saetze as $satz) {
$punkte = explode(":", $satz);
if (!empty($runden_invers))
$runden_invers .= " ";
$runden_invers .= $punkte[1] . ":" . $punkte[0];
}
return $runden_invers;
}
function runden_detailliert_auswertung($runden) {
$ergebnis = 0;
$heim_saetze = 0;
$unentschieden_saetze = 0;
$gast_saetze = 0;
$heim_punkte = 0;
$gast_punkte = 0;
if ($runden != null) {
$saetze = explode(" ", $runden); $saetze = explode(" ", $runden);
foreach ($saetze as $satz) { foreach ($saetze as $satz) {
$punkte = explode(":", $satz); $punkte = explode(":", $satz);
$heim_punkte += (int)$punkte[0]; if (!empty($runden_invers))
$gast_punkte += (int)$punkte[1]; $runden_invers .= " ";
if ($punkte[0] > $punkte[1]) $runden_invers .= $punkte[1] . ":" . $punkte[0];
$heim_saetze++;
else if ($punkte[0] < $punkte[1])
$gast_saetze++;
else
$unentschieden_saetze++;
} }
if ($heim_saetze > $gast_saetze) return $runden_invers;
$ergebnis = 1; }
else if ($heim_saetze < $gast_saetze)
$ergebnis = 2; function runden_detailliert_auswertung($runden): array
} {
return array($ergebnis, $heim_saetze, $unentschieden_saetze, $gast_saetze, $heim_punkte, $gast_punkte); $ergebnis = 0;
$heim_saetze = 0;
$unentschieden_saetze = 0;
$gast_saetze = 0;
$heim_punkte = 0;
$gast_punkte = 0;
if ($runden != null) {
$saetze = explode(" ", $runden);
foreach ($saetze as $satz) {
$punkte = explode(":", $satz);
$heim_punkte += (int)$punkte[0];
$gast_punkte += (int)$punkte[1];
if ($punkte[0] > $punkte[1])
$heim_saetze++;
else if ($punkte[0] < $punkte[1])
$gast_saetze++;
else
$unentschieden_saetze++;
}
if ($heim_saetze > $gast_saetze)
$ergebnis = 1;
else if ($heim_saetze < $gast_saetze)
$ergebnis = 2;
}
return array($ergebnis, $heim_saetze, $unentschieden_saetze, $gast_saetze, $heim_punkte, $gast_punkte);
} }
// pass two file names // pass two file names
// returns TRUE if files are the same, FALSE otherwise // returns TRUE if files are the same, FALSE otherwise
function files_identical($fn1, $fn2) { function files_identical($fn1, $fn2): bool
if(!is_file($fn1) || !is_file($fn2)) {
return FALSE; if (!is_file($fn1) || !is_file($fn2))
return FALSE;
if(filesize($fn1) !== filesize($fn2)) if (filesize($fn1) !== filesize($fn2))
return FALSE; return FALSE;
if(!$fp1 = fopen($fn1, 'rb')) if (!$fp1 = fopen($fn1, 'rb'))
return FALSE; return FALSE;
if(!$fp2 = fopen($fn2, 'rb')) { if (!$fp2 = fopen($fn2, 'rb')) {
fclose($fp1); fclose($fp1);
return FALSE; return FALSE;
} }
$same = TRUE; $same = TRUE;
while (!feof($fp1) and !feof($fp2)) while (!feof($fp1) and !feof($fp2))
if(fread($fp1, 4096) !== fread($fp2, 4096)) { if (fread($fp1, 4096) !== fread($fp2, 4096)) {
$same = FALSE; $same = FALSE;
break; break;
} }
if(feof($fp1) !== feof($fp2)) if (feof($fp1) !== feof($fp2))
$same = FALSE; $same = FALSE;
fclose($fp1); fclose($fp1);
fclose($fp2); fclose($fp2);
return $same; return $same;
} }
?>
@@ -1,6 +1,12 @@
<?php <?php
function bildKopierenAngepasst($quelle, $ziel, $ziel_breite, $ziel_hoehe, $zuschneiden) use JetBrains\PhpStorm\NoReturn;
use Joomla\CMS\Application\SiteApplication;
use Joomla\CMS\Factory;
use Joomla\Filesystem\File;
use Joomla\Filesystem\Folder;
function bildKopierenAngepasst($quelle, $ziel, $ziel_breite, $ziel_hoehe, $zuschneiden): bool
{ {
$len = strlen($ziel); $len = strlen($ziel);
if ($len < 4 || $ziel[$len - 4] != ".") if ($len < 4 || $ziel[$len - 4] != ".")
@@ -14,7 +20,7 @@ function bildKopierenAngepasst($quelle, $ziel, $ziel_breite, $ziel_hoehe, $zusch
$quelle_breite = imagesx($quelle_image); $quelle_breite = imagesx($quelle_image);
$quelle_hoehe = imagesy($quelle_image); $quelle_hoehe = imagesy($quelle_image);
if ($quelle_breite == $ziel_breite && $quelle_hoehe == $ziel_hoehe) if ($quelle_breite == $ziel_breite && $quelle_hoehe == $ziel_hoehe)
return JFile::copy($quelle, $ziel); return File::copy($quelle, $ziel);
$ziel_image = imagecreatetruecolor($ziel_breite, $ziel_hoehe); $ziel_image = imagecreatetruecolor($ziel_breite, $ziel_hoehe);
$hintergrund = $ext == "png" ? imagecolorallocatealpha($ziel_image, 0, 0, 0, 127) : imagecolorallocate($ziel_image, 64, 64, 64); $hintergrund = $ext == "png" ? imagecolorallocatealpha($ziel_image, 0, 0, 0, 127) : imagecolorallocate($ziel_image, 64, 64, 64);
@@ -53,7 +59,426 @@ function bildKopierenAngepasst($quelle, $ziel, $ziel_breite, $ziel_hoehe, $zusch
} }
$output = ob_get_contents(); $output = ob_get_contents();
ob_end_clean(); ob_end_clean();
JFile::write($ziel, $output); File::write($ziel, $output);
return true; return true;
} }
#[NoReturn] function bildAnpassen($typ, $id = 0): void
{
global $sportsmanager_joomla_path;
$jInput = Factory::getContainer()->get(SiteApplication::class)->input;
if (empty($id))
$id = $jInput->get('id', 0, 'INT');
$fixed_width = $jInput->get('w', 0, 'INT');
$fixed_height = $jInput->get('h', 0, 'INT');
$max_width = $jInput->get('mw', 0, 'INT');
$max_height = $jInput->get('mh', 0, 'INT');
$no_cache = $jInput->get('nc', 0, 'INT');
$pfad = $sportsmanager_joomla_path . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'sportsmanager' . DIRECTORY_SEPARATOR . $typ . DIRECTORY_SEPARATOR . $id . '.';
if (File::exists($pfad . 'png'))
$ext = "png";
else if (File::exists($pfad . 'jpg'))
$ext = "jpg";
else {
ob_end_clean(); // Wegen UTF-8-Zeichen, die in der ausgabe vorhanden sind
header('HTTP/1.1 404 Not Found');
die();
}
$filemtime = filemtime($pfad . $ext);
$last_modified = gmdate('D, d M Y H:i:s', $filemtime) . " GMT";
$etag = md5($id . '.' . $ext . $filemtime);
// Prüfung, ob die im Browsercache vorhandene Datei der hiesigen entspricht
if ($_SERVER['HTTP_IF_NONE_MATCH'] == '"' . $etag . '"' || $last_modified == $_SERVER['HTTP_IF_MODIFIED_SINCE']) {
ob_end_clean(); // Wegen UTF-8-Zeichen, die in der ausgabe vorhanden sind
header('HTTP/1.1 304 Not Modified');
if ($no_cache)
header("Cache-Control: must-revalidate"); // Bewirkt, dass der Browser jedesmal die Datei neu prüft
else
header("Cache-Control: max-age=2592000"); // Bewirkt, dass nach dreißig Tagen die Datei vom Browser auf eine Aktualisierung geprüft wird.
header("Last-Modified: " . $last_modified);
header('ETag: "' . $etag . '"');
die();
}
$image = $ext == "png" ? imagecreatefrompng($pfad . $ext) : imagecreatefromjpeg($pfad . $ext);
if ($image === false) {
ob_end_clean(); // Wegen UTF-8-Zeichen, die in der ausgabe vorhanden sind
header('HTTP/1.1 404 Not Found');
die();
}
ob_end_clean(); // Wegen UTF-8-Zeichen, die in der ausgabe vorhanden sind
header("Content-type: image/" . ($ext == "png" ? "png" : "jpeg"));
if ($no_cache)
header("Cache-Control: must-revalidate"); // Bewirkt, dass der Browser jedesmal die Datei neu prüft
else
header("Cache-Control: max-age=2592000"); // Bewirkt, dass nach dreißig Tagen die Datei vom Browser auf eine Aktualisierung geprüft wird.
header("Last-Modified: " . $last_modified);
header('ETag: "' . $etag . '"');
$width = imagesx($image);
$height = imagesy($image);
if (($fixed_width == 0 || $width == $fixed_width) && ($fixed_height == 0 || $height == $fixed_height) && ($fixed_width != 0 || $max_width == 0 || $width <= $max_width) && ($fixed_height != 0 || $max_height == 0 || $height <= $max_height)) {
if ($ext == "png") {
imagesavealpha($image, true);
imagepng($image);
} else
imagejpeg($image);
die();
}
$new_width = $width;
$new_height = $height;
if ($max_height > 0 && $new_height > $max_height) {
$new_width = max(round($new_width * $max_height / $new_height), 1);
$new_height = $max_height;
}
if ($max_width > 0 && $new_width > $max_width) {
$new_height = max(round($new_height * $max_width / $new_width), 1);
$new_width = $max_width;
}
if ($max_width > 0 && (($max_width - $new_width) % 2) == 1) // Toleranz bei nur 1 Pixel Unterschied
$new_width += 1;
if ($max_height > 0 && (($max_height - $new_height) % 2) == 1) // Toleranz bei nur 1 Pixel Unterschied
$new_height += 1;
$image_resized = imagecreatetruecolor(max($fixed_width, $new_width), max($fixed_height, $new_height));
$color = $ext == "png" ? imagecolorallocatealpha($image_resized, 0, 0, 0, 127) : imagecolorallocate($image_resized, 64, 64, 64);
imagefill($image_resized, 0, 0, $color);
imagecopyresampled($image_resized, $image, round((imagesx($image_resized) - $new_width) / 2), round((imagesy($image_resized) - $new_height) / 2), 0, 0, $new_width, $new_height, $width, $height);
if ($ext == "png") {
imagesavealpha($image_resized, true);
imagepng($image_resized);
} else
imagejpeg($image_resized);
die();
}
function bildLoeschen($typ, $id): void
{
global $sportsmanager_joomla_path;
$typ_exploded = explode("/", $typ);
$typ = $typ_exploded[0];
$typ_prefix = count($typ_exploded) > 1 ? $typ_exploded[1] : "";
$bilder_pfad = $sportsmanager_joomla_path . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'sportsmanager' . DIRECTORY_SEPARATOR . $typ;
$pfad = $bilder_pfad . '/' . $typ_prefix . $id . ".";
if (!is_file($pfad . 'png') && !is_file($pfad . 'jpg'))
return;
$alte_bilder = Folder::files($bilder_pfad, '^' . $typ_prefix . $id . '\.|^' . $typ_prefix . 'I' . $id . 'T');
foreach ($alte_bilder as $fn)
File::delete($bilder_pfad . DIRECTORY_SEPARATOR . $fn);
}
function bildIdentisch($typ1, $id1, $typ2, $id2): bool
{
global $sportsmanager_joomla_path;
$typ1_exploded = explode("/", $typ1);
$typ1 = $typ1_exploded[0];
$typ1_prefix = count($typ1_exploded) > 1 ? $typ1_exploded[1] : "";
$bilder_pfad1 = $sportsmanager_joomla_path . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'sportsmanager' . DIRECTORY_SEPARATOR . $typ1;
$pfad1 = $bilder_pfad1 . '/' . $typ1_prefix . $id1 . ".";
if (is_file($pfad1 . "png"))
$ext = "png";
else if (is_file($pfad1 . "jpg"))
$ext = "jpg";
else
$ext = "";
$pfad1 .= $ext;
$typ2_exploded = explode("/", $typ2);
$typ2 = $typ2_exploded[0];
$typ2_prefix = count($typ2_exploded) > 1 ? $typ2_exploded[1] : "";
$bilder_pfad2 = $sportsmanager_joomla_path . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'sportsmanager' . DIRECTORY_SEPARATOR . $typ2;
$pfad2 = $bilder_pfad2 . '/' . $typ2_prefix . $id2 . "." . $ext;
return files_identical($pfad1, $pfad2);
}
function teamImage($teamId, $vereinId, $width = 240, $height = 240): ?string
{
$url = bildURL("mannschaften", $teamId, 0, 0, $width, $height);
if ($url == null) {
$url = bildURL("vereine", $vereinId, 0, 0, $width, $height);
}
return $url;
}
function playerImage($playerId, $gender, $width = 180, $height = 240): ?string
{
$url = bildURL("spieler", $playerId, $width, $height, 0,0, $gender == 'M' ? 'm' : 'w');
if ($url == null) {
$url = bildURL("mannschaftsmitglieder", $playerId, $width, $height);
}
return $url;
}
#[NoReturn] function spielerbild(): void
{
$db = getDatabase();
$jInput = Factory::getContainer()->get(SiteApplication::class)->input;
$spielernr = $db->escape(trim($jInput->get('spielernr', '', 'RAW')));
$lizenznr = $db->escape(trim($jInput->get('lizenznr', '', 'RAW')));
if (empty($spielernr) && empty($lizenznr)) {
ob_end_clean(); // Wegen UTF-8-Zeichen, die in der ausgabe vorhanden sind
header('HTTP/1.1 404 Not Found');
die();
}
$query = "SELECT spieler_id"
. "\n FROM #__sportsmanager_spieler"
. "\n WHERE NOT ISNULL(aktueller_verein_id) AND NOT bild_ausblenden" . (!empty($spielernr) ? " AND spielernr = '$spielernr'" : " AND lizenznr = '$lizenznr'")
. "\n ORDER BY spieler_id DESC";
$db->setQuery($query);
if (!$db->execute()) {
die($db->stderr(true));
}
$rows = $db->loadObjectList();
if (count($rows) < 1) {
ob_end_clean(); // Wegen UTF-8-Zeichen, die in der ausgabe vorhanden sind
header('HTTP/1.1 404 Not Found');
die();
}
$id = $rows[0]->spieler_id;
bildAnpassen("spieler", $id);
}
function bildURL($typ, $id, $fixed_width = 0, $fixed_height = 0, $max_width = 0, $max_height = 0, $alternativ = ""): ?string
{
global $sportsmanager_joomla_path;
global $sportsmanager_joomla_url;
$typ_exploded = explode("/", $typ);
$typ = $typ_exploded[0];
$typ_prefix = count($typ_exploded) > 1 ? $typ_exploded[1] : "";
$pfad = $sportsmanager_joomla_path . "/images/sportsmanager/" . $typ . "/" . $typ_prefix . $id . ".";
if (is_file($pfad . "png"))
$ext = "png";
else if (is_file($pfad . "jpg"))
$ext = "jpg";
else if (!empty($alternativ)) {
$id = $alternativ;
$pfad = $sportsmanager_joomla_path . "/images/sportsmanager/" . $typ . "/" . $typ_prefix . $id . ".";
if (is_file($pfad . "png"))
$ext = "png";
else if (is_file($pfad . "jpg"))
$ext = "jpg";
else
return null;
}
else
return null;
$time = filemtime($pfad . $ext);
if ($fixed_width > 0 && $fixed_height > 0) {
$pfad_angepasst = $sportsmanager_joomla_path . "/images/sportsmanager/" . $typ . "/" . $typ_prefix . "I" . $id . "T" . $time . "W" . $fixed_width . "H" . $fixed_height . "." . $ext;
if (is_file($pfad_angepasst)) {
return $sportsmanager_joomla_url . 'images/sportsmanager/' . $typ . '/' . basename($pfad_angepasst);
}
}
$size = getimagesize($pfad . $ext);
$width = $size[0];
$height = $size[1];
$max_width = $fixed_width > 0 ? $fixed_width : $max_width;
$max_height = $fixed_height > 0 ? $fixed_height : $max_height;
if (($fixed_width == 0 || $width == $fixed_width) && ($fixed_height == 0 || $height == $fixed_height) && ($fixed_width != 0 || $max_width == 0 || $width <= $max_width) && ($fixed_height != 0 || $max_height == 0 || $height <= $max_height)) {
$pfad_angepasst = $sportsmanager_joomla_path . "/images/sportsmanager/" . $typ . "/" . $typ_prefix . "I" . $id . "T" . $time . "W" . $width . "H" . $height . "." . $ext;
if (!is_file($pfad_angepasst)) {
if (!copy($pfad . $ext, $pfad_angepasst))
return null;
}
return $sportsmanager_joomla_url . 'images/sportsmanager/' . $typ . '/' . basename($pfad_angepasst);
}
$new_width = $width;
$new_height = $height;
if ($max_height > 0 && $new_height > $max_height) {
$new_width = max(round($new_width * $max_height / $new_height), 1);
$new_height = $max_height;
}
if ($max_width > 0 && $new_width > $max_width) {
$new_height = max(round($new_height * $max_width / $new_width), 1);
$new_width = $max_width;
}
if ($max_width > 0 && (($max_width - $new_width) % 2) == 1) // Toleranz bei nur 1 Pixel Unterschied
$new_width += 1;
if ($max_height > 0 && (($max_height - $new_height) % 2) == 1) // Toleranz bei nur 1 Pixel Unterschied
$new_height += 1;
$pfad_angepasst = $sportsmanager_joomla_path . "/images/sportsmanager/" . $typ . "/" . $typ_prefix . "I" . $id . "T" . $time . "W" . max($fixed_width, $new_width) . "H" . max($fixed_height, $new_height) . "." . $ext;
if (!is_file($pfad_angepasst)) {
$image = $ext == "png" ? imagecreatefrompng($pfad . $ext) : imagecreatefromjpeg($pfad . $ext);
if ($image === false)
return null;
$image_resized = imagecreatetruecolor(max($fixed_width, $new_width), max($fixed_height, $new_height));
$color = $ext == "png" ? imagecolorallocatealpha($image_resized, 0, 0, 0, 127) : imagecolorallocate($image_resized, 64, 64, 64);
imagefill($image_resized, 0, 0, $color);
imagecopyresampled($image_resized, $image, round((imagesx($image_resized) - $new_width) / 2), round((imagesy($image_resized) - $new_height) / 2), 0, 0, $new_width, $new_height, $width, $height);
if ($ext == "png") {
imagesavealpha($image_resized, true);
imagepng($image_resized, $pfad_angepasst);
}
else
imagejpeg($image_resized, $pfad_angepasst);
}
return $sportsmanager_joomla_url . 'images/sportsmanager/' . $typ . '/' . basename($pfad_angepasst);
}
/*
* #resize=250
#resize=250,250,blue
#resize=250,250,blue
#resize=250,250&sizes=60%,80%,200%
#resize=250,250,cover&sizes=60%,80%,200%
#resize=250,250,fill&sizes=60%,80%,200%
#crop=250,250,center,top
#crop=250,250
#crop=250,250,center,bottom
#crop=250,250,left
#crop=250,250,right
*/
function yoothemeBild($typ, $id, $alternativ, $resize = '', $zusatz = ""): ?string
{
global $sportsmanager_joomla_path;
$typ_exploded = explode("/", $typ);
$typ = $typ_exploded[0];
$typ_prefix = count($typ_exploded) > 1 ? $typ_exploded[1] : "";
$pfad = $sportsmanager_joomla_path . "/images/sportsmanager/" . $typ . "/" . $typ_prefix . $id . ".";
if (is_file($pfad . "png"))
$ext = "png";
else if (is_file($pfad . "jpg"))
$ext = "jpg";
else if (!empty($alternativ)) {
$id = $alternativ;
$pfad = $sportsmanager_joomla_path . "/images/sportsmanager/" . $typ . "/" . $typ_prefix . $id . ".";
if (is_file($pfad . "png"))
$ext = "png";
else if (is_file($pfad . "jpg"))
$ext = "jpg";
else
return null;
}
else
return null;
$bildpfad = "images/sportsmanager/" . $typ . "/" . $typ_prefix . $id . "." . $ext;
return '<img class="el-image" data-src="' . $bildpfad . $resize . '" ' . $zusatz . ' uk-img />';
}
function bildHTML($typ, $id, $fixed_width = 0, $fixed_height = 0, $max_width = 0, $max_height = 0, $zusatz = "", $alternativ = ""): ?string
{
global $sportsmanager_joomla_path;
global $sportsmanager_joomla_url;
$typ_exploded = explode("/", $typ);
$typ = $typ_exploded[0];
$typ_prefix = count($typ_exploded) > 1 ? $typ_exploded[1] : "";
$pfad = $sportsmanager_joomla_path . "/images/sportsmanager/" . $typ . "/" . $typ_prefix . $id . ".";
if (is_file($pfad . "png"))
$ext = "png";
else if (is_file($pfad . "jpg"))
$ext = "jpg";
else if (!empty($alternativ)) {
$id = $alternativ;
$pfad = $sportsmanager_joomla_path . "/images/sportsmanager/" . $typ . "/" . $typ_prefix . $id . ".";
if (is_file($pfad . "png"))
$ext = "png";
else if (is_file($pfad . "jpg"))
$ext = "jpg";
else
return null;
}
else
return null;
$time = filemtime($pfad . $ext);
if ($fixed_width > 0 && $fixed_height > 0) {
$pfad_angepasst = $sportsmanager_joomla_path . "/images/sportsmanager/" . $typ . "/" . $typ_prefix . "I" . $id . "T" . $time . "W" . $fixed_width . "H" . $fixed_height . "." . $ext;
if (is_file($pfad_angepasst)) {
return '<img src="' . $sportsmanager_joomla_url . 'images/sportsmanager/' . $typ . '/' . basename($pfad_angepasst) . '" width="' . $fixed_width . '" height="' . $fixed_height . '" ' . $zusatz . ' />';
}
}
$size = getimagesize($pfad . $ext);
$width = $size[0];
$height = $size[1];
$max_width = $fixed_width > 0 ? $fixed_width : $max_width;
$max_height = $fixed_height > 0 ? $fixed_height : $max_height;
if (($fixed_width == 0 || $width == $fixed_width) && ($fixed_height == 0 || $height == $fixed_height) && ($fixed_width != 0 || $max_width == 0 || $width <= $max_width) && ($fixed_height != 0 || $max_height == 0 || $height <= $max_height)) {
$pfad_angepasst = $sportsmanager_joomla_path . "/images/sportsmanager/" . $typ . "/" . $typ_prefix . "I" . $id . "T" . $time . "W" . $width . "H" . $height . "." . $ext;
if (!is_file($pfad_angepasst)) {
if (!copy($pfad . $ext, $pfad_angepasst))
return null;
}
return '<img src="' . $sportsmanager_joomla_url . 'images/sportsmanager/' . $typ . '/' . basename($pfad_angepasst) . '" width="' . $width . '" height="' . $height . '" ' . $zusatz . ' />';
}
$new_width = $width;
$new_height = $height;
if ($max_height > 0 && $new_height > $max_height) {
$new_width = max(round($new_width * $max_height / $new_height), 1);
$new_height = $max_height;
}
if ($max_width > 0 && $new_width > $max_width) {
$new_height = max(round($new_height * $max_width / $new_width), 1);
$new_width = $max_width;
}
if ($max_width > 0 && (($max_width - $new_width) % 2) == 1) // Toleranz bei nur 1 Pixel Unterschied
$new_width += 1;
if ($max_height > 0 && (($max_height - $new_height) % 2) == 1) // Toleranz bei nur 1 Pixel Unterschied
$new_height += 1;
$pfad_angepasst = $sportsmanager_joomla_path . "/images/sportsmanager/" . $typ . "/" . $typ_prefix . "I" . $id . "T" . $time . "W" . max($fixed_width, $new_width) . "H" . max($fixed_height, $new_height) . "." . $ext;
if (!is_file($pfad_angepasst)) {
$image = $ext == "png" ? imagecreatefrompng($pfad . $ext) : imagecreatefromjpeg($pfad . $ext);
if ($image === false)
return null;
$image_resized = imagecreatetruecolor(max($fixed_width, $new_width), max($fixed_height, $new_height));
$color = $ext == "png" ? imagecolorallocatealpha($image_resized, 0, 0, 0, 127) : imagecolorallocate($image_resized, 64, 64, 64);
imagefill($image_resized, 0, 0, $color);
imagecopyresampled($image_resized, $image, round((imagesx($image_resized) - $new_width) / 2), round((imagesy($image_resized) - $new_height) / 2), 0, 0, $new_width, $new_height, $width, $height);
if ($ext == "png") {
imagesavealpha($image_resized, true);
imagepng($image_resized, $pfad_angepasst);
}
else
imagejpeg($image_resized, $pfad_angepasst);
}
return '<img src="' . $sportsmanager_joomla_url . 'images/sportsmanager/' . $typ . '/' . basename($pfad_angepasst) . '" width="' . max($fixed_width, $new_width) . '" height="' . max($fixed_height, $new_height) . '" ' . $zusatz . ' />';
}
File diff suppressed because it is too large Load Diff
@@ -1,204 +1,218 @@
<?php <?php
use JetBrains\PhpStorm\NoReturn;
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
require_once(JPATH_COMPONENT . DIRECTORY_SEPARATOR . 'views/sportsmanager/view_tools.php'); require_once JPATH_SITE . '/components/com_sportsmanager/views/sportsmanager/view_tools.php';
require_once JPATH_SITE . '/components/com_sportsmanager/util/image.php';
class JSON_sportsmanager { class JSON_sportsmanager
{
static function mannschaften($veranstaltung, $rows) { static function mannschaften($veranstaltung, $rows): array
$teams = []; {
foreach ($rows as $team) { $teams = [];
$team->teambild = teamImage($team->team_id, $team->verein_id); foreach ($rows as $team) {
$teams[] = $team; $team->teambild = teamImage($team->team_id, $team->verein_id);
} $teams[] = $team;
if ($veranstaltung == null) {
return $teams;
}
return [
'veranstaltung' => $veranstaltung,
'teams' => $teams,
];
}
static function tabelleAnzeigen($veranstaltung, $modus, $teams, $spieltag, $spieltage, $alleine_angezeigt, $praesentation) {
foreach ($teams as $team) {
$team->teambild = teamImage($team->team_id, $team->verein_id);
}
return [
'tabelle' => $teams,
'modus' => $modus,
];
}
static function tabelleEigeneAnzeigen($veranstaltung, $modus, $teams, $alleine_angezeigt, $praesentation) {
foreach($teams as $team) {
$team->teambild = teamImage($team->team_id, $team->verein_id);
} }
return [ if ($veranstaltung == null) {
'tabelle' => $teams, return $teams;
}
return [
'veranstaltung' => $veranstaltung,
'teams' => $teams,
];
}
static function tabelleAnzeigen($modus, $teams): array
{
foreach ($teams as $team) {
$team->teambild = teamImage($team->team_id, $team->verein_id);
}
return [
'tabelle' => $teams,
'modus' => $modus, 'modus' => $modus,
]; ];
} }
static function _getPlayerDetails($game, $home_player_map, $away_player_map) { static function tabelleEigeneAnzeigen($modus, $teams): array
// TODO dynamisch machen {
$game->heim_spieler_1_vorname = isset($home_player_map[$game->heim_spieler_1_id]) foreach ($teams as $team) {
? $home_player_map[$game->heim_spieler_1_id]->vorname $team->teambild = teamImage($team->team_id, $team->verein_id);
: NULL; }
$game->heim_spieler_1_nachname = isset($home_player_map[$game->heim_spieler_1_id]) return [
? $home_player_map[$game->heim_spieler_1_id]->nachname 'tabelle' => $teams,
: NULL; 'modus' => $modus,
$game->heim_spieler_1_bild = isset($home_player_map[$game->heim_spieler_1_id]) ];
? $home_player_map[$game->heim_spieler_1_id]->bild }
: NULL;
$game->heim_spieler_2_vorname = isset($home_player_map[$game->heim_spieler_2_id]) static function _getPlayerDetails($game, $home_player_map, $away_player_map): void
? $home_player_map[$game->heim_spieler_2_id]->vorname {
: NULL; // TODO dynamisch machen
$game->heim_spieler_2_nachname = isset($home_player_map[$game->heim_spieler_2_id]) $game->heim_spieler_1_vorname = isset($home_player_map[$game->heim_spieler_1_id])
? $home_player_map[$game->heim_spieler_2_id]->nachname ? $home_player_map[$game->heim_spieler_1_id]->vorname
: NULL; : NULL;
$game->heim_spieler_2_bild = isset($home_player_map[$game->heim_spieler_2_id]) $game->heim_spieler_1_nachname = isset($home_player_map[$game->heim_spieler_1_id])
? $home_player_map[$game->heim_spieler_2_id]->bild ? $home_player_map[$game->heim_spieler_1_id]->nachname
: NULL; : NULL;
$game->heim_spieler_1_bild = isset($home_player_map[$game->heim_spieler_1_id])
? $home_player_map[$game->heim_spieler_1_id]->bild
: NULL;
$game->gast_spieler_1_vorname = isset($away_player_map[$game->gast_spieler_1_id]) $game->heim_spieler_2_vorname = isset($home_player_map[$game->heim_spieler_2_id])
? $away_player_map[$game->gast_spieler_1_id]->vorname ? $home_player_map[$game->heim_spieler_2_id]->vorname
: NULL; : NULL;
$game->gast_spieler_1_nachname = isset($away_player_map[$game->gast_spieler_1_id]) $game->heim_spieler_2_nachname = isset($home_player_map[$game->heim_spieler_2_id])
? $away_player_map[$game->gast_spieler_1_id]->nachname ? $home_player_map[$game->heim_spieler_2_id]->nachname
: NULL; : NULL;
$game->gast_spieler_1_bild = isset($away_player_map[$game->gast_spieler_1_id]) $game->heim_spieler_2_bild = isset($home_player_map[$game->heim_spieler_2_id])
? $away_player_map[$game->gast_spieler_1_id]->bild ? $home_player_map[$game->heim_spieler_2_id]->bild
: NULL; : NULL;
$game->gast_spieler_2_vorname = isset($away_player_map[$game->gast_spieler_2_id]) $game->gast_spieler_1_vorname = isset($away_player_map[$game->gast_spieler_1_id])
? $away_player_map[$game->gast_spieler_2_id]->vorname ? $away_player_map[$game->gast_spieler_1_id]->vorname
: NULL; : NULL;
$game->gast_spieler_2_nachname = isset($away_player_map[$game->gast_spieler_2_id]) $game->gast_spieler_1_nachname = isset($away_player_map[$game->gast_spieler_1_id])
? $away_player_map[$game->gast_spieler_2_id]->nachname ? $away_player_map[$game->gast_spieler_1_id]->nachname
: NULL; : NULL;
$game->gast_spieler_2_bild = isset($away_player_map[$game->gast_spieler_2_id]) $game->gast_spieler_1_bild = isset($away_player_map[$game->gast_spieler_1_id])
? $away_player_map[$game->gast_spieler_2_id]->bild ? $away_player_map[$game->gast_spieler_1_id]->bild
: NULL; : NULL;
} $game->gast_spieler_2_vorname = isset($away_player_map[$game->gast_spieler_2_id])
? $away_player_map[$game->gast_spieler_2_id]->vorname
: NULL;
$game->gast_spieler_2_nachname = isset($away_player_map[$game->gast_spieler_2_id])
? $away_player_map[$game->gast_spieler_2_id]->nachname
: NULL;
$game->gast_spieler_2_bild = isset($away_player_map[$game->gast_spieler_2_id])
? $away_player_map[$game->gast_spieler_2_id]->bild
: NULL;
static function adminEditBegegnungSpielplan($bestaetigen, $veranstaltung, $begegnung, $heim_team, $gast_team, $spiele, $heim_spieler, $gast_spieler, $teamspiel_modus, $encrypted_pin, $count_verlegen_aktionen, $erneut_oeffnen, $aus_uebersicht) { }
$heim_team->teambild = teamImage($heim_team->team_id, $heim_team->verein_id);
$gast_team->teambild = teamImage($gast_team->team_id, $gast_team->verein_id); static function adminEditBegegnungSpielplan($bestaetigen, $veranstaltung, $begegnung, $heim_team, $gast_team, $spiele, $heim_spieler, $gast_spieler, $teamspiel_modus): array
$heim_spieler_map = []; {
$gast_spieler_map = []; $heim_team->teambild = teamImage($heim_team->team_id, $heim_team->verein_id);
foreach ($heim_spieler as $player) { $gast_team->teambild = teamImage($gast_team->team_id, $gast_team->verein_id);
$player->bild = playerImage($player->spieler_id, $player->geschlecht); $heim_spieler_map = [];
$heim_spieler_map[$player->spieler_id] = $player; $gast_spieler_map = [];
} foreach ($heim_spieler as $player) {
foreach ($gast_spieler as $player) { $player->bild = playerImage($player->spieler_id, $player->geschlecht);
$player->bild = playerImage($player->spieler_id, $player->geschlecht); $heim_spieler_map[$player->spieler_id] = $player;
$gast_spieler_map[$player->spieler_id] = $player; }
} foreach ($gast_spieler as $player) {
$begegnung->bezeichnung = $veranstaltung->bezeichnung; $player->bild = playerImage($player->spieler_id, $player->geschlecht);
$begegnung->veranstaltung_id = $veranstaltung->veranstaltung_id; $gast_spieler_map[$player->spieler_id] = $player;
foreach ($spiele as $game) { }
self::_getPlayerDetails($game, $heim_spieler_map, $gast_spieler_map); $begegnung->bezeichnung = $veranstaltung->bezeichnung;
} $begegnung->veranstaltung_id = $veranstaltung->veranstaltung_id;
foreach ($spiele as $game) {
self::_getPlayerDetails($game, $heim_spieler_map, $gast_spieler_map);
}
$begegnung->spieltag = Rundenbezeichnung($begegnung->spieltag, $veranstaltung->unterteilung == 0); $begegnung->spieltag = Rundenbezeichnung($begegnung->spieltag, $veranstaltung->unterteilung == 0);
return [ return [
'bestaetigen' => $bestaetigen, 'bestaetigen' => $bestaetigen,
'veranstaltung' => $veranstaltung, 'veranstaltung' => $veranstaltung,
'begegnung' => $begegnung, 'begegnung' => $begegnung,
'heim_team' => $heim_team, 'heim_team' => $heim_team,
'gast_team' => $gast_team, 'gast_team' => $gast_team,
'spiele' => $spiele, 'spiele' => $spiele,
'heim_spieler' => $heim_spieler, 'heim_spieler' => $heim_spieler,
'gast_spieler' => $gast_spieler, 'gast_spieler' => $gast_spieler,
'modus' => $teamspiel_modus, 'modus' => $teamspiel_modus,
]; ];
} }
static function mannschaftDetails($veranstaltung, $team, $mitglieder, $mailverteiler, $mitglieder_statistiken, $teamansprechpartner, $begegnungen, $vorheriges_team_id, $naechstes_team_id, $team_moderator, $details_anzeigen, $ansprechpartner_anzeigen, $weitere_veranstaltungen, $veranstaltungsbezeichnungen, $spielberechtigungen, $ansicht_vereinigt, $ist_vergangen) { static function mannschaftDetails($veranstaltung, $team, $mitglieder, $teamansprechpartner, $begegnungen, $ansprechpartner_anzeigen, $veranstaltungsbezeichnungen): array
global $sportsmanager_joomla_path; {
global $sportsmanager_joomla_url; global $sportsmanager_joomla_path;
global $sportsmanager_joomla_url;
$team->teambild = teamImage($team->team_id, $team->verein_id); $team->teambild = teamImage($team->team_id, $team->verein_id);
$team->color = getColorOfImage(str_replace($sportsmanager_joomla_url, $sportsmanager_joomla_path . '/', $team->teambild)); $team->color = getColorOfImage(str_replace($sportsmanager_joomla_url, $sportsmanager_joomla_path . '/', $team->teambild));
foreach ($mitglieder as $m) { foreach ($mitglieder as $m) {
$m->bild = playerImage($m->spieler_id, $m->geschlecht); $m->bild = playerImage($m->spieler_id, $m->geschlecht);
} }
foreach ($begegnungen as $begegnung) { foreach ($begegnungen as $begegnung) {
$begegnung->heim_name = $begegnung->auswaerts == '1' ? $begegnung->gegner : $team->teamname; $begegnung->heim_name = $begegnung->auswaerts == '1' ? $begegnung->gegner : $team->teamname;
$begegnung->heim_teamgruppe = $begegnung->auswaerts == '1' ? $begegnung->gegner_teamgruppe_id : $team->teamgruppe_id; $begegnung->heim_teamgruppe = $begegnung->auswaerts == '1' ? $begegnung->gegner_teamgruppe_id : $team->teamgruppe_id;
$begegnung->gast_name = $begegnung->auswaerts == '1' ? $team->teamname : $begegnung->gegner; $begegnung->gast_name = $begegnung->auswaerts == '1' ? $team->teamname : $begegnung->gegner;
$begegnung->gast_teamgruppe = $begegnung->auswaerts == '1' ? $team->teamgruppe_id : $begegnung->gegner_teamgruppe_id; $begegnung->gast_teamgruppe = $begegnung->auswaerts == '1' ? $team->teamgruppe_id : $begegnung->gegner_teamgruppe_id;
$begegnung->spielort_name = $begegnung->heimspielort_name; $begegnung->spielort_name = $begegnung->heimspielort_name;
$begegnung->heim_bild = $begegnung->auswaerts == '1' ? teamImage($begegnung->gegner_id, $begegnung->gegner_verein_id) : teamImage($team->team_id, $team->verein_id); $begegnung->heim_bild = $begegnung->auswaerts == '1' ? teamImage($begegnung->gegner_id, $begegnung->gegner_verein_id) : teamImage($team->team_id, $team->verein_id);
$begegnung->gast_bild = $begegnung->auswaerts == '1' ? teamImage($team->team_id, $team->verein_id) : teamImage($begegnung->gegner_id, $begegnung->gegner_verein_id); $begegnung->gast_bild = $begegnung->auswaerts == '1' ? teamImage($team->team_id, $team->verein_id) : teamImage($begegnung->gegner_id, $begegnung->gegner_verein_id);
$begegnung->bezeichnung = $veranstaltungsbezeichnungen[$begegnung->veranstaltung_id]; $begegnung->bezeichnung = $veranstaltungsbezeichnungen[$begegnung->veranstaltung_id];
$begegnung->spieltag = Rundenbezeichnung($begegnung->spieltag, $veranstaltung->unterteilung == 0); $begegnung->spieltag = Rundenbezeichnung($begegnung->spieltag, $veranstaltung->unterteilung == 0);
} }
if (getUserID() == 0 && $ansprechpartner_anzeigen) { if (getUserID() == 0 && $ansprechpartner_anzeigen) {
foreach ($teamansprechpartner as $ansprechpartner) { foreach ($teamansprechpartner as $ansprechpartner) {
unset($ansprechpartner->mobil); unset($ansprechpartner->mobil);
unset($ansprechpartner->telefon); unset($ansprechpartner->telefon);
} }
} }
$team->veranstaltung_name = $veranstaltungsbezeichnungen[$team->veranstaltung_id]; $team->veranstaltung_name = $veranstaltungsbezeichnungen[$team->veranstaltung_id];
return [ return [
'team' => $team, 'team' => $team,
'mitglieder' => $mitglieder, 'mitglieder' => $mitglieder,
'kontakt' => $ansprechpartner_anzeigen ? $teamansprechpartner : NULL, 'kontakt' => $ansprechpartner_anzeigen ? $teamansprechpartner : NULL,
'begegnungen' => $begegnungen 'begegnungen' => $begegnungen
]; ];
} }
static function JSON($data, $meta = NULL) { #[NoReturn] static function JSON($data, $meta = NULL): void
$response = [ {
'data' => $data $response = [
]; 'data' => $data
if ($meta != NULL) { ];
$response['meta'] = $meta; if ($meta != NULL) {
} $response['meta'] = $meta;
header('Content-Type: application/json; charset=utf-8', true); }
echo json_encode($response); header('Content-Type: application/json; charset=utf-8');
jexit(); echo json_encode($response);
} jexit();
}
static function spielerstatistik($spielerstatistik, $spielerstatistik_punkte, $allein_angezeigt, $filter_saison_id, $vorherige_spielerstatistik_id, $naechste_spielerstatistik_id, $details_anzeigen) { #[NoReturn] static function spielerstatistik($spielerstatistik_punkte): void
$rank = 1; {
foreach ($spielerstatistik_punkte as $s) { $rank = 1;
$s->spieler_bild = playerImage($s->spieler_id, $s->geschlecht); foreach ($spielerstatistik_punkte as $s) {
$s->spieler_2_bild= playerImage($s->spieler_2_id, $s->geschlecht_2); $s->spieler_bild = playerImage($s->spieler_id, $s->geschlecht);
$s->quote = ($s->spielpunkte_gewonnen > 0 || $s->spielpunkte_verloren > 0) $s->spieler_2_bild = playerImage($s->spieler_2_id, $s->geschlecht_2);
? round($s->spielpunkte_gewonnen * 100 / ($s->spielpunkte_gewonnen + $s->spielpunkte_verloren), 0) . '%' $s->quote = ($s->spielpunkte_gewonnen > 0 || $s->spielpunkte_verloren > 0)
: '-'; ? round($s->spielpunkte_gewonnen * 100 / ($s->spielpunkte_gewonnen + $s->spielpunkte_verloren)) . '%'
$s->rank = '' . $rank; : '-';
$rank++; $s->rank = '' . $rank;
} $rank++;
self::JSON($spielerstatistik_punkte); }
} self::JSON($spielerstatistik_punkte);
}
static function spielerDetails($spieler, $vereine, $veranstalter, $spieler_elo_verlauf_einzel, $spieler_elo_verlauf_doppel, $spielerNamen, $teamNamen, $veranstaltungBezeichnungen, $turnierdisziplinBezeichnungen, $individualwettbewerbBezeichnungen, $ranglistenplatzierungen, $turnierplatzierungen, $teams, $sortierung, $vorheriger_spieler_id, $naechster_spieler_id, $elo_detailliert, $statistik, $beginn, $kategorie, $einstufungen, $filter, $veranstaltungid, $veranstalterid, $einstufungid, $unabhaengige_ansicht, $details_anzeigen) { #[NoReturn] static function spielerDetails($spieler, $vereine, $veranstalter, $spieler_elo_verlauf_einzel, $spieler_elo_verlauf_doppel, $spielerNamen, $teamNamen, $veranstaltungBezeichnungen, $turnierdisziplinBezeichnungen, $individualwettbewerbBezeichnungen, $ranglistenplatzierungen, $turnierplatzierungen, $teams, $elo_detailliert, $statistik, $einstufungen): void
$letzte_einzel = []; {
$spieler->bild = playerImage($spieler->spieler_id, $spieler->geschlecht); $letzte_einzel = [];
for ($i = sizeof($spieler_elo_verlauf_einzel) - 1; $i >= max(sizeof($spieler_elo_verlauf_einzel)-10, 0); $i--) { $spieler->bild = playerImage($spieler->spieler_id, $spieler->geschlecht);
$e = $spieler_elo_verlauf_einzel[$i]; for ($i = sizeof($spieler_elo_verlauf_einzel) - 1; $i >= max(sizeof($spieler_elo_verlauf_einzel) - 10, 0); $i--) {
$letzte_einzel[] = [ $e = $spieler_elo_verlauf_einzel[$i];
'datum' => $e['z'], $letzte_einzel[] = [
'datum' => $e['z'],
'spieler_1' => isset($spielerNamen[$e['h1']]) ? [ 'spieler_1' => isset($spielerNamen[$e['h1']]) ? [
'spieler_id' => $e['h1'], 'spieler_id' => $e['h1'],
'bild' => playerImage($e['h1'], 'M'), 'bild' => playerImage($e['h1'], 'M'),
'vorname' => explode(', ',$spielerNamen[$e['h1']])[1], 'vorname' => explode(', ', $spielerNamen[$e['h1']])[1],
'nachname' => explode(', ',$spielerNamen[$e['h1']])[0], 'nachname' => explode(', ', $spielerNamen[$e['h1']])[0],
] : NULL, ] : NULL,
'spieler_team' => isset($e['th']) ? [ 'spieler_team' => isset($e['th']) ? [
'id' => $e['th'], 'id' => $e['th'],
'name' => $teamNamen[$e['th']], 'name' => $teamNamen[$e['th']],
]: NULL, ] : NULL,
'gegner_1' => isset($spielerNamen[$e['g1']]) ? [ 'gegner_1' => isset($spielerNamen[$e['g1']]) ? [
'spieler_id' => $e['g1'], 'spieler_id' => $e['g1'],
'bild' => playerImage($e['g1'], 'M'), 'bild' => playerImage($e['g1'], 'M'),
@@ -221,10 +235,10 @@ class JSON_sportsmanager {
]; ];
} }
$letzte_doppel = []; $letzte_doppel = [];
for ($i = sizeof($spieler_elo_verlauf_doppel) - 1; $i >= max(sizeof($spieler_elo_verlauf_doppel) - 10, 0); $i--) { for ($i = sizeof($spieler_elo_verlauf_doppel) - 1; $i >= max(sizeof($spieler_elo_verlauf_doppel) - 10, 0); $i--) {
$d = $spieler_elo_verlauf_doppel[$i]; $d = $spieler_elo_verlauf_doppel[$i];
$letzte_doppel[] = [ $letzte_doppel[] = [
'datum' => $d['z'], 'datum' => $d['z'],
'spieler_1' => isset($spielerNamen[$d['h1']]) ? [ 'spieler_1' => isset($spielerNamen[$d['h1']]) ? [
'spieler_id' => $d['h1'], 'spieler_id' => $d['h1'],
'bild' => playerImage($d['h1'], 'M'), 'bild' => playerImage($d['h1'], 'M'),
@@ -252,7 +266,7 @@ class JSON_sportsmanager {
'bild' => playerImage($d['g2'], 'M'), 'bild' => playerImage($d['g2'], 'M'),
'vorname' => explode(', ', $spielerNamen[$d['g2']])[1], 'vorname' => explode(', ', $spielerNamen[$d['g2']])[1],
'nachname' => explode(', ', $spielerNamen[$d['g2']])[0], 'nachname' => explode(', ', $spielerNamen[$d['g2']])[0],
]: NULL, ] : NULL,
'gegner_team' => isset($d['th']) && isset($d['tg']) ? 'gegner_team' => isset($d['th']) && isset($d['tg']) ?
[ [
'id' => $d['tg'], 'id' => $d['tg'],
@@ -268,11 +282,11 @@ class JSON_sportsmanager {
'ergebnis' => $d['s'], 'ergebnis' => $d['s'],
]; ];
} }
self::JSON([ self::JSON([
'spieler' => $spieler, 'spieler' => $spieler,
'vereine' => $vereine, 'vereine' => $vereine,
'teams' => $teams, 'teams' => $teams,
'veranstalter'=> $veranstalter, 'veranstalter' => $veranstalter,
'ranglisten_platzierungen' => $ranglistenplatzierungen, 'ranglisten_platzierungen' => $ranglistenplatzierungen,
'turnier_platzierungen' => $turnierplatzierungen, 'turnier_platzierungen' => $turnierplatzierungen,
'statistik' => $statistik, 'statistik' => $statistik,
@@ -285,53 +299,54 @@ class JSON_sportsmanager {
]); ]);
} }
static function begegnungVerlegen($veranstaltung, $begegnung, $heim_team, $gast_team, $verlegen_aktionen, $berechtigt_fuer_akzeptieren, $aus_uebersicht, $vorschlagendes_team_id) { #[NoReturn] static function begegnungVerlegen($veranstaltung, $verlegen_aktionen, $berechtigt_fuer_akzeptieren, $vorschlagendes_team_id): void
$letzte_aktionen = array(); {
foreach ($verlegen_aktionen as $aktion) { $letzte_aktionen = array();
if ($aktion->aktion == 1 || $aktion->aktion == 5 || $aktion == 10) { foreach ($verlegen_aktionen as $aktion) {
break; if ($aktion->aktion == 1 || $aktion->aktion == 5 || $aktion == 10) {
} break;
array_push($letzte_aktionen, $aktion); }
} $letzte_aktionen[] = $aktion;
$termine = array(); }
if (count($letzte_aktionen) > 0) { $termine = array();
$eingetragen = $letzte_aktionen[0]->eingetragen; if (count($letzte_aktionen) > 0) {
foreach ($letzte_aktionen as $aktion) { $eingetragen = $letzte_aktionen[0]->eingetragen;
if ($aktion->eingetragen != $eingetragen || $aktion->aktion != 0 || $aktion->zeitpunkt == NULL) { foreach ($letzte_aktionen as $aktion) {
break; if ($aktion->eingetragen != $eingetragen || $aktion->aktion != 0 || $aktion->zeitpunkt == NULL) {
} break;
array_push($termine, $aktion); }
} $termine[] = $aktion;
} }
}
$berechtigt_anfordern = $veranstaltung->initial_ohne_termin != 1 && (count($letzte_aktionen) == 0 || $letzte_aktionen[0]->aktion == 1); $berechtigt_anfordern = $veranstaltung->initial_ohne_termin != 1 && (count($letzte_aktionen) == 0 || $letzte_aktionen[0]->aktion == 1);
$berechtigt_vorschlagen = ($veranstaltung->initial_ohne_termin != 2 || (count($letzte_aktionen) != 0 && $letzte_aktionen[0]->aktion != 1)) $berechtigt_vorschlagen = ($veranstaltung->initial_ohne_termin != 2 || (count($letzte_aktionen) != 0 && $letzte_aktionen[0]->aktion != 1))
&& (!$veranstaltung->keine_gegenvorschlaege || count($letzte_aktionen) == 0 || $letzte_aktionen[0]->aktion != 3 || $letzte_aktionen[0]->team_id != $vorschlagendes_team_id) && (!$veranstaltung->keine_gegenvorschlaege || count($letzte_aktionen) == 0 || $letzte_aktionen[0]->aktion != 3 || $letzte_aktionen[0]->team_id != $vorschlagendes_team_id)
&& (count($termine) == 0 || !$veranstaltung->keine_gegenvorschlaege || $letzte_aktionen[0]->team_id == $vorschlagendes_team_id); && (count($termine) == 0 || !$veranstaltung->keine_gegenvorschlaege || $letzte_aktionen[0]->team_id == $vorschlagendes_team_id);
$berechtigt_ablehnen = count($letzte_aktionen) != 0 && ($letzte_aktionen[0]->aktion == 0 || $letzte_aktionen[0]->aktion == 3 || $letzte_aktionen[0]->aktion == 4) $berechtigt_ablehnen = count($letzte_aktionen) != 0 && ($letzte_aktionen[0]->aktion == 0 || $letzte_aktionen[0]->aktion == 3 || $letzte_aktionen[0]->aktion == 4)
&& ((($veranstaltung->ablehnen == 1 || $veranstaltung->ablehnen == 3) && $berechtigt_fuer_akzeptieren) || (($veranstaltung->ablehnen == 1 || $veranstaltung->ablehnen == 2) && ((($veranstaltung->ablehnen == 1 || $veranstaltung->ablehnen == 3) && $berechtigt_fuer_akzeptieren) || (($veranstaltung->ablehnen == 1 || $veranstaltung->ablehnen == 2)
&& $berechtigt_vorschlagen)); && $berechtigt_vorschlagen));
$response = []; $response = [];
$anzahl_termine = $veranstaltung->termine_maximal == 0 ? 3 : $veranstaltung->termine_maximal; $anzahl_termine = $veranstaltung->termine_maximal == 0 ? 3 : $veranstaltung->termine_maximal;
for ($termin = 1; $termin <= $anzahl_termine; $termin++) { for ($termin = 1; $termin <= $anzahl_termine; $termin++) {
if (isset($termine[$termin-1])) { if (isset($termine[$termin - 1])) {
$response[] = [ $response[] = [
'begegnung_historie_id' => $termine[$termin-1]->begegnung_historie_id, 'begegnung_historie_id' => $termine[$termin - 1]->begegnung_historie_id,
'zeitpunkt' => $termine[$termin-1]->zeitpunkt 'zeitpunkt' => $termine[$termin - 1]->zeitpunkt
]; ];
} }
} }
self::JSON([ self::JSON([
'termine' => $response, 'termine' => $response,
'berechtigt_anfordern' => $berechtigt_anfordern, 'berechtigt_anfordern' => $berechtigt_anfordern,
'berechtigt_ablehnen' => $berechtigt_ablehnen, 'berechtigt_ablehnen' => $berechtigt_ablehnen,
'berechtigt_akzeptieren' => $berechtigt_fuer_akzeptieren ? TRUE : FALSE, 'berechtigt_akzeptieren' => (bool)$berechtigt_fuer_akzeptieren,
'termine_minimal' => $veranstaltung->termine_minimal, 'termine_minimal' => $veranstaltung->termine_minimal,
'termine_maximal' => $veranstaltung->termine_maximal, 'termine_maximal' => $veranstaltung->termine_maximal,
]); ]);
} }
} }
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -3,29 +3,32 @@
* Sports Manager (C) 2006-2020, Sven Nickel * Sports Manager (C) 2006-2020, Sven Nickel
*/ */
use Joomla\Filesystem\Folder;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Uri\Uri;
// kein direkter Zugriff // kein direkter Zugriff
defined("_JEXEC") or die("Restricted access"); defined("_JEXEC") or die("Restricted access");
function htmlentities_utf8($s) { function htmlentities_utf8($s): string
{
return htmlentities($s, ENT_QUOTES, "UTF-8"); return htmlentities($s, ENT_QUOTES, "UTF-8");
} }
function htmlentities_noquotes_utf8($s) { function addOnLoad($function): void
return htmlentities($s, ENT_NOQUOTES, "UTF-8"); {
}
function addOnLoad($function) {
?> ?>
<script language="JavaScript"> <script language="JavaScript">
function addLoadEvent(func) { function addLoadEvent(func) {
var oldonload = window.onload; const oldOnload = window.onload;
if (typeof window.onload != 'function') { if (typeof window.onload != 'function') {
window.onload = func; window.onload = func;
} }
else { else {
window.onload = function () { window.onload = function () {
if (oldonload) { if (oldOnload) {
oldonload(); oldOnload();
} }
func(); func();
} }
@@ -37,17 +40,17 @@ function addOnLoad($function) {
<?php <?php
} }
function SportsManagerURL($weitereParameter = null, $ssl = 0) function SportsManagerURL($weitereParameter = null, $ssl = 0): ?string
{ {
$urlPath = handleFilter($weitereParameter); $urlPath = handleFilter($weitereParameter);
$joomlaBaseUrl = JUri::getInstance()->toString([ $joomlaBaseUrl = Uri::getInstance()->toString([
"scheme", "scheme",
"host", "host",
"port", "port",
"path", "path",
]); ]);
if (strpos($joomlaBaseUrl, "?") !== false) { if (str_contains($joomlaBaseUrl, "?")) {
// Base URL already contains a query string, append with '&' // Base URL already contains a query string, append with '&'
$finalUrl = $joomlaBaseUrl . "&" . ltrim($urlPath, "&"); $finalUrl = $joomlaBaseUrl . "&" . ltrim($urlPath, "&");
} else { } else {
@@ -55,15 +58,15 @@ function SportsManagerURL($weitereParameter = null, $ssl = 0)
$finalUrl = $joomlaBaseUrl . "?" . ltrim($urlPath, "&"); $finalUrl = $joomlaBaseUrl . "?" . ltrim($urlPath, "&");
} }
return \Joomla\CMS\Router\Route::_($finalUrl, false, $ssl); return Route::_($finalUrl, false, $ssl);
} }
function handleFilter($urlPart) function handleFilter($urlPart)
{ {
// Check if both '&filter=' and '#' are present in the URL part // Check if both '&filter=' and '#' are present in the URL part
if ( if (
strpos($urlPart, "&filter=") !== false && str_contains($urlPart, "&filter=") &&
strpos($urlPart, "#") !== false str_contains($urlPart, "#")
) { ) {
// Split the string by '#' to remove the hash part // Split the string by '#' to remove the hash part
$parts = explode("#", $urlPart, 2); $parts = explode("#", $urlPart, 2);
@@ -76,9 +79,7 @@ function handleFilter($urlPart)
unset($queryParams["filter"]); unset($queryParams["filter"]);
// Rebuild the query string without the 'filter' parameter // Rebuild the query string without the 'filter' parameter
$newQuery = http_build_query($queryParams); return http_build_query($queryParams);
return $newQuery;
} else { } else {
// Return the original URL part if either '&filter=' or '#' is not present // Return the original URL part if either '&filter=' or '#' is not present
return $urlPart; return $urlPart;
@@ -98,42 +99,27 @@ function hervorheben($titel) {
return $titel . " *"; return $titel . " *";
} }
function Laenderkennungen() { function Laenderkennungen(): array
$kennungen = array("AUT", "BEL", "BUL", "CZE", "DEN", "FRA", "GBR", "GER", "LUX", "NED", "SUI", "USA"); {
return array("AUT", "BEL", "BUL", "CZE", "DEN", "FRA", "GBR", "GER", "LUX", "NED", "SUI", "USA");
return $kennungen;
} }
function rundenstufe($stufe) { function rundenstufe($stufe): string
switch ($stufe) { {
case 0: return match ($stufe) {
$bezeichnung = JText::_("COM_SPORTSMANAGER_FINAL_RANKS"); 0 => Text::_("COM_SPORTSMANAGER_FINAL_RANKS"),
break; 1 => Text::_("COM_SPORTSMANAGER_MAIN_ROUND"),
case 1: 2 => Text::_("COM_SPORTSMANAGER_ADDITIONAL_ROUND"),
$bezeichnung = JText::_("COM_SPORTSMANAGER_MAIN_ROUND"); 3 => Text::_("COM_SPORTSMANAGER_2ND_ADDITIONAL_ROUND"),
break; 10 => Text::_("COM_SPORTSMANAGER_PRELIMINARY_ROUND"),
case 2: 20 => Text::_("COM_SPORTSMANAGER_REGISTRATIONS"),
$bezeichnung = JText::_("COM_SPORTSMANAGER_ADDITIONAL_ROUND"); default => "",
break; };
case 3:
$bezeichnung = JText::_("COM_SPORTSMANAGER_2ND_ADDITIONAL_ROUND");
break;
case 10:
$bezeichnung = JText::_("COM_SPORTSMANAGER_PRELIMINARY_ROUND");
break;
case 20:
$bezeichnung = JText::_("COM_SPORTSMANAGER_REGISTRATIONS");
break;
default:
$bezeichnung = "";
} // switch
return $bezeichnung;
} }
function StringsZusammenfassen($titel1, $titel2, $ersatz = null, $separator = " / ") { function StringsZusammenfassen($titel1, $titel2, $ersatz = null, $separator = " / ") {
if ($ersatz == null) { if ($ersatz == null) {
$ersatz = JText::_("COM_SPORTSMANAGER_NONE"); $ersatz = Text::_("COM_SPORTSMANAGER_NONE");
} }
$t1 = NichtLeererString($titel1, $ersatz); $t1 = NichtLeererString($titel1, $ersatz);
$t2 = NichtLeererString($titel2, $ersatz); $t2 = NichtLeererString($titel2, $ersatz);
@@ -144,76 +130,59 @@ function StringsZusammenfassen($titel1, $titel2, $ersatz = null, $separator = "
function Rundenbezeichnung($runde, $spieltag = false, $bezeichnung_verstecken = false, $kurzform = false) { function Rundenbezeichnung($runde, $spieltag = false, $bezeichnung_verstecken = false, $kurzform = false) {
if ($kurzform) { if ($kurzform) {
if ($runde >= 20000) if ($runde >= 20000)
return JText::sprintf("COM_SPORTSMANAGER_PLACE_FROM_TO_SHORTCUT", 99 - $runde % 100, 99 - floor(($runde - 20000) / 100) + 99 - ($runde % 100)); return Text::sprintf("COM_SPORTSMANAGER_PLACE_FROM_TO_SHORTCUT", 99 - $runde % 100, 99 - floor(($runde - 20000) / 100) + 99 - ($runde % 100));
switch ($runde) { return match ($runde) {
case 0: 0 => $spieltag
return $spieltag ? Text::_("COM_SPORTSMANAGER_MATCH_DAY_NONE")
? JText::_("COM_SPORTSMANAGER_MATCH_DAY_NONE") : Text::_("COM_SPORTSMANAGER_ROUND_NONE"),
: JText::_("COM_SPORTSMANAGER_ROUND_NONE"); 19999 => Text::_("COM_SPORTSMANAGER_FINAL_SHORTCUT"),
case 19999: 19998 => Text::_("COM_SPORTSMANAGER_3RD_PLACE_SHORTCUT"),
return JText::_("COM_SPORTSMANAGER_FINAL_SHORTCUT"); 19997 => Text::_("COM_SPORTSMANAGER_HALF_FINAL_SHORTCUT"),
case 19998: 19996 => Text::_("COM_SPORTSMANAGER_QUARTER_FINAL_SHORTCUT"),
return JText::_("COM_SPORTSMANAGER_3RD_PLACE_SHORTCUT"); 19995 => Text::_("COM_SPORTSMANAGER_ROUND_OF_16_SHORTCUT"),
case 19997: 19994 => Text::_("COM_SPORTSMANAGER_ROUND_OF_32_SHORTCUT"),
return JText::_("COM_SPORTSMANAGER_HALF_FINAL_SHORTCUT"); 19993 => Text::_("COM_SPORTSMANAGER_ROUND_OF_64_SHORTCUT"),
case 19996: 19992 => Text::_("COM_SPORTSMANAGER_ROUND_OF_128_SHORTCUT"),
return JText::_("COM_SPORTSMANAGER_QUARTER_FINAL_SHORTCUT"); default => $bezeichnung_verstecken ? $runde : Text::sprintf($spieltag ? "COM_SPORTSMANAGER_MATCH_DAY_NR_SHORTCUT" : "COM_SPORTSMANAGER_ROUND_NR_SHORTCUT", $runde),
case 19995: };
return JText::_("COM_SPORTSMANAGER_ROUND_OF_16_SHORTCUT");
case 19994:
return JText::_("COM_SPORTSMANAGER_ROUND_OF_32_SHORTCUT");
case 19993:
return JText::_("COM_SPORTSMANAGER_ROUND_OF_64_SHORTCUT");
case 19992:
return JText::_("COM_SPORTSMANAGER_ROUND_OF_128_SHORTCUT");
}
return $bezeichnung_verstecken ? $runde : JText::sprintf($spieltag ? "COM_SPORTSMANAGER_MATCH_DAY_NR_SHORTCUT" : "COM_SPORTSMANAGER_ROUND_NR_SHORTCUT", $runde); }
}
else { else {
if ($runde >= 20000) if ($runde >= 20000)
return JText::sprintf("COM_SPORTSMANAGER_PLACE_FROM_TO", 99 - $runde % 100, 99 - floor(($runde - 20000) / 100) + 99 - ($runde % 100)); return Text::sprintf("COM_SPORTSMANAGER_PLACE_FROM_TO", 99 - $runde % 100, 99 - floor(($runde - 20000) / 100) + 99 - ($runde % 100));
switch ($runde) { return match ($runde) {
case 0: 0 => $spieltag
return $spieltag ? Text::_("COM_SPORTSMANAGER_MATCH_DAY_NONE")
? JText::_("COM_SPORTSMANAGER_MATCH_DAY_NONE") : Text::_("COM_SPORTSMANAGER_ROUND_NONE"),
: JText::_("COM_SPORTSMANAGER_ROUND_NONE"); 19999 => Text::_("COM_SPORTSMANAGER_FINAL"),
case 19999: 19998 => Text::_("COM_SPORTSMANAGER_3RD_PLACE"),
return JText::_("COM_SPORTSMANAGER_FINAL"); 19997 => Text::_("COM_SPORTSMANAGER_HALF_FINAL"),
case 19998: 19996 => Text::_("COM_SPORTSMANAGER_QUARTER_FINAL"),
return JText::_("COM_SPORTSMANAGER_3RD_PLACE"); 19995 => Text::_("COM_SPORTSMANAGER_ROUND_OF_16"),
case 19997: 19994 => Text::_("COM_SPORTSMANAGER_ROUND_OF_32"),
return JText::_("COM_SPORTSMANAGER_HALF_FINAL"); 19993 => Text::_("COM_SPORTSMANAGER_ROUND_OF_64"),
case 19996: 19992 => Text::_("COM_SPORTSMANAGER_ROUND_OF_128"),
return JText::_("COM_SPORTSMANAGER_QUARTER_FINAL"); default => $bezeichnung_verstecken
case 19995: ? $runde
return JText::_("COM_SPORTSMANAGER_ROUND_OF_16"); : Text::sprintf(
case 19994: $spieltag
return JText::_("COM_SPORTSMANAGER_ROUND_OF_32"); ? "COM_SPORTSMANAGER_MATCH_DAY_NR"
case 19993: : "COM_SPORTSMANAGER_ROUND_NR",
return JText::_("COM_SPORTSMANAGER_ROUND_OF_64"); $runde
case 19992: ),
return JText::_("COM_SPORTSMANAGER_ROUND_OF_128"); };
}
return $bezeichnung_verstecken }
? $runde
: JText::sprintf(
$spieltag
? "COM_SPORTSMANAGER_MATCH_DAY_NR"
: "COM_SPORTSMANAGER_ROUND_NR",
$runde
);
}
} }
function FormatiertesDatum($s, $zeit_anzeigen = true, $wochentag_anzeigen = true) { function FormatiertesDatum($s, $zeit_anzeigen = true, $wochentag_anzeigen = true): string
{
if ($s != null && strlen($s) > 0) { if ($s != null && strlen($s) > 0) {
$ts = getdate(strtotime($s)); $ts = getdate(strtotime($s));
if ($wochentag_anzeigen) { if ($wochentag_anzeigen) {
$wochentage = array(JText::_("COM_SPORTSMANAGER_DAY_0_SHORTCUT"), JText::_("COM_SPORTSMANAGER_DAY_1_SHORTCUT"), JText::_("COM_SPORTSMANAGER_DAY_2_SHORTCUT"), JText::_("COM_SPORTSMANAGER_DAY_3_SHORTCUT"), JText::_("COM_SPORTSMANAGER_DAY_4_SHORTCUT"), JText::_("COM_SPORTSMANAGER_DAY_5_SHORTCUT"), JText::_("COM_SPORTSMANAGER_DAY_6_SHORTCUT")); $wochentage = array(Text::_("COM_SPORTSMANAGER_DAY_0_SHORTCUT"), Text::_("COM_SPORTSMANAGER_DAY_1_SHORTCUT"), Text::_("COM_SPORTSMANAGER_DAY_2_SHORTCUT"), Text::_("COM_SPORTSMANAGER_DAY_3_SHORTCUT"), Text::_("COM_SPORTSMANAGER_DAY_4_SHORTCUT"), Text::_("COM_SPORTSMANAGER_DAY_5_SHORTCUT"), Text::_("COM_SPORTSMANAGER_DAY_6_SHORTCUT"));
if ($zeit_anzeigen) if ($zeit_anzeigen)
return sprintf("%s, %02d.%02d.%04d %02d:%02d", $wochentage[$ts["wday"]], $ts["mday"], $ts["mon"], $ts["year"], $ts["hours"], $ts["minutes"]); return sprintf("%s, %02d.%02d.%04d %02d:%02d", $wochentage[$ts["wday"]], $ts["mday"], $ts["mon"], $ts["year"], $ts["hours"], $ts["minutes"]);
@@ -225,10 +194,11 @@ function FormatiertesDatum($s, $zeit_anzeigen = true, $wochentag_anzeigen = true
return sprintf("%02d.%02d.%04d", $ts["mday"], $ts["mon"], $ts["year"]); return sprintf("%02d.%02d.%04d", $ts["mday"], $ts["mon"], $ts["year"]);
} }
return JText::_("COM_SPORTSMANAGER_DATE_NONE"); return Text::_("COM_SPORTSMANAGER_DATE_NONE");
} }
function FormatierterTermin($erster_tag, $letzter_tag, $jahr_anzeigen = false, $filter_jahr = null) { function FormatierterTermin($erster_tag, $letzter_tag, $jahr_anzeigen = false, $filter_jahr = null): string
{
$erster_ts = getdate(strtotime($erster_tag)); $erster_ts = getdate(strtotime($erster_tag));
$letzter_ts = getdate(strtotime($letzter_tag)); $letzter_ts = getdate(strtotime($letzter_tag));
if (!empty($filter_jahr)) if (!empty($filter_jahr))
@@ -246,401 +216,12 @@ function FormatierterTermin($erster_tag, $letzter_tag, $jahr_anzeigen = false, $
return $erster_termin . "-" . $letzter_termin; return $erster_termin . "-" . $letzter_termin;
} }
function bildLoeschen($typ, $id) { function terminDokumentname($id): bool|string
global $sportsmanager_joomla_path;
$typ_exploded = explode("/", $typ);
$typ = $typ_exploded[0];
$typ_prefix = count($typ_exploded) > 1 ? $typ_exploded[1] : "";
$bilder_pfad = $sportsmanager_joomla_path . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'sportsmanager' . DIRECTORY_SEPARATOR . $typ;
$pfad = $bilder_pfad . '/' . $typ_prefix . $id . ".";
if (!is_file($pfad . 'png') && !is_file($pfad . 'jpg'))
return;
$alte_bilder = JFolder::files($bilder_pfad, '^' . $typ_prefix . $id . '\.|^' . $typ_prefix . 'I' . $id . 'T');
foreach ($alte_bilder as $fn)
JFile::delete($bilder_pfad . DIRECTORY_SEPARATOR . $fn);
}
function bildIdentisch($typ1, $id1, $typ2, $id2) {
global $sportsmanager_joomla_path;
$typ1_exploded = explode("/", $typ1);
$typ1 = $typ1_exploded[0];
$typ1_prefix = count($typ1_exploded) > 1 ? $typ1_exploded[1] : "";
$bilder_pfad1 = $sportsmanager_joomla_path . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'sportsmanager' . DIRECTORY_SEPARATOR . $typ1;
$pfad1 = $bilder_pfad1 . '/' . $typ1_prefix . $id1 . ".";
if (is_file($pfad1 . "png"))
$ext = "png";
else if (is_file($pfad1 . "jpg"))
$ext = "jpg";
else
$ext = "";
$pfad1 .= $ext;
$typ2_exploded = explode("/", $typ2);
$typ2 = $typ2_exploded[0];
$typ2_prefix = count($typ2_exploded) > 1 ? $typ2_exploded[1] : "";
$bilder_pfad2 = $sportsmanager_joomla_path . DIRECTORY_SEPARATOR . 'images' . DIRECTORY_SEPARATOR . 'sportsmanager' . DIRECTORY_SEPARATOR . $typ2;
$pfad2 = $bilder_pfad2 . '/' . $typ2_prefix . $id2 . "." . $ext;
return files_identical($pfad1, $pfad2);
}
function teamImage($teamId, $vereinId, $width = 240, $height = 240) {
$url = bildURL("mannschaften", $teamId, 0, 0, $width, $height);
if ($url == null) {
$url = bildURL("vereine", $vereinId, 0, 0, $width, $height);
}
return $url;
}
function playerImage($playerId, $gender, $width = 180, $height = 240) {
$url = bildURL("spieler", $playerId, $width, $height, 0,0,'', $gender == 'M' ? 'm' : 'w');
if ($url == null) {
$url = bildURL("mannschaftsmitglieder", $playerId, $width, $height, 0,0,'');
}
return $url;
}
function bildURL($typ, $id, $fixed_width = 0, $fixed_height = 0, $max_width = 0, $max_height = 0, $zusatz = "", $alternativ = "") {
global $sportsmanager_joomla_path;
global $sportsmanager_joomla_url;
$typ_exploded = explode("/", $typ);
$typ = $typ_exploded[0];
$typ_prefix = count($typ_exploded) > 1 ? $typ_exploded[1] : "";
$pfad = $sportsmanager_joomla_path . "/images/sportsmanager/" . $typ . "/" . $typ_prefix . $id . ".";
if (is_file($pfad . "png"))
$ext = "png";
else if (is_file($pfad . "jpg"))
$ext = "jpg";
else if (!empty($alternativ)) {
$id = $alternativ;
$pfad = $sportsmanager_joomla_path . "/images/sportsmanager/" . $typ . "/" . $typ_prefix . $id . ".";
if (is_file($pfad . "png"))
$ext = "png";
else if (is_file($pfad . "jpg"))
$ext = "jpg";
else
return null;
}
else
return null;
$time = filemtime($pfad . $ext);
if ($fixed_width > 0 && $fixed_height > 0) {
$pfad_angepasst = $sportsmanager_joomla_path . "/images/sportsmanager/" . $typ . "/" . $typ_prefix . "I" . $id . "T" . $time . "W" . $fixed_width . "H" . $fixed_height . "." . $ext;
if (is_file($pfad_angepasst)) {
return $sportsmanager_joomla_url . 'images/sportsmanager/' . $typ . '/' . basename($pfad_angepasst);
}
}
$size = getimagesize($pfad . $ext);
$width = $size[0];
$height = $size[1];
$max_width = $fixed_width > 0 ? $fixed_width : $max_width;
$max_height = $fixed_height > 0 ? $fixed_height : $max_height;
if (($fixed_width == 0 || $width == $fixed_width) && ($fixed_height == 0 || $height == $fixed_height) && ($fixed_width != 0 || $max_width == 0 || $width <= $max_width) && ($fixed_height != 0 || $max_height == 0 || $height <= $max_height)) {
$pfad_angepasst = $sportsmanager_joomla_path . "/images/sportsmanager/" . $typ . "/" . $typ_prefix . "I" . $id . "T" . $time . "W" . $width . "H" . $height . "." . $ext;
if (!is_file($pfad_angepasst)) {
if (!copy($pfad . $ext, $pfad_angepasst))
return null;
}
return $sportsmanager_joomla_url . 'images/sportsmanager/' . $typ . '/' . basename($pfad_angepasst);
}
$new_width = $width;
$new_height = $height;
if ($max_height > 0 && $new_height > $max_height) {
$new_width = max(round($new_width * $max_height / $new_height), 1);
$new_height = $max_height;
}
if ($max_width > 0 && $new_width > $max_width) {
$new_height = max(round($new_height * $max_width / $new_width), 1);
$new_width = $max_width;
}
if ($max_width > 0 && (($max_width - $new_width) % 2) == 1) // Toleranz bei nur 1 Pixel Unterschied
$new_width += 1;
if ($max_height > 0 && (($max_height - $new_height) % 2) == 1) // Toleranz bei nur 1 Pixel Unterschied
$new_height += 1;
$pfad_angepasst = $sportsmanager_joomla_path . "/images/sportsmanager/" . $typ . "/" . $typ_prefix . "I" . $id . "T" . $time . "W" . max($fixed_width, $new_width) . "H" . max($fixed_height, $new_height) . "." . $ext;
if (!is_file($pfad_angepasst)) {
$image = $ext == "png" ? imagecreatefrompng($pfad . $ext) : imagecreatefromjpeg($pfad . $ext);
if ($image === false)
return null;
$image_resized = imagecreatetruecolor(max($fixed_width, $new_width), max($fixed_height, $new_height));
$color = $ext == "png" ? imagecolorallocatealpha($image_resized, 0, 0, 0, 127) : imagecolorallocate($image_resized, 64, 64, 64);
imagefill($image_resized, 0, 0, $color);
imagecopyresampled($image_resized, $image, round((imagesx($image_resized) - $new_width) / 2), round((imagesy($image_resized) - $new_height) / 2), 0, 0, $new_width, $new_height, $width, $height);
if ($ext == "png") {
imagesavealpha($image_resized, true);
imagepng($image_resized, $pfad_angepasst);
}
else
imagejpeg($image_resized, $pfad_angepasst);
}
return $sportsmanager_joomla_url . 'images/sportsmanager/' . $typ . '/' . basename($pfad_angepasst);
}
/*
* #resize=250
#resize=250,250,blue
#resize=250,250,blue
#resize=250,250&sizes=60%,80%,200%
#resize=250,250,cover&sizes=60%,80%,200%
#resize=250,250,fill&sizes=60%,80%,200%
#crop=250,250,center,top
#crop=250,250
#crop=250,250,center,bottom
#crop=250,250,left
#crop=250,250,right
*/
function yoothemeBild($typ, $id, $resize = '', $zusatz = "", $alternativ)
{ {
global $sportsmanager_joomla_path; global $sportsmanager_joomla_path;
global $sportsmanager_joomla_url;
$typ_exploded = explode("/", $typ);
$typ = $typ_exploded[0];
$typ_prefix = count($typ_exploded) > 1 ? $typ_exploded[1] : "";
$pfad = $sportsmanager_joomla_path . "/images/sportsmanager/" . $typ . "/" . $typ_prefix . $id . ".";
if (is_file($pfad . "png"))
$ext = "png";
else if (is_file($pfad . "jpg"))
$ext = "jpg";
else if (!empty($alternativ)) {
$id = $alternativ;
$pfad = $sportsmanager_joomla_path . "/images/sportsmanager/" . $typ . "/" . $typ_prefix . $id . ".";
if (is_file($pfad . "png"))
$ext = "png";
else if (is_file($pfad . "jpg"))
$ext = "jpg";
else
return null;
}
else
return null;
$time = filemtime($pfad . $ext);
$bildpfad = "images/sportsmanager/" . $typ . "/" . $typ_prefix . $id . "." . $ext;
return '<img class="el-image" data-src="' . $bildpfad . $resize . '" ' . $zusatz . ' uk-img />';
}
/*
Quick and dirty DTFL Logo Bilder
*/
function logoBilder($typ, $id, $resize = '', $zusatz = "", $alternativ)
{
global $sportsmanager_joomla_path;
global $sportsmanager_joomla_url;
$typ_exploded = explode("/", $typ);
$typ = $typ_exploded[0];
$typ_prefix = count($typ_exploded) > 1 ? $typ_exploded[1] : "";
$pfad = $sportsmanager_joomla_path . "/images/sportsmanager/" . $typ . "/" . $typ_prefix . $id . ".";
if (is_file($pfad . "png"))
$ext = "png";
else if (is_file($pfad . "jpg"))
$ext = "jpg";
else if (!empty($alternativ)) {
$id = $alternativ;
$pfad = $sportsmanager_joomla_path . "/images/sportsmanager/" . $typ . "/" . $typ_prefix . $id . ".";
if (is_file($pfad . "png"))
$ext = "png";
else if (is_file($pfad . "jpg"))
$ext = "jpg";
else
return null;
}
else
return null;
$time = filemtime($pfad . $ext);
$bildpfad = "images/sportsmanager/" . $typ . "/" . $typ_prefix . $id . "." . $ext;
return '<img class="el-image" data-src="' . $bildpfad . $resize . '" ' . $zusatz . ' uk-img />';
}
function bildHTML($typ, $id, $fixed_width = 0, $fixed_height = 0, $max_width = 0, $max_height = 0, $zusatz = "", $alternativ = "") {
global $sportsmanager_joomla_path;
global $sportsmanager_joomla_url;
$typ_exploded = explode("/", $typ);
$typ = $typ_exploded[0];
$typ_prefix = count($typ_exploded) > 1 ? $typ_exploded[1] : "";
$pfad = $sportsmanager_joomla_path . "/images/sportsmanager/" . $typ . "/" . $typ_prefix . $id . ".";
if (is_file($pfad . "png"))
$ext = "png";
else if (is_file($pfad . "jpg"))
$ext = "jpg";
else if (!empty($alternativ)) {
$id = $alternativ;
$pfad = $sportsmanager_joomla_path . "/images/sportsmanager/" . $typ . "/" . $typ_prefix . $id . ".";
if (is_file($pfad . "png"))
$ext = "png";
else if (is_file($pfad . "jpg"))
$ext = "jpg";
else
return null;
}
else
return null;
$time = filemtime($pfad . $ext);
if ($fixed_width > 0 && $fixed_height > 0) {
$pfad_angepasst = $sportsmanager_joomla_path . "/images/sportsmanager/" . $typ . "/" . $typ_prefix . "I" . $id . "T" . $time . "W" . $fixed_width . "H" . $fixed_height . "." . $ext;
if (is_file($pfad_angepasst)) {
return '<img src="' . $sportsmanager_joomla_url . 'images/sportsmanager/' . $typ . '/' . basename($pfad_angepasst) . '" width="' . $fixed_width . '" height="' . $fixed_height . '" ' . $zusatz . ' />';
}
}
$size = getimagesize($pfad . $ext);
$width = $size[0];
$height = $size[1];
$max_width = $fixed_width > 0 ? $fixed_width : $max_width;
$max_height = $fixed_height > 0 ? $fixed_height : $max_height;
if (($fixed_width == 0 || $width == $fixed_width) && ($fixed_height == 0 || $height == $fixed_height) && ($fixed_width != 0 || $max_width == 0 || $width <= $max_width) && ($fixed_height != 0 || $max_height == 0 || $height <= $max_height)) {
$pfad_angepasst = $sportsmanager_joomla_path . "/images/sportsmanager/" . $typ . "/" . $typ_prefix . "I" . $id . "T" . $time . "W" . $width . "H" . $height . "." . $ext;
if (!is_file($pfad_angepasst)) {
if (!copy($pfad . $ext, $pfad_angepasst))
return null;
}
return '<img src="' . $sportsmanager_joomla_url . 'images/sportsmanager/' . $typ . '/' . basename($pfad_angepasst) . '" width="' . $width . '" height="' . $height . '" ' . $zusatz . ' />';
}
$new_width = $width;
$new_height = $height;
if ($max_height > 0 && $new_height > $max_height) {
$new_width = max(round($new_width * $max_height / $new_height), 1);
$new_height = $max_height;
}
if ($max_width > 0 && $new_width > $max_width) {
$new_height = max(round($new_height * $max_width / $new_width), 1);
$new_width = $max_width;
}
if ($max_width > 0 && (($max_width - $new_width) % 2) == 1) // Toleranz bei nur 1 Pixel Unterschied
$new_width += 1;
if ($max_height > 0 && (($max_height - $new_height) % 2) == 1) // Toleranz bei nur 1 Pixel Unterschied
$new_height += 1;
$pfad_angepasst = $sportsmanager_joomla_path . "/images/sportsmanager/" . $typ . "/" . $typ_prefix . "I" . $id . "T" . $time . "W" . max($fixed_width, $new_width) . "H" . max($fixed_height, $new_height) . "." . $ext;
if (!is_file($pfad_angepasst)) {
$image = $ext == "png" ? imagecreatefrompng($pfad . $ext) : imagecreatefromjpeg($pfad . $ext);
if ($image === false)
return null;
$image_resized = imagecreatetruecolor(max($fixed_width, $new_width), max($fixed_height, $new_height));
$color = $ext == "png" ? imagecolorallocatealpha($image_resized, 0, 0, 0, 127) : imagecolorallocate($image_resized, 64, 64, 64);
imagefill($image_resized, 0, 0, $color);
imagecopyresampled($image_resized, $image, round((imagesx($image_resized) - $new_width) / 2), round((imagesy($image_resized) - $new_height) / 2), 0, 0, $new_width, $new_height, $width, $height);
if ($ext == "png") {
imagesavealpha($image_resized, true);
imagepng($image_resized, $pfad_angepasst);
}
else
imagejpeg($image_resized, $pfad_angepasst);
}
return '<img src="' . $sportsmanager_joomla_url . 'images/sportsmanager/' . $typ . '/' . basename($pfad_angepasst) . '" width="' . max($fixed_width, $new_width) . '" height="' . max($fixed_height, $new_height) . '" ' . $zusatz . ' />';
}
function terminDokumentname($id) {
global $sportsmanager_joomla_path;
$pfad = $sportsmanager_joomla_path . "/images/sportsmanager/termine"; $pfad = $sportsmanager_joomla_path . "/images/sportsmanager/termine";
$dokumente = JFolder::files($pfad, '^' . $id . ' '); $dokumente = Folder::files($pfad, '^' . $id . ' ');
return !empty($dokumente) ? substr($dokumente[0], strlen((string) $id) + 1) : false; return !empty($dokumente) ? substr($dokumente[0], strlen((string) $id) + 1) : false;
} }
function lightBoxJSShow($lightbox_class = "lightbox") {
return "show" . $lightbox_class . "();";
}
function lightBoxJSHide($lightbox_class = "lightbox") {
return "hide" . $lightbox_class . "();";
}
function lightBoxClassHide($lightbox_class = "lightbox") {
return $lightbox_class . "_close";
}
function lightBoxHeader($lightbox_class = "lightbox") {
?>
<style type="text/css">
div<?php echo "#" . $lightbox_class; ?> {
position: fixed;
left: 50px;
right: 50px;
top: 50px;
bottom: 50px;
border: 1px solid #999999;
overflow: scroll;
background-color: #e4e4e4;
padding: 20px;
display: none;
visibility: hidden;
}
div<?php echo "#" . $lightbox_class . "_close"; ?> {
position: fixed;
right: 0px;
top: 0px;
bottom: 0px;
left: 0px;
overflow: hidden;
display: none;
visibility: hidden;
background-color: rgba(0, 0, 0, 0.8);
}
</style>
<script type="text/javascript">
//<!--
function show<?php echo $lightbox_class; ?>() {
document.getElementById("<?php echo $lightbox_class; ?>").style.display = "inline";
document.getElementById("<?php echo $lightbox_class; ?>").style.visibility = "visible";
document.getElementById("<?php echo $lightbox_class . "_close"; ?>").style.display = "inline";
document.getElementById("<?php echo $lightbox_class . "_close"; ?>").style.visibility = "visible";
}
function hide<?php echo $lightbox_class; ?>() {
document.getElementById("<?php echo $lightbox_class; ?>").style.display = "none";
document.getElementById("<?php echo $lightbox_class; ?>").style.visibility = "hidden";
document.getElementById("<?php echo $lightbox_class . "_close"; ?>").style.display = "none";
document.getElementById("<?php echo $lightbox_class . "_close"; ?>").style.visibility = "hidden";
}
//-->
</script>
<?php
}
@@ -74,13 +74,13 @@ COM_SPORTSMANAGER_GAME="Spiel"
COM_SPORTSMANAGER_GAMES="Spiele" COM_SPORTSMANAGER_GAMES="Spiele"
COM_SPORTSMANAGER_GAMES_SHORTCUT="S" COM_SPORTSMANAGER_GAMES_SHORTCUT="S"
COM_SPORTSMANAGER_ADD_PLAYER_STATISTICS="Spielerstatistik hinzuf&uuml;gen" COM_SPORTSMANAGER_ADD_PLAYER_STATISTICS="Spielerstatistik hinzuf&uuml;gen"
COM_SPORTSMANAGER_PLAYER_STATISTICS="Spielerstatistik" COM_SPORTSMANAGER_PLAYER_STATISTIC="Spielerstatistik"
COM_SPORTSMANAGER_COMPETITION="Wettbewerb" COM_SPORTSMANAGER_COMPETITION="Wettbewerb"
COM_SPORTSMANAGER_COMPETITIONS="Wettbewerbe" COM_SPORTSMANAGER_COMPETITIONS="Wettbewerbe"
COM_SPORTSMANAGER_IN_COMPETITIONS="in Wettbewerb" COM_SPORTSMANAGER_IN_COMPETITIONS="in Wettbewerb"
COM_SPORTSMANAGER_COMPETITIONS_SHORTCUT="W" COM_SPORTSMANAGER_COMPETITIONS_SHORTCUT="W"
COM_SPORTSMANAGER_DUPLICATE="Duplizieren" COM_SPORTSMANAGER_DUPLICATE="Duplizieren"
COM_SPORTSMANAGER_CONFIRM_REMOVE_RANKING="Willst du die Spielerstatistik wirklich entfernen?" COM_SPORTSMANAGER_CONFIRM_REMOVE_PLAYER_STATISTICS="Willst du die Spielerstatistik wirklich entfernen?"
COM_SPORTSMANAGER_LIVE_TICKER="Live-Ticker" COM_SPORTSMANAGER_LIVE_TICKER="Live-Ticker"
COM_SPORTSMANAGER_PLACE="Platz" COM_SPORTSMANAGER_PLACE="Platz"
COM_SPORTSMANAGER_TEAM="Mannschaft" COM_SPORTSMANAGER_TEAM="Mannschaft"
@@ -289,7 +289,6 @@ COM_SPORTSMANAGER_REQUEST_MESSAGE_PLURAL="Es m&uuml;ssen mindestens %d Termine v
COM_SPORTSMANAGER_REJECT_SHIFT="Verschiebung ablehnen" COM_SPORTSMANAGER_REJECT_SHIFT="Verschiebung ablehnen"
COM_SPORTSMANAGER_TO="bis" COM_SPORTSMANAGER_TO="bis"
COM_SPORTSMANAGER_PLAYER_STATISTICS="Spielerstatistiken" COM_SPORTSMANAGER_PLAYER_STATISTICS="Spielerstatistiken"
COM_SPORTSMANAGER_PERFORMANCE_INDEX="Leistungsindex"
COM_SPORTSMANAGER_PERFORMANCE_INDEX_SHORTCUT="LI" COM_SPORTSMANAGER_PERFORMANCE_INDEX_SHORTCUT="LI"
COM_SPORTSMANAGER_WON="gewonnen" COM_SPORTSMANAGER_WON="gewonnen"
COM_SPORTSMANAGER_LOST="verloren" COM_SPORTSMANAGER_LOST="verloren"
@@ -827,7 +826,6 @@ COM_SPORTSMANAGER_REMOVE_STATE_REALLY="Willst du das Land wirklich entfernen?"
COM_SPORTSMANAGER_DATES_STATE="Termine Land" COM_SPORTSMANAGER_DATES_STATE="Termine Land"
COM_SPORTSMANAGER_RENAME_APPOINTMENTS_STATE="Termine mit dem bisherigen Land umbenennen" COM_SPORTSMANAGER_RENAME_APPOINTMENTS_STATE="Termine mit dem bisherigen Land umbenennen"
COM_SPORTSMANAGER_FINAL_RANKING="FINAL RANKING" COM_SPORTSMANAGER_FINAL_RANKING="FINAL RANKING"
COM_SPORTSMANAGER_HOME_TEAM2="Heimmanschaft"
COM_SPORTSMANAGER_RESULTS2="Resultat" COM_SPORTSMANAGER_RESULTS2="Resultat"
COM_SPORTSMANAGER_NO_GAMES="Keine Spiele" COM_SPORTSMANAGER_NO_GAMES="Keine Spiele"
COM_SPORTSMANAGER_END_GAME="Endspiel" COM_SPORTSMANAGER_END_GAME="Endspiel"
@@ -925,3 +923,64 @@ COM_SPORTSMANAGER_RANK="Rang"
; SPIELER BEARBEITEN ; SPIELER BEARBEITEN
COM_SPORTSMANAGER_LIZENZ="Lizenz" COM_SPORTSMANAGER_LIZENZ="Lizenz"
COM_SPORTSMANAGER_ARIA_LABEL_MATCHDAY_SELECT="Wähle einen Spieltag"
COM_SPORTSMANAGER_ARIA_LABEL_PROPOSAL_DAY="Wähle den Tag des Begegnungsvorschlags"
COM_SPORTSMANAGER_ARIA_LABEL_PROPOSAL_MONTH="Wähle den Monat des Begegnungsvorschlags"
COM_SPORTSMANAGER_ARIA_LABEL_PROPOSAL_YEAR="Wähle das Jahr des Begegnungsvorschlags"
COM_SPORTSMANAGER_ARIA_LABEL_PROPOSAL_HOUR="Wähle die Stunde des Begegnungsvorschlags"
COM_SPORTSMANAGER_ARIA_LABEL_PROPOSAL_MINUTE="Wähle die Minute des Begegnungsvorschlags"
COM_SPORTSMANAGER_ARIA_LABEL_SPECIAL_FILTER="Erweiterter Filter"
COM_SPORTSMANAGER_ARIA_LABEL_PLACE="Ort"
COM_SPORTSMANAGER_ARIA_LABEL_ELIGIBLE_CLUB="Wähle berechtigten Verein"
COM_SPORTSMANAGER_ARIA_LABEL_TOURNAMENT_START_MONTH="Monat des Turnierbeginns"
COM_SPORTSMANAGER_ARIA_LABEL_TOURNAMENT_START_YEAR="Jahr des Turnierbeginns"
COM_SPORTSMANAGER_ARIA_LABEL_TOURNAMENT_END_MONTH="Monat des Turnierendes"
COM_SPORTSMANAGER_ARIA_LABEL_TOURNAMENT_END_YEAR="Jahr des Turnierendes"
COM_SPORTSMANAGER_ARIA_LABEL_ELIGIBLE_USER="Wähle berechtigten Anwender"
COM_SPORTSMANAGER_ARIA_LABEL_POINTS_GUEST="Punkte Gast"
COM_SPORTSMANAGER_ARIA_LABEL_POINTS_HOME="Punkte Heim"
COM_SPORTSMANAGER_ARIA_LABEL_PLAYER_GUEST="Spieler Gast"
COM_SPORTSMANAGER_ARIA_LABEL_PLAYER_HOME="Spieler Heim"
COM_SPORTSMANAGER_ARIA_LABEL_SCHEDULE_DATE_MONTH="Wähle den Monat"
COM_SPORTSMANAGER_ARIA_LABEL_SCHEDULE_DATE_YEAR="Wähle das Jahr"
COM_SPORTSMANAGER_ARIA_LABEL_SCHEDULE_DATE_HOUR="Wähle eine Stunde"
COM_SPORTSMANAGER_ARIA_LABEL_SCHEDULE_DATE_MINUTE="Wähle eine Minute"
COM_SPORTSMANAGER_ARIA_LABEL_GAME_NUMBER_GUEST="Spiel Gast"
COM_SPORTSMANAGER_ARIA_LABEL_GAME_NUMBER_HOME="Spiel Heim"
COM_SPORTSMANAGER_ARIA_LABEL_GAME_LINK_DOUBLE="Verknüpfung Doppel"
COM_SPORTSMANAGER_ARIA_LABEL_GAME_LINK_SINGLE="Verknüpfung Einzel"
COM_SPORTSMANAGER_ARIA_LABEL_PLACEMENT_MIN="Platzierung Min."
COM_SPORTSMANAGER_ARIA_LABEL_PLACEMENT_MAX="Platzierung Max."
COM_SPORTSMANAGER_ARIA_LABEL_PARTICIPANT_MIN="Teilnehmer Min."
COM_SPORTSMANAGER_ARIA_LABEL_PARTICIPANT_MAX="Teilnehmer Max."
COM_SPORTSMANAGER_ARIA_LABEL_RANKING_START_MONTH="Monat des Ranglistenbeginns"
COM_SPORTSMANAGER_ARIA_LABEL_RANKING_START_YEAR="Jahr des Ranglistenbeginns"
COM_SPORTSMANAGER_ARIA_LABEL_RANKING_END_MONTH="Monat des Ranglistenendes"
COM_SPORTSMANAGER_ARIA_LABEL_RANKING_END_YEAR="Jahr des Ranglistenendes"
COM_SPORTSMANAGER_ARIA_LABEL_MAXIMUM_EVALUATED_COUNT="Maximal gewertete Teilnahmen"
COM_SPORTSMANAGER_ARIA_LABEL_STATISTICS_START_MONTH="Monat des Statistikbeginns"
COM_SPORTSMANAGER_ARIA_LABEL_STATISTICS_START_YEAR="Jahr des Statistikbeginns"
COM_SPORTSMANAGER_ARIA_LABEL_STATISTICS_END_MONTH="Monat des Statistikendes"
COM_SPORTSMANAGER_ARIA_LABEL_STATISTICS_END_YEAR="Jahr des Statistikendes"
COM_SPORTSMANAGER_ARIA_LABEL_ELIGIBLE_ORGANIZER="Wähle berechtigten Veranstalter"
COM_SPORTSMANAGER_ARIA_LABEL_EVENT_START_MONTH="Monat des Veranstaltungsbeginns"
COM_SPORTSMANAGER_ARIA_LABEL_EVENT_START_YEAR="Jahr des Veranstaltungsbeginns"
COM_SPORTSMANAGER_ARIA_LABEL_EVENT_END_MONTH="Monat des Veranstaltungsendes"
COM_SPORTSMANAGER_ARIA_LABEL_EVENT_END_YEAR="Jahr des Veranstaltungsendes"
COM_SPORTSMANAGER_ARIA_LABEL_FIRST_ROUND="Erste Runde"
COM_SPORTSMANAGER_ARIA_LABEL_FIRST_ROUND_TYPE="Erste Runde Typ"
COM_SPORTSMANAGER_ARIA_LABEL_FIRST_ROUND_PLACE="Erste Runde Platzierung"
COM_SPORTSMANAGER_ARIA_LABEL_LAST_ROUND="Letzte Runde"
COM_SPORTSMANAGER_ARIA_LABEL_LAST_ROUND_TYPE="Letzte Runde Typ"
COM_SPORTSMANAGER_ARIA_LABEL_LAST_ROUND_PLACE="Letzte Runde Platzierung"
COM_SPORTSMANAGER_ARIA_LABEL_ROUND_TYPE="Rundentyp"
COM_SPORTSMANAGER_ARIA_LABEL_ROUND_PLACE="Rundenplatzierung"
COM_SPORTSMANAGER_HOME_POINTS="Heim Punkte"
COM_SPORTSMANAGER_GUEST_POINTS="Gast Punkte"
COM_SPORTSMANAGER_ARIA_LABEL_ENCOUNTER_YEAR="Jahr der Begegnung"
COM_SPORTSMANAGER_ARIA_LABEL_PAIRING_TEAM="Team für Paarung"
COM_SPORTSMANAGER_ARIA_LABEL_ELIGIBLE_COMPETITION="Wähle berechtigten Anwender"
COM_SPORTSMANAGER_ARIA_LABEL_RANKING_EVALUATION="Ranking Wertung"
COM_SPORTSMANAGER_ARIA_LABEL_LASTNAME="Nachname"
COM_SPORTSMANAGER_ARIA_LABEL_FIRSTNAME="Vorname"
COM_SPORTSMANAGER_ARIA_LABEL_CLUB="Verein"
@@ -74,13 +74,13 @@ COM_SPORTSMANAGER_GAME="Game"
COM_SPORTSMANAGER_GAMES="Games" COM_SPORTSMANAGER_GAMES="Games"
COM_SPORTSMANAGER_GAMES_SHORTCUT="G" COM_SPORTSMANAGER_GAMES_SHORTCUT="G"
COM_SPORTSMANAGER_ADD_PLAYER_STATISTICS="Add player statistics" COM_SPORTSMANAGER_ADD_PLAYER_STATISTICS="Add player statistics"
COM_SPORTSMANAGER_PLAYER_STATISTICS="Player statistics" COM_SPORTSMANAGER_PLAYER_STATISTIC="Player statistics"
COM_SPORTSMANAGER_COMPETITION="Competition" COM_SPORTSMANAGER_COMPETITION="Competition"
COM_SPORTSMANAGER_COMPETITIONS="Competitions" COM_SPORTSMANAGER_COMPETITIONS="Competitions"
COM_SPORTSMANAGER_IN_COMPETITIONS="in competition" COM_SPORTSMANAGER_IN_COMPETITIONS="in competition"
COM_SPORTSMANAGER_COMPETITIONS_SHORTCUT="C" COM_SPORTSMANAGER_COMPETITIONS_SHORTCUT="C"
COM_SPORTSMANAGER_DUPLICATE="Duplicate" COM_SPORTSMANAGER_DUPLICATE="Duplicate"
COM_SPORTSMANAGER_CONFIRM_REMOVE_RANKING="Do you really want to remove the player statistics?" COM_SPORTSMANAGER_CONFIRM_REMOVE_PLAYER_STATISTICS="Do you really want to remove the player statistics?"
COM_SPORTSMANAGER_LIVE_TICKER="Live ticker" COM_SPORTSMANAGER_LIVE_TICKER="Live ticker"
COM_SPORTSMANAGER_PLACE="Place" COM_SPORTSMANAGER_PLACE="Place"
COM_SPORTSMANAGER_TEAM="Team" COM_SPORTSMANAGER_TEAM="Team"
@@ -289,7 +289,6 @@ COM_SPORTSMANAGER_REQUEST_MESSAGE_PLURAL="At least %d dates must be given comple
COM_SPORTSMANAGER_REJECT_SHIFT="Reject shift" COM_SPORTSMANAGER_REJECT_SHIFT="Reject shift"
COM_SPORTSMANAGER_TO="until" COM_SPORTSMANAGER_TO="until"
COM_SPORTSMANAGER_PLAYER_STATISTICS="Player statistics" COM_SPORTSMANAGER_PLAYER_STATISTICS="Player statistics"
COM_SPORTSMANAGER_PERFORMANCE_INDEX="Performance index"
COM_SPORTSMANAGER_PERFORMANCE_INDEX_SHORTCUT="PI" COM_SPORTSMANAGER_PERFORMANCE_INDEX_SHORTCUT="PI"
COM_SPORTSMANAGER_WON="won" COM_SPORTSMANAGER_WON="won"
COM_SPORTSMANAGER_LOST="lost" COM_SPORTSMANAGER_LOST="lost"
@@ -444,7 +443,7 @@ COM_SPORTSMANAGER_NOTE="Note"
COM_SPORTSMANAGER_WANT_REALLY_REMOVE="Do you really want to remove the club?" COM_SPORTSMANAGER_WANT_REALLY_REMOVE="Do you really want to remove the club?"
COM_SPORTSMANAGER_ADD="Add" COM_SPORTSMANAGER_ADD="Add"
COM_SPORTSMANAGER_REMOVE_ACCOUNT="Remove account" COM_SPORTSMANAGER_REMOVE_ACCOUNT="Remove account"
COM_SPORTSMANAGER_DISTRICT="Ristrict" COM_SPORTSMANAGER_DISTRICT="District"
COM_SPORTSMANAGER_ELIGIBLE_FOR_TEAM="Eligible for team" COM_SPORTSMANAGER_ELIGIBLE_FOR_TEAM="Eligible for team"
COM_SPORTSMANAGER_ELIGIBLE_FOR_CLUB="Eligible for club" COM_SPORTSMANAGER_ELIGIBLE_FOR_CLUB="Eligible for club"
COM_SPORTSMANAGER_SAVED_CLUB="Club to maintain" COM_SPORTSMANAGER_SAVED_CLUB="Club to maintain"
@@ -827,7 +826,6 @@ COM_SPORTSMANAGER_REMOVE_STATE_REALLY="Do you really want to remove the country?
COM_SPORTSMANAGER_DATES_STATE="Appointments country" COM_SPORTSMANAGER_DATES_STATE="Appointments country"
COM_SPORTSMANAGER_RENAME_APPOINTMENTS_STATE="Rename appointments with the preset country" COM_SPORTSMANAGER_RENAME_APPOINTMENTS_STATE="Rename appointments with the preset country"
COM_SPORTSMANAGER_FINAL_RANKING="FINAL RANKING" COM_SPORTSMANAGER_FINAL_RANKING="FINAL RANKING"
COM_SPORTSMANAGER_HOME_TEAM2="Home team"
COM_SPORTSMANAGER_RESULTS2="Result" COM_SPORTSMANAGER_RESULTS2="Result"
COM_SPORTSMANAGER_NO_GAMES="No games" COM_SPORTSMANAGER_NO_GAMES="No games"
COM_SPORTSMANAGER_END_GAME="Final" COM_SPORTSMANAGER_END_GAME="Final"
@@ -922,3 +920,65 @@ COM_SPORTSMANAGER_POINTS_TABLE="Points table"
COM_SPORTSMANAGER_EVALUATION="Auswertung" COM_SPORTSMANAGER_EVALUATION="Auswertung"
COM_SPORTSMANAGER_FUNCTION_DESCRIPTION="Variables: n = number of participants, p = place, m = multiplier of rating and in doubles possibly additionally reduced rating<br />Functions: +, -, *, /, round(x), pow(x), if(a > b, x, y), min(x, y), max(x, y), log(x), ln(x), logn(b, x)<br />VerteilungR(r, p, n, m) := max(round((((m * r - 1) * (-log(p / n) * (1 - (p / n)))) / (-log(1 / n) * (1 - (1 / n)))) + 1), 1)<br />Verteilung(r, p, n, m) := max(round(m * round((((r - 1) * (-log(p / n) * (1 - (p / n)))) / (-log(1 / n) * (1 - (1 / n)))) + 1)), 1)<br /><br />The functions VerteilungR() and Verteilung() distribute points for place 1 (r) descending to the individual places (p) of the number of participants (n).<br />VerteilungR() applies the multiplier (m) to the points for 1st place and then distributes down to 1 point for the last place.<br />Verteilung() applies the multiplier (m) to the points after the calculation, i.e. the last place receives 1 * m points." COM_SPORTSMANAGER_FUNCTION_DESCRIPTION="Variables: n = number of participants, p = place, m = multiplier of rating and in doubles possibly additionally reduced rating<br />Functions: +, -, *, /, round(x), pow(x), if(a > b, x, y), min(x, y), max(x, y), log(x), ln(x), logn(b, x)<br />VerteilungR(r, p, n, m) := max(round((((m * r - 1) * (-log(p / n) * (1 - (p / n)))) / (-log(1 / n) * (1 - (1 / n)))) + 1), 1)<br />Verteilung(r, p, n, m) := max(round(m * round((((r - 1) * (-log(p / n) * (1 - (p / n)))) / (-log(1 / n) * (1 - (1 / n)))) + 1)), 1)<br /><br />The functions VerteilungR() and Verteilung() distribute points for place 1 (r) descending to the individual places (p) of the number of participants (n).<br />VerteilungR() applies the multiplier (m) to the points for 1st place and then distributes down to 1 point for the last place.<br />Verteilung() applies the multiplier (m) to the points after the calculation, i.e. the last place receives 1 * m points."
COM_SPORTSMANAGER_LIZENZ="License" COM_SPORTSMANAGER_LIZENZ="License"
COM_SPORTSMANAGER_ARIA_LABEL_MATCHDAY_SELECT="Choose a match day"
COM_SPORTSMANAGER_ARIA_LABEL_PROPOSAL_DAY="Choose the day of the match proposal"
COM_SPORTSMANAGER_ARIA_LABEL_PROPOSAL_MONTH="Choose the month of the match proposal"
COM_SPORTSMANAGER_ARIA_LABEL_PROPOSAL_YEAR="Choose the year of the match proposal"
COM_SPORTSMANAGER_ARIA_LABEL_PROPOSAL_HOUR="Choose the hour of the match proposal"
COM_SPORTSMANAGER_ARIA_LABEL_PROPOSAL_MINUTE="Choose the minute of the match proposal"
COM_SPORTSMANAGER_ARIA_LABEL_SPECIAL_FILTER="Advanced Filter"
COM_SPORTSMANAGER_ARIA_LABEL_PLACE="Location"
COM_SPORTSMANAGER_ARIA_LABEL_ELIGIBLE_CLUB="Choose eligible club"
COM_SPORTSMANAGER_ARIA_LABEL_TOURNAMENT_START_MONTH="Month of tournament start"
COM_SPORTSMANAGER_ARIA_LABEL_TOURNAMENT_START_YEAR="Year of tournament start"
COM_SPORTSMANAGER_ARIA_LABEL_TOURNAMENT_END_MONTH="Month of tournament end"
COM_SPORTSMANAGER_ARIA_LABEL_TOURNAMENT_END_YEAR="Year of tournament end"
COM_SPORTSMANAGER_ARIA_LABEL_ELIGIBLE_USER="Choose eligible user"
COM_SPORTSMANAGER_ARIA_LABEL_POINTS_GUEST="Points away"
COM_SPORTSMANAGER_ARIA_LABEL_POINTS_HOME="Points home"
COM_SPORTSMANAGER_ARIA_LABEL_PLAYER_GUEST="Player away"
COM_SPORTSMANAGER_ARIA_LABEL_PLAYER_HOME="Player home"
COM_SPORTSMANAGER_ARIA_LABEL_SCHEDULE_DATE_MONTH="Choose a Month"
COM_SPORTSMANAGER_ARIA_LABEL_SCHEDULE_DATE_YEAR="Choose a Year"
COM_SPORTSMANAGER_ARIA_LABEL_SCHEDULE_DATE_HOUR="Choose an Hour"
COM_SPORTSMANAGER_ARIA_LABEL_SCHEDULE_DATE_MINUTE="Choose a Minute"
COM_SPORTSMANAGER_ARIA_LABEL_GAME_NUMBER_GUEST="Game away"
COM_SPORTSMANAGER_ARIA_LABEL_GAME_NUMBER_HOME="Game home"
COM_SPORTSMANAGER_ARIA_LABEL_GAME_LINK_DOUBLE="Game link double"
COM_SPORTSMANAGER_ARIA_LABEL_GAME_LINK_SINGLE="Game link single"
COM_SPORTSMANAGER_ARIA_LABEL_PLACEMENT_MIN="Placement min."
COM_SPORTSMANAGER_ARIA_LABEL_PLACEMENT_MAX="Placement max."
COM_SPORTSMANAGER_ARIA_LABEL_PARTICIPANT_MIN="Participant min."
COM_SPORTSMANAGER_ARIA_LABEL_PARTICIPANT_MAX="Participant max."
COM_SPORTSMANAGER_ARIA_LABEL_RANKING_START_MONTH="Month of ranking start"
COM_SPORTSMANAGER_ARIA_LABEL_RANKING_START_YEAR="Year of ranking start"
COM_SPORTSMANAGER_ARIA_LABEL_RANKING_END_MONTH="Month of ranking end"
COM_SPORTSMANAGER_ARIA_LABEL_RANKING_END_YEAR="Year of ranking end"
COM_SPORTSMANAGER_ARIA_LABEL_MAXIMUM_EVALUATED_COUNT="Maximum number of evaluated participations"
COM_SPORTSMANAGER_ARIA_LABEL_STATISTICS_START_MONTH="Month of statistics start"
COM_SPORTSMANAGER_ARIA_LABEL_STATISTICS_START_YEAR="Year of statistics start"
COM_SPORTSMANAGER_ARIA_LABEL_STATISTICS_END_MONTH="Month of statistics end"
COM_SPORTSMANAGER_ARIA_LABEL_STATISTICS_END_YEAR="Year of statistics end"
COM_SPORTSMANAGER_ARIA_LABEL_ELIGIBLE_ORGANIZER="Choose eligible organizer"
COM_SPORTSMANAGER_ARIA_LABEL_EVENT_START_MONTH="Month of event start"
COM_SPORTSMANAGER_ARIA_LABEL_EVENT_START_YEAR="Year of event start"
COM_SPORTSMANAGER_ARIA_LABEL_EVENT_END_MONTH="Month of event end"
COM_SPORTSMANAGER_ARIA_LABEL_EVENT_END_YEAR="Year of event end"
COM_SPORTSMANAGER_ARIA_LABEL_FIRST_ROUND="First round"
COM_SPORTSMANAGER_ARIA_LABEL_FIRST_ROUND_TYPE="First round type"
COM_SPORTSMANAGER_ARIA_LABEL_FIRST_ROUND_PLACE="First round place"
COM_SPORTSMANAGER_ARIA_LABEL_LAST_ROUND="Last round"
COM_SPORTSMANAGER_ARIA_LABEL_LAST_ROUND_TYPE="Last round type"
COM_SPORTSMANAGER_ARIA_LABEL_LAST_ROUND_PLACE="Last round place"
COM_SPORTSMANAGER_ARIA_LABEL_ROUND_TYPE="round type"
COM_SPORTSMANAGER_ARIA_LABEL_ROUND_PLACE="round place"
COM_SPORTSMANAGER_HOME_POINTS="Home points"
COM_SPORTSMANAGER_GUEST_POINTS="Guest points"
COM_SPORTSMANAGER_ARIA_LABEL_ENCOUNTER_YEAR="Year of encounter"
COM_SPORTSMANAGER_ARIA_LABEL_PAIRING_TEAM="Team for fixture"
COM_SPORTSMANAGER_ARIA_LABEL_ELIGIBLE_COMPETITION="Choose eligible user"
COM_SPORTSMANAGER_ARIA_LABEL_RANKING_EVALUATION="Ranking evaluation"
COM_SPORTSMANAGER_ARIA_LABEL_LASTNAME="Lastname"
COM_SPORTSMANAGER_ARIA_LABEL_FIRSTNAME="Firstname"
COM_SPORTSMANAGER_ARIA_LABEL_CLUB="Club"
+244 -222
View File
File diff suppressed because it is too large Load Diff
+7 -6
View File
@@ -8,18 +8,19 @@
<license>GNU/GPL</license> <license>GNU/GPL</license>
<version>2.0.0</version> <version>2.0.0</version>
<description>Verwaltung von Spielern und Vereinen in Mannschafts- und Individualwettbewerben</description> <description>Verwaltung von Spielern und Vereinen in Mannschafts- und Individualwettbewerben</description>
<namespace path="src">Dtfb\Component\com_sportsmanager</namespace>
<files folder="site"> <files folder="site">
<filename>index.html</filename> <filename>index.html</filename>
<filename>admin.php</filename> <filename>admin.php</filename>
<filename>api.php</filename> <filename>api.php</filename>
<filename>controller.php</filename>
<filename>database.php</filename>
<filename>sportsmanager.php</filename> <filename>sportsmanager.php</filename>
<filename>mathparser.php</filename> <filename>mathparser.php</filename>
<filename>tools.php</filename> <filename>tools.php</filename>
<filename>js/jquery.min.js</filename> <filename>js/jquery.min.js</filename>
<folder>images</folder> <folder>database</folder>
<folder>images</folder>
<folder>models</folder> <folder>models</folder>
<folder>src</folder>
<folder>util</folder> <folder>util</folder>
<folder>views</folder> <folder>views</folder>
</files> </files>
@@ -35,10 +36,10 @@
<administration> <administration>
<files folder="admin"> <files folder="admin">
<filename>access.xml</filename> <filename>access.xml</filename>
<filename>sportsmanager.php</filename>
<filename>controller.php</filename>
<filename>index.html</filename> <filename>index.html</filename>
<folder>views</folder> <folder>services</folder>
<folder>src</folder>
<folder>tmpl</folder>
</files> </files>
<languages folder="admin"> <languages folder="admin">
<language tag="en-GB">language/en-GB/en-GB.com_sportsmanager.ini <language tag="en-GB">language/en-GB/en-GB.com_sportsmanager.ini