From a946549386904f38536e60a6c5c75723e588fa83 Mon Sep 17 00:00:00 2001
From: Olav Morken <olav.morken@uninett.no>
Date: Mon, 5 Oct 2009 13:01:29 +0000
Subject: [PATCH] Frontpage: Mark links to sp examples as deprecated.

Update issue 209
Owner: andreassolberg
Status: Started
Needs update of dictionary: {core:frontpage:deprecated}

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1820 44740490-163a-0410-bde0-09ae8108e29a
---
 modules/core/dictionaries/frontpage.php       | 3 +++
 modules/core/templates/frontpage_auth.tpl.php | 6 +++++-
 modules/core/www/frontpage_auth.php           | 8 ++++++--
 3 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/modules/core/dictionaries/frontpage.php b/modules/core/dictionaries/frontpage.php
index cdb138dc8..54996c8fc 100644
--- a/modules/core/dictionaries/frontpage.php
+++ b/modules/core/dictionaries/frontpage.php
@@ -900,6 +900,9 @@ $lang = array(
 		'es' => 'Probar las fuentes para la autentificaciĂłn ya configuradas',
 		'tr' => 'Düzenlenmiş kimlik doğrulama kaynaklarını test et',
 	),
+	'deprecated' => array (
+		'en' => 'Deprecated',
+	),
 
 );
 
diff --git a/modules/core/templates/frontpage_auth.tpl.php b/modules/core/templates/frontpage_auth.tpl.php
index 8c9764fd3..7e58920b2 100644
--- a/modules/core/templates/frontpage_auth.tpl.php
+++ b/modules/core/templates/frontpage_auth.tpl.php
@@ -18,7 +18,11 @@ if ($this->data['isadmin']) {
 <ul>
 <?php
 	foreach ($this->data['links_auth'] AS $link) {
-		echo '<li><a href="' . htmlspecialchars($link['href']) . '">' . $this->t($link['text']) . '</a></li>';
+		echo '<li><a href="' . htmlspecialchars($link['href']) . '">' . $this->t($link['text']) . '</a>';
+		if (isset($link['deprecated']) && $link['deprecated']) {
+			echo ' <b>' . $this->t('{core:frontpage:deprecated}') . '</b>';
+		}
+		echo '</li>';
 	}
 ?>
 </ul>
diff --git a/modules/core/www/frontpage_auth.php b/modules/core/www/frontpage_auth.php
index 37d07180f..fa1bc296b 100644
--- a/modules/core/www/frontpage_auth.php
+++ b/modules/core/www/frontpage_auth.php
@@ -32,12 +32,16 @@ $links_auth[] = array(
 if ($config->getValue('enable.saml20-sp') === true)
 	$links_auth[] = array(
 		'href' => SimpleSAML_Utilities::getBaseURL() . 'example-simple/saml2-example.php',
-		'text' => '{core:frontpage:link_saml2example}');
+		'text' => '{core:frontpage:link_saml2example}',
+		'deprecated' => TRUE,
+	);
 
 if ($config->getValue('enable.shib13-sp') === true)
 	$links_auth[] = array(
 		'href' => SimpleSAML_Utilities::getBaseURL() . 'example-simple/shib13-example.php',
-		'text' => '{core:frontpage:link_shib13example}');
+		'text' => '{core:frontpage:link_shib13example}',
+		'deprecated' => TRUE,
+	);
 
 
 $allLinks = array(
-- 
GitLab