From c204185ae86a98994f80010abf35a190c9406739 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Sun, 12 Jul 2026 18:08:19 +0000
Subject: [PATCH] =Refactor of Integrations.php. Separated different functionality into traits that classes can use to add that functionality. Hopefully will make maintaining it a little easier. Still have to finish up, as well as refactoring the individual classes to utilize the new system.
---
inc/ui/Navigation.php | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/inc/ui/Navigation.php b/inc/ui/Navigation.php
index 16a7e66..d075776 100644
--- a/inc/ui/Navigation.php
+++ b/inc/ui/Navigation.php
@@ -23,7 +23,7 @@
*/
class Navigation {
private string $id;
- private array $items = [];
+ public array $items = [];
private array $classes = [];
protected array $defaultMenuClasses = [];
private bool $isNav = true;
@@ -230,6 +230,7 @@
$menuItem->url($item['url']);
}
+
if (!empty($item['submenu'])) {
$submenu = $menuItem->submenu();
$submenu->populateFromArray($item['submenu']);
@@ -353,6 +354,7 @@
$this->current = $current;
if ($current) {
$this->addClass('current');
+ $this->attribute('aria-current', 'page');
}
return $this;
}
@@ -375,6 +377,9 @@
* @return string
*/
public function render(): string {
+ if (!$this->url && (!$this->submenu || empty($this->submenu->items))) {
+ return '';
+ }
$classes = $this->classes;
if ($this->submenu) {
$classes[] = 'has-submenu';
--
Gitblit v1.10.0