[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb: [1818] trunk



Revision: 1818
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=1818&view=rev
Author:   tetragon
Date:     2007-10-24 17:14:07 -0700 (Wed, 24 Oct 2007)

Log Message:
-----------
Convert company_logo to template

Modified Paths:
--------------
    trunk/bin/am.pl

Added Paths:
-----------
    trunk/UI/am-company-logo.html

Added: trunk/UI/am-company-logo.html
===================================================================
--- trunk/UI/am-company-logo.html	                        (rev 0)
+++ trunk/UI/am-company-logo.html	2007-10-25 00:14:07 UTC (rev 1818)
@@ -0,0 +1,26 @@
+<?lsmb INCLUDE 'ui-header.html' ?> 
+<?lsmb PROCESS elements.html ?> 
+<body>
+<center>
+<a href="http://www.ledgersmb.org"; target="_blank"><img src="images/ledgersmb.png" width="200" height="100" border="0" alt="LedgerSMB Logo" /></a>
+<h1 class="login"><?lsmb text('Version [_1]', form.version) ?></h1>
+<p><?lsmb text('Company: [_1]', user.company) ?><br />
+<?lsmb user.address.replace('&lt;br&gt;', '<br />') ?></p>
+
+<table border="0">
+  <tr>
+    <th align="right"><?lsmb text('User') ?></th>
+    <td><?lsmb user.name ?></td>
+  </tr>
+  <tr>
+    <th align="right"><?lsmb text('Dataset') ?></th>
+    <td><?lsmb user.dbname ?></td>
+  </tr>
+  <tr>
+    <th align="right"><?lsmb text('Database Host') ?></th>
+    <td><?lsmb user.dbhost ?></td>
+  </tr>
+</table>
+</center>
+</body>
+</html>

Modified: trunk/bin/am.pl
===================================================================
--- trunk/bin/am.pl	2007-10-25 00:03:28 UTC (rev 1817)
+++ trunk/bin/am.pl	2007-10-25 00:14:07 UTC (rev 1818)
@@ -2209,7 +2209,7 @@
 
 sub company_logo {
 
-    $myconfig{address} =~ s/\\n/<br>/g;
+    $myconfig{address} =~ s/\\n/<br>/g; # Template cleans this up
     $myconfig{dbhost} = $locale->text('localhost') unless $myconfig{dbhost};
 
     $form->{stylesheet} = $myconfig{stylesheet};
@@ -2217,48 +2217,14 @@
     $form->{title} = $locale->text('About');
 
     # create the logo screen
-    $form->header;
-
-    print qq|
-<body>
-
-<pre>
-
-</pre>
-<center>
-<a href="http://www.ledgersmb.org/"; target="_blank"><img src="images/ledgersmb.png" width="200" height="100" border="0" alt="LedgerSMB Logo" /></a>
-<h1 class="login">| . $locale->text('Version') . qq| $form->{version}</h1>
-
-<p>
-|.$locale->text('Company').qq| :
-<p>
-<b>
-$myconfig{company}
-<br>$myconfig{address}
-</b>
-
-<p>
-<table border=0>
-  <tr>
-    <th align="right">| . $locale->text('User') . qq|</th>
-    <td>$myconfig{name}</td>
-  </tr>
-  <tr>
-    <th align="right">| . $locale->text('Dataset') . qq|</th>
-    <td>$myconfig{dbname}</td>
-  </tr>
-  <tr>
-    <th align="right">| . $locale->text('Database Host') . qq|</th>
-    <td>$myconfig{dbhost}</td>
-  </tr>
-</table>
-
-</center>
-
-</body>
-</html>
-|;
-
+    my $template = LedgerSMB::Template->new_UI(
+        user => \%myconfig, 
+        locale => $locale,
+        template => 'am-company-logo');
+    $template->render({
+        form => $form,
+        user => \%myconfig,
+    });
 }
 
 sub recurring_transactions {


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.