From 992a9d6ca186bb4399143dd5ee72a27a3b4909aa Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Mon, 26 Oct 2020 18:03:48 +0100 Subject: Initial commit --- src/Settings.php | 97 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 src/Settings.php (limited to 'src/Settings.php') diff --git a/src/Settings.php b/src/Settings.php new file mode 100644 index 0000000..d9947f8 --- /dev/null +++ b/src/Settings.php @@ -0,0 +1,97 @@ + +
+

+
+ +
+
+ + + 'timber-editor_general_supported-post-types']); + + register_setting('timber-editor', 'timber-editor_codemirror_theme'); + add_settings_section('timber-editor_codemirror', 'CodeMirror', function () {}, 'timber-editor'); + add_settings_field('timber-editor_codemirror_theme', 'Theme', function () { + $theme = self::getCodeMirrorTheme(); + $themes = include_once 'codemirror-themes.php'; + ?> + +

+ + + +

+ 'timber-editor_codemirror_theme']); + } + + /** + * @return string[] + */ + public static function getGeneralSupportedPostTypes() + { + return get_option('timber-editor_general_supported-post-types', ['page']) ?: []; + } + + /** + * @return string + */ + public static function getCodeMirrorTheme() + { + return get_option('timber-editor_codemirror_theme', 'default'); + } +} -- cgit v1.2.3