-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Joomla 5.x compatibility Namespace ConseilGouz instead of Joomla Remove Zoom increment/Icons size list sizes Use Webassets + Display dynamic version number
- Loading branch information
1 parent
2a1404b
commit 6fd0e30
Showing
13 changed files
with
129 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
CG_XML_ZOOM_DESCRIPTION="<p style='text-align:left;padding-left:5px;font-size:inherit'>CG Zoom Page version 2.1.0 : increase/decrease your page size</p>" | ||
CG_XML_ZOOM_DESCRIPTION="<p style='text-align:left;padding-left:5px;font-size:inherit'>CG Zoom Page : increase/decrease your page size</p>" | ||
CG_INC="Zoom Increment" | ||
CG_INC_DESC="Select increment to apply at each click." | ||
CG_ICON_COLOR="Icons color" | ||
CG_ICON_COLOR_DESC="Select your icons' color." | ||
CG_ICON_HEIGHT="Icons size" | ||
CG_ICON_HEIGHT_DESC="Select your icons' size (default: 2.5 em)" | ||
CG_ICON_HEIGHT_DESC="Select your icons' size (default: 2.5 em)" | ||
CG_ZOOM_INCREASE="Increase page size" | ||
CG_ZOOM_RESTORE="Back to default style" | ||
CG_ZOOM_DECREASE="Decrease page size" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
CG_XML_ZOOM_DESCRIPTION="<p style='text-align:left;padding-left:5px;font-size:inherit'>CG Zoom Page version 2.1.0 : agrandit/Diminue une page</p>" | ||
CG_XML_ZOOM_DESCRIPTION="<p style='text-align:left;padding-left:5px;font-size:inherit'>CG Zoom Page : increase/decrease page size.</p>" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,10 @@ | ||
CG_XML_ZOOM_DESCRIPTION="<p style='text-align:left;padding-left:5px;font-size:inherit'>CG Zoom Page version 2.1.0 : agrandit/diminue une page</p>" | ||
CG_XML_ZOOM_DESCRIPTION="<p style='text-align:left;padding-left:5px;font-size:inherit'>CG Zoom Page : agrandit/diminue une page</p>" | ||
CG_INC="Incrément du zoom" | ||
CG_INC_DESC="Sélectionnez l'incrément à appliquer sur votre page à chaque click." | ||
CG_ICON_COLOR="Couleur des icônes" | ||
CG_ICON_COLOR_DESC="Sélectionnez la couleur de vos icônes" | ||
CG_ICON_HEIGHT="Taille des icônes" | ||
CG_ICON_HEIGHT_DESC="Sélectionnez la taille des icônes (défaut: 2.5 em)" | ||
CG_ICON_HEIGHT_DESC="Sélectionnez la taille des icônes (défaut: 2.5 em)" | ||
CG_ZOOM_INCREASE="Agrandir la page" | ||
CG_ZOOM_RESTORE="Revenir au style par défaut" | ||
CG_ZOOM_DECREASE="Diminuer la page" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
CG_XML_ZOOM_DESCRIPTION="<p style='text-align:left;padding-left:5px;font-size:inherit'>CG Zoom Page version 2.1.0 : agrandit/Diminue une page</p>" | ||
CG_XML_ZOOM_DESCRIPTION="<p style='text-align:left;padding-left:5px;font-size:inherit'>CG Zoom Page : agrandit/Diminue une page</p>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
<?php | ||
/** | ||
* CG Zoom Article for Joomla 4.x/5.x | ||
* Version : 2.1.1 | ||
* Package : CG Zoom Page | ||
* copyright : Copyright (C) 2021 ConseilGouz. All rights reserved. | ||
* license : http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL | ||
* From : http://stackoverflow.com/questions/10464038/imitate-browser-zoom-with-javascript | ||
*/ | ||
namespace ConseilGouz\Module\CGZoomPage\Site\Field; | ||
|
||
use Joomla\CMS\Component\ComponentHelper; | ||
use Joomla\CMS\Factory; | ||
use Joomla\CMS\Form\FormField; | ||
use Joomla\CMS\Language\Text; | ||
use Joomla\String\StringHelper; | ||
|
||
// Prevent direct access | ||
defined('_JEXEC') || die; | ||
|
||
class VersionField extends FormField | ||
{ | ||
/** | ||
* Element name | ||
* | ||
* @var string | ||
*/ | ||
protected $_name = 'Version'; | ||
|
||
function getInput() | ||
{ | ||
$return = ''; | ||
// Load language | ||
$extension = $this->def('extension'); | ||
|
||
$version = ''; | ||
|
||
$jinput = Factory::getApplication()->input; | ||
$db = Factory::getDBO(); | ||
$query = $db->getQuery(true); | ||
$query | ||
->select($db->quoteName('manifest_cache')) | ||
->from($db->quoteName('#__extensions')) | ||
->where($db->quoteName('element') . '=' . $db->Quote($extension)); | ||
$db->setQuery($query, 0, 1); | ||
$row = $db->loadAssoc(); | ||
$tmp = json_decode($row['manifest_cache']); | ||
$version = $tmp->version; | ||
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ | ||
$wa = Factory::getApplication()->getDocument()->getWebAssetManager(); | ||
|
||
$css = ''; | ||
$css .= ".version {display:block;text-align:right;color:brown;font-size:10px;}"; | ||
$css .= ".readonly.plg-desc {font-weight:normal;}"; | ||
$css .= "fieldset.radio label {width:auto;}"; | ||
$wa->addInlineStyle($css); | ||
$margintop = $this->def('margintop'); | ||
if (StringHelper::strlen($margintop)) { | ||
$js = "document.addEventListener('DOMContentLoaded', function() { | ||
vers = document.querySelector('.version'); | ||
parent = vers.parentElement.parentElement; | ||
parent.style.marginTop = '".$margintop."'; | ||
})"; | ||
$wa->addInlineScript($js); | ||
} | ||
$return .= '<span class="version">' . Text::_('JVERSION') . ' ' . $version . "</span>"; | ||
|
||
return $return; | ||
} | ||
public function def($val, $default = '') | ||
{ | ||
return ( isset( $this->element[$val] ) && (string) $this->element[$val] != '' ) ? (string) $this->element[$val] : $default; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<!DOCTYPE html><html><body></body></html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<!DOCTYPE html><html><body></body></html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<!DOCTYPE html><html><body></body></html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters