From 8926e6618dded0cc101a2584d7825f06392693c0 Mon Sep 17 00:00:00 2001 From: Gabriel Peleskei Date: Wed, 19 Jul 2023 10:56:36 +0000 Subject: [PATCH] Finalized module for smarty, added more blocks in templates --- CHANGELOG.md | 4 ++ README.md | 7 +- docs/README.txt | 36 ---------- metadata.php | 10 +++ .../{block => blocks}/oe_captcha_form.tpl | 0 views/smarty/tpl/include/oe_captcha.tpl | 63 ++++++++++++----- views/twig/oe_captcha.html.twig | 69 ++++++++++++------- 7 files changed, 110 insertions(+), 79 deletions(-) delete mode 100755 docs/README.txt rename views/smarty/{block => blocks}/oe_captcha_form.tpl (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index f532d8b..67ffc35 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Removed - Suggest dropped out +- /docs folder (no relevant information) + +### Deprecated +- Tests won't work for this release and should be updated in the future. ## [2.0.4] - 22 Oct 2021 diff --git a/README.md b/README.md index 98bfc8c..3922987 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,8 @@ can submit the following forms: - contact - invite - pricealarm (not bound in twig) + - newsletter (not bound in twig) + - forgotpwd (not bound in twig) The captcha module then validates the submitted value against the expected one and then decides whether to process the request (e.g. send contact mail to shop administrator) or refuse and show an error message instead. @@ -41,8 +43,6 @@ And install module: ```bash composer require oxid-projects/captcha-module vendor/bin/oe-console oe:module:install source/modules/oe/captcha -# And activate -vendor/bin/oe-console oe:module:activate oecaptcha ``` ## Activate Module @@ -51,6 +51,7 @@ vendor/bin/oe-console oe:module:activate oecaptcha - Or use console ```bash vendor/bin/oe-console oe:module:activate oecaptcha +vendor/bin/oe-console oe:cache:clear ``` ## Uninstall @@ -62,10 +63,12 @@ vendor/bin/oe-console oe:module:deactivate oecaptcha If installed over composer (packagist): ```bash composer remove oxid-projects/captcha-module +vendor/bin/oe-console oe:cache:clear ``` else if cloned: ```bash vendor/bin/oe-console oe:module:uninstall oecaptcha +vendor/bin/oe-console oe:cache:clear composer remove oxid-projects/captcha-module composer config --unset repositories.oxid-projects/captcha-module # and remove the source itself diff --git a/docs/README.txt b/docs/README.txt deleted file mode 100755 index 5400211..0000000 --- a/docs/README.txt +++ /dev/null @@ -1,36 +0,0 @@ -==Title== -OE Captcha - -==Author== -OXID eSales AG - -==Prefix== -oe - -==Shop Version== -6.x - -==Version== -1.0.0 - -==Link== -http://www.oxid-esales.com/ - -==Mail== - - -==Description== -OE Captcha Module - -==Installation== -Activate the module in administration area. - -==Extend== - - -==Modules== - -==Modified original templates== - -==Uninstall== -Disable the module in administration area and delete module folder. diff --git a/metadata.php b/metadata.php index 1146a10..7c8f446 100755 --- a/metadata.php +++ b/metadata.php @@ -73,6 +73,16 @@ $aModule = [ 'block' => 'captcha_form', 'file' => 'views/smarty/blocks/oe_captcha_form.tpl', ], + [ + 'template' => 'form/newsletter.tpl', + 'block' => 'captcha_form', + 'file' => 'views/smarty/blocks/oe_captcha_form.tpl', + ], + [ + 'template' => 'form/forgotpwd_email.tpl', + 'block' => 'captcha_form', + 'file' => 'views/smarty/blocks/oe_captcha_form.tpl', + ], ], 'settings' => [ [ diff --git a/views/smarty/block/oe_captcha_form.tpl b/views/smarty/blocks/oe_captcha_form.tpl similarity index 100% rename from views/smarty/block/oe_captcha_form.tpl rename to views/smarty/blocks/oe_captcha_form.tpl diff --git a/views/smarty/tpl/include/oe_captcha.tpl b/views/smarty/tpl/include/oe_captcha.tpl index e7c5c06..3c13fe4 100644 --- a/views/smarty/tpl/include/oe_captcha.tpl +++ b/views/smarty/tpl/include/oe_captcha.tpl @@ -1,20 +1,47 @@ -[{assign var="oCaptcha" value=$oView->getOeCaptcha()}] - +[{assign var="oCaptcha" value=$oView->getCaptcha()}] +[{block name="body"}] + [{block name="style"}] + + [{/block}] -
- + [{block name="hidden"}] + + [{/block}] -
-
- - [{if $oCaptcha->isImageVisible()}] - - [{else}] - [{$oCaptcha->getText()}] - [{/if}] - - -
-
-
\ No newline at end of file + [{block name="form_group"}] +
+ [{block name="label"}] + + [{/block}] + + [{block name="input_control"}] +
+ [{block name="input_group"}] +
+ [{block name="image_group"}] + + [{if $oCaptcha->isImageVisible()}] + [{block name="image_visible"}] + + [{/block}] + [{else}] + [{block name="image_hidden"}] + [{$oCaptcha->getText()}] + [{/block}] + [{/if}] + + [{/block}] + [{block name="input"}] + + [{/block}] +
+ [{/block}] +
+ [{/block}] +
+ [{/block}] +[{/block}] \ No newline at end of file diff --git a/views/twig/oe_captcha.html.twig b/views/twig/oe_captcha.html.twig index 0bccbc6..528974d 100644 --- a/views/twig/oe_captcha.html.twig +++ b/views/twig/oe_captcha.html.twig @@ -1,26 +1,49 @@ {% set oCaptcha = oView.getCaptcha() %} - -{% block style %} - -{% endblock %} -
- +{% block body %} + {% block style %} + + {% endblock %} + + {% block hidden %} + + {% endblock %} + + {% block form_group %} +
+ {% block label %} + + {% endblock %} -
-
- - {% if oCaptcha.isImageVisible() %} - - {% else %} - {{ oCaptcha.getText() }} - {% endif %} - - -
+ {% block input_control %} +
+ {% block input_group %} +
+ {% block image_group %} + + {% if oCaptcha.isImageVisible() %} + {% block image_visible %} + + {% endblock %} + {% else %} + {% block image_hidden %} + {{ oCaptcha.getText() }} + {% endblock %} + {% endif %} + + {% endblock %} + + {% block input %} + + {% endblock %} +
+ {% endblock %} +
+ {% endblock %}
-
\ No newline at end of file + {% endblock %} +{% endblock %} \ No newline at end of file