HEX
Server: Apache
System: Linux webd006.cluster128.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User: zwafgyp (177615)
PHP: 7.4.33
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/z/w/a/zwafgyp/coolswim/wp-content/mu-plugins/ionos-help-center/inc/class-settings.php
<?php
namespace Ionos\Help_Center;

// Do not allow direct access!
use function defined;

if ( ! defined( 'ABSPATH' ) ) {
	die();
}

/**
 * Class Help_Center_Settings
 */
class Settings {

	public function __construct() {
		if ( is_admin() ) {
			add_action( 'ionos_assistant_register_settings', array( $this, 'register_settings' ), 10, 2 );
		}
	}

	/**
	 * creates settings option for IONOS Assistant Settings Page
	 */
	public function register_settings( $options_group_id, $branding_data ) {
		if ( ! isset( $branding_data['name'] ) || \Ionos\Help_Center\Helper::get_config_parameter( 'enabled' ) !== '1' ) {
			return null;
		}

		register_setting(
			$options_group_id,
			'ionos_help_center_enabled',
			array( 'default' => '1' )
		);

		add_settings_section(
			'ionos_help_center_integration_settings',
			'',
			'',
			'ionos_assistant_settings_plugin'
		);

		add_settings_field(
			'ionos_help_center_enabled',
			sprintf(
				__( '%s - Help', 'ionos-help-center' ),
				$branding_data['name']
			),
			array( $this, 'help_center_settings' ),
			'ionos_assistant_settings_plugin',
			'ionos_help_center_integration_settings',
			array(
				'branding_data' => $branding_data,
			)
		);
	}

	public function help_center_settings( $args ) {
		$option = get_option( 'ionos_help_center_enabled', '1' );

		echo '<label for="ionos_help_center_enabled">';
		echo '<input  id="ionos_help_center_enabled" name="ionos_help_center_enabled" type="checkbox" value="1" ' . checked( '1', $option, false ) . ' />';
		echo sprintf( __( 'Use %s help', 'ionos-help-center' ), $args['branding_data']['name'] . '</label>' );
	}
}