[Koha-patches] [PATCH] Bug 8670 - Update POD of C4::Branch::GetBranches() to use TT syntax

Owen Leonard oleonard at myacpl.org
Mon Aug 19 16:58:27 CEST 2013


This patch updates the example template syntax in the POD for
C4::Branch::GetBranches() to use Template Toolkit syntax.

To test, view the POD for C4::Branch::GetBranches() and confirm that it
looks correct.
---
 C4/Branch.pm |   14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/C4/Branch.pm b/C4/Branch.pm
index 8b76771..108f24f 100644
--- a/C4/Branch.pm
+++ b/C4/Branch.pm
@@ -90,11 +90,15 @@ Create a branch selector with the following code.
 
 =head3 in TEMPLATE
 
-    <select name="branch">
-        <option value="">Default</option>
-        <!-- TMPL_LOOP name="branchloop" -->
-        <option value="<!-- TMPL_VAR name="value" -->" <!-- TMPL_IF name="selected" -->selected<!-- /TMPL_IF -->><!-- TMPL_VAR name="branchname" --></option>
-        <!-- /TMPL_LOOP -->
+    <select name="branch" id="branch">
+        <option value=""></option>
+            [% FOREACH branchloo IN branchloop %]
+                [% IF ( branchloo.selected ) %]
+                    <option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>
+                [% ELSE %]
+                    <option value="[% branchloo.value %]" >[% branchloo.branchname %]</option>
+                [% END %]
+            [% END %]
     </select>
 
 =head4 Note that you often will want to just use GetBranchesLoop, for exactly the example above.
-- 
1.7.9.5


More information about the Koha-patches mailing list