From 4089ba01e0881c89a72332e13bc3a80b6bddec2a Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Mon, 29 Jun 2026 22:15:55 +0000
Subject: [PATCH] =DashboardManager overhaul. A bit easier to modify the output of pages. Still have to get the account pages to work as expected, as well as verify the integrations and others are working - but registrar/content pages work as expected. Also fixed up the table generation in CRUD.js and CRUDSkeleton.php
---
inc/admin/SEOAdmin.php | 19 +++++++++----------
1 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/inc/admin/SEOAdmin.php b/inc/admin/SEOAdmin.php
index 007e453..ddf9d75 100644
--- a/inc/admin/SEOAdmin.php
+++ b/inc/admin/SEOAdmin.php
@@ -1,6 +1,7 @@
<?php
namespace JVBase\admin;
+use JVBase\base\SchemaHelper;
use JVBase\meta\Form;
use JVBase\registrar\Registrar;
use JVBase\ui\Tabs;
@@ -107,7 +108,8 @@
public function __construct()
{
$this->setChecks();
- add_filter('jvbDashboardPage', [$this, 'addDashboardSection'], 20, 2);
+ add_action(BASE.'dashboard_page_seo', [$this, 'addDashboardSection'], 10);
+
add_action('admin_menu', [$this, 'addAdminMenu']);
$this->addFormListeners();
}
@@ -143,14 +145,9 @@
);
}
- public function addDashboardSection(string $content, string $page):string
+ public function addDashboardSection():void
{
- if ($page !== 'SEO') {
- return $content;
- }
- ob_start();
$this->renderAdminPage();
- return ob_get_clean();
}
public function renderAdminPage(bool $outputScripts = true):void
@@ -208,7 +205,7 @@
jvbInlineStyles('forms');
}
- public function renderProperty(string $property, ?string $value, mixed $class):void
+ public function renderProperty(string $property, mixed $value, mixed $class):void
{
$method = 'get'.ucFirst($property).'FieldConfig';
$config = method_exists($class, $method) ? $class->$method() : $this->buildConfig($property);
@@ -254,7 +251,8 @@
$this->formStart('website');
$default = 'JVBase\managers\SEO\render\Thing\CreativeWork\WebSite';
// $this->renderSchemaTypeSelection($value);
- $stored = get_option(BASE.'WebsiteSchema',apply_filters(BASE.'websiteSchema', []));
+ $stored = SchemaHelper::schema('website');
+
$this->renderFieldsFor($default, $stored);
$this->formEnd();
return ob_get_clean();
@@ -266,7 +264,8 @@
$default = apply_filters(BASE.'OrganizationSchemaType', 'JVBase\managers\SEO\render\Thing\Organization\Organization');
$value = get_option(BASE.'OrganizationSchemaType', $default);
$this->renderSchemaTypeSelection($value);
- $stored = get_option(BASE.'OrganizationSchema',apply_filters(BASE.'OrganizationSchema', []));
+
+ $stored = SchemaHelper::schema('organization');
$this->renderFieldsFor($value, $stored);
$this->formEnd();
return ob_get_clean();
--
Gitblit v1.10.0