diff --git a/README.MD b/README.MD index 3f18674..a75fede 100755 --- a/README.MD +++ b/README.MD @@ -64,6 +64,10 @@ Phoca Maps Plugin is a Joomla! plugin. With Phoca Maps Plugin you can display on 4.0.1 +## Version (Joomla! 5.x) + +5.0.0 + ## License @@ -73,3 +77,17 @@ GNU/GPL This project is open source project - feel free to contribute! Thank you. + + + +## Social Media + +- [Phoca on Facebook](https://www.facebook.com/Phoca.cz) + +- [Phoca on X (Twitter)](https://twitter.com/PhocaCz) + +- [Phoca on YouTube](https://www.youtube.com/user/phocavideos) + +- [Phoca on GitHub](https://github.com/PhocaCz) + +- [Phoca on Reddit](https://www.reddit.com/user/PhocaCz) diff --git a/checksum.json b/checksum.json new file mode 100644 index 0000000..2041ed1 --- /dev/null +++ b/checksum.json @@ -0,0 +1 @@ +{"plg_content_phocamaps_v5.0.0.zip":{"key":"plg_content_phocamaps_v5.0.0.zip","extname":"plg_content_phocamaps","version":"5.0.0","checksum":"236d505272ccb1c6ffb4a41bc4824b3bc69f1178c1ed2a9f148cc535ea8ce8510b9fdcec47d7659b65c9561a682d226a7cee12d0e4d98e2c907c97932b77ff3d"}} \ No newline at end of file diff --git a/content-phocamaps-release-news.png b/content-phocamaps-release-news.png new file mode 100644 index 0000000..acdae44 Binary files /dev/null and b/content-phocamaps-release-news.png differ diff --git a/content-phocamaps-release-news.svg b/content-phocamaps-release-news.svg new file mode 100644 index 0000000..df1f489 --- /dev/null +++ b/content-phocamaps-release-news.svg @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + WWW.PHOCA.CZ/NEWS + Phoca Maps Content Pluginversion 5.0.0 + has been released + + + + + + + diff --git a/content-phocamaps-release.png b/content-phocamaps-release.png index 6df8063..b4bb3b1 100755 Binary files a/content-phocamaps-release.png and b/content-phocamaps-release.png differ diff --git a/content-phocamaps-release.svg b/content-phocamaps-release.svg index 03b1e85..614a253 100644 --- a/content-phocamaps-release.svg +++ b/content-phocamaps-release.svg @@ -132,7 +132,7 @@ x="255.99997" y="242.20009" id="tspan1992" - style="font-size:34.6667px;text-align:center;text-anchor:middle">version 4.0.1 + style="font-size:34.6667px;text-align:center;text-anchor:middle">version 5.0.0 @@ -36,7 +37,28 @@ https://www.phoca.cz/
Updates
- + + site +
+ + + + phocamaps + content + plugin + 5.0.0 + https://www.phoca.cz/ + + https://github.com/PhocaCz/PhocaMapsPlugin/releases/download/5.0.0/plg_content_phocamaps_v5.0.0.zip + + 236d505272ccb1c6ffb4a41bc4824b3bc69f1178c1ed2a9f148cc535ea8ce8510b9fdcec47d7659b65c9561a682d226a7cee12d0e4d98e2c907c97932b77ff3d + + stable + + + https://www.phoca.cz/ +
Updates
+ site
diff --git a/phocamaps-48.png b/phocamaps-48.png index 2cf011e..e3afbee 100755 Binary files a/phocamaps-48.png and b/phocamaps-48.png differ diff --git a/phocamaps-512.png b/phocamaps-512.png index cbce658..027230f 100755 Binary files a/phocamaps-512.png and b/phocamaps-512.png differ diff --git a/phocamaps.php b/phocamaps.php index 4d80d38..607301d 100755 --- a/phocamaps.php +++ b/phocamaps.php @@ -15,16 +15,20 @@ use Joomla\CMS\Language\Text; use Joomla\CMS\Filesystem\File; use Joomla\CMS\Object\CMSObject; +use Joomla\CMS\Plugin\CMSPlugin; +use Joomla\CMS\Plugin\PluginHelper; +use Joomla\CMS\Uri\Uri; defined( '_JEXEC' ) or die( 'Restricted access' ); if(!defined('DS')) define('DS', DIRECTORY_SEPARATOR); jimport( 'joomla.plugin.plugin' ); jimport( 'joomla.application.component.helper' ); -class plgContentPhocaMaps extends JPlugin +class plgContentPhocaMaps extends CMSPlugin { protected $_plgPhocaMapsNr = 0; - protected $_loadedBootstrap = 0; + protected $_loadedBootstrap = 0; + public $plg_name = "phocamaps"; public function __construct(& $subject, $config) { @@ -47,12 +51,18 @@ public function onContentPrepare($context, &$article, &$params, $page = 0) { return true; } + + //$layout = new FileLayout('test', null, []); + //$layout->addIncludePaths([JPATH_SITE . '/plugins/content/phocamaps/layouts']); + + $app = Factory::getApplication(); $view = $app->input->get('view'); if ($view == 'tag') { return; } $param['display_map_description'] = $this->params->get('display_map_description', 0); + $param['display_auto_location'] = $this->params->get('display_auto_location', 0); // Start Plugin @@ -92,14 +102,14 @@ public function onContentPrepare($context, &$article, &$params, $page = 0) { //$paramsC = new JParameter( $table->params ); $component = 'com_phocamaps'; - $paramsC = JComponentHelper::getParams($component) ; + $paramsC = ComponentHelper::getParams($component) ; $tmpl = array(); - JHtml::_('jquery.framework', false); + HTMLHelper::_('jquery.framework', false); - $document->addStyleSheet(JURI::base(true).'/media/com_phocamaps/css/phocamaps.css'); - $document->addStyleSheet(JURI::base(true).'/media/plg_content_phocamaps/css/default.css'); + $document->addStyleSheet(URI::base(true).'/media/com_phocamaps/css/phocamaps.css'); + $document->addStyleSheet(URI::base(true).'/media/plg_content_phocamaps/css/default.css'); $allIds = array(); @@ -494,8 +504,12 @@ public function onContentPrepare($context, &$article, &$params, $page = 0) { - $hStyle = 'font-size:120%;margin: 5px 0px;font-weight:bold;'; - $text = '
' . addslashes($markerV->title) . '
'; + //$hStyle = 'font-size:120%;margin: 5px 0px;font-weight:bold;'; + //$text = '
' . addslashes($markerV->title) . '
'; + + // template + // $text = '
' . addslashes($markerV->title) . '
'; + // Try to correct images in description $markerV->description = PhocaMapsHelper::fixImagePath($markerV->description); $markerV->description = str_replace('@', '@', $markerV->description); @@ -504,6 +518,9 @@ public function onContentPrepare($context, &$article, &$params, $page = 0) { //$markerV->description = str_replace('"', '"', $markerV->description); //$markerV->description = htmlentities($markerV->description); + + // template + /* $text .= '
'. PhocaMapsHelper::strTrimAll(addslashes($markerV->description)).'
'; @@ -512,9 +529,10 @@ public function onContentPrepare($context, &$article, &$params, $page = 0) { .''.PhocaMapsHelper::strTrimAll(addslashes($markerV->gpslatitude)).'' .'' .''.PhocaMapsHelper::strTrimAll(addslashes($markerV->gpslongitude)).''; - } - + }*/ + // Get marker text from tmpl so it can be overriden by template override + $text = str_replace(array("\r", "\n", "\t"), '', $this->getTemplateOutput($markerV, "marker")); if(empty($markerV->icon)) { $markerV->icon = 0; @@ -547,6 +565,15 @@ public function onContentPrepare($context, &$article, &$params, $page = 0) { if(isset($mapp->scrollwheelzoom) && $mapp->scrollwheelzoom != 0){ $output .= $map->setListener(); } + + + if ((int)$mapp->autolocation == 1) { + $output .= $map->setAutolocation(); + } + + // Set own custom JS which can be overriden by template + $output .= $this->getTemplateOutput(["mapId"=>$this->_plgPhocaMapsNr], "custom_js"); + $output .= $map->endMapFunction(); if ($tmpl['displaydir']) { @@ -937,5 +964,15 @@ public function onContentPrepare($context, &$article, &$params, $page = 0) { }// end if count_matches return true; } + + public function getTemplateOutput($data, $tmpl = "default") { + + ob_start(); + + $getTemplatePath = PluginHelper::getLayoutPath('content', $this->plg_name, $tmpl); + include($getTemplatePath); + + return ob_get_clean(); + } } ?> diff --git a/phocamaps.png b/phocamaps.png index 831d236..c3b054d 100755 Binary files a/phocamaps.png and b/phocamaps.png differ diff --git a/phocamaps.xml b/phocamaps.xml index b670bca..69b6606 100755 --- a/phocamaps.xml +++ b/phocamaps.xml @@ -1,13 +1,13 @@ - + plg_content_phocamaps Jan Pavelka (www.phoca.cz) - 15/03/2023 + 24/03/2024 https://www.phoca.cz Jan Pavelka GNU/GPL - 4.0.1 + 5.0.0 PLG_CONTENT_PHOCAMAPS_DESCRIPTION PhocaMapsPlugin @@ -18,6 +18,7 @@ + tmpl index.html manifest.xml phocamaps.php @@ -36,21 +37,21 @@ - + - +
- + - + - +
diff --git a/tmpl/custom_js.php b/tmpl/custom_js.php new file mode 100644 index 0000000..bdfafe3 --- /dev/null +++ b/tmpl/custom_js.php @@ -0,0 +1,14 @@ + diff --git a/tmpl/marker.php b/tmpl/marker.php new file mode 100644 index 0000000..82a147c --- /dev/null +++ b/tmpl/marker.php @@ -0,0 +1,33 @@ + +
title);?>
+
description)); ?>
+displaygps == 1) : +?> +
+ + + + + + + + + +
: gpslatitude));?>
gpslongitude));?>
+
+