From 165c82a8b06688164b4b083640ba47c46deff95a Mon Sep 17 00:00:00 2001 From: Harald Wolff-Thobaben Date: Tue, 23 Nov 2021 00:37:13 +0100 Subject: [PATCH] fix lndropdown-default.php: target=... --- html/mod_menu/collapse-default.php | 42 ----------- html/mod_menu/item-heading.php | 1 - html/mod_menu/item-url.php | 8 -- html/mod_menu/item.php | 90 ---------------------- html/mod_menu/lndropdown-default.php | 107 +++++++++++++++++++++++++++ 5 files changed, 107 insertions(+), 141 deletions(-) delete mode 100644 html/mod_menu/collapse-default.php delete mode 100644 html/mod_menu/item-heading.php delete mode 100644 html/mod_menu/item-url.php delete mode 100644 html/mod_menu/item.php create mode 100644 html/mod_menu/lndropdown-default.php diff --git a/html/mod_menu/collapse-default.php b/html/mod_menu/collapse-default.php deleted file mode 100644 index c7c4f58..0000000 --- a/html/mod_menu/collapse-default.php +++ /dev/null @@ -1,42 +0,0 @@ - - * @license GNU General Public License version 2 or later; see LICENSE.txt - */ - -defined('_JEXEC') or die; - -use Joomla\CMS\Helper\ModuleHelper; -use Joomla\CMS\HTML\HTMLHelper; -use Joomla\CMS\Language\Text; - - - -$id = ''; -if ($tagId = $params->get('tag_id', '')) -{ - $id = ' id="' . $tagId . '"'; -} - -?> - diff --git a/html/mod_menu/item-heading.php b/html/mod_menu/item-heading.php deleted file mode 100644 index 79c0b45..0000000 --- a/html/mod_menu/item-heading.php +++ /dev/null @@ -1 +0,0 @@ - data-bs-toggle="dropdown" aria-expanded="false">title;?> \ No newline at end of file diff --git a/html/mod_menu/item-url.php b/html/mod_menu/item-url.php deleted file mode 100644 index 453a700..0000000 --- a/html/mod_menu/item-url.php +++ /dev/null @@ -1,8 +0,0 @@ - \ No newline at end of file diff --git a/html/mod_menu/item.php b/html/mod_menu/item.php deleted file mode 100644 index 5442d70..0000000 --- a/html/mod_menu/item.php +++ /dev/null @@ -1,90 +0,0 @@ -hasChildren() && ($item->level < $params['endLevel']); - $hasParent = $item->hasParent(); - - $itemParams = $item->getParams(); - $class = 'item-' . $item->id; - $mi_class = 'nav-link'; - $attributes = array(); - - if ($hasParent) - { - $mi_class .= " dropdown-item"; - } else { - // $class .= " nav-item"; - } - $class .= " nav-item"; - - if ($hasChildren) - { - $class .= " dropdown"; - $mi_class .= " dropdown-toggle"; - $attributes["role"] = 'button'; - } - if ($item->type === 'separator') - { - $class .= ' divider'; - } - if ($item->id == $default_id) - { - $class .= ' default'; - } - - if ($item->id == $active_id || ($item->type === 'alias' && $itemParams->get('aliasoptions') == $active_id)) - { - $class .= ' current'; - } - - if ($item->browserNav == 1) - { - $attributes['target'] = '_blank'; - $attributes['rel'] = 'noopener noreferrer'; - - if ($item->anchor_rel == 'nofollow') - { - $attributes['rel'] .= ' nofollow'; - } - } - elseif ($item->browserNav == 2) - { - $options = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,' . $params->get('window_open'); - - $attributes['onclick'] = "window.open(this.href, 'targetWindow', '" . $options . "'); return false;"; - } - - echo '
  • '; - - switch ($item->type) : - case 'heading': - require ModuleHelper::getLayoutPath('mod_menu', 'item-heading'); - break; - case 'component': - case 'url': - require ModuleHelper::getLayoutPath('mod_menu', 'item-url'); - break; - case 'separator': - break; - default: - require ModuleHelper::getLayoutPath('mod_menu', 'item-url'); - break; - endswitch; - - if ($hasChildren) - { - echo '"; - } - - echo "
  • "; - -?> \ No newline at end of file diff --git a/html/mod_menu/lndropdown-default.php b/html/mod_menu/lndropdown-default.php new file mode 100644 index 0000000..518bcd2 --- /dev/null +++ b/html/mod_menu/lndropdown-default.php @@ -0,0 +1,107 @@ + + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +defined('_JEXEC') or die; + +use Joomla\CMS\Helper\ModuleHelper; +use Joomla\CMS\HTML\HTMLHelper; +use Joomla\CMS\Language\Text; + +if (!defined('__LNDROPDOWN')){ + define('__LNDROPDOWN',''); + function menu_item($item, $endlevel) + { + $attributes = array(); + + $hasChildren = $item->hasChildren() && ($item->level < $endlevel); + $hasParent = $item->hasParent(); + + $isHeading = $item->type == 'heading'; + + $li_classes = "ln-nav-item pe-pointer px-1 mx-2"; + + if ($item->browserNav == 1) + { + $attributes['target'] = '_blank'; + $attributes['rel'] = 'noopener noreferrer'; + + if ($item->anchor_rel == 'nofollow') + { + $attributes['rel'] .= ' nofollow'; + } + } + elseif ($item->browserNav == 2) + { + $options = 'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,' . $params->get('window_open'); + $attributes['onclick'] = "window.open(this.href, 'targetWindow', '" . $options . "'); return false;"; + } + + + ?>
  • + $v) + { + echo ' ' . $n . '="' . $v . '"'; + } + ?>>title;?> +
    +
      getChildren() as $i => &$item) + { + menu_item($item, $endlevel); + } + unset($item); + ?>
    +
    +
  • +
    + + +
    +
      &$item) + { + menu_item($item, $endlevel); + } + unset($item); + ?>
    +
    +
    + &$item) { + if ($item->level == $params['startLevel']) { + array_push($items, $item); + } +} +unset($item); + +menu('m'.$module->id, $items, $params['endLevel']); +?> \ No newline at end of file