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 18, 2024
1 parent 43b186c commit 14f9f2d
Show file tree
Hide file tree
Showing 11 changed files with 51 additions and 12 deletions.
4 changes: 4 additions & 0 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ Phoca Open Graph System Plugin is a Joomla! CMS Plugin. It allows adding of open

4.0.7

## Version (Joomla! 5.x)

5.0.0



## License
Expand Down
1 change: 1 addition & 0 deletions checksum.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"plg_system_phocaopengraph_v5.0.0.zip":{"key":"plg_system_phocaopengraph_v5.0.0.zip","extname":"plg_system_phocaopengraph","version":"5.0.0","checksum":"39e3f87f448b8e7c47ccad188522e6811cea9b2f34c363260b6dc6f8ef5b1d39e51ab686ff7b6b5dddf539537e2b86edf12e24faf2fc6e80dfd083a6cef4f6f0"}}
4 changes: 4 additions & 0 deletions language/en-GB/en-GB.plg_system_phocaopengraph.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
; @test utf-8 ä, ö, ü
;

;[5.0.0]
PLG_SYSTEM_PHOCA_OPEN_GRAPH_DISPLAY_ITEMPROP_IMAGE_LABEL="Display Itemprop (Image)"
PLG_SYSTEM_PHOCA_OPEN_GRAPH_DISPLAY_ITEMPROP_IMAGE_DESC="Display or hide 'itemprop' attribute for image meta tags"

;[3.0.6]
PLG_SYSTEM_PHOCA_OPEN_GRAPH_ENABLE_ARTICLE_COMPONENT_CATEGORIES_VIEW_LABEL="Enable In Article Component (Categories View)"
PLG_SYSTEM_PHOCA_OPEN_GRAPH_ENABLE_ARTICLE_COMPONENT_CATEGORIES_VIEW_DESC="Enable or disable this plugin in Article component (com_content) - in Categories view."
Expand Down
22 changes: 21 additions & 1 deletion manifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
<downloads>
<downloadurl type="full" format="zip">https://github.com/PhocaCz/PhocaOpenGraphSystemPlugin/releases/download/4.0.7/plg_system_phocaopengraph_v4.0.7.zip</downloadurl>
</downloads>
<sha512>eedad2f9d74cfffc8ece57cb02a69ce60e301093205dab94d8bee69a5a092269d8f7524a2aec9648f150dccd52fbba84f321f4551d6aa09ca83e173f0295105f</sha512>
<tags>
<tag>stable</tag>
</tags>
Expand All @@ -41,4 +40,25 @@
<targetplatform name="joomla" version="4\.*"/>
<client>site</client>
</update>
<update>
<name><![CDATA[ Phoca Open Graph System Plugin ]]></name>
<description><![CDATA[ Phoca Open Graph System Plugin is a Joomla! CMS Plugin. It allows adding of open graph information into site. Such information stored in meta tags can be then automatically displayed on e.g. Facebook while some visitor of the site commented e.g. article. ]]></description>
<element>phocaopengraph</element>
<folder>system</folder>
<type>plugin</type>
<version>5.0.0</version>
<infourl title="Phoca Open Graph System Plugin 5.0.0">https://www.phoca.cz/</infourl>
<downloads>
<downloadurl type="full" format="zip">https://github.com/PhocaCz/PhocaOpenGraphSystemPlugin/releases/download/5.0.0/plg_system_phocaopengraph_v5.0.0.zip</downloadurl>
</downloads>
<sha512>39e3f87f448b8e7c47ccad188522e6811cea9b2f34c363260b6dc6f8ef5b1d39e51ab686ff7b6b5dddf539537e2b86edf12e24faf2fc6e80dfd083a6cef4f6f0</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>
8 changes: 5 additions & 3 deletions models/fields/phocaoghead.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
*/

use Joomla\CMS\Factory;
use Joomla\CMS\Form\FormField;
use Joomla\CMS\Language\Text;

defined('JPATH_BASE') or die;
jimport('joomla.html.html');
jimport('joomla.form.formfield');

class JFormFieldPhocaOGHead extends JFormField
class JFormFieldPhocaOGHead extends FormField
{
protected $type = 'PhocaOGHead';

Expand All @@ -39,12 +41,12 @@ protected function getInput() {
.'<table border="0"><tr>'
.'<td valign="middle" align="center">'. $image.'</td>'
.'<td valign="middle" align="center">'
.'<strong>'. JText::_($this->element['default']) . '</strong></td>'
.'<strong>'. Text::_($this->element['default']) . '</strong></td>'
.'</tr></table>'
.'</div>';
} else {
return '<div class="ph-options-head">'
.'<strong>'. JText::_($this->element['default']) . '</strong>'
.'<strong>'. Text::_($this->element['default']) . '</strong>'
.'</div>';
}
} else {
Expand Down
9 changes: 6 additions & 3 deletions phocaopengraph.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@

use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Plugin\CMSPlugin;
use Joomla\CMS\Uri\Uri;

defined( '_JEXEC' ) or die( 'Restricted access' );
jimport( 'joomla.plugin.plugin' );


class plgSystemPhocaOpenGraph extends JPlugin
class plgSystemPhocaOpenGraph extends CMSPlugin
{

public $twitterEnable = 0;
Expand Down Expand Up @@ -85,6 +86,8 @@ public function renderTag($name, $value, $type = 1) {

$document = Factory::getDocument();

$display_itemprop_image = $this->params->get('display_itemprop_image', 1);

$docType = $document->getType();
if ($docType == 'pdf' || $docType == 'raw' || $docType == 'json' || $docType == 'xml') {
return;
Expand All @@ -99,7 +102,7 @@ public function renderTag($name, $value, $type = 1) {
$document->setMetadata(htmlspecialchars($name, ENT_COMPAT, 'UTF-8'), htmlspecialchars($value, ENT_COMPAT, 'UTF-8'));
} else {
$attributes = '';
if ($name == 'og:image') {
if ($name == 'og:image' && $display_itemprop_image == 1) {
$attributes = ' itemprop="image"';
}
$document->addCustomTag('<meta property="'.htmlspecialchars($name, ENT_COMPAT, 'UTF-8').'"'.$attributes.' content="' . htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . '" />');
Expand Down Expand Up @@ -222,7 +225,7 @@ function onBeforeRender() {
$this->renderTag('og:title', $document->title, $type);
$this->renderTag('og:description', $document->description, $type);
//$this->renderTag('og:url', $document->base, $type);
$this->renderTag('og:url', JUri::current(), $type);
$this->renderTag('og:url', Uri::current(), $type);
$this->renderTag('og:type', 'website', $type);


Expand Down
11 changes: 8 additions & 3 deletions phocaopengraph.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="system" method="upgrade" version="4.0">
<extension type="plugin" group="system" method="upgrade" version="5.0">
<name>plg_system_phocaopengraph</name>
<author>Jan Pavelka (www.phoca.cz)</author>
<creationDate>25/09/2023</creationDate>
<creationDate>10/12/2023</creationDate>
<authorEmail></authorEmail>
<authorUrl>https://www.phoca.cz</authorUrl>
<copyright>Jan Pavelka</copyright>
<license>GNU/GPL</license>
<version>4.0.7</version>
<version>5.0.0</version>
<description>PLG_SYSTEM_PHOCAOPENGRAPH_DESCRIPTION</description>
<projectName>PhocaOpenGraphSystemPlugin</projectName>

Expand Down Expand Up @@ -39,6 +39,11 @@
<option value="2">PLG_SYSTEM_PHOCA_OPEN_GRAPH_PROPERTY</option>
</field>

<field name="display_itemprop_image" type="list" default="1" label="PLG_SYSTEM_PHOCA_OPEN_GRAPH_DISPLAY_ITEMPROP_IMAGE_LABEL" description="PLG_SYSTEM_PHOCA_OPEN_GRAPH_DISPLAY_ITEMPROP_IMAGE_DESC">
<option value="0">PLG_SYSTEM_PHOCA_OPEN_GRAPH_NO</option>
<option value="1">PLG_SYSTEM_PHOCA_OPEN_GRAPH_YES</option>
</field>

<field name="image" type="media" default="" label="PLG_SYSTEM_PHOCA_OPEN_GRAPH_IMAGE_LABEL" description="PLG_SYSTEM_PHOCA_OPEN_GRAPH_IMAGE_DESC"/>

<field name="find_image_content" type="list" default="0" label="PLG_SYSTEM_PHOCA_OPEN_GRAPH_FIND_IMAGE_CONTENT_LABEL" description="PLG_SYSTEM_PHOCA_OPEN_GRAPH_FIND_IMAGE_CONTENT_DESC">
Expand Down
Binary file modified system-phocaopengraph-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.
2 changes: 1 addition & 1 deletion system-phocaopengraph-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 system-phocaopengraph-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 system-phocaopengraph-release.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 14f9f2d

Please sign in to comment.