From bf815b33908394fcda4fb6cb987caaca58b20fd0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20KUBLER?= <francois@kubler.org>
Date: Wed, 9 Mar 2011 21:57:00 +0100
Subject: [PATCH] Fixed PHP syntax in template files.

  * Full PHP tags
  * Alternative syntax for control structures
  * Semi-colon at the end of instructions
---
 admin/templates/index.php   |  2 +-
 admin/templates/plugins.php |  8 ++++----
 admin/templates/users.php   |  6 +++---
 files/templates/index.php   | 18 +++++++++---------
 log/templates/index.php     |  8 ++++----
 templates/layout.admin.php  | 28 ++++++++++++++--------------
 templates/layout.guest.php  | 14 +++++++-------
 templates/layout.user.php   | 28 ++++++++++++++--------------
 templates/login.php         |  6 +++---
 9 files changed, 59 insertions(+), 59 deletions(-)

diff --git a/admin/templates/index.php b/admin/templates/index.php
index ad60ad0801..2ca7b0b2d3 100644
--- a/admin/templates/index.php
+++ b/admin/templates/index.php
@@ -7,6 +7,6 @@
 
 <ul>
 	<?php foreach($_["adminpages"] as $i): ?>
-		<li><a href="<?php echo link_to($i["app"], $i["file"]) ?>"><?php echo $i["name"] ?></a></li>
+		<li><a href="<?php echo link_to($i["app"], $i["file"]); ?>"><?php echo $i["name"]; ?></a></li>
 	<?php endforeach; ?>
 </ul>
diff --git a/admin/templates/plugins.php b/admin/templates/plugins.php
index ef9ef4fa4e..8f5e87d3e8 100644
--- a/admin/templates/plugins.php
+++ b/admin/templates/plugins.php
@@ -18,10 +18,10 @@
 	</thead>
 	<tbody>
 		<?php foreach($_["plugins"] as $plugin): ?>
-			<td><?php echo $plugin["info"]["id"] ?></td>
-			<td><?php echo $plugin["info"]["version"] ?></td>
-			<td><?php echo $plugin["info"]["name"] ?></td>
-			<td><?php echo $plugin["info"]["author"] ?></td>
+			<td><?php echo $plugin["info"]["id"]; ?></td>
+			<td><?php echo $plugin["info"]["version"]; ?></td>
+			<td><?php echo $plugin["info"]["name"]; ?></td>
+			<td><?php echo $plugin["info"]["author"]; ?></td>
 			<td>enable</td>
 		<?php endforeach; ?>
 	</tbody>
diff --git a/admin/templates/users.php b/admin/templates/users.php
index 6ad10cafc4..7aa93baf49 100644
--- a/admin/templates/users.php
+++ b/admin/templates/users.php
@@ -18,8 +18,8 @@
 		<?php foreach($_["users"] as $user): ?>
 			<tr>
 				<td><input type="checkbox"></td>
-				<td><?php echo $user["name"] ?></td>
-				<td><?php echo $user["groups"] ?></td>
+				<td><?php echo $user["name"]; ?></td>
+				<td><?php echo $user["groups"]; ?></td>
 			</tr>
 		<?php endforeach; ?>
 	</tbody>
@@ -36,7 +36,7 @@
 	<tbody>
 		<?php foreach($_["groups"] as $group): ?>
 			<tr>
-				<td><?php echo $group["name"] ?></td>
+				<td><?php echo $group["name"]; ?></td>
 				<td>remove</td>
 			</tr>
 		<?php endforeach; ?>
diff --git a/files/templates/index.php b/files/templates/index.php
index fe7ec903c2..695a3c45a9 100644
--- a/files/templates/index.php
+++ b/files/templates/index.php
@@ -12,10 +12,10 @@
 </div>
 
 <p class="nav">
-	<a href="<? echo link_to( "files", "index.php?dir=/" ) ?>"><img src="<? echo image_path( "", "actions/go-home.png" ) ?>" alt="Root" /></a>
-	<? foreach( $_["breadcrumb"] as $crumb ){ ?>
-		<a href="<? echo link_to( "files", "index.php?dir=".$crumb["dir"] ) ?>"><? echo $crumb["name"] ?></a>
-	<? } ?>
+	<a href="<?php echo link_to("files", "index.php?dir=/"); ?>"><img src="<?php echo image_path("", "actions/go-home.png"); ?>" alt="Root" /></a>
+	<?php foreach($_["breadcrumb"] as $crumb): ?>
+		<a href="<?php echo link_to("files", "index.php?dir=".$crumb["dir"]); ?>"><?php echo $crumb["name"]; ?></a>
+	<?php endforeach; ?>
 </p>
 
 <table cellspacing="0">
@@ -29,15 +29,15 @@
 		</tr>
 	</thead>
 	<tbody>
-		<? foreach( $_["files"] as $file ){ ?>
+		<?php foreach($_["files"] as $file): ?>
 			<tr>
 				<td class="selection"><input type="checkbox" /></td>
-				<td class="filename"><a style="background-image:url(<? if( $file["type"] == "dir" ) echo mimetype_icon( "dir" ); else echo mimetype_icon( $file["mime"] )  ?>)" href="<? if( $file["type"] == "dir" ) echo link_to( "files", "index.php?dir=".$file["directory"]."/".$file["name"] ); else echo link_to( "files", "download.php?file=".$file["directory"]."/".$file["name"] )  ?>" title=""><? echo $file["name"] ?></a></td>
-				<td class="filesize"><? if( $file["type"] != "dir" ) echo human_file_size( $file["size"] ) ?></td>
-				<td class="date"><? if( $file["type"] != "dir" ) echo $file["date"] ?></td>
+				<td class="filename"><a style="background-image:url(<?php if($file["type"] == "dir") echo mimetype_icon("dir"); else echo mimetype_icon($file["mime"]); ?>)" href="<?php if($file["type"] == "dir") echo link_to("files", "index.php?dir=".$file["directory"]."/".$file["name"]); else echo link_to("files", "download.php?file=".$file["directory"]."/".$file["name"]); ?>" title=""><?php echo $file["name"]; ?></a></td>
+				<td class="filesize"><?php if($file["type"] != "dir" ) echo human_file_size($file["size"]); ?></td>
+				<td class="date"><?php if($file["type"] != "dir") echo $file["date"]; ?></td>
 				<td class="fileaction"><a href="" title=""><img src="images/drop-arrow.png" alt="+" /></a></td>
 			</tr>
-		<? } ?>
+		<?php endforeach; ?>
 	</tbody>
 </table>
 
diff --git a/log/templates/index.php b/log/templates/index.php
index be91fa00da..02fea0f87b 100644
--- a/log/templates/index.php
+++ b/log/templates/index.php
@@ -36,12 +36,12 @@
 		</tr>
 	</thead>
 	<tbody>
-		<? foreach( $_["logs"] as $entry ){ ?>
+		<?php foreach($_["logs"] as $entry): ?>
 			<tr>
-				<td class="login"><em><? echo $entry["user"] ?></em> <? echo $entry["message"] ?></td>
-				<td class="date"><? echo $entry["date"] ?></td>
+				<td class="login"><em><?php echo $entry["user"]; ?></em> <?php echo $entry["message"]; ?></td>
+				<td class="date"><?php echo $entry["date"]; ?></td>
 			</tr>
-		<? } ?>
+		<?php endforeach; ?>
 	</tbody>
 </table>
 
diff --git a/templates/layout.admin.php b/templates/layout.admin.php
index b4fcc91588..ebf0a1f048 100644
--- a/templates/layout.admin.php
+++ b/templates/layout.admin.php
@@ -9,24 +9,24 @@
 		<title>ownCloud</title>
 		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 		<link rel="shortcut icon" href="favicon.ico" />
-		<? foreach( $_["cssfiles"] as $cssfile ){ ?>
-			<link rel="stylesheet" href="<? echo $cssfile ?>" type="text/css" media="screen" />
-		<? } ?>
-		<? foreach( $_["jsfiles"] as $jsfile ){ ?>
-			<script type="text/javascript" src="<? echo $jsfile ?>"></script>
-		<? } ?>
+		<?php foreach($_["cssfiles"] as $cssfile): ?>
+			<link rel="stylesheet" href="<?php echo $cssfile; ?>" type="text/css" media="screen" />
+		<?php endforeach; ?>
+		<?php foreach($_["jsfiles"] as $jsfile): ?>
+			<script type="text/javascript" src="<?php echo $jsfile; ?>"></script>
+		<?php endforeach; ?>
 	</head>
 
 	<body>
 		<div id="header">
-			<a href="<? echo link_to( "", "index.php" )?>" title="" id="owncloud"><img src="<? echo image_path( "", "owncloud-logo-small-white.png" ) ?>" alt="ownCloud" /></a>
+			<a href="<?php echo link_to("", "index.php"); ?>" title="" id="owncloud"><img src="<?php echo image_path("", "owncloud-logo-small-white.png"); ?>" alt="ownCloud" /></a>
 
 			<div id="user">
 				<a id="user_menu_link" href="" title="">Username</a>
 				<ul id="user_menu">
-					<? foreach( $_["personalmenu"] as $entry ){ ?>
-						<li><a href="<? echo link_to( $entry["app"], $entry["file"] )?>" title=""><? echo $entry["name"] ?></a></li>
-					<? } ?>
+					<?php foreach($_["personalmenu"] as $entry ): ?>
+						<li><a href="<?php echo link_to($entry["app"], $entry["file"]); ?>" title=""><?php echo $entry["name"]; ?></a></li>
+					<?php endforeach; ?>
 				</ul>
 			</div>
 		</div>
@@ -34,14 +34,14 @@
 		<div id="main">
 			<div id="plugins">
 				<ul>
-					<? foreach( $_["navigation"] as $entry ){ ?>
-						<li><a href="<? echo link_to( $entry["app"], $entry["file"] )?>" title=""><? echo $entry["name"] ?></a></li>
-					<? } ?>
+					<?php foreach($_["navigation"] as $entry): ?>
+						<li><a href="<?php echo link_to($entry["app"], $entry["file"]); ?>" title=""><?php echo $entry["name"]; ?></a></li>
+					<?php endforeach; ?>
 				</ul>
 			</div>
 
 			<div id="content">
-				<? echo $_["content"] ?>
+				<?php echo $_["content"]; ?>
 			</div>
 		</div>
 	</body>
diff --git a/templates/layout.guest.php b/templates/layout.guest.php
index a5ebf7a76a..a163a97103 100644
--- a/templates/layout.guest.php
+++ b/templates/layout.guest.php
@@ -9,16 +9,16 @@
 		<title>ownCloud</title>
 		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 		<link rel="shortcut icon" href="favicon.ico" />
-		<? foreach( $_["cssfiles"] as $cssfile ){ ?>
-			<link rel="stylesheet" href="<? echo $cssfile ?>" type="text/css" media="screen" />
-		<? } ?>
-		<? foreach( $_["jsfiles"] as $jsfile ){ ?>
-			<script type="text/javascript" src="<? echo $jsfile ?>"></script>
-		<? } ?>
+		<?php foreach($_["cssfiles"] as $cssfile): ?>
+			<link rel="stylesheet" href="<?php echo $cssfile; ?>" type="text/css" media="screen" />
+		<?php endforeach; ?>
+		<?php foreach($_["jsfiles"] as $jsfile): ?>
+			<script type="text/javascript" src="<?php echo $jsfile; ?>"></script>
+		<?php endforeach; ?>
 	</head>
 
 	<body class="login">
-		<? echo $_["content"] ?>
+		<?php echo $_["content"]; ?>
 		<p class="info">
 			ownCloud is an open personal cloud which runs on your personal server.<br />
 			To learn more, please visit <a href="http://www.owncloud.org/">owncloud.org</a>.
diff --git a/templates/layout.user.php b/templates/layout.user.php
index 0643c99e93..20fb3f88cd 100644
--- a/templates/layout.user.php
+++ b/templates/layout.user.php
@@ -9,24 +9,24 @@
 		<title>ownCloud</title>
 		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 		<link rel="shortcut icon" href="favicon.ico" />
-		<? foreach( $_["cssfiles"] as $cssfile ){ ?>
-			<link rel="stylesheet" href="<? echo $cssfile ?>" type="text/css" media="screen" />
-		<? } ?>
-		<? foreach( $_["jsfiles"] as $jsfile ){ ?>
-			<script type="text/javascript" src="<? echo $jsfile ?>"></script>
-		<? } ?>
+		<?php foreach($_["cssfiles"] as $cssfile): ?>
+			<link rel="stylesheet" href="<?php echo $cssfile; ?>" type="text/css" media="screen" />
+		<?php endforeach; ?>
+		<?php foreach($_["jsfiles"] as $jsfile): ?>
+			<script type="text/javascript" src="<?php echo $jsfile; ?>"></script>
+		<?php endforeach; ?>
 	</head>
 
 	<body>
 		<div id="header">
-			<a href="<? echo link_to( "", "index.php" )?>" title="" id="owncloud"><img src="<? echo image_path( "", "owncloud-logo-small-white.png" ) ?>" alt="ownCloud" /></a>
+			<a href="<?php echo link_to("", "index.php"); ?>" title="" id="owncloud"><img src="<?php echo image_path("", "owncloud-logo-small-white.png"); ?>" alt="ownCloud" /></a>
 
 			<div id="user">
 				<a id="user_menu_link" href="" title="">Username</a>
 				<ul id="user_menu">
-					<? foreach( $_["personalmenu"] as $entry ){ ?>
-						<li><a href="<? echo link_to( $entry["app"], $entry["file"] )?>" title=""><? echo $entry["name"] ?></a></li>
-					<? } ?>
+					<?php foreach($_["personalmenu"] as $entry): ?>
+						<li><a href="<?php echo link_to($entry["app"], $entry["file"]); ?>" title=""><?php echo $entry["name"]; ?></a></li>
+					<?php endforeach; ?>
 				</ul>
 			</div>
 		</div>
@@ -34,14 +34,14 @@
 		<div id="main">
 			<div id="plugins">
 				<ul>
-					<? foreach( $_["navigation"] as $entry ){ ?>
-						<li><a href="<? echo link_to( $entry["app"], $entry["file"] )?>" title=""><? echo $entry["name"] ?></a></li>
-					<? } ?>
+					<?php foreach($_["navigation"] as $entry): ?>
+						<li><a href="<?php echo link_to($entry["app"], $entry["file"]); ?>" title=""><?php echo $entry["name"]; ?></a></li>
+					<?php endforeach; ?>
 				</ul>
 			</div>
 
 			<div id="content">
-				<? echo $_["content"] ?>
+				<?php echo $_["content"]; ?>
 			</div>
 		</div>
 	</body>
diff --git a/templates/login.php b/templates/login.php
index 60b8dc0253..a165fc7246 100644
--- a/templates/login.php
+++ b/templates/login.php
@@ -4,13 +4,13 @@
  */
 ?>
 <div id="login">
-	<img src="<? echo image_path( "", "owncloud-logo-medium-white.png" ) ?>" alt="ownCloud" />
+	<img src="<?php echo image_path("", "owncloud-logo-medium-white.png"); ?>" alt="ownCloud" />
 	<form action="index.php" method="post">
 		<!-- <h1>Sign in :</h1> -->
 		<fieldset>
-			<? if( $_["error"] ){ ?>
+			<?php if($_["error"]): ?>
 				Login failed!
-			<? } ?>
+			<?php endif; ?>
 			<p><input type="text" name="user" value="" /></p>
 			<p><input type="password" name="password" /></p>
 			<p><input type="submit" value="Sign in" /></p>
-- 
GitLab