Skip to content

Commit

Permalink
5.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
PhocaCz committed Mar 25, 2024
1 parent 284313b commit c5dd3d8
Show file tree
Hide file tree
Showing 15 changed files with 179 additions and 20 deletions.
18 changes: 18 additions & 0 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
1 change: 1 addition & 0 deletions checksum.json
Original file line number Diff line number Diff line change
@@ -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"}}
Binary file added content-phocamaps-release-news.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
32 changes: 32 additions & 0 deletions content-phocamaps-release-news.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified content-phocamaps-release.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion content-phocamaps-release.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions language/en-GB/en-GB.plg_content_phocamaps.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
; @test utf-8 ä, ö, ü
;


;[3.0.9]
PLG_CONTENT_PHOCAMAPS_BOOTSTRAP_MODAL_BOX="Bootstrap Modal Box"

Expand Down
24 changes: 23 additions & 1 deletion manifest.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?xml version="1.0" ?>
<updates>
<update>
<name><![CDATA[ Phoca Maps Content Plugin ]]></name>
Expand Down Expand Up @@ -36,7 +37,28 @@
<maintainer><![CDATA[ Phoca.cz ]]></maintainer>
<maintainerurl>https://www.phoca.cz/</maintainerurl>
<section>Updates</section>
<targetplatform name="joomla" version="4.[012]"/>
<targetplatform name="joomla" version="4\.*"/>
<client>site</client>
</update>
<update>
<name><![CDATA[ Phoca Maps Content Plugin ]]></name>
<description><![CDATA[ Phoca Maps Plugin is a Joomla! plugin. With Phoca Maps Plugin you can display one or more maps on your site (in the article). You can display the map or only link to selected map. When user click on this link, the map will be displayed in Modal Box window or in standard Popup window. ]]></description>
<element>phocamaps</element>
<folder>content</folder>
<type>plugin</type>
<version>5.0.0</version>
<infourl title="Phoca Maps Content Plugin 5.0.0">https://www.phoca.cz/</infourl>
<downloads>
<downloadurl type="full" format="zip">https://github.com/PhocaCz/PhocaMapsPlugin/releases/download/5.0.0/plg_content_phocamaps_v5.0.0.zip</downloadurl>
</downloads>
<sha512>236d505272ccb1c6ffb4a41bc4824b3bc69f1178c1ed2a9f148cc535ea8ce8510b9fdcec47d7659b65c9561a682d226a7cee12d0e4d98e2c907c97932b77ff3d</sha512>
<tags>
<tag>stable</tag>
</tags>
<maintainer><![CDATA[ Phoca.cz ]]></maintainer>
<maintainerurl>https://www.phoca.cz/</maintainerurl>
<section>Updates</section>
<targetplatform name="joomla" version="(4|5)\.*"/>
<client>site</client>
</update>
</updates>
Binary file modified phocamaps-48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified phocamaps-512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
57 changes: 47 additions & 10 deletions phocamaps.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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
Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -494,8 +504,12 @@ public function onContentPrepare($context, &$article, &$params, $page = 0) {



$hStyle = 'font-size:120%;margin: 5px 0px;font-weight:bold;';
$text = '<div style="'.$hStyle.'">' . addslashes($markerV->title) . '</div>';
//$hStyle = 'font-size:120%;margin: 5px 0px;font-weight:bold;';
//$text = '<div style="'.$hStyle.'">' . addslashes($markerV->title) . '</div>';

// template
// $text = '<div class="pmMarkerTitle">' . addslashes($markerV->title) . '</div>';

// Try to correct images in description
$markerV->description = PhocaMapsHelper::fixImagePath($markerV->description);
$markerV->description = str_replace('@', '&#64;', $markerV->description);
Expand All @@ -504,6 +518,9 @@ public function onContentPrepare($context, &$article, &$params, $page = 0) {
//$markerV->description = str_replace('"', '&#34;', $markerV->description);

//$markerV->description = htmlentities($markerV->description);

// template
/*
$text .= '<div>'. PhocaMapsHelper::strTrimAll(addslashes($markerV->description)).'</div>';
Expand All @@ -512,9 +529,10 @@ public function onContentPrepare($context, &$article, &$params, $page = 0) {
.'<td>'.PhocaMapsHelper::strTrimAll(addslashes($markerV->gpslatitude)).'</td></tr>'
.'<tr><td></td>'
.'<td>'.PhocaMapsHelper::strTrimAll(addslashes($markerV->gpslongitude)).'</td></tr></table></div>';
}

}*/

// 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;
Expand Down Expand Up @@ -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']) {
Expand Down Expand Up @@ -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();
}
}
?>
Binary file modified phocamaps.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 9 additions & 8 deletions phocamaps.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<extension type="plugin" group="content" method="upgrade" version="4.0">
<extension type="plugin" group="content" method="upgrade" version="5.0">
<name>plg_content_phocamaps</name>
<author>Jan Pavelka (www.phoca.cz)</author>
<creationDate>15/03/2023</creationDate>
<creationDate>24/03/2024</creationDate>
<authorEmail></authorEmail>
<authorUrl>https://www.phoca.cz</authorUrl>
<copyright>Jan Pavelka</copyright>
<license>GNU/GPL</license>
<version>4.0.1</version>
<version>5.0.0</version>
<description>PLG_CONTENT_PHOCAMAPS_DESCRIPTION</description>
<projectName>PhocaMapsPlugin</projectName>

Expand All @@ -18,6 +18,7 @@
</media>

<files>
<folder>tmpl</folder>
<filename plugin="phocamaps">index.html</filename>
<filename plugin="phocamaps">manifest.xml</filename>
<filename plugin="phocamaps">phocamaps.php</filename>
Expand All @@ -36,21 +37,21 @@
</administration>

<config>

<fields name="params" addpath="/administrator/components/com_phocamaps/models/fields">

<fieldset name="basic">

<field name="display_map_description" type="list" default="0" label="PLG_CONTENT_PHOCAMAPS_DISPLAY_MAP_DESCRIPTION_LABEL" description="PLG_CONTENT_PHOCAMAPS_DISPLAY_MAP_DESCRIPTION_DESC">
<option value="0">PLG_CONTENT_PHOCAMAPS_NO</option>
<option value="1">PLG_CONTENT_PHOCAMAPS_YES</option>
</field>

<field name="detail_window" type="list" default="1" label="PLG_CONTENT_PHOCAMAPS_DETAIL_WINDOW_LABEL" description="PLG_CONTENT_PHOCAMAPS_DETAIL_WINDOW_DESC">
<option value="1">PLG_CONTENT_PHOCAMAPS_STANDARD_POPUP_WINDOW</option>
<option value="2">PLG_CONTENT_PHOCAMAPS_BOOTSTRAP_MODAL_BOX</option>
</field>


</fieldset>
</fields>
Expand Down
14 changes: 14 additions & 0 deletions tmpl/custom_js.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/

use Joomla\Language\Text;

defined( '_JEXEC' ) or die( 'Restricted access' );

?>
33 changes: 33 additions & 0 deletions tmpl/marker.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/

use Joomla\Language\Text;

defined( '_JEXEC' ) or die( 'Restricted access' );

?>
<div class="pmMarkerTitle"><?= addslashes($data->title);?></div>
<div><?php echo PhocaMapsHelper::strTrimAll(addslashes($data->description)); ?></div>
<?php
if ($data->displaygps == 1) :
?>
<div class="pmgps">
<table style="border:0">
<tr>
<td><strong><?php echo Text::_('PLG_CONTENT_PHOCAMAPS_GPS');?>: </strong></td>
<td><?php echo PhocaMapsHelper::strTrimAll(addslashes($data->gpslatitude));?></td>
</tr>
<tr>
<td></td>
<td><?php echo PhocaMapsHelper::strTrimAll(addslashes($data->gpslongitude));?></td>
</tr>
</table>
</div>
<?php
endif;

0 comments on commit c5dd3d8

Please sign in to comment.