diff --git a/composer.json b/composer.json index 65f9241..4f5c004 100755 --- a/composer.json +++ b/composer.json @@ -3,8 +3,9 @@ "description": "Extend Nette Forms for WordPress use.", "require": { "ext-json": "*", - "php": ">=8.0", - "nette/forms": "^3.0" + "php": ">=7.2", + "nette/forms": "^3.0", + "nette/utils": "^3.2" }, "autoload": { "psr-4": { diff --git a/composer.lock b/composer.lock index 9d89da7..b7c7bc6 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "c4a12e674512f4d7b123016180a2bc3c", + "content-hash": "33ce8b6a8e5ed970bf7026e25081f406", "packages": [ { "name": "nette/component-model", @@ -222,30 +222,29 @@ }, { "name": "nette/utils", - "version": "v4.0.0", + "version": "v3.2.10", "source": { "type": "git", "url": "https://github.com/nette/utils.git", - "reference": "cacdbf5a91a657ede665c541eda28941d4b09c1e" + "reference": "a4175c62652f2300c8017fb7e640f9ccb11648d2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nette/utils/zipball/cacdbf5a91a657ede665c541eda28941d4b09c1e", - "reference": "cacdbf5a91a657ede665c541eda28941d4b09c1e", + "url": "https://api.github.com/repos/nette/utils/zipball/a4175c62652f2300c8017fb7e640f9ccb11648d2", + "reference": "a4175c62652f2300c8017fb7e640f9ccb11648d2", "shasum": "" }, "require": { - "php": ">=8.0 <8.3" + "php": ">=7.2 <8.4" }, "conflict": { - "nette/finder": "<3", - "nette/schema": "<1.2.2" + "nette/di": "<3.0.6" }, "require-dev": { "jetbrains/phpstorm-attributes": "dev-master", - "nette/tester": "^2.4", + "nette/tester": "~2.0", "phpstan/phpstan": "^1.0", - "tracy/tracy": "^2.9" + "tracy/tracy": "^2.3" }, "suggest": { "ext-gd": "to use Image", @@ -259,7 +258,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "3.2-dev" } }, "autoload": { @@ -303,9 +302,9 @@ ], "support": { "issues": "https://github.com/nette/utils/issues", - "source": "https://github.com/nette/utils/tree/v4.0.0" + "source": "https://github.com/nette/utils/tree/v3.2.10" }, - "time": "2023-02-02T10:41:53+00:00" + "time": "2023-07-30T15:38:18+00:00" } ], "packages-dev": [], @@ -316,7 +315,7 @@ "prefer-lowest": false, "platform": { "ext-json": "*", - "php": ">=8.0" + "php": ">=7.2" }, "platform-dev": [], "plugin-api-version": "2.3.0" diff --git a/src/Controls/ChosenInput.php b/src/Controls/ChosenInput.php index 11f6a8e..323651e 100644 --- a/src/Controls/ChosenInput.php +++ b/src/Controls/ChosenInput.php @@ -30,8 +30,6 @@ public function getControl(): Html { $el = parent::getControl(); - - $id = $this->getHtmlId(); $settings = $this->settings; $settings_default = [ diff --git a/src/Controls/CloneInput.php b/src/Controls/CloneInput.php index 19e7d95..1654bc8 100644 --- a/src/Controls/CloneInput.php +++ b/src/Controls/CloneInput.php @@ -115,7 +115,7 @@ public function getControl(): Html }); '; - return Html::fromHtml( $html .$add_button . $scripts ); + return Html::fromHtml( $html .$add_button . $scripts )->setName('div'); } diff --git a/src/Controls/TextEditor.php b/src/Controls/TextEditor.php index 868e20f..6fcd101 100644 --- a/src/Controls/TextEditor.php +++ b/src/Controls/TextEditor.php @@ -21,10 +21,9 @@ public function __construct( $label = null, array $settings = null ) { parent::__construct( $label ); $this->settings = (array) $settings; - $this->setOption( 'type', 'editor' ); + $this->setOption( 'type', 'wp_editor' ); } - /** * 生成控件 HTML 内容 * @@ -53,6 +52,6 @@ public function getControl(): Html { $html = ob_get_contents(); ob_end_clean(); - return Html::fromHtml( $html ); + return Html::fromHtml( $html )->setName('div'); } } diff --git a/src/Translator/DefaultTranslator.php b/src/Translator/DefaultTranslator.php index 0805664..b2264a9 100644 --- a/src/Translator/DefaultTranslator.php +++ b/src/Translator/DefaultTranslator.php @@ -15,7 +15,7 @@ class DefaultTranslator implements Translator * * @usage: Translator($message); */ - public function translate(string|\Stringable $message, mixed ...$parameters): string|\Stringable + public function translate($message, ...$parameters): string { return __($message, 'wprs'); }