diff --git a/cg_template_switcher_changelog.xml b/cg_template_switcher_changelog.xml index c51d585..d4b52a1 100644 --- a/cg_template_switcher_changelog.xml +++ b/cg_template_switcher_changelog.xml @@ -1,4 +1,16 @@ + + pkg_cg_template_switcher + package + 2.0.6 + + Update : 17/10/2022 + + + Joomla 3.10 compatibility + Update/Changelog files on github + + pkg_cg_template_switcher package diff --git a/packages/mod_cg_template_switcher_j4.zip b/packages/mod_cg_template_switcher_j4.zip index babf0e4..d2cb542 100644 Binary files a/packages/mod_cg_template_switcher_j4.zip and b/packages/mod_cg_template_switcher_j4.zip differ diff --git a/packages/mod_cg_template_switcher_j4/language/en-GB/mod_cg_template_switcher.ini b/packages/mod_cg_template_switcher_j4/language/en-GB/mod_cg_template_switcher.ini index 837294a..45a5d5e 100644 --- a/packages/mod_cg_template_switcher_j4/language/en-GB/mod_cg_template_switcher.ini +++ b/packages/mod_cg_template_switcher_j4/language/en-GB/mod_cg_template_switcher.ini @@ -1,4 +1,4 @@ -CG_XML_DESCRIPTION="

CG Template Switcher version 2.0.5

" +CG_XML_DESCRIPTION="

CG Template Switcher version 2.0.6

" CG_STYLE_PREVIEW="Preview template ?" CG_STYLE_PREVIEWDESC="Show or not template preview window ?" CG_STYLE_AUTO="Auto Switch" diff --git a/packages/mod_cg_template_switcher_j4/language/en-GB/mod_cg_template_switcher.sys.ini b/packages/mod_cg_template_switcher_j4/language/en-GB/mod_cg_template_switcher.sys.ini index ef80489..1308ba4 100644 --- a/packages/mod_cg_template_switcher_j4/language/en-GB/mod_cg_template_switcher.sys.ini +++ b/packages/mod_cg_template_switcher_j4/language/en-GB/mod_cg_template_switcher.sys.ini @@ -1,2 +1,2 @@ -CG_XML_DESCRIPTION="

CG Template Switcher version 2.0.5

" +CG_XML_DESCRIPTION="

CG Template Switcher version 2.0.6

" diff --git a/packages/mod_cg_template_switcher_j4/language/fr-FR/mod_cg_template_switcher.ini b/packages/mod_cg_template_switcher_j4/language/fr-FR/mod_cg_template_switcher.ini index fe1234b..2ea2939 100644 --- a/packages/mod_cg_template_switcher_j4/language/fr-FR/mod_cg_template_switcher.ini +++ b/packages/mod_cg_template_switcher_j4/language/fr-FR/mod_cg_template_switcher.ini @@ -1,4 +1,4 @@ -CG_XML_DESCRIPTION="

CG Template Switcher version 2.0.5.

" +CG_XML_DESCRIPTION="

CG Template Switcher version 2.0.6.

" CG_STYLE_PREVIEW="Prévisualisation du template ?" CG_STYLE_PREVIEWDESC="Activer ou non la Prévisualisation du template ?" CG_STYLE_AUTO="Auto Switch" diff --git a/packages/mod_cg_template_switcher_j4/language/fr-FR/mod_cg_template_switcher.sys.ini b/packages/mod_cg_template_switcher_j4/language/fr-FR/mod_cg_template_switcher.sys.ini index ca7eda7..bb98aec 100644 --- a/packages/mod_cg_template_switcher_j4/language/fr-FR/mod_cg_template_switcher.sys.ini +++ b/packages/mod_cg_template_switcher_j4/language/fr-FR/mod_cg_template_switcher.sys.ini @@ -1 +1 @@ -CG_XML_DESCRIPTION="

CG Template Switcher version 2.0.5.

" +CG_XML_DESCRIPTION="

CG Template Switcher version 2.0.6.

" diff --git a/packages/mod_cg_template_switcher_j4/mod_cg_template_switcher.xml b/packages/mod_cg_template_switcher_j4/mod_cg_template_switcher.xml index 34c2c6f..2d4b5e8 100644 --- a/packages/mod_cg_template_switcher_j4/mod_cg_template_switcher.xml +++ b/packages/mod_cg_template_switcher_j4/mod_cg_template_switcher.xml @@ -2,16 +2,15 @@ CG Template Switcher ConseilGouz - September 2022 + October 2022 Copyright (C) 2022 ConseilGouz. All rights reserved http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 pascal.leconte@conseilgouz.com www.conseilgouz.com - 2.0.5 + 2.0.6 CG_XML_DESCRIPTION ConseilGouz\Module\CGTemplateSwitcher - script.php - https://www.conseilgouz.com/updates/mod_cg_template_switcher_changelog.xml + https://raw.githubusercontent.com/conseilgouz/pkg_cg_template_switcher_j4/master/cg_template_switcher_changelog.xml mod_cg_template_switcher.php index.html @@ -32,7 +31,10 @@ -
+
JYES - + @@ -66,8 +70,4 @@
- - https://www.conseilgouz.com/updates/mod_cg_template_switcher_update.xml - - \ No newline at end of file diff --git a/packages/mod_cg_template_switcher_j4/mod_cg_template_switcher_changelog.xml b/packages/mod_cg_template_switcher_j4/mod_cg_template_switcher_changelog.xml deleted file mode 100644 index 49a6d24..0000000 --- a/packages/mod_cg_template_switcher_j4/mod_cg_template_switcher_changelog.xml +++ /dev/null @@ -1,48 +0,0 @@ - - - mod_cg_template_switcher - Module - 2.0.5 - - Update : 09/09/2022 - - - Autoselect current template - Display thumbnails from media directory - No click on thumbnail - - - - mod_cg_template_switcher - Module - 2.0.2 - - Update : 29/08/2022 - - - Uninstall package - - - - mod_cg_template_switcher - Module - 2.0.1 - - Update : 04/10/2021 - - - Joomla 4 compatibility - - - - mod_cg_template_switcher - Module - 2.0.0 - - Update : 21/09/2021 - - - Joomla 4 compatibility - - - diff --git a/packages/mod_cg_template_switcher_j4/script.php b/packages/mod_cg_template_switcher_j4/script.php deleted file mode 100644 index 4267444..0000000 --- a/packages/mod_cg_template_switcher_j4/script.php +++ /dev/null @@ -1,162 +0,0 @@ -dir = __DIR__; - $this->lang = Factory::getLanguage(); - $this->lang->load($this->extname); - } - - function preflight($type, $parent) - { - if ( ! $this->passMinimumJoomlaVersion()) - { - $this->uninstallInstaller(); - return false; - } - - if ( ! $this->passMinimumPHPVersion()) - { - $this->uninstallInstaller(); - return false; - } - // To prevent installer from running twice if installing multiple extensions - if ( ! file_exists($this->dir . '/' . $this->installerName . '.xml')) - { - return true; - } - $xml = simplexml_load_file(JPATH_BASE . '/modules/mod_'.$this->extname.'/mod_'.$this->extname.'.xml'); - $this->previous_version = $xml->version; - } - - function postflight($type, $parent) - { - if (($type=='install') || ($type == 'update')) { // remove obsolete dir/files - $this->postinstall_cleanup(); - } - - switch ($type) { - case 'install': $message = Text::_('ISO_POSTFLIGHT_INSTALLED'); break; - case 'uninstall': $message = Text::_('ISO_POSTFLIGHT_UNINSTALLED'); break; - case 'update': $message = Text::_('ISO_POSTFLIGHT_UPDATED'); break; - case 'discover_install': $message = Text::_('ISO_POSTFLIGHT_DISC_INSTALLED'); break; - } - return true; - } - private function postinstall_cleanup() { - $obsloteFolders = ['css', 'js','language']; - // Remove plugins' files which load outside of the component. If any is not fully updated your site won't crash. - foreach ($obsloteFolders as $folder) - { - $f = JPATH_SITE . '/modules/mod_'.$this->extname.'/' . $folder; - - if (!@file_exists($f) || !is_dir($f) || is_link($f)) - { - continue; - } - - Folder::delete($f); - } - $obsloteFiles = [sprintf("%s/modules/mod_%s/helper.php", JPATH_SITE, $this->extname)]; - foreach ($obsloteFiles as $file) - { - if (@is_file($file)) - { - File::delete($file); - } - } - $j = new Version(); - $version=$j->getShortVersion(); - $version_arr = explode('.',$version); - if (($version_arr[0] == "4") || (($version_arr[0] == "3") && ($version_arr[1] == "10"))) { - // Delete 3.9 and older language files - $langFiles = [ - sprintf("%s/language/en-GB/en-GB.mod_%s.ini", JPATH_SITE, $this->extname), - sprintf("%s/language/en-GB/en-GB.mod_%s.sys.ini", JPATH_SITE, $this->extname), - sprintf("%s/language/fr-FR/fr-FR.mod_%s.ini", JPATH_SITE, $this->extname), - sprintf("%s/language/fr-FR/fr-FR.mod_%s.sys.ini", JPATH_SITE, $this->extname), - ]; - foreach ($langFiles as $file) { - if (@is_file($file)) { - File::delete($file); - } - } - } - } - - // Check if Joomla version passes minimum requirement - private function passMinimumJoomlaVersion() - { - $j = new Version(); - $version=$j->getShortVersion(); - if (version_compare($version, $this->min_joomla_version, '<')) - { - Factory::getApplication()->enqueueMessage( - 'Incompatible Joomla version : found ' . $version . ', Minimum : ' . $this->min_joomla_version . '', - 'error' - ); - - return false; - } - - return true; - } - - // Check if PHP version passes minimum requirement - private function passMinimumPHPVersion() - { - - if (version_compare(PHP_VERSION, $this->min_php_version, '<')) - { - Factory::getApplication()->enqueueMessage( - 'Incompatible PHP version : found ' . PHP_VERSION . ', Minimum ' . $this->min_php_version . '', - 'error' - ); - return false; - } - - return true; - } - private function uninstallInstaller() - { - if ( ! JFolder::exists(JPATH_PLUGINS . '/system/' . $this->installerName)) { - return; - } - $this->delete([ - JPATH_PLUGINS . '/system/' . $this->installerName . '/language', - JPATH_PLUGINS . '/system/' . $this->installerName, - ]); - $db = Factory::getDbo(); - $query = $db->getQuery(true) - ->delete('#__extensions') - ->where($db->quoteName('element') . ' = ' . $db->quote($this->installerName)) - ->where($db->quoteName('folder') . ' = ' . $db->quote('system')) - ->where($db->quoteName('type') . ' = ' . $db->quote('plugin')); - $db->setQuery($query); - $db->execute(); - Factory::getCache()->clean('_system'); - } - -} \ No newline at end of file diff --git a/packages/mod_cg_template_switcher_j4/src/Rule/TemplatesRule.php b/packages/mod_cg_template_switcher_j4/src/Rule/TemplatesRule.php index 71ff9d4..33a3ee8 100644 --- a/packages/mod_cg_template_switcher_j4/src/Rule/TemplatesRule.php +++ b/packages/mod_cg_template_switcher_j4/src/Rule/TemplatesRule.php @@ -1,12 +1,9 @@ enqueueMessage(JText::_('CG_ACTIVATE'),'error'); + return false; + } + return true; + + } +} \ No newline at end of file diff --git a/packages/plg_system_cgstyle_j4.zip b/packages/plg_system_cgstyle_j4.zip index 8e2af62..a462c88 100644 Binary files a/packages/plg_system_cgstyle_j4.zip and b/packages/plg_system_cgstyle_j4.zip differ diff --git a/packages/plg_system_cgstyle_j4/cgstyle.php b/packages/plg_system_cgstyle_j4/cgstyle.php index e636c05..fa5a397 100644 --- a/packages/plg_system_cgstyle_j4/cgstyle.php +++ b/packages/plg_system_cgstyle_j4/cgstyle.php @@ -1,7 +1,7 @@ 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 ); + } } } } diff --git a/packages/plg_system_cgstyle_j4/cgstyle.xml b/packages/plg_system_cgstyle_j4/cgstyle.xml index f7b8d6b..19b124c 100644 --- a/packages/plg_system_cgstyle_j4/cgstyle.xml +++ b/packages/plg_system_cgstyle_j4/cgstyle.xml @@ -2,12 +2,12 @@ plg_system_cgstyle ConseilGouz - September 2022 + October 2022 (C)2022 ConseilGouz. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt pascal.leconte@conseilgouz.com www.conseilgouz.com - 2.0.4 + 2.0.6 PLG_SYSTEM_CGSTYLE_XML_DESCRIPTION cgstyle.php @@ -25,7 +25,4 @@
- - https://www.conseilgouz.com/updates/plg_system_cgstyle_update.xml -
diff --git a/packages/plg_system_cgstyle_j4/language/en-GB/plg_system_cgstyle.ini b/packages/plg_system_cgstyle_j4/language/en-GB/plg_system_cgstyle.ini index acfaaca..c55d27b 100644 --- a/packages/plg_system_cgstyle_j4/language/en-GB/plg_system_cgstyle.ini +++ b/packages/plg_system_cgstyle_j4/language/en-GB/plg_system_cgstyle.ini @@ -1,2 +1,2 @@ -PLG_SYSTEM_CGSTYLE_XML_DESCRIPTION="Systeme - Template Style Switcher version 2.0.4." +PLG_SYSTEM_CGSTYLE_XML_DESCRIPTION="Systeme - Template Style Switcher version 2.0.6." PLG_SYSTEM_CGSTYLE="Systeme - Template Style Switcher" diff --git a/packages/plg_system_cgstyle_j4/language/en-GB/plg_system_cgstyle.sys.ini b/packages/plg_system_cgstyle_j4/language/en-GB/plg_system_cgstyle.sys.ini index 7246179..7dafd77 100644 --- a/packages/plg_system_cgstyle_j4/language/en-GB/plg_system_cgstyle.sys.ini +++ b/packages/plg_system_cgstyle_j4/language/en-GB/plg_system_cgstyle.sys.ini @@ -1,3 +1,3 @@ -PLG_SYSTEM_CGSTYLE_XML_DESCRIPTION="Systeme - Template Style Switcher version 2.0.4." +PLG_SYSTEM_CGSTYLE_XML_DESCRIPTION="Systeme - Template Style Switcher version 2.0.6." PLG_SYSTEM_CGSTYLE="System - Template Style Switcher" diff --git a/packages/plg_system_cgstyle_j4/language/fr-FR/plg_system_cgstyle.ini b/packages/plg_system_cgstyle_j4/language/fr-FR/plg_system_cgstyle.ini index acfaaca..c55d27b 100644 --- a/packages/plg_system_cgstyle_j4/language/fr-FR/plg_system_cgstyle.ini +++ b/packages/plg_system_cgstyle_j4/language/fr-FR/plg_system_cgstyle.ini @@ -1,2 +1,2 @@ -PLG_SYSTEM_CGSTYLE_XML_DESCRIPTION="Systeme - Template Style Switcher version 2.0.4." +PLG_SYSTEM_CGSTYLE_XML_DESCRIPTION="Systeme - Template Style Switcher version 2.0.6." PLG_SYSTEM_CGSTYLE="Systeme - Template Style Switcher" diff --git a/packages/plg_system_cgstyle_j4/language/fr-FR/plg_system_cgstyle.sys.ini b/packages/plg_system_cgstyle_j4/language/fr-FR/plg_system_cgstyle.sys.ini index acfaaca..c55d27b 100644 --- a/packages/plg_system_cgstyle_j4/language/fr-FR/plg_system_cgstyle.sys.ini +++ b/packages/plg_system_cgstyle_j4/language/fr-FR/plg_system_cgstyle.sys.ini @@ -1,2 +1,2 @@ -PLG_SYSTEM_CGSTYLE_XML_DESCRIPTION="Systeme - Template Style Switcher version 2.0.4." +PLG_SYSTEM_CGSTYLE_XML_DESCRIPTION="Systeme - Template Style Switcher version 2.0.6." PLG_SYSTEM_CGSTYLE="Systeme - Template Style Switcher" diff --git a/pkg_cgtemplateswitcher.xml b/pkg_cgtemplateswitcher.xml index 1b8ffc0..7ac7dda 100644 --- a/pkg_cgtemplateswitcher.xml +++ b/pkg_cgtemplateswitcher.xml @@ -1,13 +1,13 @@ CG Template Switcher - September 2022 + October 2022 cgtemplateswitcher https://www.gnu.org/licenses/gpl-2.0.html GNU/GPL ConseilGouz pascal.leconte@conseilgouz.com www.conseilgouz.com - 2.0.5 + 2.0.6 https://www.conseilgouz.com/ ConseilGouz Package CG Template Switcher @@ -16,8 +16,8 @@ mod_cg_template_switcher_j4.zip plg_system_cgstyle_j4.zip - https://www.conseilgouz.com/updates/cg_template_switcher_changelog.xml + https://raw.githubusercontent.com/conseilgouz/pkg_cg_template_switcher_j4/master/cg_template_switcher_changelog.xml - https://www.conseilgouz.com/updates/pkg_cg_template_switcher_update.xml + https://raw.githubusercontent.com/conseilgouz/updates_github/master/pkg_cg_template_switcher_update.xml \ No newline at end of file diff --git a/script.php b/script.php index c3b37b4..354bac6 100644 --- a/script.php +++ b/script.php @@ -1,7 +1,7 @@ getQuery(true) + ->delete('#__update_sites') + ->where($db->quoteName('location') . ' like "%432473037d.url-de-test.ws/%"'); + $db->setQuery($query); + $db->execute(); + // Simple Isotope is now on Github + $query = $db->getQuery(true) + ->delete('#__update_sites') + ->where($db->quoteName('location') . ' like "%conseilgouz.com/updates/mod_cg_template%"'); + $db->setQuery($query); + $db->execute(); + $query = $db->getQuery(true) + ->delete('#__update_sites') + ->where($db->quoteName('location') . ' like "%conseilgouz.com/updates/pkg_cg_template%"'); + $db->setQuery($query); + $db->execute(); + } // enable CGStyle plugin private function postinstall_enable_plugin() {