@@ -36,7 +37,28 @@
https://www.phoca.cz/
-
+
+ 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/
+
+
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 @@
+
+= addslashes($data->title);?>
+description)); ?>
+displaygps == 1) :
+?>
+
+
+
+ : |
+ gpslatitude));?> |
+
+
+ |
+ gpslongitude));?> |
+
+
+
+