From 67496be88209d29c0794abf7de002db623d4afee Mon Sep 17 00:00:00 2001 From: Konstantin Obenland Date: Sun, 24 Mar 2019 16:54:16 +0100 Subject: [PATCH] Add setting --- src/ASMP.php | 16 +++++++++ src/Plugin.php | 1 + src/SettingsGeneralService.php | 62 ++++++++++++++++++++++++++++++++++ views/setting.php | 7 ++++ 4 files changed, 86 insertions(+) create mode 100644 src/ASMP.php create mode 100644 src/SettingsGeneralService.php create mode 100644 views/setting.php diff --git a/src/ASMP.php b/src/ASMP.php new file mode 100644 index 0000000..93375ca --- /dev/null +++ b/src/ASMP.php @@ -0,0 +1,16 @@ +view_factory = $view_factory; + } + + /** + * Register the service. + * + * @return void + */ + public function register(): void { + if ( ! isset( $_SERVER[ ASMP::VERSION ] ) ) { + // TODO return; + } + + // TODO + $_SERVER[ ASMP::ENDPOINT ] = [ '5.6', '7.0', '7.2' ]; + + add_action( 'admin_init', function() { + \add_settings_field( 'asmp', esc_html__( 'PHP Versions', 'asmp' ), [ $this, 'render' ], 'general' ); + } ); + } + + /** + * Render the admin notice. + * + * @return void + */ + public function render(): void { + echo $this->view_factory->create( 'views/setting' ) + ->render(); + } +} + diff --git a/views/setting.php b/views/setting.php new file mode 100644 index 0000000..fd1c7d4 --- /dev/null +++ b/views/setting.php @@ -0,0 +1,7 @@ +