Preparation fpr new mareike & solea module

This commit is contained in:
2024-07-30 23:06:59 +02:00
parent 19a10e5704
commit 5e107d36ca
10 changed files with 177 additions and 206 deletions

View File

@ -40,11 +40,27 @@ class MainController
}
public function __construct()
{
global $dbHandler;
global $dbHandler, $wpdb;
add_menu_page(
__('Events', BDP_LV_PLUGIN_SLUG),
__('Events', BDP_LV_PLUGIN_SLUG),
$show_menu = false;
foreach ([self::KOMPASS_EVENTS_EVENTS] as $table) {
$sqlTable = $wpdb->prefix . $table;
$sql = "SHOW TABLES LIKE '$sqlTable'";
$result = $wpdb->get_var( $sql );
if ( $result == $sqlTable ) {
$show_menu = true;
}
}
if (!$show_menu) {
return;
}
add_menu_page(
__('Events (legacy)', BDP_LV_PLUGIN_SLUG),
__('Events (legacy)', BDP_LV_PLUGIN_SLUG),
'send_mails',
'kompass-events',
[$this, 'router'],