Skip to content

Commit

Permalink
2.0.6
Browse files Browse the repository at this point in the history
- Joomla 3.10 compatibility
- Update/Changelog files on github
  • Loading branch information
pmleconte committed Oct 17, 2022
1 parent aab2648 commit 6f2b8a5
Show file tree
Hide file tree
Showing 20 changed files with 92 additions and 245 deletions.
12 changes: 12 additions & 0 deletions cg_template_switcher_changelog.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
<changelogs>
<changelog>
<element>pkg_cg_template_switcher</element>
<type>package</type>
<version>2.0.6</version>
<note>
<item>Update : 17/10/2022</item>
</note>
<fix>
<item>Joomla 3.10 compatibility</item>
<item>Update/Changelog files on github</item>
</fix>
</changelog>
<changelog>
<element>pkg_cg_template_switcher</element>
<type>package</type>
Expand Down
Binary file modified packages/mod_cg_template_switcher_j4.zip
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CG_XML_DESCRIPTION="<p style='text-align:left;padding-left:5px;font-size:inherit'>CG Template Switcher version 2.0.5</p>"
CG_XML_DESCRIPTION="<p style='text-align:left;padding-left:5px;font-size:inherit'>CG Template Switcher version 2.0.6</p>"
CG_STYLE_PREVIEW="Preview template ?"
CG_STYLE_PREVIEWDESC="Show or not template preview window ?"
CG_STYLE_AUTO="Auto Switch"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
CG_XML_DESCRIPTION="<p style='text-align:left;padding-left:5px;font-size:inherit'>CG Template Switcher version 2.0.5</p>"
CG_XML_DESCRIPTION="<p style='text-align:left;padding-left:5px;font-size:inherit'>CG Template Switcher version 2.0.6</p>"

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CG_XML_DESCRIPTION="<p style='text-align:left;padding-left:5px;font-size:inherit'>CG Template Switcher version 2.0.5.</p>"
CG_XML_DESCRIPTION="<p style='text-align:left;padding-left:5px;font-size:inherit'>CG Template Switcher version 2.0.6.</p>"
CG_STYLE_PREVIEW="Pr&eacute;visualisation du template ?"
CG_STYLE_PREVIEWDESC="Activer ou non la Pr&eacute;visualisation du template ?"
CG_STYLE_AUTO="Auto Switch"
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
CG_XML_DESCRIPTION="<p style='text-align:left;padding-left:5px;font-size:inherit'>CG Template Switcher version 2.0.5.</p>"
CG_XML_DESCRIPTION="<p style='text-align:left;padding-left:5px;font-size:inherit'>CG Template Switcher version 2.0.6.</p>"
20 changes: 10 additions & 10 deletions packages/mod_cg_template_switcher_j4/mod_cg_template_switcher.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@
<extension version="4.0" type="module" method="upgrade" client="site">
<name>CG Template Switcher</name>
<author>ConseilGouz</author>
<creationDate>September 2022</creationDate>
<creationDate>October 2022</creationDate>
<copyright>Copyright (C) 2022 ConseilGouz. All rights reserved</copyright>
<license>http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2</license>
<authorEmail>pascal.leconte@conseilgouz.com</authorEmail>
<authorUrl>www.conseilgouz.com</authorUrl>
<version>2.0.5</version>
<version>2.0.6</version>
<description>CG_XML_DESCRIPTION</description>
<namespace path="src">ConseilGouz\Module\CGTemplateSwitcher</namespace>
<scriptfile>script.php</scriptfile>
<changelogurl>https://www.conseilgouz.com/updates/mod_cg_template_switcher_changelog.xml</changelogurl>
<changelogurl>https://raw.githubusercontent.com/conseilgouz/pkg_cg_template_switcher_j4/master/cg_template_switcher_changelog.xml</changelogurl>
<files>
<filename module="mod_cg_template_switcher">mod_cg_template_switcher.php</filename>
<filename>index.html</filename>
Expand All @@ -32,15 +31,20 @@

<config>
<fields name="params" >
<fieldset name="basic" addruleprefix="ConseilGouz\Module\CGTemplateSwitcher\Site\Rule">
<fieldset name="basic"
addruleprefix="ConseilGouz\Module\CGTemplateSwitcher\Site\Rule"
addrulepath="/modules/mod_cg_template_switcher/src/Rule"
>
<field name="templatesall" type="radio" class="btn-group btn-group-yesno" default="true"
label="CG_TEMPLATES_ALL" description="CG_TEMPLATES_ALLDESC"
validate="templates"
>
<option value="true">JYES</option>
<option value="false">JNO</option>
</field>
<field showon="templatesall:false" name="templates" type="templatestyle" label="Templates" description="CG_TEMPLATESDESC" multiple="multiple"/>
<field showon="templatesall:false" name="templates" type="templatestyle"
label="Templates" description="CG_TEMPLATESDESC"
multiple="multiple" layout="joomla.form.field.groupedlist-fancy-select"/>
<field name="showpreview" type="radio" class="btn-group btn-group-yesno" default="true"
label="CG_STYLE_PREVIEW" description="CG_STYLE_PREVIEWDESC"
>
Expand All @@ -66,8 +70,4 @@
</fieldset>
</fields>
</config>
<updateservers>
<server type="extension" name="CG Template Switcher" priority="1">https://www.conseilgouz.com/updates/mod_cg_template_switcher_update.xml</server>
</updateservers>

</extension>

This file was deleted.

162 changes: 0 additions & 162 deletions packages/mod_cg_template_switcher_j4/script.php

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
<?php
/**
* CG template switcher Module
* Version : 1.0.10
* Package : Joomla 3.7.x
* copyright : Copyright (C) 2018 ConseilGouz. All rights reserved.
* Version : 2.0.6
* copyright : Copyright (C) 2022 ConseilGouz. All rights reserved.
* license : http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
* Updated on : March, 2018
* Version 01.0.10 : CSP Compliance
*/
namespace ConseilGouz\Module\CGTemplateSwitcher\Site\Rule;
defined( '_JEXEC' ) or die( 'Restricted access' );
Expand Down
23 changes: 23 additions & 0 deletions packages/mod_cg_template_switcher_j4/src/Rule/templates.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php
/**
* CG template switcher Module
* Version : 2.0.6
* Package : Joomla 3.10.x
* copyright : Copyright (C) 2022 ConseilGouz. All rights reserved.
* license : http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
*/

defined( '_JEXEC' ) or die( 'Restricted access' );
class JFormRuleTemplates extends JFormRule
{

public function test(SimpleXMLElement $element, $value, $group = null, JRegistry $input = null, JForm $form = null) {

if (!JPluginHelper::isEnabled('system', 'cgstyle')) {
JFactory::getApplication()->enqueueMessage(JText::_('CG_ACTIVATE'),'error');
return false;
}
return true;

}
}
Binary file modified packages/plg_system_cgstyle_j4.zip
Binary file not shown.
12 changes: 10 additions & 2 deletions packages/plg_system_cgstyle_j4/cgstyle.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* @package CG template switcher Module
* @version 2.0.4
* @version 2.0.6
* @subpackage system.cg_style
*
* @copyright Copyright (C) 2022 Conseilgouz. All rights reserved.
Expand All @@ -12,6 +12,8 @@
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Plugin\CMSPlugin;
use Joomla\CMS\Version;

class PlgSystemCGStyle extends CMSPlugin
{
public function onAfterRoute() {
Expand All @@ -30,7 +32,13 @@ public function onAfterRoute() {
$db->setQuery($query);
$style = $db->loadObject();
if ($style != null) {
$app->setTemplate( $style); // 4.0 : expect an object
$j = new Version();
$version=substr($j->getShortVersion(), 0,1);
if ($version == "4") { // Joomla 4.0
$app->setTemplate( $style);
}else { // Joomla 3.10
$app->setTemplate( $style->template, $style->params );
}
}
}
}
Expand Down
7 changes: 2 additions & 5 deletions packages/plg_system_cgstyle_j4/cgstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<extension version="4.0" type="plugin" group="system" method="upgrade">
<name>plg_system_cgstyle</name>
<author>ConseilGouz</author>
<creationDate>September 2022</creationDate>
<creationDate>October 2022</creationDate>
<copyright>(C)2022 ConseilGouz. All rights reserved.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<authorEmail>pascal.leconte@conseilgouz.com</authorEmail>
<authorUrl>www.conseilgouz.com</authorUrl>
<version>2.0.4</version>
<version>2.0.6</version>
<description>PLG_SYSTEM_CGSTYLE_XML_DESCRIPTION</description>
<files>
<filename plugin="cgstyle">cgstyle.php</filename>
Expand All @@ -25,7 +25,4 @@
</fieldset>
</fields>
</config>
<updateservers>
<server type="plugin" folder="system" priority="1" name="cgstyle">https://www.conseilgouz.com/updates/plg_system_cgstyle_update.xml</server>
</updateservers>
</extension>
Loading

0 comments on commit 6f2b8a5

Please sign in to comment.