Skip to content

Commit

Permalink
Update to 1.0.5
Browse files Browse the repository at this point in the history
 YOOtheme Template parameters are now supported.
  • Loading branch information
renekreijveld committed Jul 30, 2021
1 parent 9da1ffd commit ad801f3
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 18 deletions.
21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,26 @@ Don't forget to turn the option off again!

### Version history

2021-07-30 Added uk-active class on active toplevel item, version bumped to 1.0.4.
2021-07-30 1.0.5 YOOtheme Template parameters are now supported.
With the YOOtheme Pro template, modules have an extra parameters tab called Templates.
Modules that are published in the dropdown columns now support the following YOOtheme Template parameters:

2021-07-17 Added update server, version bumped to 1.0.3.
- Visibility
- Style
- Title Style
- Title Decoration

2021-07-15 Warning fix, version bumped to 1.0.2
For this to work you need to set in the Advanced tab the Header Tag to H3 and the Module Style to Inherited.

2021-07-30 1.0.4 Added uk-active class on active toplevel item.

2021-07-17 1.0.3 Added update server.

2021-07-15 1.0.2 Warning fix.
Add an array typecast in the helper to prevent a warning.

2021-07-15 Code improvements, version bumped to 1.0.1
2021-07-15 1.0.1 Code improvements.
Added coded improvements by Dmitrii Cymbal and added the option to set a dropdown to 'No dropdown'.
Also the Modules Anywhere plugin is no longer needed.

2021-07-14 Initial version
2021-07-14 1.0.1 Initial version
2 changes: 1 addition & 1 deletion source/helper.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* @package YOOtheme MegaMenu
* @version 1.0.4
* @version 1.0.5
* @copyright Copyright (C) 2021 Destiny B.V., All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE.txt
* @author url: https://www.destiny.nl
Expand Down
2 changes: 1 addition & 1 deletion source/language/en-GB/en-GB.mod_yootheme_megamenu.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
; package YOOtheme MegaMenu
; English language file
; version 1.0.4
; version 1.0.5
; copyright (C) 2021 Destiny B.V., All rights reserved.
; license GNU General Public License version 3 or later; see LICENSE.txt
; author url: https://www.destiny.nl
Expand Down
2 changes: 1 addition & 1 deletion source/language/nl-NL/nl-NL.mod_yootheme_megamenu.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
; package YOOtheme MegaMenu
; Dutch language file
; version 1.0.4
; version 1.0.5
; copyright (C) 2021 Destiny B.V., All rights reserved.
; license GNU General Public License version 3 or later; see LICENSE.txt
; author url: https://www.destiny.nl
Expand Down
2 changes: 1 addition & 1 deletion source/mod_yootheme_megamenu.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* @package YOOtheme MegaMenu
* @version 1.0.4
* @version 1.0.5
* @copyright Copyright (C) 2021 Destiny B.V., All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE.txt
* @author url: https://www.destiny.nl
Expand Down
4 changes: 2 additions & 2 deletions source/mod_yootheme_megamenu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<license>GNU General Public License version 3 or later</license>
<authorEmail>email@renekreijveld.nl</authorEmail>
<authorUrl>https://www.destiny.nl</authorUrl>
<version>1.0.4</version>
<description>Mega Menu module for YOOtheme Pro, version 1.0.4.</description>
<version>1.0.5</version>
<description>Mega Menu module for YOOtheme Pro, version 1.0.5.</description>
<updateservers>
<server type="extension" priority="1" name="YOOtheme Mega Menu Module">https://raw.githubusercontent.com/renekreijveld/YOOthemeMegaMenu/main/updates/mod_yootheme_megamenu.xml</server>
</updateservers>
Expand Down
36 changes: 29 additions & 7 deletions source/tmpl/default.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* @package YOOtheme MegaMenu
* @version 1.0.4
* @version 1.0.5
* @copyright Copyright (C) 2021 Destiny B.V., All rights reserved.
* @license GNU General Public License version 3 or later; see LICENSE.txt
* @author url: https://www.destiny.nl
Expand Down Expand Up @@ -57,16 +57,36 @@
$attribs = array();
foreach ($modules as $mod)
{
// Get extra module paramaters
$modParams = json_decode($mod->params);
if (substr($modParams->style,0,7) === 'System-')
$extraClass = $modParams->moduleclass_sfx;
// Get extra YOOtheme Template tab parameters
$yooParams = json_decode($modParams->yoo_config);
$class = [];
$title = [];
$titleClass = [];
$title_element = ($modParams->header_tag ? $modParams->header_tag : 'h3');
$titleClass[] = ($yooParams->title_style ? "uk-$yooParams->title_style" : '');
$titleClass[] = ($yooParams->title_decoration ? "uk-heading-$yooParams->title_decoration" : '');
$class[] = ($yooParams->visibility ? "uk-visible@$yooParams->visibility" : '');
$class[] = ($yooParams->style ? "uk-card uk-card-body uk-$yooParams->style" : 'uk-panel');
$attribs['style'] = '';
echo '<div class="' . $extraClass . ' ' . implode(" ", $class) . '">';
if ($mod->showtitle === '1')
{
$attribs['style'] = substr($modParams->style,7);
}
else
{
$attribs['style'] = '';
echo '<' . $title_element . ' class="' . implode(" ", $titleClass) . '">';
if ($yooParams->title_decoration === 'line')
{
echo '<span>' . $mod->title . '</span>';
}
else
{
echo $mod->title;
}
echo '</' . $title_element . '>';
}
echo ModuleHelper::renderModule($mod, $attribs);
echo '</div>';
}
?>
</div>
Expand All @@ -77,3 +97,5 @@
</li>
<?php endforeach; ?>
</ul>


0 comments on commit ad801f3

Please sign in to comment.