diff --git a/vendor/autoload.php b/vendor/autoload.php index 7b363db1..bf64b0bd 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -22,4 +22,4 @@ require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInit066c4ad60e2a566f23e65e5f53006199::getLoader(); +return ComposerAutoloaderInit2c498cedc94f6f3eba7205ee47469408::getLoader(); diff --git a/vendor/composer/autoload_files.php b/vendor/composer/autoload_files.php index 9dae5938..e3b78684 100644 --- a/vendor/composer/autoload_files.php +++ b/vendor/composer/autoload_files.php @@ -6,5 +6,5 @@ $baseDir = dirname($vendorDir); return array( - 'e4e11a001002b1c747a45db4ce1ccc3a' => $vendorDir . '/cmb2/cmb2/init.php', + 'ad901de1e5d16b81f427bfe3dc3de508' => $vendorDir . '/cmb2/cmb2/init.php', ); diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php index b621c647..28717f25 100644 --- a/vendor/composer/autoload_psr4.php +++ b/vendor/composer/autoload_psr4.php @@ -7,6 +7,5 @@ return array( 'RRule\\' => array($baseDir . '/src', $vendorDir . '/rlanvin/php-rrule/src'), - 'RRZE\\WP\\' => array($vendorDir . '/rrze/wp/src'), 'RRZE\\Calendar\\' => array($baseDir . '/includes'), ); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 6b68b958..4ff4e7fb 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInit066c4ad60e2a566f23e65e5f53006199 +class ComposerAutoloaderInit2c498cedc94f6f3eba7205ee47469408 { private static $loader; @@ -24,16 +24,16 @@ public static function getLoader() require __DIR__ . '/platform_check.php'; - spl_autoload_register(array('ComposerAutoloaderInit066c4ad60e2a566f23e65e5f53006199', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInit2c498cedc94f6f3eba7205ee47469408', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); - spl_autoload_unregister(array('ComposerAutoloaderInit066c4ad60e2a566f23e65e5f53006199', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInit2c498cedc94f6f3eba7205ee47469408', 'loadClassLoader')); require __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInit066c4ad60e2a566f23e65e5f53006199::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInit2c498cedc94f6f3eba7205ee47469408::getInitializer($loader)); $loader->register(true); - $filesToLoad = \Composer\Autoload\ComposerStaticInit066c4ad60e2a566f23e65e5f53006199::$files; + $filesToLoad = \Composer\Autoload\ComposerStaticInit2c498cedc94f6f3eba7205ee47469408::$files; $requireFile = \Closure::bind(static function ($fileIdentifier, $file) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index a7af938e..fa0fa15d 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -4,17 +4,16 @@ namespace Composer\Autoload; -class ComposerStaticInit066c4ad60e2a566f23e65e5f53006199 +class ComposerStaticInit2c498cedc94f6f3eba7205ee47469408 { public static $files = array ( - 'e4e11a001002b1c747a45db4ce1ccc3a' => __DIR__ . '/..' . '/cmb2/cmb2/init.php', + 'ad901de1e5d16b81f427bfe3dc3de508' => __DIR__ . '/..' . '/cmb2/cmb2/init.php', ); public static $prefixLengthsPsr4 = array ( 'R' => array ( 'RRule\\' => 6, - 'RRZE\\WP\\' => 8, 'RRZE\\Calendar\\' => 14, ), ); @@ -25,10 +24,6 @@ class ComposerStaticInit066c4ad60e2a566f23e65e5f53006199 0 => __DIR__ . '/../..' . '/src', 1 => __DIR__ . '/..' . '/rlanvin/php-rrule/src', ), - 'RRZE\\WP\\' => - array ( - 0 => __DIR__ . '/..' . '/rrze/wp/src', - ), 'RRZE\\Calendar\\' => array ( 0 => __DIR__ . '/../..' . '/includes', @@ -53,10 +48,10 @@ class ComposerStaticInit066c4ad60e2a566f23e65e5f53006199 public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInit066c4ad60e2a566f23e65e5f53006199::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInit066c4ad60e2a566f23e65e5f53006199::$prefixDirsPsr4; - $loader->prefixesPsr0 = ComposerStaticInit066c4ad60e2a566f23e65e5f53006199::$prefixesPsr0; - $loader->classMap = ComposerStaticInit066c4ad60e2a566f23e65e5f53006199::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInit2c498cedc94f6f3eba7205ee47469408::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit2c498cedc94f6f3eba7205ee47469408::$prefixDirsPsr4; + $loader->prefixesPsr0 = ComposerStaticInit2c498cedc94f6f3eba7205ee47469408::$prefixesPsr0; + $loader->classMap = ComposerStaticInit2c498cedc94f6f3eba7205ee47469408::$classMap; }, null, ClassLoader::class); } diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index ade9fcec..44fa4686 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -180,59 +180,6 @@ "source": "https://github.com/rlanvin/php-rrule/tree/v2.4.1" }, "install-path": "../rlanvin/php-rrule" - }, - { - "name": "rrze/wp", - "version": "1.2.2", - "version_normalized": "1.2.2.0", - "source": { - "type": "git", - "url": "https://github.com/RRZE-Webteam/rrze-wp.git", - "reference": "b0c51e6a07011ec1d3ebf8a71fae5a93c05a6014" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/RRZE-Webteam/rrze-wp/zipball/b0c51e6a07011ec1d3ebf8a71fae5a93c05a6014", - "reference": "b0c51e6a07011ec1d3ebf8a71fae5a93c05a6014", - "shasum": "" - }, - "require": { - "php": ">=8.0" - }, - "time": "2023-11-28T09:49:37+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "RRZE\\WP\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-3.0-or-later" - ], - "authors": [ - { - "name": "Rolf v. d. Forst", - "email": "rolf.v.d.forst@fau.de", - "homepage": "https://www.rrze.fau.de" - }, - { - "name": "Benjamin Klemencic", - "email": "benjamin.klemencic@fau.de", - "homepage": "https://www.rrze.fau.de" - } - ], - "description": "A general purpose library for WordPress.", - "homepage": "https://github.com/RRZE-Webteam/rrze-wp", - "keywords": [ - "wordpress" - ], - "support": { - "issues": "https://github.com/RRZE-Webteam/rrze-wp/issues", - "source": "https://github.com/RRZE-Webteam/rrze-wp/tree/1.2.2" - }, - "install-path": "../rrze/wp" } ], "dev": true, diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 4c0f04da..20243ddc 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -1,15 +1,24 @@ array( - 'name' => 'rrze/rrze-calendar', - 'pretty_version' => '2.0.10', - 'version' => '2.0.10.0', - 'reference' => NULL, - 'type' => 'wordpress-plugin', + 'name' => '__root__', + 'pretty_version' => 'dev-master', + 'version' => 'dev-master', + 'reference' => '50a3090906f6af0c909c1343d8614b3544eeb08f', + 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev' => true, ), 'versions' => array( + '__root__' => array( + 'pretty_version' => 'dev-master', + 'version' => 'dev-master', + 'reference' => '50a3090906f6af0c909c1343d8614b3544eeb08f', + 'type' => 'library', + 'install_path' => __DIR__ . '/../../', + 'aliases' => array(), + 'dev_requirement' => false, + ), 'cmb2/cmb2' => array( 'pretty_version' => 'v2.10.1', 'version' => '2.10.1.0', @@ -37,23 +46,5 @@ 'aliases' => array(), 'dev_requirement' => false, ), - 'rrze/rrze-calendar' => array( - 'pretty_version' => '2.0.10', - 'version' => '2.0.10.0', - 'reference' => NULL, - 'type' => 'wordpress-plugin', - 'install_path' => __DIR__ . '/../../', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'rrze/wp' => array( - 'pretty_version' => '1.2.2', - 'version' => '1.2.2.0', - 'reference' => 'b0c51e6a07011ec1d3ebf8a71fae5a93c05a6014', - 'type' => 'library', - 'install_path' => __DIR__ . '/../rrze/wp', - 'aliases' => array(), - 'dev_requirement' => false, - ), ), ); diff --git a/vendor/composer/platform_check.php b/vendor/composer/platform_check.php index adfb472f..4c3a5d68 100644 --- a/vendor/composer/platform_check.php +++ b/vendor/composer/platform_check.php @@ -4,8 +4,8 @@ $issues = array(); -if (!(PHP_VERSION_ID >= 80000)) { - $issues[] = 'Your Composer dependencies require a PHP version ">= 8.0.0". You are running ' . PHP_VERSION . '.'; +if (!(PHP_VERSION_ID >= 80100)) { + $issues[] = 'Your Composer dependencies require a PHP version ">= 8.1.0". You are running ' . PHP_VERSION . '.'; } if ($issues) { diff --git a/vendor/rrze/wp/.gitignore b/vendor/rrze/wp/.gitignore deleted file mode 100644 index f0602c7e..00000000 --- a/vendor/rrze/wp/.gitignore +++ /dev/null @@ -1,12 +0,0 @@ -### vscode ### -.vscode/ -### NetBeans ### -**/nbproject/ -### PhpStorm ### -.idea/ -### macOS ### -.DS_Store -### Node ### -node_modules/ -### Tmp ### -_tmp/ diff --git a/vendor/rrze/wp/README.md b/vendor/rrze/wp/README.md deleted file mode 100644 index ce1c828b..00000000 --- a/vendor/rrze/wp/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# RRZE WordPress Library - -General purpose library for WordPress. - -## Installation - -Install the latest version with - -```bash -% composer require rrze/wp -``` diff --git a/vendor/rrze/wp/composer.json b/vendor/rrze/wp/composer.json deleted file mode 100644 index e638a648..00000000 --- a/vendor/rrze/wp/composer.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "rrze/wp", - "description": "A general purpose library for WordPress.", - "version": "1.2.2", - "type": "library", - "keywords": [ - "wordpress" - ], - "homepage": "https://github.com/RRZE-Webteam/rrze-wp", - "license": "GPL-3.0-or-later", - "authors": [ - { - "name": "Rolf v. d. Forst", - "email": "rolf.v.d.forst@fau.de", - "homepage": "https://www.rrze.fau.de" - }, - { - "name": "Benjamin Klemencic", - "email": "benjamin.klemencic@fau.de", - "homepage": "https://www.rrze.fau.de" - } - ], - "require": { - "php": ">=8.0" - }, - "autoload": { - "psr-4": { - "RRZE\\WP\\": "src" - } - }, - "lock": false -} \ No newline at end of file diff --git a/vendor/rrze/wp/src/Debug.php b/vendor/rrze/wp/src/Debug.php deleted file mode 100644 index ea34d1a8..00000000 --- a/vendor/rrze/wp/src/Debug.php +++ /dev/null @@ -1,53 +0,0 @@ -pluginFile = $pluginFile; - } - - /** - * loaded method - */ - public function loaded() - { - $this->setBasename() - ->setDirectory() - ->setUrl() - ->setVersion(); - } - - /** - * getFile method - * Get the full path and filename of the plugin. - * @return string The full path and filename. - */ - public function getFile(): string - { - return $this->pluginFile; - } - - /** - * getBasename method - * Get the basename of the plugin. - * @return string The basename. - */ - public function getBasename(): string - { - return $this->basename; - } - - /** - * setBasename method - * Set the basename of the plugin. - * @return object This Plugin object. - */ - public function setBasename(): object - { - $this->basename = plugin_basename($this->pluginFile); - return $this; - } - - /** - * getDirectory method - * Get the filesystem directory path (with trailing slash) for the plugin. - * @return string The filesystem directory path. - */ - public function getDirectory(): string - { - return $this->directory; - } - - /** - * setDirectory method - * Set the filesystem directory path (with trailing slash) for the plugin. - * @return object This Plugin object. - */ - public function setDirectory(): object - { - $this->directory = rtrim(plugin_dir_path($this->pluginFile), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR; - return $this; - } - - /** - * getPath method - * Get the filesystem directory path (with trailing slash) for the plugin. - * @param string $path The path name. - * @return string The filesystem directory path. - */ - public function getPath(string $path = ''): string - { - return $this->directory . ($path ? trim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR : ''); - } - - /** - * getUrl method - * Get the URL directory path (with trailing slash) for the plugin. - * @param string $path The path name. - * @return string The URL directory path. - */ - public function getUrl(string $path = ''): string - { - return $this->url . ($path ? trim($path, '/') . '/' : ''); - } - - /** - * setUrl method - * Set the URL directory path (with trailing slash) for the plugin. - * @return object This Plugin object. - */ - public function setUrl(): object - { - $this->url = rtrim(plugin_dir_url($this->pluginFile), '/') . '/'; - return $this; - } - - /** - * getSlug method - * Get the slug of the plugin. - * @return string The slug. - */ - public function getSlug(): string - { - return sanitize_title(dirname($this->basename)); - } - - /** - * getVersion method - * Get the version of the plugin. - * @return string The version. - */ - public function getVersion(): string - { - if (defined('WP_DEBUG') && WP_DEBUG) { - return bin2hex(random_bytes(4)); - } - return $this->version; - } - - /** - * getVersion method - * Set the version of the plugin. - * @return object This Plugin object. - */ - public function setVersion(): object - { - $headers = ['Version' => 'Version']; - $fileData = get_file_data($this->pluginFile, $headers, 'plugin'); - if (isset($fileData['Version'])) { - $this->version = $fileData['Version']; - }; - return $this; - } - - /** - * __call method - * Method overloading. - */ - public function __call(string $name, array $arguments) - { - if (!method_exists($this, $name)) { - $message = sprintf('Call to undefined method %1$s::%2$s', __CLASS__, $name); - do_action( - 'rrze.log.error', - $message, - [ - 'class' => __CLASS__, - 'method' => $name, - 'arguments' => $arguments - ] - ); - if (defined('WP_DEBUG') && WP_DEBUG) { - throw new \Exception($message); - } - } - } -} diff --git a/vendor/rrze/wp/src/Settings/Error.php b/vendor/rrze/wp/src/Settings/Error.php deleted file mode 100644 index 5070e57f..00000000 --- a/vendor/rrze/wp/src/Settings/Error.php +++ /dev/null @@ -1,45 +0,0 @@ -error = new \WP_Error; - $this->settings = $settings; - } - - public function getAll() - { - global $wp_settings_error; - - return $wp_settings_error[$this->settings->optionName] ?? false; - } - - public function get($key) - { - $errors = $this->getAll(); - - if (! is_wp_error($errors)) { - return; - } - - return $errors->get_error_message($key); - } - - public function add($key, $message) - { - global $wp_settings_error; - - $this->error->add($key, $message); - - $wp_settings_error[$this->settings->optionName] = $this->error; - } -} diff --git a/vendor/rrze/wp/src/Settings/Flash.php b/vendor/rrze/wp/src/Settings/Flash.php deleted file mode 100644 index 8f4c352b..00000000 --- a/vendor/rrze/wp/src/Settings/Flash.php +++ /dev/null @@ -1,29 +0,0 @@ -settings = $settings; - } - - public function has() - { - global $wp_settings_flash; - - return $wp_settings_flash[$this->settings->optionName] ?? null; - } - - public function set($status, $message) - { - global $wp_settings_flash; - - $wp_settings_flash[$this->settings->optionName] = compact('status', 'message'); - } -} diff --git a/vendor/rrze/wp/src/Settings/Option.php b/vendor/rrze/wp/src/Settings/Option.php deleted file mode 100644 index e726cc5f..00000000 --- a/vendor/rrze/wp/src/Settings/Option.php +++ /dev/null @@ -1,105 +0,0 @@ -section = $section; - $this->type = $type; - $this->args = $args; - - $typeMap = apply_filters('rrze_wp_settings_option_type_map', [ - 'text' => Text::class, - 'checkbox' => Checkbox::class, - 'choices' => Choices::class, - 'textarea' => Textarea::class, - 'wp-editor' => WPEditor::class, - 'code-editor' => CodeEditor::class, - 'select' => Select::class, - 'select-multiple' => SelectMultiple::class, - 'color' => Color::class, - ]); - - $this->implementation = new $typeMap[$this->type]($section, $args); - } - - public function getArg($key, $fallback = null) - { - return $this->args[$key] ?? $fallback; - } - - public function sanitize($value) - { - if (is_callable($this->getArg('sanitize'))) { - return $this->getArg('sanitize')($value); - } - - return $this->implementation->sanitize($value); - } - - public function validate($value) - { - if (is_array($this->getArg('validate'))) { - foreach ($this->getArg('validate') as $validate) { - if (!is_callable($validate['callback'])) { - continue; - } - - $valid = $validate['callback']($value); - - if (!$valid) { - $this->section->tab->settings->errors->add($this->getArg('name'), $validate['feedback']); - - return false; - } - } - - return true; - } - - if (is_callable($this->getArg('validate'))) { - return $this->getArg('validate')($value); - } - - return $this->implementation->validate($value); - } - - public function render() - { - if (is_callable($this->getArg('visible')) && $this->getArg('visible')() === false) { - return; - } - - if (is_callable($this->getArg('render'))) { - echo $this->getArg('render')($this->implementation); - - return; - } - - echo $this->implementation->render(); - } -} diff --git a/vendor/rrze/wp/src/Settings/Options/Checkbox.php b/vendor/rrze/wp/src/Settings/Options/Checkbox.php deleted file mode 100644 index d6a402ca..00000000 --- a/vendor/rrze/wp/src/Settings/Options/Checkbox.php +++ /dev/null @@ -1,18 +0,0 @@ -getIdAttribute()); - - wp_localize_script('jquery', $settings_name, wp_enqueue_code_editor(['type' => $this->getArg('editor_type', 'text/html')])); - - wp_add_inline_script('wp-theme-plugin-editor', 'jQuery(function($){ - if($("#'.$this->getIdAttribute().'").length > 0) { - wp.codeEditor.initialize($("#'.$this->getIdAttribute().'"), '.$settings_name.'); - } - });'); - } - - public function sanitize($value) - { - return $value; - } -} diff --git a/vendor/rrze/wp/src/Settings/Options/Color.php b/vendor/rrze/wp/src/Settings/Options/Color.php deleted file mode 100644 index cea9f09c..00000000 --- a/vendor/rrze/wp/src/Settings/Options/Color.php +++ /dev/null @@ -1,29 +0,0 @@ -section = $section; - $this->args = $args; - } - - public function render() - { - return Template::include('options/' . $this->template, ['option' => $this]); - } - - public function hasError() - { - return $this->section->tab->settings->errors->get($this->getArg('name')); - } - - public function sanitize($value) - { - return sanitize_text_field($value); - } - - public function validate($value) - { - return true; - } - - public function getArg($key, $fallback = null) - { - if (empty($this->args[$key])) { - return $fallback; - } - - if (is_callable($this->args[$key])) { - return $this->args[$key](); - } - - return $this->args[$key]; - } - - public function getLabel() - { - return esc_attr($this->getArg('label')); - } - - public function getIdAttribute() - { - return $this->getArg('id', sanitize_title($this->getNameAttribute())); - } - - public function getName() - { - return $this->getArg('name'); - } - - public function getCss() - { - return $this->getArg('css', []); - } - - - public function getInputClassAttribute() - { - $class = $this->getCss()['input_class'] ?? null; - - return !empty($class) ? esc_attr($class) : null; - } - - public function getLabelClassAttribute() - { - $class = $this->getCss()['label_class'] ?? null; - - return !empty($class) ? esc_attr($class) : null; - } - - public function getNameAttribute() - { - return $this->section->tab->settings->optionName . '[' . $this->getArg('name') . ']'; - } - - public function getValueAttribute() - { - $value = get_option($this->section->tab->settings->optionName)[$this->getArg('name')] ?? false; - - return $value ? $value : $this->args['default'] ?? null; - } -} diff --git a/vendor/rrze/wp/src/Settings/Options/Password.php b/vendor/rrze/wp/src/Settings/Options/Password.php deleted file mode 100644 index 780e3803..00000000 --- a/vendor/rrze/wp/src/Settings/Options/Password.php +++ /dev/null @@ -1,8 +0,0 @@ -addTab(__('General', 'textdomain')); - -$section = $tab->addSection('General Section'); - -$section->addOption('text', [ - 'name' => 'title', - 'label' => __('Title', 'textdomain') -]); - -$settings->build(); -``` - -### Initializing the Settings class - -```php -use RRZE\WP\Settings; - -$settings = new Settings(__('Custom Settings')); -``` - -The constructor supports two parameters, namely `$title` and `$slug`. By default, the page slug is generated by sanitizing the title. However, if you have a specific slug preference, you can pass it as the second parameter to the constructor. - -Additional methods available in this class include: - -```php -$settings->setCapability('manage_options') - ->setOptionName('my_plugin_option') - ->setMenuTitle(__('My Plugin', 'textdomain')) - ->setMenuIcon('dashicons-admin-generic') - ->setMenuPosition(5) - ->setMenuParentSlug('options-general.php'); -``` - -### Tabs - -Tabs will be displayed only if there is more than one tab available. - -```php -$settings->addTab(__('General', 'textdomain')); -``` diff --git a/vendor/rrze/wp/src/Settings/Section.php b/vendor/rrze/wp/src/Settings/Section.php deleted file mode 100644 index cffd67a7..00000000 --- a/vendor/rrze/wp/src/Settings/Section.php +++ /dev/null @@ -1,41 +0,0 @@ -tab = $tab; - $this->title = $title; - $this->args = $args; - $this->slug = $this->args['slug'] ?? sanitize_title($title); - $this->description = $this->args['description'] ?? null; - $this->as_link = $this->args['as_link'] ?? false; - } - - public function addOption($type, $args = []) - { - $option = new Option($this, $type, $args); - - $this->options[] = $option; - - return $option; - } -} diff --git a/vendor/rrze/wp/src/Settings/Settings.php b/vendor/rrze/wp/src/Settings/Settings.php deleted file mode 100644 index ba5b8641..00000000 --- a/vendor/rrze/wp/src/Settings/Settings.php +++ /dev/null @@ -1,314 +0,0 @@ -loadTextdomain(); - - $this->title = $title; - $this->optionName = strtolower(str_replace('-', '_', sanitize_title($this->title))); - $this->slug = $slug; - - if ($this->slug === null) { - $this->slug = sanitize_title($title); - } - } - - public function loadTextdomain() - { - $mofile = dirname(__FILE__) . '/languages/rrze-wp-settings-' . get_locale() . '.mo'; - load_textdomain('rrze-wp-settings', $mofile); - } - - public function setMenuParentSlug($slug) - { - $this->parentSlug = $slug; - return $this; - } - - public function setMenuTitle($title) - { - $this->menuTitle = $title; - return $this; - } - - public function getMenuTitle() - { - return $this->menuTitle ?? $this->title; - } - - public function setCapability($capability) - { - $this->capability = $capability; - return $this; - } - - public function setOptionName($name) - { - $this->optionName = $name; - return $this; - } - - public function setMenuIcon($icon) - { - $this->menuIcon = $icon; - return $this; - } - - public function setMenuPosition($position) - { - $this->menuPosition = $position; - return $this; - } - - public function addToMenu() - { - if ($this->parentSlug) { - add_submenu_page($this->parentSlug, $this->title, $this->getMenuTitle(), $this->capability, $this->slug, [$this, 'render'], $this->menuPosition); - } else { - add_menu_page($this->title, $this->getMenuTitle(), $this->capability, $this->slug, [$this, 'render'], $this->menuIcon, $this->menuPosition); - } - } - - public function build() - { - $this->errors = new Error($this); - $this->flash = new Flash($this); - - add_action('admin_init', [$this, 'save'], 20); - add_action('admin_menu', [$this, 'addToMenu'], 20); - add_action('admin_head', [$this, 'styling'], 20); - } - - public function isOnSettingsPage() - { - $screen = get_current_screen(); - if (is_null($screen)) { - return false; - } - - if ($screen->base === 'settings_page_' . $this->slug) { - return true; - } - - return false; - } - - public function styling() - { - if (!$this->isOnSettingsPage()) { - return; - } - - echo ''; - } - - public function getTabBySlug($slug) - { - foreach ($this->tabs as $tab) { - if ($tab->slug === $slug) { - return $tab; - } - } - - return false; - } - - public function getActiveTab() - { - $default = $this->tabs[0] ?? false; - - if (isset($_GET['tab'])) { - return in_array($_GET['tab'], array_map(function ($tab) { - return $tab->slug; - }, $this->tabs)) ? $this->getTabBySlug($_GET['tab']) : $default; - } - - return $default; - } - - public function addTab($title, $slug = null) - { - $tab = new Tab($this, $title, $slug); - - $this->tabs[] = $tab; - - return $tab; - } - - public function addSection($title, $args = []) - { - if (empty($this->tabs)) { - $tab = $this->addTab('Unnamed tab'); - } else { - $tab = end($this->tabs); - } - - return $tab->addSection($title, $args); - } - - public function addOption($type, $args = []) - { - $tab = end($this->tabs); - - if (!$tab instanceof Tab) { - return false; - } - - $section = end($tab->sections); - - if (!$section instanceof Section) { - return false; - } - - return $section->addOption($type, $args); - } - - public function shouldMakeTabs() - { - return count($this->tabs) > 1; - } - - public function getUrl() - { - if ($this->parentSlug && strpos($this->parentSlug, '.php') !== false) { - return add_query_arg('page', $this->slug, admin_url($this->parentSlug)); - } - - return admin_url("admin.php?page=$this->slug"); - } - - public function getFullUrl() - { - $params = []; - - if ($active_tab = $this->getActiveTab()) { - $params['tab'] = $active_tab->slug; - - if ($active_section = $active_tab->getActiveSection()) { - $params['section'] = $active_section->slug; - } - } - - return add_query_arg($params, $this->getUrl()); - } - - public function renderTabMenu() - { - if (!$this->shouldMakeTabs()) { - return; - } - - Template::include('tab-menu', ['settings' => $this]); - } - - public function renderActiveSections() - { - Template::include('sections', ['settings' => $this]); - } - - public function render() - { - Worker::setWorkBuilder(new WorkBuilder); - - do_action('rrze_wp_settings_before_render_settings_page'); - - Worker::enqueue(); - - Template::include('settings-page', ['settings' => $this]); - - do_action('rrze_wp_settings_after_render_settings_page'); - } - - public function defaultOptions() - { - $options = []; - foreach ($this->tabs as $tab) { - foreach ($tab->sections as $section) { - foreach ($section->options as $option) { - $options[$option->args['name']] = $option->args['default'] ?? null; - } - } - } - - return $options; - } - - public function getOptions() - { - $defaults = $this->defaultOptions(); - $options = get_option($this->optionName, []); - $options = wp_parse_args($options, $defaults); - $options = array_intersect_key($options, $defaults); - - return $options; - } - - public function getOption($option) - { - $options = $this->getOptions(); - return $options[$option] ?? null; - } - - public function save() - { - if (!isset($_POST['rrze_wp_settings_save']) || !wp_verify_nonce($_POST['rrze_wp_settings_save'], 'rrze_wp_settings_save_' . $this->optionName)) { - return; - } - - if (!current_user_can($this->capability)) { - wp_die(__("You don't have enough permissions to do that.", 'rrze-wp-settings')); - } - - $currentOptions = $this->getOptions(); - $submittedOptions = apply_filters('rrze_wp_settings_new_options', $_POST[$this->optionName] ?? [], $currentOptions); - $newOptions = $currentOptions; - - foreach ($this->getActiveTab()->getActiveSections() as $section) { - foreach ($section->options as $option) { - $value = $submittedOptions[$option->implementation->getName()] ?? null; - - $valid = $option->validate($value); - - if (!$valid) { - continue; - } - - $value = apply_filters('rrze_wp_settings_new_options_' . $option->implementation->getName(), $option->sanitize($value), $option->implementation); - - $newOptions[$option->implementation->getName()] = $value; - } - } - - update_option($this->optionName, $newOptions); - - $this->flash->set('success', __('Settings saved.', 'rrze-wp-settings')); - } -} diff --git a/vendor/rrze/wp/src/Settings/Tab.php b/vendor/rrze/wp/src/Settings/Tab.php deleted file mode 100644 index cd01364e..00000000 --- a/vendor/rrze/wp/src/Settings/Tab.php +++ /dev/null @@ -1,88 +0,0 @@ -title = $title; - $this->settings = $settings; - - if ($this->slug === null) { - $this->slug = sanitize_title($title); - } - } - - public function addSection($title, $args = []) - { - $section = new Section($this, $title, $args); - - $this->sections[] = $section; - - return $section; - } - - public function getSectionLinks() - { - return array_filter($this->sections, function ($section) { - return $section->as_link; - }); - } - - public function containsOnlySectionLinks() - { - return count($this->getSectionLinks()) === count($this->sections); - } - - public function getSectionByName($name) - { - foreach ($this->sections as $section) { - if ($section->slug == $name) { - return $section; - } - } - - return false; - } - - public function getActiveSection() - { - if (empty($this->getSectionLinks())) { - return; - } - - if (isset($_REQUEST['section'])) { - return $this->getSectionByName($_REQUEST['section']); - } - - if ($this->containsOnlySectionLinks()) { - return $this->sections[0]; - } - } - - public function getActiveSections() - { - if (!isset($_REQUEST['section']) && $this->containsOnlySectionLinks()) { - return [$this->sections[0]]; - } - - return \array_filter($this->sections, function ($section) { - if (isset($_REQUEST['section'])) { - return $section->as_link && $_REQUEST['section'] == $section->slug; - } - - return !$section->as_link; - }); - } -} diff --git a/vendor/rrze/wp/src/Settings/Template.php b/vendor/rrze/wp/src/Settings/Template.php deleted file mode 100644 index 79f9fe56..00000000 --- a/vendor/rrze/wp/src/Settings/Template.php +++ /dev/null @@ -1,27 +0,0 @@ - $value) { - ${$name} = $value; - } - - $full_path = __DIR__ . "/templates/{$file}.php"; - - if (!file_exists($full_path)) { - return; - } - - ob_start(); - - include $full_path; - - echo apply_filters('rrze_wp_settings_template_render', ob_get_clean(), $file, $variables); - } -} diff --git a/vendor/rrze/wp/src/Settings/WorkBuilder.php b/vendor/rrze/wp/src/Settings/WorkBuilder.php deleted file mode 100644 index 2fd5c5df..00000000 --- a/vendor/rrze/wp/src/Settings/WorkBuilder.php +++ /dev/null @@ -1,27 +0,0 @@ -enqueued[$handle] = $callback; - } - - public function remove($handle) - { - unset($this->enqueued[$handle]); - } - - public function enqueue() - { - foreach ($this->enqueued as $enqueue) { - $enqueue(); - } - } -} diff --git a/vendor/rrze/wp/src/Settings/Worker.php b/vendor/rrze/wp/src/Settings/Worker.php deleted file mode 100644 index 1278a07e..00000000 --- a/vendor/rrze/wp/src/Settings/Worker.php +++ /dev/null @@ -1,35 +0,0 @@ -add($handle, $callback); - } - - public function remove($handle) - { - static::builder()->remove($handle); - } - - public static function enqueue() - { - static::builder()->enqueue(); - } -} diff --git a/vendor/rrze/wp/src/Settings/languages/rrze-wp-settings-de_DE.mo b/vendor/rrze/wp/src/Settings/languages/rrze-wp-settings-de_DE.mo deleted file mode 100644 index 8c8dad94..00000000 Binary files a/vendor/rrze/wp/src/Settings/languages/rrze-wp-settings-de_DE.mo and /dev/null differ diff --git a/vendor/rrze/wp/src/Settings/languages/rrze-wp-settings-de_DE.po b/vendor/rrze/wp/src/Settings/languages/rrze-wp-settings-de_DE.po deleted file mode 100644 index 480b2771..00000000 --- a/vendor/rrze/wp/src/Settings/languages/rrze-wp-settings-de_DE.po +++ /dev/null @@ -1,35 +0,0 @@ -msgid "" -msgstr "" -"Project-Id-Version: RRZE\\WP\\Settings\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-23T07:50:21+00:00\n" -"PO-Revision-Date: 2023-06-23 09:50+0200\n" -"Last-Translator: RRZE Webteam \n" -"Language-Team: Deutsch\n" -"Language: de_DE\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;" -"_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;_ex:1,2c;" -"esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;" -"esc_html_x:1,2c\n" -"X-Poedit-Basepath: .\n" -"X-Poedit-SourceCharset: UTF-8\n" -"X-Generator: Poedit 3.3.1\n" -"X-Loco-Version: 2.4.0; wp-5.4.2\n" -"X-Poedit-SearchPath-0: .\n" -"X-Poedit-SearchPath-1: ..\n" - -#: Settings.php:287 -msgid "You don't have enough permissions to do that." -msgstr "Du hast nicht genug Rechte, um das zu tun." - -#: Settings.php:312 -msgid "Settings saved." -msgstr "Die Einstellungen wurden gespeichert." - -#: templates/settings-page.php:18 -msgid "Settings issues detected." -msgstr "Einstellungsprobleme erkannt." diff --git a/vendor/rrze/wp/src/Settings/languages/rrze-wp-settings-de_DE_formal.mo b/vendor/rrze/wp/src/Settings/languages/rrze-wp-settings-de_DE_formal.mo deleted file mode 100644 index 36dc9ffa..00000000 Binary files a/vendor/rrze/wp/src/Settings/languages/rrze-wp-settings-de_DE_formal.mo and /dev/null differ diff --git a/vendor/rrze/wp/src/Settings/languages/rrze-wp-settings-de_DE_formal.po b/vendor/rrze/wp/src/Settings/languages/rrze-wp-settings-de_DE_formal.po deleted file mode 100644 index 611eda8b..00000000 --- a/vendor/rrze/wp/src/Settings/languages/rrze-wp-settings-de_DE_formal.po +++ /dev/null @@ -1,37 +0,0 @@ -msgid "" -msgstr "" -"Project-Id-Version: RRZE\\WP\\Settings\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-06-23T07:50:21+00:00\n" -"PO-Revision-Date: 2023-06-23 09:51+0200\n" -"Last-Translator: RRZE Webteam \n" -"Language-Team: Deutsch (Sie)\n" -"Language: de\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;" -"_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;_ex:1,2c;" -"esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;" -"esc_html_x:1,2c\n" -"X-Poedit-Basepath: .\n" -"X-Poedit-SourceCharset: UTF-8\n" -"X-Generator: Poedit 3.3.1\n" -"X-Loco-Version: 2.4.0; wp-5.4.2\n" -"X-Loco-Template: languages/rrze-private-site-de_DE.po\n" -"X-Poedit-SearchPath-0: .\n" -"X-Poedit-SearchPath-1: ..\n" - -#: Settings.php:287 -msgid "You don't have enough permissions to do that." -msgstr "" -"Sie verfügen nicht über die erforderlichen Berechtigungen, um dies zu tun." - -#: Settings.php:312 -msgid "Settings saved." -msgstr "Die Einstellungen wurden gespeichert." - -#: templates/settings-page.php:18 -msgid "Settings issues detected." -msgstr "Einstellungsprobleme erkannt." diff --git a/vendor/rrze/wp/src/Settings/templates/options/checkbox.php b/vendor/rrze/wp/src/Settings/templates/options/checkbox.php deleted file mode 100644 index 819ddb6b..00000000 --- a/vendor/rrze/wp/src/Settings/templates/options/checkbox.php +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - hasError()) { ?> -
- - - \ No newline at end of file diff --git a/vendor/rrze/wp/src/Settings/templates/options/choices.php b/vendor/rrze/wp/src/Settings/templates/options/choices.php deleted file mode 100644 index e7ee472b..00000000 --- a/vendor/rrze/wp/src/Settings/templates/options/choices.php +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - getArg('options', []) as $key => $label) { ?> -
- -
- - getArg('description')) { ?> -

- - hasError()) { ?> -
- - - \ No newline at end of file diff --git a/vendor/rrze/wp/src/Settings/templates/options/code-editor.php b/vendor/rrze/wp/src/Settings/templates/options/code-editor.php deleted file mode 100644 index 457fe3b9..00000000 --- a/vendor/rrze/wp/src/Settings/templates/options/code-editor.php +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - getArg('description')) { ?> -

- - hasError()) { ?> -
- - - \ No newline at end of file diff --git a/vendor/rrze/wp/src/Settings/templates/options/color.php b/vendor/rrze/wp/src/Settings/templates/options/color.php deleted file mode 100644 index 93377856..00000000 --- a/vendor/rrze/wp/src/Settings/templates/options/color.php +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - getArg('description')) { ?> -

- - hasError()) { ?> -
- - - \ No newline at end of file diff --git a/vendor/rrze/wp/src/Settings/templates/options/password.php b/vendor/rrze/wp/src/Settings/templates/options/password.php deleted file mode 100644 index 46115353..00000000 --- a/vendor/rrze/wp/src/Settings/templates/options/password.php +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - getArg('description')) { ?> -

- - hasError()) { ?> -
- - - \ No newline at end of file diff --git a/vendor/rrze/wp/src/Settings/templates/options/select-multiple.php b/vendor/rrze/wp/src/Settings/templates/options/select-multiple.php deleted file mode 100644 index 6a6f5fd1..00000000 --- a/vendor/rrze/wp/src/Settings/templates/options/select-multiple.php +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - getArg('description')) { ?> -

- - - hasError()) { ?> -
- - - \ No newline at end of file diff --git a/vendor/rrze/wp/src/Settings/templates/options/select.php b/vendor/rrze/wp/src/Settings/templates/options/select.php deleted file mode 100644 index 7435fbed..00000000 --- a/vendor/rrze/wp/src/Settings/templates/options/select.php +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - getArg('description')) { ?> -

- - hasError()) { ?> -
- - - \ No newline at end of file diff --git a/vendor/rrze/wp/src/Settings/templates/options/text.php b/vendor/rrze/wp/src/Settings/templates/options/text.php deleted file mode 100644 index 434ab7ab..00000000 --- a/vendor/rrze/wp/src/Settings/templates/options/text.php +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - getArg('description')) { ?> -

- - hasError()) { ?> -
- - - \ No newline at end of file diff --git a/vendor/rrze/wp/src/Settings/templates/options/textarea.php b/vendor/rrze/wp/src/Settings/templates/options/textarea.php deleted file mode 100644 index bb266b80..00000000 --- a/vendor/rrze/wp/src/Settings/templates/options/textarea.php +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - getArg('description')) { ?> -

- - hasError()) { ?> -
- - - \ No newline at end of file diff --git a/vendor/rrze/wp/src/Settings/templates/options/wp-editor.php b/vendor/rrze/wp/src/Settings/templates/options/wp-editor.php deleted file mode 100644 index 3141d761..00000000 --- a/vendor/rrze/wp/src/Settings/templates/options/wp-editor.php +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - getValueAttribute(), $option->getIdAttribute(), [ - 'textarea_name' => $option->getNameAttribute(), - 'wpautop' => $option->getArg('wpautop', true), - 'teeny' => $option->getArg('teeny', false), - 'media_buttons' => $option->getArg('media_buttons', true), - 'default_editor' => $option->getArg('default_editor'), - 'drag_drop_upload' => $option->getArg('drag_drop_upload', false), - 'textarea_rows' => $option->getArg('textarea_rows', 10), - 'tabindex' => $option->getArg('tabindex'), - 'tabfocus_elements' => $option->getArg('tabfocus_elements'), - 'editor_css' => $option->getArg('editor_css'), - 'editor_class' => $option->getArg('editor_class'), - 'tinymce' => $option->getArg('tinymce', true), - 'quicktags' => $option->getArg('quicktags', true) - ]); ?> - getArg('description')) { ?> -

- - hasError()) { ?> -
- - - \ No newline at end of file diff --git a/vendor/rrze/wp/src/Settings/templates/section-menu.php b/vendor/rrze/wp/src/Settings/templates/section-menu.php deleted file mode 100644 index ac4921bf..00000000 --- a/vendor/rrze/wp/src/Settings/templates/section-menu.php +++ /dev/null @@ -1,13 +0,0 @@ - -getActiveTab()->getSectionLinks()) { ?> - - \ No newline at end of file diff --git a/vendor/rrze/wp/src/Settings/templates/section.php b/vendor/rrze/wp/src/Settings/templates/section.php deleted file mode 100644 index 999aef83..00000000 --- a/vendor/rrze/wp/src/Settings/templates/section.php +++ /dev/null @@ -1,19 +0,0 @@ - -

title; ?>

- -description) { ?> -
description; ?>
- - - - - options as $option) { ?> - render(); ?> - - -
\ No newline at end of file diff --git a/vendor/rrze/wp/src/Settings/templates/sections.php b/vendor/rrze/wp/src/Settings/templates/sections.php deleted file mode 100644 index 18c4239f..00000000 --- a/vendor/rrze/wp/src/Settings/templates/sections.php +++ /dev/null @@ -1,17 +0,0 @@ - -
- - - getActiveTab()->getActiveSections() as $section) { ?> - - - - optionName, 'rrze_wp_settings_save'); ?> - - -
\ No newline at end of file diff --git a/vendor/rrze/wp/src/Settings/templates/settings-page.php b/vendor/rrze/wp/src/Settings/templates/settings-page.php deleted file mode 100644 index 0c73b62e..00000000 --- a/vendor/rrze/wp/src/Settings/templates/settings-page.php +++ /dev/null @@ -1,25 +0,0 @@ - -
-

title; ?>

- - flash->has()) { ?> -
-

-
- - - errors->getAll()) { ?> -
-

-
- - - renderTabMenu(); ?> - - renderActiveSections(); ?> -
\ No newline at end of file diff --git a/vendor/rrze/wp/src/Settings/templates/tab-menu.php b/vendor/rrze/wp/src/Settings/templates/tab-menu.php deleted file mode 100644 index 4c343fc9..00000000 --- a/vendor/rrze/wp/src/Settings/templates/tab-menu.php +++ /dev/null @@ -1,11 +0,0 @@ - - \ No newline at end of file