forked from joomla/joomla-cms
-
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.
Merge pull request joomla#46 from joomla/cassiopeia/4-0-dev-frontend-…
…metismenu-and-html-structure Add Metismenu to Cassiopeia, rework Cassiopeia's HTML structure, use relative CSS sizes
- Loading branch information
Showing
23 changed files
with
445 additions
and
130 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
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,18 @@ | ||
<?php | ||
/** | ||
* @package Joomla.Site | ||
* @subpackage mod_custom | ||
* | ||
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved. | ||
* @license GNU General Public License version 2 or later; see LICENSE.txt | ||
*/ | ||
|
||
defined('_JEXEC') or die; | ||
?> | ||
|
||
|
||
<div class="mod-custom custom banner-overlay" <?php if ($params->get('backgroundimage')) : ?> style="background-image:url(<?php echo $params->get('backgroundimage'); ?>)"<?php endif; ?> > | ||
<div class="overlay"> | ||
<?php echo $module->content; ?> | ||
</div> | ||
</div> |
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,114 @@ | ||
<?php | ||
/** | ||
* @package Joomla.Site | ||
* @subpackage mod_menu | ||
* | ||
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved. | ||
* @license GNU General Public License version 2 or later; see LICENSE.txt | ||
*/ | ||
|
||
defined('_JEXEC') or die; | ||
|
||
use Joomla\CMS\Helper\ModuleHelper; | ||
use Joomla\CMS\Language\Text; | ||
use Joomla\CMS\WebAsset\WebAssetManager; | ||
use Joomla\Utilities\ArrayHelper; | ||
|
||
/** @var WebAssetManager $wa */ | ||
$wa = $app->getDocument()->getWebAssetManager(); | ||
$wa->registerAndUseScript('metismenu', 'mm-horizontal.js', [], [], ['metismenujs']); | ||
|
||
$id = ''; | ||
|
||
if ($tagId = $params->get('tag_id', '')) | ||
{ | ||
$id = ' id="' . $tagId . '"'; | ||
} | ||
|
||
?> | ||
<ul<?php echo $id; ?> class="mod-menu mod-menu_metismenu metismenu mod-list <?php echo $class_sfx; ?>"> | ||
|
||
<?php foreach ($list as $i => &$item) | ||
{ | ||
$itemParams = $item->getParams(); | ||
$class = 'metismenu-item item-' . $item->id; | ||
|
||
if ($item->id == $default_id) | ||
{ | ||
$class .= ' default'; | ||
} | ||
|
||
if ($item->id == $active_id || ($item->type === 'alias' && $itemParams->get('aliasoptions') == $active_id)) | ||
{ | ||
$class .= ' current'; | ||
} | ||
|
||
if (in_array($item->id, $path)) | ||
{ | ||
$class .= ' active'; | ||
} | ||
elseif ($item->type === 'alias') | ||
{ | ||
$aliasToId = $itemParams->get('aliasoptions'); | ||
|
||
if (count($path) > 0 && $aliasToId == $path[count($path) - 1]) | ||
{ | ||
$class .= ' active'; | ||
} | ||
|
||
elseif (in_array($aliasToId, $path)) | ||
{ | ||
$class .= ' alias-parent-active'; | ||
} | ||
} | ||
|
||
if ($item->type === 'separator') | ||
{ | ||
$class .= ' divider'; | ||
} | ||
|
||
if ($item->deeper) | ||
{ | ||
$class .= ' deeper'; | ||
} | ||
|
||
if ($item->parent) | ||
{ | ||
$class .= ' parent'; | ||
} | ||
|
||
echo '<li class="' . $class . '">'; | ||
|
||
switch ($item->type) : | ||
case 'separator': | ||
case 'component': | ||
case 'heading': | ||
case 'url': | ||
require ModuleHelper::getLayoutPath('mod_menu', 'default_' . $item->type); | ||
break; | ||
|
||
default: | ||
require ModuleHelper::getLayoutPath('mod_menu', 'default_url'); | ||
break; | ||
endswitch; | ||
|
||
switch (true) : | ||
// The next item is deeper. | ||
case $item->deeper: | ||
echo '<a class="has-arrow mm-collapsed" href="#" role="button" aria-haspopup="true" aria-expanded="false"><span class="sr-only">' . Text::_('JGLOBAL_TOGGLE_DROPDOWN') . '</span></a>'; | ||
echo '<ul class="mm-collapse">'; | ||
break; | ||
|
||
// The next item is shallower. | ||
case $item->shallower: | ||
echo '</li>'; | ||
echo str_repeat('</ul></li>', $item->level_diff); | ||
break; | ||
|
||
// The next item is on the same level. | ||
default: | ||
echo '</li>'; | ||
break; | ||
endswitch; | ||
} | ||
?></ul> |
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,8 @@ | ||
document.addEventListener("DOMContentLoaded", function(event) { | ||
const allMenus = document.querySelectorAll('ul.mod-menu_metismenu'); | ||
|
||
allMenus.forEach(menu => { | ||
// eslint-disable-next-line no-new, no-undef | ||
new MetisMenu(menu); | ||
}); | ||
}); |
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
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
Oops, something went wrong.