From 314a74d6557912313e781ad6e679560f1e0dbff1 Mon Sep 17 00:00:00 2001
From: Olav Morken <olav.morken@uninett.no>
Date: Wed, 2 Jul 2008 13:01:31 +0000
Subject: [PATCH] Template: add getTag helper function, to retrieve a given
 tag.

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

diff --git a/lib/SimpleSAML/XHTML/Template.php b/lib/SimpleSAML/XHTML/Template.php
index 4a5bb4d33..35941ef10 100644
--- a/lib/SimpleSAML/XHTML/Template.php
+++ b/lib/SimpleSAML/XHTML/Template.php
@@ -187,6 +187,25 @@ class SimpleSAML_XHTML_Template {
 	}
 
 
+	/**
+	 * Retrieve a tag.
+	 *
+	 * This function retrieves a tag as an array with language => string mappings.
+	 *
+	 * @param $tag  The tag name.
+	 * @return As associative array with language => string mappings, or NULL if the tag wasn't found.
+	 */
+	public function getTag($tag) {
+		assert('is_string($tag)');
+
+		if(!array_key_exists($tag, $this->langtext)) {
+			return NULL;
+		}
+
+		return $this->langtext[$tag];
+	}
+
+
 	/**
 	 * Include text in the current language.
 	 *
-- 
GitLab