From 8849f3a4b75ba40ae9a68800a2de512174bf40f1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20=C3=85kre=20Solberg?= <andreas.solberg@uninett.no>
Date: Fri, 6 Mar 2009 10:21:11 +0000
Subject: [PATCH] Add support for loading new jquery version in jquery header
 config...

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1377 44740490-163a-0410-bde0-09ae8108e29a
---
 templates/includes/header.php | 33 ++++++++++++++++++++++++---------
 1 file changed, 24 insertions(+), 9 deletions(-)

diff --git a/templates/includes/header.php b/templates/includes/header.php
index 15357734a..817db1239 100644
--- a/templates/includes/header.php
+++ b/templates/includes/header.php
@@ -18,15 +18,30 @@ if(array_key_exists('header', $this->data)) {
 
 if(array_key_exists('jquery', $this->data)) {
 	
-	#echo('<pre>'); print_r($this->data['jquery']); exit;
-	if (isset($this->data['jquery']['core']) && $this->data['jquery']['core'])
-		echo('<script type="text/javascript" src="/' . $this->data['baseurlpath'] . 'resources/jquery.js"></script>');
-
-	if (isset($this->data['jquery']['ui']) && $this->data['jquery']['ui'])
-		echo('<script type="text/javascript" src="/' . $this->data['baseurlpath'] . 'resources/jquery-ui.js"></script>');
-
-	if (isset($this->data['jquery']['css']) && $this->data['jquery']['css'])
-		echo('<link rel="stylesheet" media="screen" type="text/css" href="/' . $this->data['baseurlpath'] . 'resources/uitheme/jquery-ui-themeroller.css" />');
+	$version = '1.5';
+	if (array_key_exists('version', $this->data['jquery']))
+		$version = $this->data['jquery']['version'];
+		
+	if ($version == '1.5') {
+		if (isset($this->data['jquery']['core']) && $this->data['jquery']['core'])
+			echo('<script type="text/javascript" src="/' . $this->data['baseurlpath'] . 'resources/jquery.js"></script>' . "\n");
+	
+		if (isset($this->data['jquery']['ui']) && $this->data['jquery']['ui'])
+			echo('<script type="text/javascript" src="/' . $this->data['baseurlpath'] . 'resources/jquery-ui.js"></script>' . "\n");
+	
+		if (isset($this->data['jquery']['css']) && $this->data['jquery']['css'])
+			echo('<link rel="stylesheet" media="screen" type="text/css" href="/' . $this->data['baseurlpath'] . 'resources/uitheme/jquery-ui-themeroller.css" />' . "\n");	
+			
+	} else if ($version == '1.6') {
+		if (isset($this->data['jquery']['core']) && $this->data['jquery']['core'])
+			echo('<script type="text/javascript" src="/' . $this->data['baseurlpath'] . 'resources/jquery-16.js"></script>' . "\n");
+	
+		if (isset($this->data['jquery']['ui']) && $this->data['jquery']['ui'])
+			echo('<script type="text/javascript" src="/' . $this->data['baseurlpath'] . 'resources/jquery-ui-16.js"></script>' . "\n");
+	
+		if (isset($this->data['jquery']['css']) && $this->data['jquery']['css'])
+			echo('<link rel="stylesheet" media="screen" type="text/css" href="/' . $this->data['baseurlpath'] . 'resources/uitheme16/ui.all.css" />' . "\n");	
+	}
 	
 }
 
-- 
GitLab