| | |
| | | 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']); |
| | |
| | | <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', |
| | |
| | | '<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> |
| | |
| | | } |
| | | } |
| | | |
| | | 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(); |
| | | |
| | |
| | | |
| | | $referrals = $this->getUserReferrals($user_id, ['per_page' => 20]); |
| | | |
| | | ob_start(); |
| | | |
| | | $tabs = new Tabs(); |
| | | $tabs->addTab('share') |
| | |
| | | |
| | | ?> |
| | | <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 |