From a506285b9693f4b1d24e51bdc0f41f73580cb0a6 Mon Sep 17 00:00:00 2001
From: Mads Freek Petersen <freek@wayf.dk>
Date: Mon, 12 May 2008 08:56:15 +0000
Subject: [PATCH] Added some backward compatibility to
 includeInlineTranslation: now it accepts a string as well as an array.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@538 44740490-163a-0410-bde0-09ae8108e29a
---
 lib/SimpleSAML/XHTML/Template.php | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lib/SimpleSAML/XHTML/Template.php b/lib/SimpleSAML/XHTML/Template.php
index e19b52bde..7c5c7a281 100644
--- a/lib/SimpleSAML/XHTML/Template.php
+++ b/lib/SimpleSAML/XHTML/Template.php
@@ -273,8 +273,13 @@ class SimpleSAML_XHTML_Template {
 	 * @param $tag         The tag that has a translation
 	 * @param $translation The translation array
 	 */
-	public function includeInlineTranslation($tag, array $translation) {
+	public function includeInlineTranslation($tag, $translation) {
 		
+		if (is_string($translaton)) {
+			$translation = array($selected_language => $translated);
+		} elseif (!is_array($translaton)) {
+			throw new Exception("Inline translation should be string or array. Is " . gettype($translation) . " now!");
+		}
 		if (!is_array($this->langtext)) 
 			$this->langtext = array();	
 		
-- 
GitLab