From e63f6ceda8b046394c2d27138ef74a9545110ee7 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Wed, 25 Jun 2008 16:04:38 -0400 Subject: [PATCH] Convert template conditionals to be actual PHP if statements --- templates/bugfield_input_checkbox.tpl | 2 +- templates/bugfield_input_text.tpl | 2 +- templates/editattach.tpl | 4 +- templates/editcomment.tpl | 8 +-- templates/explain_product.tpl | 4 +- templates/favorites.tpl | 4 +- templates/header.tpl | 24 +++---- templates/history_bit.tpl | 6 +- templates/lostpassword.tpl | 2 +- templates/newattach.tpl | 12 ++-- templates/newreport.tpl | 26 +++---- templates/pagenav.tpl | 8 +-- templates/pagenav_bit.tpl | 2 +- templates/passwordreset.tpl | 4 +- templates/quicksearch.tpl | 4 +- templates/register.tpl | 6 +- templates/search.tpl | 8 +-- templates/search_results.tpl | 12 ++-- templates/search_save.tpl | 4 +- templates/search_update.tpl | 4 +- templates/selectoption.tpl | 2 +- templates/showreport.tpl | 98 +++++++++++++-------------- templates/showreport_attachment.tpl | 4 +- templates/showreport_comment.tpl | 8 +-- templates/std_message.tpl | 16 ++--- templates/trackerhome_bits.tpl | 2 +- templates/userctrl.tpl | 22 +++--- templates/username_display.tpl | 2 +- 28 files changed, 150 insertions(+), 150 deletions(-) diff --git a/templates/bugfield_input_checkbox.tpl b/templates/bugfield_input_checkbox.tpl index 88aa131..9953b69 100644 --- a/templates/bugfield_input_checkbox.tpl +++ b/templates/bugfield_input_checkbox.tpl @@ -1,6 +1,6 @@
<%- $field[name] %> <%- $help['field' . $field['fieldid']] %> -
/>
+
<% if ($searchMode): %><% else: %> /><% endif %>
\ No newline at end of file diff --git a/templates/bugfield_input_text.tpl b/templates/bugfield_input_text.tpl index b7f26d7..7a1895f 100644 --- a/templates/bugfield_input_text.tpl +++ b/templates/bugfield_input_text.tpl @@ -1,6 +1,6 @@
<%- $field['name'] %> <%- $help['field' . $field['fieldid']] %> -
maxlength="<%- $field['maxlength'] %>" />
+
maxlength="<%- $field['maxlength'] %>"<% endif %> />
diff --git a/templates/editattach.tpl b/templates/editattach.tpl index 9335e4e..beb92d5 100644 --- a/templates/editattach.tpl +++ b/templates/editattach.tpl @@ -26,7 +26,7 @@
{@"Description"}:
-
{@"Obsolete"}: checked="checked" />
+
{@"Obsolete"}: checked="checked"<% endif %> />
@@ -34,7 +34,7 @@
- + <% if ($show['delete']): %><% endif %>
diff --git a/templates/editcomment.tpl b/templates/editcomment.tpl index 62d2332..1270f6c 100644 --- a/templates/editcomment.tpl +++ b/templates/editcomment.tpl @@ -10,12 +10,12 @@ $header - +<% if ($show['errors']): %>
{@"The following errors occurred"}: <%- $message->errorBox %>
-
+<% endif %>
@@ -29,8 +29,8 @@ $header
{@"Posted on %1$s by %2$s"}
-
style="color: red">{@"Hidden"}: checked="checked" />
-
{@"Parse Links in the Comment"}: checked="checked" />
+ <% if ($show['hide']): %>
style="color: red"<% endif %>>{@"Hidden"}: checked="checked"<% endif %> />
<% endif %> +
{@"Parse Links in the Comment"}: checked="checked"<% endif %> />
diff --git a/templates/explain_product.tpl b/templates/explain_product.tpl index 3741601..9c33fac 100644 --- a/templates/explain_product.tpl +++ b/templates/explain_product.tpl @@ -11,7 +11,7 @@

{@"Explication of Products"}

- +<% if ($globalversions): %> @@ -21,7 +21,7 @@ <%- $globalversions %>
{@"Global Versions"}
-
+<% endif %>
diff --git a/templates/favorites.tpl b/templates/favorites.tpl index 2388ec6..6c24b08 100644 --- a/templates/favorites.tpl +++ b/templates/favorites.tpl @@ -16,12 +16,12 @@ <%- $bugs %> - +<% if ($show['pagenav']): %>
<%- $pagenav %>
-
+<% endif %> <%- $footer %> \ No newline at end of file diff --git a/templates/header.tpl b/templates/header.tpl index 62162a4..816537d 100644 --- a/templates/header.tpl +++ b/templates/header.tpl @@ -16,29 +16,29 @@
{@"Hello, guest. We have noticed that you are not registered at this bug tracker. Your experience will be greatly enhanced if you log in. To do so, you first must register by clicking on the Register tab at the top. If you are already registered, you can login at the Login tab."}
- +<% endif %>
{@ {@"Syndicate"} {@"Listing"} - + <% if ($show['newreport']): %> {@"New"} - + <% endif %> {@"Display"} - + <% if ($show['search']): %> {@"Search"} - - + <% endif %> + <% if (bugdar::$userinfo['userid']): %> {@"Favorites"} - - userctrl.php">{@"Options"}login.php">{@"Login/Register"} - + <% endif %> + {@"Options"}<% else: %>login.php">{@"Login/Register"}<% endif %> + <% if ($show['admin']): %> {@"Administration"} - - + <% endif %> + <% if (bugdar::$userinfo['userid']): %> {@"Logout"} - + <% endif %>
\ No newline at end of file diff --git a/templates/history_bit.tpl b/templates/history_bit.tpl index 7a5d7cb..ccede12 100644 --- a/templates/history_bit.tpl +++ b/templates/history_bit.tpl @@ -1,6 +1,6 @@ - class="<%- $bgcolor %>"> - <%- $log['user'] %>  - <%- $log['date'] %>  + class="<%- $bgcolor %>"<% endif %>> + <% if ($show['group']): %><%- $log['user'] %><% else: %> <% endif %> + <% if ($show['group']): %><%- $log['date'] %><% else: %> <% endif %> <%- $log['field'] %> <%- $log['original'] %> <%- $log['changed'] %> diff --git a/templates/lostpassword.tpl b/templates/lostpassword.tpl index 48e8845..7922e94 100644 --- a/templates/lostpassword.tpl +++ b/templates/lostpassword.tpl @@ -18,7 +18,7 @@ $header
{@"Lost Password Recovery"}
-
{@"The specified email could not be found or it is invalid."}
+ <% if ($show['lostpwerror']): %>
{@"The specified email could not be found or it is invalid."}
<% endif %>
{@"Enter your email in the box below and you will receive a message with instructions on how to set a new password."}
{@"Email"}:
diff --git a/templates/newattach.tpl b/templates/newattach.tpl index c545dbf..dde552a 100644 --- a/templates/newattach.tpl +++ b/templates/newattach.tpl @@ -10,12 +10,12 @@ $header - +<% if ($show['errors']): %>
{@"The following errors occurred"}: <%- $message->errorBox %>
-
+<% endif %> @@ -31,15 +31,15 @@ $header
{@"Description"}:
- + <% if ($show['obsoletes']): %>
{@"Mark the Following Attachments Obsolete"}: <%- $obsoletes %>
-
+ <% endif %> - + <% if ($show['addcomment']): %>
{@"Add Comment"}:
@@ -47,7 +47,7 @@ $header
-
+ <% endif %>
diff --git a/templates/newreport.tpl b/templates/newreport.tpl index 96a29b3..15d2244 100644 --- a/templates/newreport.tpl +++ b/templates/newreport.tpl @@ -11,12 +11,12 @@ $header - +<% if ($show['errors']): %>
{@"The following errors occurred"}: <%- $message->errorBox %>
-
+<% endif %> @@ -35,18 +35,18 @@ $header
{@"Product/Version"} <%- $help['product'] %> -
+
- + <% if ($show['changestatus']): %>
{@"Status"} <%- $help['status'] %>
-
+ <% endif %>
@@ -70,32 +70,32 @@ $header
- + <% if ($show['assign']): %>
{@"Assignment"} <%- $help['assignedto'] %>
-
+ <% endif %> - + <% if ($show['changestatus']): %>
{@"Resolution"} <%- $help['resolution'] %>
-
+ <% endif %> - + <% if ($show['changestatus']): %>
{@"Priority"} <%- $help['priority'] %>
-
+ <% endif %> <%- $customfields['right'] %> @@ -110,9 +110,9 @@ $header
{@"Description/Initial Report"} - + -
checked="checked" /> {@"Parse Links in the Comment"}
+
checked="checked"<% endif %> /> {@"Parse Links in the Comment"}
diff --git a/templates/pagenav.tpl b/templates/pagenav.tpl index 1894b33..0d08ebb 100644 --- a/templates/pagenav.tpl +++ b/templates/pagenav.tpl @@ -1,7 +1,7 @@
- {@"First"} ... - {@"Prev"} ... + <% if ($show['first']): %>{@"First"} ...<% endif %> + <% if ($show['prev']): %>{@"Prev"} ...<% endif %> $pagebits - ... {@"Next"} - ... {@"Last"} + <% if ($show['next']): %>... {@"Next"}<% endif %> + <% if ($show['last']): %>... {@"Last"}<% endif %>
\ No newline at end of file diff --git a/templates/pagenav_bit.tpl b/templates/pagenav_bit.tpl index cbb24da..9d96fe1 100644 --- a/templates/pagenav_bit.tpl +++ b/templates/pagenav_bit.tpl @@ -1 +1 @@ - <%- $number %><%- $number %> \ No newline at end of file + <% if ($nolink): %><%- $number %><% else: %><%- $number %><% endif %> \ No newline at end of file diff --git a/templates/passwordreset.tpl b/templates/passwordreset.tpl index 68643af..5baaa4e 100644 --- a/templates/passwordreset.tpl +++ b/templates/passwordreset.tpl @@ -14,12 +14,12 @@ - +<% if ($show['errors']): %>
{@"The following errors occurred"}: <%- $message->errorBox %>
-
+<% endif %>
diff --git a/templates/quicksearch.tpl b/templates/quicksearch.tpl index 8114cbf..7e504ad 100644 --- a/templates/quicksearch.tpl +++ b/templates/quicksearch.tpl @@ -15,9 +15,9 @@
{@"Quick Search"}
- + <% if ($error): %>
$error
-
+ <% endif %> diff --git a/templates/register.tpl b/templates/register.tpl index b7bfa15..a16380e 100644 --- a/templates/register.tpl +++ b/templates/register.tpl @@ -10,12 +10,12 @@ $header - +<% if ($show['errors']): %>
{@"The following errors occurred"}: <%- $message->errorBox %>
-
+<% endif %> @@ -30,7 +30,7 @@ $header
{@"Display Name"}:
{@"Password"}:
{@"Confirm Password"}:
-
{@"Show My Email Publicly"}: checked="checked" /> {@"Yes"}
+
{@"Show My Email Publicly"}: checked="checked"<% endif %> /> {@"Yes"}
{@"Language"}:
diff --git a/templates/search.tpl b/templates/search.tpl index 690e125..1096b87 100644 --- a/templates/search.tpl +++ b/templates/search.tpl @@ -11,12 +11,12 @@ <%- $header %> - +<% if ($searches): %> {@"Run Saved Search"}: - +<% endif %>

{@"Any fields left blank or unselected will be excluded from the search query."}

@@ -147,7 +147,7 @@ - + <% if (bugdar::$userinfo['userid']): %>
{@"Favorite"} @@ -160,7 +160,7 @@
- + <% endif %> <%- $customfields['right'] %> diff --git a/templates/search_results.tpl b/templates/search_results.tpl index b5a762b..59e1139 100644 --- a/templates/search_results.tpl +++ b/templates/search_results.tpl @@ -9,11 +9,11 @@ <%- $header %> - +<% if ($show['cached']): %>
{@"This search has been cached for your convenience. You can perform a new search by clicking here."}
{@"Alternatively, you can re-run this search by clicking here."}

-
+<% endif %> @@ -24,16 +24,16 @@
[{@"Export results as XML"}] - [{@"Save Search"}] - [{@"Mass Update Bugs in Result"}] + <% if ($show['save']): %>[{@"Save Search"}]<% endif %> + <% if ($show['update']): %>[{@"Mass Update Bugs in Result"}]<% endif %>
- +<% if ($show['pagenav']): %>
<%- $pagenav %>
-
+<% endif %> <%- $footer %> \ No newline at end of file diff --git a/templates/search_save.tpl b/templates/search_save.tpl index 5ce0709..89fd461 100644 --- a/templates/search_save.tpl +++ b/templates/search_save.tpl @@ -10,12 +10,12 @@ <%- $header %> - +<% if ($show['errors']): %>
{@"The following errors occurred"}: <%- $message->errorBox %>
-
+<% endif %> diff --git a/templates/search_update.tpl b/templates/search_update.tpl index 8f0cded..9be9aa2 100644 --- a/templates/search_update.tpl +++ b/templates/search_update.tpl @@ -71,7 +71,7 @@ - + <% if (bugdar::$userinfo['userid']): %>
{@"Favorite"} @@ -84,7 +84,7 @@
-
+ <% endif %> <%- $customfields[right] %> diff --git a/templates/selectoption.tpl b/templates/selectoption.tpl index 3f01a50..41f43c0 100644 --- a/templates/selectoption.tpl +++ b/templates/selectoption.tpl @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/templates/showreport.tpl b/templates/showreport.tpl index bb15123..b73d4a7 100644 --- a/templates/showreport.tpl +++ b/templates/showreport.tpl @@ -26,17 +26,17 @@ $header
<%- $bug['bugid'] %> - + <% if ($show['edit']): %> / - class="error">{@"Hidden"}: - checked="checked" /> - - / {@"Hidden Bug"} - + class="error"<% endif %>>{@"Hidden"}: + checked="checked"<% endif %> /> + <% else: %> + <% if ($bug['hidden']): %> / {@"Hidden Bug"}<% endif %> + <% endif %> / [{@"Show Bug History"}] - / [<%- $favoritetext %>] - / [{@"Delete"}] + <% if ($show['subscribe']): %>/ [<%- $favoritetext %>]<% endif %> + <% if ($show['delete']): %>/ [{@"Delete"}]<% endif %>
@@ -51,7 +51,7 @@ $header
{@"Product/Version"} $help[product] -
<%- $bug['product'] %> / <%- $bug['component'] %> / <%- $bug['version'] %>
+
<%- $bug['product'] %> <% if ($bug['component']): %>/ <%- $bug['component'] %><% endif %> / <% if ($show['edit']): %><% else: %><%- $bug['version'] %><% endif %>
@@ -59,11 +59,11 @@ $header
{@"Status"} $help[status]
- + <% if ($show['changestatus']): %> - + <% else: %> <%- $bug['status'] %> - + <% endif %>
@@ -72,11 +72,11 @@ $header
{@"Severity"} $help[severity]
- + <% if ($show['edit']): %> - + <% else: %> <%- $bug['severity'] %> - + <% endif %>
@@ -85,12 +85,12 @@ $header
{@"Duplicate Of"} $help[duplicateof]
- - <%- $bug['duplicateof'] %>" /> - <%- $duplicate['bugid'] %> - - <%- $duplicateof['summary'] %>{@"- none -"} - + <% if ($show['edit']): %> + + <% if ($bug['duplicateof']): %><%- $duplicate['bugid'] %><% endif %> + <% else: %> + <% if ($bug['duplicateof']): %><%- $duplicateof['summary'] %><% else: %>{@"- none -"}<% endif %> + <% endif %>
@@ -107,11 +107,11 @@ $header
{@"Summary"} $help[summary]
- + <% if ($show['edit']): %> - + <% else: %> <%- $bug['summary'] %> - + <% endif %>
@@ -127,11 +127,11 @@ $header
{@"Assignment"} $help[assignedto]
- - - - <%- $bug['assigninfo'] %>{@"- none -"} - + <% if ($show['assign']): %> + + <% else: %> + <% if ($bug['assigninfo']): %><%- $bug['assigninfo'] %><% else: %>{@"- none -"}<% endif %> + <% endif %>
@@ -140,11 +140,11 @@ $header
{@"Resolution"} $help[resolution]
- + <% if ($show['changestatus']): %> - + <% else: %> <%- $bug['resolution'] %> - + <% endif %>
@@ -153,11 +153,11 @@ $header
{@"Priority"} $help[priority]
- + <% if ($show['changestatus']): %> - + <% else: %> <%- $bug['priority'] %> - + <% endif %>
@@ -166,11 +166,11 @@ $header
{@"Dependencies"} $help[dependency]
- + <% if ($show['edit']): %> <%- $dependencies %> - - <%- $dependencies %>{@"- none -"} - + <% else: %> + <% if ($dependencies): %><%- $dependencies %><% else: %>{@"- none -"}<% endif %> + <% endif %>
@@ -184,19 +184,19 @@ $header
- +<% if ($show['newreply']): %>
- {@"New Reply"} : {@"Automation"} $help[newreply] + {@"New Reply"}<% if ($show['automations']): %> : {@"Automation"} <% endif %> $help[newreply] -
checked="checked" /> {@"Parse Links in the Comment"}
+
checked="checked"<% endif %> /> {@"Parse Links in the Comment"}
-
+<% endif %>
@@ -212,20 +212,20 @@ $header
- + <% if ($show['attachments']): %>
- {@"Attachments"} : {@"New"} + {@"Attachments"}<% if ($show['putattachments']): %> : {@"New"}<% endif %> <%- $attachments %>
-
+ <% endif %> -
fiftyhundred"> +
fifty<% endif %><% else: %>hundred<% endif %><% endif %>">
{@"Votes"} @@ -236,7 +236,7 @@ $header
- + <% if ($show['vote']): %>
@@ -253,7 +253,7 @@ $header
-
+ <% endif %>
diff --git a/templates/showreport_attachment.tpl b/templates/showreport_attachment.tpl index 0f912b3..5cc2ef7 100644 --- a/templates/showreport_attachment.tpl +++ b/templates/showreport_attachment.tpl @@ -1,6 +1,6 @@ diff --git a/templates/showreport_comment.tpl b/templates/showreport_comment.tpl index f3efa29..b407009 100644 --- a/templates/showreport_comment.tpl +++ b/templates/showreport_comment.tpl @@ -10,15 +10,15 @@ <%- $comment['comment_parsed'] %>
- + <% if ($show['editcomment']): %>
- [{@"Delete"}] + <% if ($show['delete']): %>[{@"Delete"}]<% endif %> [{@"Edit Comment"}] - {@"Hidden"}{@"Visible"} + <% if ($comment['hidden']): %>{@"Hidden"}<% else: %>{@"Visible"}<% endif %>
-
+ <% endif %>
diff --git a/templates/std_message.tpl b/templates/std_message.tpl index ebabb79..b753883 100644 --- a/templates/std_message.tpl +++ b/templates/std_message.tpl @@ -3,27 +3,27 @@ <%- $headinclude %> - <%- bugdar::$options['trackertitle'] %> - <if condition="$show['confirm']">{@"Confirm"}<else />{@"Notice"}</if> + <%- bugdar::$options['trackertitle'] %> - <% if ($show['confirm']): %>{@"Confirm"}<% else: %>{@"Notice"}<% endif %> <%- $header %> - +<% if ($show['confirm']): %> <%- $extra %> - +<% endif %>
-
{@"Confirm"}{@"Notice"}
+
<% if ($show['confirm']): %>{@"Confirm"}<% else: %>{@"Notice"}<% endif %>
<%- $message %> - + <% if ($show['confirm']): %>

@@ -31,13 +31,13 @@
- + <% endif %>
- +<% if ($show['confirm']): %> - +<% endif %> <%- $footer %> \ No newline at end of file diff --git a/templates/trackerhome_bits.tpl b/templates/trackerhome_bits.tpl index bc14a39..738a582 100644 --- a/templates/trackerhome_bits.tpl +++ b/templates/trackerhome_bits.tpl @@ -1,6 +1,6 @@ - style="background-color: <%- $bug['bgcolor'] %>; font-style: italic" class="<%- $bug['bgcolor'] %>" style="font-style: italic"> + style="background-color: <%- $bug['bgcolor'] %><% if ($bug['hidden']): %>; font-style: italic<% endif %>"<% else: %> class="<%- $bug['bgcolor'] %>"<% if ($bug['hidden']): %> style="font-style: italic"<% endif %><% endif %>> $fields diff --git a/templates/userctrl.tpl b/templates/userctrl.tpl index bfc4786..4d49939 100644 --- a/templates/userctrl.tpl +++ b/templates/userctrl.tpl @@ -14,12 +14,12 @@ - +<% if ($show['errors']): %>
{@"The following errors occurred"}: <%- $message->errorBox %>
-
+<% endif %>
@@ -34,18 +34,18 @@ {@"Display Name"} - + <% endif %>
{@"Show Email Publicly"} - checked="checked" /> {@"Yes"} - checked="checked" /> {@"No"} + checked="checked"<% endif %> /> {@"Yes"} + checked="checked"<% endif %> /> {@"No"}
{@"Show Status Colors on Bug Listings"} - checked="checked" /> {@"Yes"} - checked="checked" /> {@"No"} + checked="checked"<% endif %> /> {@"Yes"} + checked="checked"<% endif %> /> {@"No"}
@@ -60,7 +60,7 @@
{@"Observe Daylight Savings Time (DST)"} - checked="checked" /> {@"Yes, I'm currently observing DST"} + checked="checked"<% endif %> /> {@"Yes, I'm currently observing DST"}
@@ -144,7 +144,7 @@
- + <% if ($searches): %>
{@"Saved Searches"}
@@ -154,7 +154,7 @@
-
+ <% endif %>
@@ -195,7 +195,7 @@
- + <% endif %>
diff --git a/templates/username_display.tpl b/templates/username_display.tpl index 34d9cf6..49cc015 100644 --- a/templates/username_display.tpl +++ b/templates/username_display.tpl @@ -1 +1 @@ -{@"User ID: %1$s"}"><%- $userinfo['displayname'] %><%- $userinfo['displayname'] %> \ No newline at end of file +{@"User ID: %1$s"}"><% if ($userinfo['showemail']): %><%- $userinfo['displayname'] %><% else: %><%- $userinfo['displayname'] %><% endif %> \ No newline at end of file -- 2.43.5