diff --git a/includes/admin/class-settings-page.php b/includes/admin/class-settings-page.php new file mode 100644 index 0000000..27abc1c --- /dev/null +++ b/includes/admin/class-settings-page.php @@ -0,0 +1,110 @@ + {name => '' + active => true|false} + } + */ + + // todo generate this somehow + // maybe with filters, similar as with the settings + $submenu_options = array( + 'general' => array( + 'name' => 'General', + 'active' => false + ), + 'events_manager' => array( + 'name' => 'Events Manager', + 'active' => false, + ), + 'gatherpress' => array( + 'name' => 'Gatherpress', + 'active' => false, + ), + 'the_events_calendar' => array( + 'name' => 'The Events Calendar', + 'active' => false, + ), + 'vsel' => array( + 'name' => 'VS Event', + 'active' => false, + ), + ); + + $submenu_options[$tab]['active'] = true; + + + + switch ( $tab ) { + case 'general': + \load_template( ACTIVITYPUB_EVENT_EXTENSIONS_PLUGIN_DIR . 'templates/settings-general.php' , true, $submenu_options ); + break; + default: + \load_template( ACTIVITYPUB_EVENT_EXTENSIONS_PLUGIN_DIR . 'templates/settings-extractor.php', true, $submenu_options ); + break; + } + + } + +} diff --git a/includes/class-settings.php b/includes/class-settings.php deleted file mode 100644 index e69de29..0000000 diff --git a/includes/class-setup.php b/includes/class-setup.php index cf2f799..f1715a8 100644 --- a/includes/class-setup.php +++ b/includes/class-setup.php @@ -13,7 +13,7 @@ namespace Activitypub_Event_Extensions; use Activitypub_Event_Extensions\Admin\Event_Plugin_Admin_Notices; use Activitypub_Event_Extensions\Admin\General_Admin_Notices; - +use Activitypub_Event_Extensions\Admin\Settings_Page; // Exit if accessed directly. defined( 'ABSPATH' ) || exit; // @codeCoverageIgnore @@ -141,6 +141,9 @@ class Setup { return; } + add_action( 'admin_menu', array( Settings_Page::static, 'admin_menu' ) ); + add_filter( 'plugin_action_links_Activitypub_Event_Extensions', array( Settings_Page::static, 'settings_links' ) ); + add_filter( 'activitypub_transformer', array( $this, 'register_activitypub_event_transformer' ), 10, 3 ); } diff --git a/templates/admin-header.php b/templates/admin-header.php new file mode 100644 index 0000000..53cb250 --- /dev/null +++ b/templates/admin-header.php @@ -0,0 +1,21 @@ + +