Handling of new components

This commit is contained in:
2024-08-12 15:11:25 +02:00
parent 138b3859aa
commit da63fe3b3c
10 changed files with 225 additions and 28 deletions

View File

@ -6,6 +6,49 @@ namespace Bdp\Modules\KompassSettings\Controllers;
class SettingsPage
{
public static function add_menu() {
if (
null !== get_option('bdp_calendar_source_url', null ) ||
!file_exists(dirname(BDP_LV_STARTUP_FILE ) . '/../kronos/kronos.php')
)
{
add_menu_page(
'Kalender Installation',
'Kalender Installation',
'manage_options',
'kompass-calendar',
['Bdp\Modules\PluginInstaller\Controllers\InstallSingleplugin', 'install_calendar'],
'dashicons-calendar-alt',
2
);
if ( file_exists(dirname(BDP_LV_STARTUP_FILE ) . '/../kronos/kronos.php') ) {
add_action( 'admin_notices', array( 'Bdp\Modules\PluginInstaller\Controllers\OutdatedModule', 'calender' ) );
}
}
if (
!file_exists(dirname(BDP_LV_STARTUP_FILE ) . '/../solea/solea.php')
)
{
add_menu_page(
'Installiere solea (Veranstaltungen)',
'Installiere solea (Veranstaltungen)',
'manage_options',
'kompass-events',
['Bdp\Modules\PluginInstaller\Controllers\InstallSingleplugin', 'install_events'],
'dashicons-tickets-alt',
2
);
}
add_submenu_page('options-general.php',
'kompass Einstellungen',
'kompass Einstellungen',
@ -63,10 +106,8 @@ class SettingsPage
if (isset($_REQUEST['update_options']) && $_REQUEST['update_options'] == true) {
switch ($tab) {
case 'tab2':
update_option('bdp_calendar_categories', json_encode($_POST['category']));
update_option('bdp_calendar_source_url', $_POST['bdp_calendar_source_url']);
$showMessage = __('The settings were saved.', BDP_LV_PLUGIN_SLUG);
break;
kompass_print_message_box('Diese Funktion wird nicht mdehr unterstützt.', 'error');
break;
case 'tab3':
update_option('kompass_seo_google_verification', $_POST['kompass_seo_google_verification']);