am/form_footer auf template umgeschrieben
authorSven Schöling <s.schoeling@linet-services.de>
Fri, 20 Jan 2012 19:46:32 +0000 (20:46 +0100)
committerSven Schöling <s.schoeling@linet-services.de>
Fri, 20 Jan 2012 19:46:32 +0000 (20:46 +0100)
bin/mozilla/am.pl
templates/webpages/am/form_footer.html [new file with mode: 0644]

index f28fa52..e24e7c2 100644 (file)
@@ -366,44 +366,18 @@ sub account_header {
 }
 
 sub form_footer {
-  $main::lxdebug->enter_sub();
-
-  my $form     = $main::form;
-  my $locale   = $main::locale;
-
-  $main::auth->assert('config');
-
-  print qq|
-
-<input name=callback type=hidden value="| . H($form->{callback}) . qq|">
-
-<br>|;
-  if ((!$form->{id}) || ($form->{id} && $form->{orphaned}) || (($form->{type} eq "account") && (!$form->{new_chart_valid}))) {
-    print qq|
-<input type=submit class=submit name=action value="|
-    . $locale->text('Save') . qq|">
-|;
-}
-
-  if ($form->{id} && $form->{orphaned}) {
-    print qq|<input type=submit class=submit name=action value="|
-      . $locale->text('Delete') . qq|">|;
-  }
-
-  if ($form->{id} && $form->{type} eq "account") {
-    print qq|
-    <input class=submit type=submit name=action value="|
-      . $locale->text('Save as new') . qq|">|;
-  }
-
-  print qq|
-</form>
+  $::lxdebug->enter_sub;
+  $::auth->assert('config');
 
-</body>
-</html>
-|;
+  print $::form->parse_html_template('am/form_footer', {
+    show_save        => !$::form->{id}
+                     || ($::form->{id} && $::form->{orphaned})
+                     || ($::form->{type} eq "account" && !$::form->{new_chart_valid}),
+    show_delete      => $::form->{id} && $::form->{orphaned},
+    show_save_as_new => $::form->{id} && $::form->{type} eq "account",
+  });
 
-  $main::lxdebug->leave_sub();
+  $::lxdebug->leave_sub;
 }
 
 sub save_account {
diff --git a/templates/webpages/am/form_footer.html b/templates/webpages/am/form_footer.html
new file mode 100644 (file)
index 0000000..99bfdf3
--- /dev/null
@@ -0,0 +1,15 @@
+[%- USE T8 %]
+[%- USE L %]
+[%- USE HTML %]
+[%- USE LxERP %]
+[% L.hidden_tag('callback', callback) %]
+
+<br>
+[%- IF show_save %][% L.submit_tag('action', LxERP.t8('Save')) %][% END %]
+[%- IF show_delete %][% L.submit_tag('action', LxERP.t8('Delete')) %][% END %]
+[%- IF show_save_as_new %][% L.submit_tag('action', LxERP.t8('Save as new')) %][% END %]
+
+</form>
+
+</body>
+</html>