mirror of
https://github.com/Heretek-AI/heretek-control-core.git
synced 2026-10-11 21:09:58 +00:00
feat(migrate): register Backup & Migrate module + admin tab (Phase 1 T1)
Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
099a90f22f
commit
9319bc9765
@@ -155,6 +155,7 @@ class EMCP_Tools_Admin {
|
||||
'tools' => 'dashicons-admin-tools',
|
||||
'history' => 'dashicons-undo',
|
||||
'redirects' => 'dashicons-randomize',
|
||||
'migrate' => 'dashicons-migrate',
|
||||
'modules' => 'dashicons-screenoptions',
|
||||
'connection' => 'dashicons-admin-links',
|
||||
'ai-chat' => 'dashicons-format-chat',
|
||||
@@ -181,6 +182,7 @@ class EMCP_Tools_Admin {
|
||||
self::PAGE_SLUG . '-ai-chat' => __( 'AI Chat', 'emcp-tools' ),
|
||||
self::PAGE_SLUG . '-context' => __( 'Context', 'emcp-tools' ),
|
||||
self::PAGE_SLUG . '-redirects' => __( 'Redirects', 'emcp-tools' ),
|
||||
self::PAGE_SLUG . '-migrate' => __( 'Backup & Migrate', 'emcp-tools' ),
|
||||
self::PAGE_SLUG . '-memory' => __( 'Memory', 'emcp-tools' ),
|
||||
self::PAGE_SLUG . '-prompts' => __( 'Prompts', 'emcp-tools' ),
|
||||
self::PAGE_SLUG . '-templates' => __( 'Templates', 'emcp-tools' ),
|
||||
@@ -206,6 +208,10 @@ class EMCP_Tools_Admin {
|
||||
if ( ! $this->module_tab_visible( 'redirects' ) ) {
|
||||
unset( $this->submenus[ self::PAGE_SLUG . '-redirects' ] );
|
||||
}
|
||||
// Backup & Migrate tab is gated by the Migrate (Pro) module.
|
||||
if ( ! $this->module_tab_visible( 'migrate' ) ) {
|
||||
unset( $this->submenus[ self::PAGE_SLUG . '-migrate' ] );
|
||||
}
|
||||
// Module-backed tabs: drop each when its module is off/unavailable.
|
||||
foreach ( array( 'prompts', 'templates', 'brand-kits' ) as $emcp_mod_id ) {
|
||||
if ( ! $this->module_tab_visible( $emcp_mod_id ) ) {
|
||||
@@ -232,6 +238,8 @@ class EMCP_Tools_Admin {
|
||||
return 'history';
|
||||
case self::PAGE_SLUG . '-redirects':
|
||||
return 'redirects';
|
||||
case self::PAGE_SLUG . '-migrate':
|
||||
return 'migrate';
|
||||
case self::PAGE_SLUG . '-modules':
|
||||
return 'modules';
|
||||
case self::PAGE_SLUG . '-connection':
|
||||
@@ -3304,6 +3312,11 @@ class EMCP_Tools_Admin {
|
||||
include EMCP_TOOLS_DIR . 'includes/admin/views/page-history.php';
|
||||
} elseif ( 'redirects' === $active_tab && $this->module_tab_visible( 'redirects' ) ) {
|
||||
include EMCP_TOOLS_DIR . 'includes/admin/views/page-redirects.php';
|
||||
} elseif ( 'migrate' === $active_tab && $this->module_tab_visible( 'migrate' ) ) {
|
||||
$emcp_migrate_view = EMCP_Tools_Pro_Loader::path( 'includes/admin/views/page-migrate.php' );
|
||||
if ( '' !== $emcp_migrate_view ) {
|
||||
include $emcp_migrate_view;
|
||||
}
|
||||
} elseif ( 'widgets' === $active_tab ) {
|
||||
include EMCP_TOOLS_DIR . 'includes/admin/views/page-widgets.php';
|
||||
} elseif ( 'marketplace' === $active_tab ) {
|
||||
|
||||
@@ -251,5 +251,13 @@ final class EMCP_Tools_Pro_Loader {
|
||||
$registry->register( new EMCP_Tools_Memory_Module() );
|
||||
}
|
||||
}
|
||||
|
||||
$migrate_path = self::path( 'includes/modules/class-migrate-module.php' );
|
||||
if ( '' !== $migrate_path ) {
|
||||
require_once $migrate_path;
|
||||
if ( class_exists( 'EMCP_Tools_Migrate_Module' ) ) {
|
||||
$registry->register( new EMCP_Tools_Migrate_Module() );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,6 +140,9 @@
|
||||
<testsuite name="Cloud">
|
||||
<directory>pro/tests/unit/Cloud</directory>
|
||||
</testsuite>
|
||||
<testsuite name="Migrate">
|
||||
<directory>pro/tests/unit/migrate</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
|
||||
<source>
|
||||
|
||||
+1
-1
Submodule pro updated: 07144e73ae...7c3ba37e72
@@ -71,3 +71,11 @@ includes/abilities/class-generateblocks-integration.php
|
||||
includes/blocks-catalog/class-blocksy-blocks-catalog.php
|
||||
includes/abilities/class-blocksy-blocks-integration.php
|
||||
includes/abilities/class-blocksy-extensions-integration.php
|
||||
|
||||
# Backup & Migrate module (Pro) — Phase 1
|
||||
includes/modules/class-migrate-module.php
|
||||
includes/admin/views/page-migrate.php
|
||||
includes/admin/views/migrate
|
||||
includes/migrate
|
||||
assets/js/migrate.js
|
||||
assets/css/migrate.css
|
||||
|
||||
Reference in New Issue
Block a user