Use mesage template for projlist errors
Use mesage template for projlist errors

--- a/include/display.git_project_list.php
+++ b/include/display.git_project_list.php
@@ -57,10 +57,14 @@
 				}
 				$tpl->assign("categorizedprojects",$projects);
 			}
-		} else
-			$tpl->assign("errmsg","No projects found");
-	} else
-		$tpl->assign("errmsg",$projects);
+		} else {
+			$tpl->assign("message","No projects found");
+			$tpl->assign("error",TRUE);
+		}
+	} else {
+		$tpl->assign("message",$projects);
+		$tpl->assign("error",TRUE);
+	}
 	$tpl->display("projectlist.tpl");
 }
 

--- a/templates/message.tpl
+++ b/templates/message.tpl
@@ -1,7 +1,7 @@
 {*
- *  error.tpl
+ *  message.tpl
  *  gitphp: A PHP git repository browser
- *  Component: Error message template
+ *  Component: Warning/error message template
  *
  *  Copyright (C) 2009 Christopher Han <xiphux@gmail.com>
  *}

--- a/templates/projectlist.tpl
+++ b/templates/projectlist.tpl
@@ -5,9 +5,9 @@
  *
  *  Copyright (C) 2009 Christopher Han <xiphux@gmail.com>
  *}
-{if $errmsg}
+{if $message}
   {* Something is wrong; display an error message instead of trying to list *}
-  {$errmsg}
+  {include file='message.tpl'}
 {else}
   <table cellspacing="0">
     {* Header *}

comments