From 0dfe1d8afafc59c4a5559c498342668d5a58d6ef Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Thu, 23 Jul 2026 22:41:41 +0000
Subject: [PATCH] =Still working away at the Integrations overhaul

---
 inc/managers/ReferralManager.php |   16 ++++++----------
 1 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/inc/managers/ReferralManager.php b/inc/managers/ReferralManager.php
index 8bc8e03..626d036 100644
--- a/inc/managers/ReferralManager.php
+++ b/inc/managers/ReferralManager.php
@@ -95,7 +95,8 @@
 		add_action('admin_notices', [$this, 'showReferralPageNotice']);
 
 
-		add_filter('jvbDashboardPage', [$this, 'renderDashPage'], 10, 2);
+		add_action(BASE.'dashboard_page_referrals', [$this, 'renderDashPage'], 10);
+//		add_filter('jvbDashboardPage', [$this, 'renderDashPage'], 10, 2);
 
 		// Handle settings save
 		add_action('admin_init', [$this, 'registerSettings']);
@@ -1265,7 +1266,7 @@
 				<p class="hint">Can\'t find it? Check your spam folder.</p>
 			</div>',
 			jvbFormStatus(),
-			esc_attr(get_option(BASE.'referral_role','client')),
+			esc_attr(Site::getReferralRole()),
 			Form::render('referral_name', '', [
 				'required'	=> true,
 				'type'		=> 'text',
@@ -1301,6 +1302,7 @@
 			'<form id="login-form">%s%s%s
 			<button type="submit">%sLogin With Magic Link</button>
 		</form>
+
 		<div class="success-content" hidden>
 			<h3>Check Your Email!</h3>
 			<p>We\'ve sent you a magic link to log in - no password required! Click the link in your email to log in.</p>
@@ -2615,12 +2617,8 @@
 		}
 	}
 
-	public function renderDashPage(string $content, string $page): string
+	public function renderDashPage():void
 	{
-		if ($page !== 'Referrals') {
-			return $content;
-		}
-
 		// Regular users get their referral dashboard
 		$user_id = get_current_user_id();
 
@@ -2632,7 +2630,6 @@
 
 		$referrals = $this->getUserReferrals($user_id, ['per_page' => 20]);
 
-		ob_start();
 
 		$tabs = new Tabs();
 		$tabs->addTab('share')
@@ -2647,11 +2644,10 @@
 
 		?>
 		<div class="referral-dashboard">
-			<?= $tabs->render(true);?>
+			<?= $tabs->render();?>
 		</div>
 
 		<?php
-		return ob_get_clean();
 	}
 
 	protected function shareDashboard(int $user_id, string $referral_code):string

--
Gitblit v1.10.0