Index: /extensions/floOs/default-colors.css
===================================================================
--- /extensions/floOs/default-colors.css	(revision 3616)
+++ /extensions/floOs/default-colors.css	(revision 3617)
@@ -1,4 +1,2 @@
-/* $Id: default-colors.css 2352 2008-05-20 00:27:26Z patdenice $ */
-
 /* others */
 
Index: /extensions/floOs/default-layout.css
===================================================================
--- /extensions/floOs/default-layout.css	(revision 3616)
+++ /extensions/floOs/default-layout.css	(revision 3617)
@@ -1,4 +1,2 @@
-/* $Id: default-layout.css 2396 2008-06-23 23:40:55Z rvelices $ */
-@import "admin/default-layout.css";
 
 BODY {
Index: /extensions/floOs/header.tpl
===================================================================
--- /extensions/floOs/header.tpl	(revision 3616)
+++ /extensions/floOs/header.tpl	(revision 3617)
@@ -1,10 +1,25 @@
-{* $Id: header.tpl 2381 2008-06-01 19:19:46Z vdigital $ *}
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
-"http://www.w3.org/TR/html4/strict.dtd">
-<html lang="{$LANG}" dir="{$DIR}">
+{* $Id: header.tpl $ *}
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html lang="{$lang_info.code}" dir="{$lang_info.direction}">
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset={$CONTENT_ENCODING}">
 <meta name="generator" content="Piwigo (aka PWG), see piwigo.org">
-<title>{$GALLERY_TITLE} :: {$PAGE_TITLE}</title>
+{if isset($meta_ref) } 
+{if isset($INFO_AUTHOR)}
+<meta name="author" content="{$INFO_AUTHOR|@replace:'"':' '}">
+{/if}
+{if isset($related_tags)}
+<meta name="keywords" content="{foreach from=$related_tags item=tag name=tag_loop}{if !$smarty.foreach.tag_loop.first}, {/if}{$tag.name}{/foreach}">
+{/if}
+{if isset($COMMENT_IMG)}
+<meta name="description" content="{$COMMENT_IMG|@strip_tags:false|@replace:'"':' '}{if isset($INFO_FILE)} - {$INFO_FILE}{/if}">
+{else}
+<meta name="description" content="{$PAGE_TITLE}{if isset($INFO_FILE)} - {$INFO_FILE}{/if}">
+{/if}
+{/if}
+
+{if (isset($REVERSE) and $REVERSE and $PAGE_TITLE == l10n('home'))}
+<title>{$GALLERY_TITLE} | {$PAGE_TITLE}</title>{else}
+<title>{$PAGE_TITLE} | {$GALLERY_TITLE}</title>{/if}
 <link rel="shortcut icon" type="image/x-icon" href="{$ROOT_URL}template-common/favicon.ico">
 
@@ -23,5 +38,5 @@
 	<link rel="stylesheet" type="text/css" href="{$ROOT_URL}template/{$themeconf.template}/fix-ie5-ie6.css">
 <![endif]-->
-<!--[if gt IE 6]>
+<!--[if IE 7]>
 	<link rel="stylesheet" type="text/css" href="{$ROOT_URL}template/{$themeconf.template}/fix-ie7.css">
 <![endif]-->
@@ -30,5 +45,4 @@
 <!--> <![endif]-->
 <link rel="stylesheet" type="text/css" media="print" href="{$ROOT_URL}template/{$themeconf.template}/print.css">
-<link rel="stylesheet" type="text/css" href="{$ROOT_URL}template/{$themeconf.template}/default-colors.css">
 <link rel="stylesheet" type="text/css" href="{$ROOT_URL}template/{$themeconf.template}/theme/{$themeconf.theme}/theme.css">
 {$themeconf.local_head}
@@ -50,7 +64,7 @@
 <![endif]-->
 
-
 {if not empty($head_elements)}
-	{foreach from=$head_elements item=elt}{$elt}{/foreach}
+	{foreach from=$head_elements item=elt}{$elt}
+	{/foreach}
 {/if}
 
@@ -59,5 +73,37 @@
 <body id="{$BODY_ID}">
 <div id="the_page">
+{php}
+if (is_admin() and !(pwg_get_session_var('floOS_array_version')) and !(pwg_get_session_var('floOS_checked_version')) )
+{
+	global $template, $page;
+	$header_msgs = array();
+	$name_is_nutd = array();
+	include_once(PHPWG_ROOT_PATH.'template/floOS/tools/version.conf.php');
+	include_once(PHPWG_ROOT_PATH.'template/floOS/tools/floOS.class.php');
+	load_language('template.lang', PHPWG_ROOT_PATH.'template/floOS/tools/');
+	$floOS = new floOS();
+	if( $floOS->is_not_up_to_date($floOS_conf['version'], '135') )
+	{
+		$template->append('header_msgs', l10n('floOS_update_needed'));
+		$name_is_nutd['floOS']=$floOS_conf['version'];
+	}
+	$floOS->theme_version_search(PHPWG_ROOT_PATH.'template/floOS/theme');
+	$name_is_nutd= $name_is_nutd + $floOS->is_nutd;
+	pwg_set_session_var('floOS_array_version',$name_is_nutd);
+	pwg_set_session_var('floOS_checked_version', true);
+}
+else if (is_admin() and  pwg_get_session_var('floOS_array_version') )
+{
 
+	global $template;
+	$header_msgs = array();
+	include_once(PHPWG_ROOT_PATH.'template/floOS/tools/floOS.class.php');
+	load_language('template.lang', PHPWG_ROOT_PATH.'template/floOS/tools/');
+	$floOS = new floOS();
+	$floOS->display(pwg_get_session_var('floOS_array_version'));
+}
+	//pwg_unset_session_var('floOS_checked_version');
+{/php}
+{$erreur}
 {if not empty($header_msgs)}
 <div class="header_msgs">
@@ -68,13 +114,7 @@
 {/if}
 
-{if not empty($PAGE_BANNER) or isset($pwgmenu) or not empty($header_notes)}
-<div id="theHeader">
-{$PAGE_BANNER}
-{if isset($pwgmenu)}
-<ul class="pwgmenu">
-  <li><a href="{$pwgmenu.WIKI}" onclick="window.open(this.href, ''); return false;"><span class="bg">{'WIKI / DOC'|@translate}</span></a></li>
-  <li><a href="{$pwgmenu.FORUM}" onclick="window.open(this.href, ''); return false;"><span class="bg">{'FORUM'|@translate}</span></a></li>
-</ul>   
-{/if}
+
+<div id="theHeader">{$PAGE_BANNER}</div>
+{if isset($theSwiftHeader)}{$theSwiftHeader}{/if}
 {if not empty($header_notes)}
 <div class="header_notes">
@@ -84,4 +124,2 @@
 </div>
 {/if}
-</div>
-{/if}
Index: /extensions/floOs/tools/floOS.class.php
===================================================================
--- /extensions/floOs/tools/floOS.class.php	(revision 3617)
+++ /extensions/floOs/tools/floOS.class.php	(revision 3617)
@@ -0,0 +1,168 @@
+<?php
+class floOS
+{
+	var $is_nutd = array();
+	function floOS_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/floOS/tools/');
+	$header_msgs = array();
+	$dh = opendir ($dir);
+	while (($file = readdir ($dh)) !== false ) {
+		if ($file !== '.' && $file !== '..' && $file !== '.svn') { // enleve svn
+			$path =$dir.'/'.$file;
+			if (is_dir($path)) {
+				$this->theme_version_search($path);
+			}
+			else
+			{
+			  $page = explode('.', $file);
+			  $nb = count($page);
+			  $nom_fichier = $page[0];
+			  for ($i = 1; $i < $nb-1; $i++){
+			   $nom_fichier .= '.'.$page[$i];
+			  }
+			  if(isset($page[1])){
+			   $ext_fichier = $page[$nb-1];
+			  }
+			  else {
+			   $ext_fichier = '';
+			  }
+			  if($nom_fichier == 'themeconf.inc' and $ext_fichier == 'php') {
+				  include($path);
+				  if (isset($themeconf['eid']))
+				  {
+					  if($this->is_not_up_to_date($themeconf['version'],$themeconf['eid']) )
+					  {
+						  
+						  $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']]=$themeconf['version'];
+					  }
+				  }
+					  
+			  }
+			}
+		}
+	}
+	closedir ($dh); // on ferme le repertoire courant
+	}
+	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/floOS/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 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 .= '&extension_include='.$eid;
+	fetchRemote($url, $result);
+	  $pem_res = @unserialize($result);
+	  foreach($pem_res as $pem_floOS)
+	  {
+		  if (!is_array($pem_floOS))
+		  {
+			$template->assign(
+				array(
+				  'erreur' => 'erreur url : '.$url,
+				)
+			  );
+		  }
+		if (!$this->floOS_version_compare($v_local, $pem_floOS['revision_name']))
+		{
+			  return true;
+		}
+		else
+		{
+			return false;
+		}
+	  }
+	}
+	function display($names)
+	{
+		if (!is_array($names))
+		{
+			global $template;
+			$template->assign(
+				array(
+					'erreur' => 'erreur get session var not array',
+				)
+			);
+		}
+		else
+		{
+			global $template, $user;
+			load_language('template.lang', PHPWG_ROOT_PATH.'template/floOS/tools/');
+			$r_names=$names;
+			foreach($names as $name => $version)
+			{
+				if ($name=='floOS')
+				{
+					include(PHPWG_ROOT_PATH.'template/floOS/tools/version.conf.php');
+					if ($this->floOS_version_compare($version, $floOS_conf['version']))
+					{
+						$template->append('header_msgs', l10n('floOS_update_needed'));
+					}
+					else
+					{
+						$p=array_search($name,array_keys($r_names));
+						array_splice ($r_names,$p,1);
+					}
+					
+				}
+				else
+				{
+					if ( is_dir(PHPWG_ROOT_PATH.'template/floOS/theme/'.$name) and is_file(PHPWG_ROOT_PATH.'template/floOS/theme/'.$name.'/themeconf.inc.php') )
+					{
+						include(PHPWG_ROOT_PATH.'template/floOS/theme/'.$name.'/themeconf.inc.php');
+						if ($this->floOS_version_compare($version, $themeconf['version']))
+						{
+							$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
+						{
+							$p=array_search($name,array_keys($r_names));
+							array_splice ($r_names,$p,1);
+						}
+					}
+				}
+			}
+		}//else
+		
+	pwg_set_session_var('floOS_array_version',$r_names);
+	}
+}
+?>
Index: /extensions/floOs/tools/language/en_UK/index.php
===================================================================
--- /extensions/floOs/tools/language/en_UK/index.php	(revision 3617)
+++ /extensions/floOs/tools/language/en_UK/index.php	(revision 3617)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
+// | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
+// | last modifier : $Author: rub $
+// | revision      : $Revision: 1912 $
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/floOs/tools/language/en_UK/template.lang.php
===================================================================
--- /extensions/floOs/tools/language/en_UK/template.lang.php	(revision 3617)
+++ /extensions/floOs/tools/language/en_UK/template.lang.php	(revision 3617)
@@ -0,0 +1,8 @@
+<?php
+
+$lang['floOS_update_needed'] = 'Your version of floOS is not up to date : <a href="http://fr.piwigo.org/ext/extension_view.php?eid=135" title="go to the page of the template" target="_blank" >click here to download the last revision of the template floOS</a>';
+	$lang['theme_update_needed_1'] = 'The theme ';
+	$lang['theme_update_needed_2'] = ' is not up to date : <a href="http://fr.piwigo.org/ext/extension_view.php?eid=';
+	$lang['theme_update_needed_3'] = '" title="go to the page of the theme" target="_blank" >click here to download the last revision of the theme ';
+	$lang['theme_update_needed_4'] = '</a>';
+?>
Index: /extensions/floOs/tools/language/fr_FR/index.php
===================================================================
--- /extensions/floOs/tools/language/fr_FR/index.php	(revision 3617)
+++ /extensions/floOs/tools/language/fr_FR/index.php	(revision 3617)
@@ -0,0 +1,33 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | PhpWebGallery - a PHP based picture gallery                           |
+// | Copyright (C) 2002-2003 Pierrick LE GALL - pierrick@phpwebgallery.net |
+// | Copyright (C) 2003-2007 PhpWebGallery Team - http://phpwebgallery.net |
+// +-----------------------------------------------------------------------+
+// | file          : $Id: index.php 1912 2007-03-16 06:30:07Z rub $
+// | last update   : $Date: 2007-03-16 07:30:07 +0100 (ven, 16 mar 2007) $
+// | last modifier : $Author: rub $
+// | revision      : $Revision: 1912 $
+// +-----------------------------------------------------------------------+
+// | This program is free software; you can redistribute it and/or modify  |
+// | it under the terms of the GNU General Public License as published by  |
+// | the Free Software Foundation                                          |
+// |                                                                       |
+// | This program is distributed in the hope that it will be useful, but   |
+// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
+// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
+// | General Public License for more details.                              |
+// |                                                                       |
+// | You should have received a copy of the GNU General Public License     |
+// | along with this program; if not, write to the Free Software           |
+// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
+// | USA.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/floOs/tools/language/fr_FR/template.lang.php
===================================================================
--- /extensions/floOs/tools/language/fr_FR/template.lang.php	(revision 3617)
+++ /extensions/floOs/tools/language/fr_FR/template.lang.php	(revision 3617)
@@ -0,0 +1,9 @@
+<?php
+
+$lang['floOS_update_needed'] = 'Votre version de floOS n\'est pas à jour : <a href="http://fr.piwigo.org/ext/extension_view.php?eid=135" title="aller à la mise à jour" target="_blank" >cliquez ici pour accéder à la dernière révision du template floOS</a>';
+	$lang['theme_update_needed_1'] = 'Le thème ';
+	$lang['theme_update_needed_2'] = ' n\'est pas à jour : <a href="http://fr.piwigo.org/ext/extension_view.php?eid=';
+	$lang['theme_update_needed_3'] = '" title="aller à la mise à jour" target="_blank" >cliquez ici pour accéder à la dernière révision du thème ';
+	$lang['theme_update_needed_4'] = '</a>';
+
+?>
Index: /extensions/floOs/tools/version.conf.php
===================================================================
--- /extensions/floOs/tools/version.conf.php	(revision 3617)
+++ /extensions/floOs/tools/version.conf.php	(revision 3617)
@@ -0,0 +1,7 @@
+<?php
+$floOS_conf = array(
+  'name' => 'floOS',
+  'version' => '2.1.1',
+);
+
+?>
