diff --git a/src/structure/components/com_sportsmanager/views/sportsmanager/view_tools.php b/src/structure/components/com_sportsmanager/views/sportsmanager/view_tools.php index 4ff9237..59527d7 100644 --- a/src/structure/components/com_sportsmanager/views/sportsmanager/view_tools.php +++ b/src/structure/components/com_sportsmanager/views/sportsmanager/view_tools.php @@ -387,7 +387,20 @@ function bildHTML($typ, $id, $fixed_width = 0, $fixed_height = 0, $max_width = 0 return null; } - return ''; + /* + * #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 + */ + return ''; } $new_width = $width; diff --git a/src/structure/plugins/system/kickyootheme/fields/kickdonation.php b/src/structure/plugins/system/kickyootheme/fields/kickdonation.php new file mode 100644 index 0000000..eb180c8 --- /dev/null +++ b/src/structure/plugins/system/kickyootheme/fields/kickdonation.php @@ -0,0 +1,34 @@ + + * @author Stefan Wendhausen + * @copyright Copyright © 2021 Kicktemp GmbH. All rights reserved. + * @license GNU General Public License version 3 or later; see LICENSE.txt + * @link https://kicktemp.com + */ + +// No direct access +defined('_JEXEC') or die; +use Joomla\Registry\Registry; + +/** + * Form Field class for Kicktemp Joomla! Extensions. + * Provides a donation code check. + */ +class JFormFieldKickDonation extends JFormField +{ + protected $type = 'kickdonation'; + + protected function getInput() + { + $html = ' 5 € 10 € # €'; + return $html; + } + + protected function getLabel() + { + return JText::_('KICKDONATION'); + } +} diff --git a/src/structure/plugins/system/kickyootheme/kickscript.php b/src/structure/plugins/system/kickyootheme/kickscript.php new file mode 100644 index 0000000..e9bc3ed --- /dev/null +++ b/src/structure/plugins/system/kickyootheme/kickscript.php @@ -0,0 +1,155 @@ + + * @author Stefan Wendhausen + * @copyright Copyright © 2019 Kicktemp GmbH. All rights reserved. + * @license GNU General Public License version 3 or later; see LICENSE.txt + * @link https://kicktemp.com + */ + + +class PlgSystemKickYOOthemeInstallerScript +{ + private $min_joomla_version = '3.8.0'; + private $min_php_version = '7.0'; + private $name = 'System Plugin Kick YOOtheme Pro'; + private $extname = 'plg_system_kickyootheme'; + private $previous_version = ''; + private $previous_version_simple = ''; + private $dir = null; + + public function __construct() + { + $this->dir = __DIR__; + } + + public function postflight($route, $installer) + { + $changelog = $this->getChangelog(); + + JFactory::getApplication()->enqueueMessage($changelog, 'notice'); + + return true; + } + + private function getChangelog() + { + $changelog = file_get_contents($this->dir . '/CHANGELOG.txt'); + + $changelog = "\n" . trim(preg_replace('#^.* \*/#s', '', $changelog)); + $changelog = preg_replace("#\r#s", '', $changelog); + + $parts = explode("\n\n", $changelog); + + if (empty($parts)) + { + return ''; + } + + $this_version = ''; + + $changelog = []; + + // Add first entry to the changelog + $changelog[] = array_shift($parts); + + // Add extra older entries if this is an upgrade based on previous installed version + if ($this->previous_version_simple) + { + if (preg_match('#^[0-9]+-[a-z]+-[0-9]+ : v([0-9\.]+(?:-dev[0-9]+)?)\n#i', trim($changelog[0]), $match)) + { + $this_version = $match[1]; + } + + foreach ($parts as $part) + { + $part = trim($part); + + if ( ! preg_match('#^[0-9]+-[a-z]+-[0-9]+ : v([0-9\.]+(?:-dev[0-9]+)?)\n#i', $part, $match)) + { + continue; + } + + $changelog_version = $match[1]; + + if (version_compare($changelog_version, $this->previous_version_simple, '<=')) + { + break; + } + + $changelog[] = $part; + } + } + + $changelog = implode("\n\n", $changelog); + + // + Added ! Removed ^ Changed # Fixed + $change_types = [ + '+' => ['Added', 'success'], + '!' => ['Removed', 'danger'], + '^' => ['Changed', 'warning'], + '#' => ['Fixed', 'info'], + ]; + foreach ($change_types as $char => $type) + { + $changelog = preg_replace( + '#\n ' . preg_quote($char, '#') . ' #', + "\n" . '' . $char . ' ', + $changelog + ); + } + + $changelog = preg_replace('#see: (https://www\.kicktemp\.com[^ \)]*)#s', 'see documentation', $changelog); + + $changelog = preg_replace( + "#(\n+)([0-9]+.*?) : v([0-9\.]+(?:-dev[0-9]+)?)([^\n]*?\n+)#", + '\1' + . '

v\3' + . ' \2

' + . '\4
',
+			$changelog
+		);
+
+		$changelog = str_replace(
+			[
+				'
',
+				'[FREE]',
+				'[PRO]',
+			],
+			[
+				'
',
+				'FREE',
+				'PRO',
+			],
+			$changelog
+		);
+
+		$changelog = preg_replace(
+			'#\[J([1-9][\.0-9]*)\]#',
+			'J\1',
+			$changelog
+		);
+
+		$title = 'Latest changes for ' . JText::_($this->name);
+
+		if ($this->previous_version_simple && version_compare($this->previous_version_simple, $this_version, '<'))
+		{
+			$title .= ' since v' . $this->previous_version_simple;
+		}
+
+		if ($this->previous_version_simple
+			&& $this->getMajorVersionPart($this->previous_version_simple) < $this->getMajorVersionPart($this_version)
+			&& ! $this->hasMessagesOfType('warning')
+		)
+		{
+			JFactory::getApplication()->enqueueMessage(JText::sprintf('RLI_MAJOR_UPGRADE', JText::_($this->name)), 'warning');
+		}
+
+		return '

' . $title . ':

' + . '
' + . $changelog + . '
'; + } +} diff --git a/src/structure/plugins/system/kickyootheme/kickyootheme.php b/src/structure/plugins/system/kickyootheme/kickyootheme.php new file mode 100644 index 0000000..974cc8e --- /dev/null +++ b/src/structure/plugins/system/kickyootheme/kickyootheme.php @@ -0,0 +1,40 @@ + + * @author Stefan Wendhausen + * @copyright Copyright © 2020 Kicktemp GmbH. All rights reserved. + * @license GNU General Public License version 3 or later; see LICENSE.txt + * @link https://kicktemp.com + */ + +defined('_JEXEC') or die; + +use function YOOtheme\app; +use YOOtheme\ImageProvider; + +/** + * Plugin class to modify the JDocumentHTML object + * + * @since 3.1 + */ +class plgSystemKickYOOtheme extends JPlugin +{ + protected $app; + + protected $buffer; + + public function onBeforeRender() + { + if (!$this->app->isClient('site')) + { + return false; + } + + $imageProvider = app(ImageProvider::class); + $content = JFactory::getDocument()->getBuffer('component'); + + JFactory::getDocument()->setBuffer($imageProvider->replace($content), 'component'); + } +} diff --git a/src/structure/plugins/system/kickyootheme/kickyootheme.xml b/src/structure/plugins/system/kickyootheme/kickyootheme.xml new file mode 100644 index 0000000..e2d166e --- /dev/null +++ b/src/structure/plugins/system/kickyootheme/kickyootheme.xml @@ -0,0 +1,30 @@ + + + plg_system_kickyootheme + Kicktemp GmbH + 30 September 2019 + Copyright © 2019 Kicktemp GmbH. All rights reserved. + GNU General Public License version 3 or later; see LICENSE.txt + hello@kicktemp.com + https://kicktemp.com + @@VERSION + PLG_SYSTEM_KICKYOOTHEME_XML_DESCRIPTION + + language + fields + kickyootheme.php + + kickscript.php + + +
+ +
+
+
+ + + https://update.kicktemp.com/joomla/plugins/plg_system_kickyootheme/update.xml + + +
diff --git a/src/structure/plugins/system/kickyootheme/language/de-DE/de-DE.plg_system_kickyootheme.ini b/src/structure/plugins/system/kickyootheme/language/de-DE/de-DE.plg_system_kickyootheme.ini new file mode 100644 index 0000000..2a93c67 --- /dev/null +++ b/src/structure/plugins/system/kickyootheme/language/de-DE/de-DE.plg_system_kickyootheme.ini @@ -0,0 +1,3 @@ +PLG_SYSTEM_KICKYOOTHEME="System - Kick YOOtheme Pro ImageProvider" +PLG_SYSTEM_KICKYOOTHEME_XML_DESCRIPTION="System plugin to modify the Component" +KICKDONATION="Projekt unterstützen?" diff --git a/src/structure/plugins/system/kickyootheme/language/de-DE/de-DE.plg_system_kickyootheme.sys.ini b/src/structure/plugins/system/kickyootheme/language/de-DE/de-DE.plg_system_kickyootheme.sys.ini new file mode 100644 index 0000000..88b730d --- /dev/null +++ b/src/structure/plugins/system/kickyootheme/language/de-DE/de-DE.plg_system_kickyootheme.sys.ini @@ -0,0 +1,2 @@ +PLG_SYSTEM_KICKYOOTHEME="System - Kick YOOtheme Pro ImageProvider" +PLG_SYSTEM_KICKYOOTHEME_XML_DESCRIPTION="System plugin to modify the Component" diff --git a/src/structure/plugins/system/kickyootheme/language/en-GB/en-GB.plg_system_kickyootheme.ini b/src/structure/plugins/system/kickyootheme/language/en-GB/en-GB.plg_system_kickyootheme.ini new file mode 100644 index 0000000..2a93c67 --- /dev/null +++ b/src/structure/plugins/system/kickyootheme/language/en-GB/en-GB.plg_system_kickyootheme.ini @@ -0,0 +1,3 @@ +PLG_SYSTEM_KICKYOOTHEME="System - Kick YOOtheme Pro ImageProvider" +PLG_SYSTEM_KICKYOOTHEME_XML_DESCRIPTION="System plugin to modify the Component" +KICKDONATION="Projekt unterstützen?" diff --git a/src/structure/plugins/system/kickyootheme/language/en-GB/en-GB.plg_system_kickyootheme.sys.ini b/src/structure/plugins/system/kickyootheme/language/en-GB/en-GB.plg_system_kickyootheme.sys.ini new file mode 100644 index 0000000..88b730d --- /dev/null +++ b/src/structure/plugins/system/kickyootheme/language/en-GB/en-GB.plg_system_kickyootheme.sys.ini @@ -0,0 +1,2 @@ +PLG_SYSTEM_KICKYOOTHEME="System - Kick YOOtheme Pro ImageProvider" +PLG_SYSTEM_KICKYOOTHEME_XML_DESCRIPTION="System plugin to modify the Component" diff --git a/src/structure/plugins/system/kickyootheme/script.php b/src/structure/plugins/system/kickyootheme/script.php new file mode 100644 index 0000000..38c4729 --- /dev/null +++ b/src/structure/plugins/system/kickyootheme/script.php @@ -0,0 +1,30 @@ + + * @author Stefan Wendhausen + * @copyright Copyright © 2019 Kicktemp GmbH. All rights reserved. + * @license GNU General Public License version 3 or later; see LICENSE.txt + * @link https://kicktemp.com + */ + +/** + * Installation class to perform additional changes during install/uninstall/update + * + * @since 1.0 + */ +class PlgSystemKickYOOthemeScript extends JInstallerScript +{ + /** + * Extension script constructor. + * + * @since 1.0 + */ + public function __construct() + { + // Define the minumum versions to be supported. + $this->minimumJoomla = '3.8'; + $this->minimumPhp = '7.0'; + } +}