Index: /extensions/floPure/header.tpl
===================================================================
--- /extensions/floPure/header.tpl	(revision 3584)
+++ /extensions/floPure/header.tpl	(revision 3585)
@@ -74,8 +74,10 @@
 <div id="the_page">
 {php}
-if (is_admin())
+if (is_admin() and !(pwg_get_session_var('flopure_checked_version')) )
+//if (is_admin())
 {
 	global $template, $page;
 	$header_msgs = array();
+	$name_is_nutd = array();
 	include_once(PHPWG_ROOT_PATH.'template/floPure/tools/version.conf.php');
 	include_once(PHPWG_ROOT_PATH.'template/floPure/tools/floPure.class.php');
@@ -85,10 +87,34 @@
 	{
 		$template->append('header_msgs', l10n('floPure_update_needed'));
+		$name_is_nutd[]='floPure';
 	}
 	$floPure->theme_version_search(PHPWG_ROOT_PATH.'template/floPure/theme');
+	$name_is_nutd=array_merge($name_is_nutd,$floPure->is_nutd);
+	pwg_set_session_var('flopure_checked_version',$name_is_nutd);
+	foreach($name_is_nutd as $i)
+	{
+	$template->append('test_a', array( 'A'=> $i) );
+	}
+	
+	
+	//pwg_set_session_var('flopure_checked_version');
 
 	
 }
+else if ( pwg_get_session_var('flopure_checked_version') )
+{
 
+	global $template;
+	$header_msgs = array();
+	include_once(PHPWG_ROOT_PATH.'template/floPure/tools/floPure.class.php');
+	load_language('template.lang', PHPWG_ROOT_PATH.'template/floPure/tools/');
+	$floPure = new floPure();
+	$floPure->display(pwg_get_session_var('flopure_checked_version'));
+	foreach(pwg_get_session_var('flopure_checked_version') as $i)
+	{
+	$template->append('test_a', array( 'A'=> $i) );
+	}
+}
+	//pwg_unset_session_var('flopure_checked_version');
 {/php}
 {$erreur}
Index: /extensions/floPure/tools/floPure.class.php
===================================================================
--- /extensions/floPure/tools/floPure.class.php	(revision 3584)
+++ /extensions/floPure/tools/floPure.class.php	(revision 3585)
@@ -2,15 +2,16 @@
 class floPure
 {
-  function floPure_version_compare($a, $b)
-  {
-    $pattern = array('/([a-z])/ei', '/\.+/', '/\.\Z|\A\./');
-    $replacement = array( "'.'.intval('\\1', 36).'.'", '.', '');
-
-    $array = preg_replace($pattern, $replacement, array($a, $b));
-
-    return version_compare($array[0], $array[1], '>=');
-  }
-  function theme_version_search($dir)
-  {
+	var $is_nutd = array();
+	function floPure_version_compare($a, $b)
+	{
+	$pattern = array('/([a-z])/ei', '/\.+/', '/\.\Z|\A\./');
+	$replacement = array( "'.'.intval('\\1', 36).'.'", '.', '');
+	
+	$array = preg_replace($pattern, $replacement, array($a, $b));
+	
+	return version_compare($array[0], $array[1], '>=');
+	}
+	function theme_version_search($dir)
+	{
 	global $template, $page;
 	load_language('template.lang', PHPWG_ROOT_PATH.'template/floPure/tools/');
@@ -46,4 +47,5 @@
 						  $msg=l10n('theme_update_needed_1').$themeconf['theme'].l10n('theme_update_needed_2').$themeconf['eid'].l10n('theme_update_needed_3').$themeconf['theme'].l10n('theme_update_needed_4');
 						  $template->append('header_msgs', $msg);
+						  $this->is_nutd[]=$themeconf['theme'];
 					  }
 				  }
@@ -54,49 +56,49 @@
 	}
 	closedir ($dh); // on ferme le repertoire courant
-  }
-  function is_not_up_to_date($v_local, $eid)
-  {
-  
+	}
+	function is_not_up_to_date($v_local, $eid)
+	{
+	
 	global $template, $user, $page;
 	include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
 	load_language('template.lang', PHPWG_ROOT_PATH.'template/floPure/tools/');
-
-    // Retrieve PEM versions
-    $version = PHPWG_VERSION;
-    $versions_to_check = array();
-    $url = PEM_URL . '/api/get_version_list.php?category_id=12&format=php';
-    if (fetchRemote($url, $result) and $pem_versions = @unserialize($result))
-    {
-      if (!preg_match('/^\d+\.\d+\.\d+/', $version))
-      {
-        $version = $pem_versions[0]['name'];
-      }
-      $branch = substr($version, 0, strrpos($version, '.'));
-      foreach ($pem_versions as $pem_version)
-      {
-        if (strpos($pem_version['name'], $branch) === 0)
-        {
-          $versions_to_check[] = $pem_version['id'];
-        }
-      }
-    }
+	
+	// Retrieve PEM versions
+	$version = PHPWG_VERSION;
+	$versions_to_check = array();
+	$url = PEM_URL . '/api/get_version_list.php?category_id=12&format=php';
+	if (fetchRemote($url, $result) and $pem_versions = @unserialize($result))
+	{
+	  if (!preg_match('/^\d+\.\d+\.\d+/', $version))
+	  {
+		$version = $pem_versions[0]['name'];
+	  }
+	  $branch = substr($version, 0, strrpos($version, '.'));
+	  foreach ($pem_versions as $pem_version)
+	  {
+		if (strpos($pem_version['name'], $branch) === 0)
+		{
+		  $versions_to_check[] = $pem_version['id'];
+		}
+	  }
+	}
 	
 	// Retrieve PEM template infos
-    $url = PEM_URL . '/api/get_revision_list.php?format=php&last_revision_only=true';
-    $url .= '&version=' . implode(',', $versions_to_check);
-    //$url .= '&lang=' . substr($user['language'], 0, 2);
+	$url = PEM_URL . '/api/get_revision_list.php?format=php&last_revision_only=true';
+	$url .= '&version=' . implode(',', $versions_to_check);
+	//$url .= '&lang=' . substr($user['language'], 0, 2);
 	$url .= '&extension_include='.$eid;
-    fetchRemote($url, $result);
-      $pem_res = @unserialize($result);
+	fetchRemote($url, $result);
+	  $pem_res = @unserialize($result);
 	  foreach($pem_res as $pem_floPure)
 	  {
-      if (!is_array($pem_floPure))
-      {
-		$template->assign(
-			array(
-			  'erreur' => 'erreur url : '.$url,
-			)
-		  );
-      }
+		  if (!is_array($pem_floPure))
+		  {
+			$template->assign(
+				array(
+				  'erreur' => 'erreur url : '.$url,
+				)
+			  );
+		  }
 		if (!$this->floPure_version_compare($v_local, $pem_floPure['revision_name']))
 		{
@@ -108,6 +110,39 @@
 		}
 	  }
-  }
-
+	}
+	function display($names)
+	{
+		if (!is_array($names))
+		{
+			$template->assign(
+				array(
+					'erreur' => 'erreur get session var not array',
+				)
+			);
+		}
+		else
+		{
+			global $template, $user;
+			load_language('template.lang', PHPWG_ROOT_PATH.'template/floPure/tools/');
+			foreach($names as $name)
+			{
+				if ($name=='floPure')
+				{
+					$template->append('header_msgs', l10n('floPure_update_needed'));
+				}
+				else
+				{
+					if ( is_dir(PHPWG_ROOT_PATH.'template/floPure/theme/'.$name) and is_file(PHPWG_ROOT_PATH.'template/floPure/theme/'.$name.'/themeconf.inc.php') )
+					{
+						include(PHPWG_ROOT_PATH.'template/floPure/theme/'.$name.'/themeconf.inc.php');
+						$msg=l10n('theme_update_needed_1').$themeconf['theme'].l10n('theme_update_needed_2').$themeconf['eid'].l10n('theme_update_needed_3').$themeconf['theme'].l10n('theme_update_needed_4');
+						$template->append('header_msgs', $msg);
+					}
+				}
+			}
+		}//else
+		return true;
+						
+	}
 }
 ?>
