Skip to content

Commit

Permalink
OXDEV-8462 Add smarty admin template and extension
Browse files Browse the repository at this point in the history
  • Loading branch information
TitaKoleva committed Jul 12, 2024
1 parent fec7b49 commit cdd8779
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 2 deletions.
6 changes: 6 additions & 0 deletions metadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
],
'templates' => [
'@oe_moduletemplate/templates/greetingtemplate.tpl' => 'views/smarty/templates/greetingtemplate.tpl',
'@oe_moduletemplate/templates/admin/user_greetings.tpl' => 'views/smarty/templates/admin/user_greetings.tpl',
],
'events' => [
'onActivate' => '\OxidEsales\ModuleTemplate\Core\ModuleEvents::onActivate',
Expand All @@ -44,6 +45,11 @@
'template' => 'page/shop/start.tpl',
'block' => 'start_welcome_text',
'file' => 'views/smarty/blocks/oemt_start_welcome_text.tpl'
],
[
'template' => 'user_main.tpl',
'block' => 'admin_user_main_form',
'file' => 'views/smarty/blocks/admin/admin_user_main_form.tpl'
]
],
'settings' => [
Expand Down
11 changes: 11 additions & 0 deletions views/smarty/blocks/admin/admin_user_main_form.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<tr>
<td class="edittext" style="color: red">
[{oxmultilang ident="OEMODULETEMPLATE_ALLOW_GREETING"}]
</td>
<td class="edittext">
<input type="checkbox" name="editval[oxuser__oxactivegreeting]" class="edittext" value='1'>
[{oxinputhelp ident="OEMODULETEMPLATE_HELP_ALLOW_GREETING"}]
</td>
</tr>

[{$smarty.block.parent}]
18 changes: 18 additions & 0 deletions views/smarty/templates/admin/user_greetings.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[{include file="headitem.tpl" title="GENERAL_ADMIN_TITLE"|oxmultilangassign box="list"}]

<form action="[{$oViewConf->getSelfLink()}]" method="post">
[{$oViewConf->getHiddenSid()}]
<input type="hidden" name="oxid" value="[{$oxid}]">
<input type="hidden" name="cl" value="oemt_admin_greeting">
</form>

<h1 class="page-header">[{oxmultilang ident="OEMODULETEMPLATE_GREETING_TITLE"}]</h1>

[{if $greeting_message}]
<div>[{oxmultilang ident="OEMODULETEMPLATE_GREETING_MESSAGE_TEXT"}] [{$greeting_message}]</div>
[{else}]
<div>[{oxmultilang ident="OEMODULETEMPLATE_NO_GREETING_TEXT"}]</div>
[{/if}]

[{include file="bottomnaviitem.tpl"}]
[{include file="bottomitem.tpl"}]
3 changes: 1 addition & 2 deletions views/twig/admin/user_greetings.html.twig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% include "headitem.html.twig" with {title: "GENERAL_ADMIN_TITLE"|translate} %}

<form name="transfer" id="transfer" action="{{ oViewConf.getSelfLink() }}" method="post">
<form action="{{ oViewConf.getSelfLink() }}" method="post">
{{ oViewConf.getHiddenSid()|raw }}
<input type="hidden" name="oxid" value="{{ oxid }}">
<input type="hidden" name="cl" value="oemt_admin_greeting">
Expand All @@ -14,6 +14,5 @@
<div>{{ translate({ ident: "OEMODULETEMPLATE_NO_GREETING_TEXT" }) }}</div>
{% endif %}


{% include "bottomnaviitem.html.twig" %}
{% include "bottomitem.html.twig" %}

0 comments on commit cdd8779

Please sign in to comment.