From 3baf3d2545ba6ece6b74a64c0def59bd0774cf54 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Wed, 10 Jun 2026 16:34:12 +0000
Subject: [PATCH] =Laid the groundwork for an improved DashboardManager.php setup. Have to put it aside so I can get the dang Northeh done though.

---
 inc/registrar/config/Section.php |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/inc/registrar/config/Section.php b/inc/registrar/config/Section.php
index 15e2def..10ac615 100644
--- a/inc/registrar/config/Section.php
+++ b/inc/registrar/config/Section.php
@@ -13,10 +13,11 @@
 	protected string $description = '';
 	protected string $icon = '';
 	protected array $fields = [];
+	private Registrar $registrar;
 
-	public function __construct(string $title) {
-		$this->title = $title;
-		$this->slug = sanitize_title($title);
+	public function __construct(string $slug, Registrar $registrar) {
+		$this->slug = sanitize_title($slug);
+		$this->registrar = $registrar;
 	}
 
 	public function setTitle(string $title): self {
@@ -25,7 +26,7 @@
 	}
 	public function getTitle():string
 	{
-		return $this->title;
+		return $this->title ?? ucwords(implode(' ', explode('-', $this->slug)));
 	}
 
 	public function setDescription(string $description):self
@@ -43,10 +44,14 @@
 		$this->icon = $icon;
 		return $this;
 	}
+	public function getIcon():string
+	{
+		return $this->icon;
+	}
 
 	protected function checkFields(string|array $fields):string|array
 	{
-		$allFields =  Registrar::getInstance($this->slug)->getFields();
+		$allFields =  $this->registrar->getFields();
 		if (is_array($fields)){
 			foreach ($fields as $index =>$fieldName){
 				if (!array_key_exists($fieldName, $allFields)){

--
Gitblit v1.10.0