Index: /trunk/plugins/language_switch/flags.tpl
===================================================================
--- /trunk/plugins/language_switch/flags.tpl	(revision 3369)
+++ /trunk/plugins/language_switch/flags.tpl	(revision 3369)
@@ -0,0 +1,48 @@
+</ul>
+<ul class="categoryActions">
+<li class="menuf">
+	<div>
+		<ul>
+			<li>
+				<a rel="nofollow" href="#">
+					<img class="flags" src="{$lang_switch.Active.img}" alt="{$lang_switch.Active.alt}" title="{$lang_switch.Active.alt}"/>
+				</a>
+				<!--[if lte IE 6]>
+					<a rel="nofollow" href="#">
+						<img class="flags" src="{$lang_switch.Active.img}" alt="{$lang_switch.Active.alt}" title="{$lang_switch.Active.alt}"/>
+						<table>
+							<tr>
+								<td>
+				<![endif]-->
+									<ul class="flag-pan">
+									{foreach from=$lang_switch.flags key=code item=flag name=f}
+										<li>
+											<a rel="nofollow" href="{$flag.url}">
+												<img class="flags" src="{$flag.img}" alt="{$flag.alt}" title="{$flag.alt}"/>
+											</a>
+										</li>
+									{/foreach}
+									</ul>
+				<!--[if lte IE 6]>
+								</td>
+							</tr>
+						</table>
+					</a>
+				<![endif]-->
+			</li>
+		</ul>
+	</div>
+</li>
+{html_head}
+{if $themeconf.template=='yoga' and $themeconf.theme=='Sylvia'}
+<link rel="stylesheet" type="text/css" href="{$LANGUAGE_SWITCH_PATH|@cat:'language_switch.css'}"> 
+{else}
+<link rel="stylesheet" type="text/css" href="{$LANGUAGE_SWITCH_PATH|@cat:'language_switch-default.css'}"> 
+{/if}
+{if Componant_exists($LANGUAGE_SWITCH_PATH, 'language_switch-local.css')}
+<link rel="stylesheet" type="text/css" href="{$LANGUAGE_SWITCH_PATH|@cat:'language_switch-local.css'}"> 
+{/if}
+<!--[if lte IE 6]>
+<link rel="stylesheet" type="text/css" href="{$LANGUAGE_SWITCH_PATH|@cat:'language_switch-ie6.css'}"> 
+<![endif]-->
+{/html_head}
Index: unk/plugins/language_switch/icons/index.php
===================================================================
--- /trunk/plugins/language_switch/icons/index.php	(revision 3368)
+++ 	(revision )
@@ -1,30 +1,0 @@
-<?php
-// +-----------------------------------------------------------------------+
-// | Piwigo - a PHP based picture gallery                                  |
-// +-----------------------------------------------------------------------+
-// | Copyright(C) 2008-2009 Piwigo Team                  http://piwigo.org |
-// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
-// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
-// +-----------------------------------------------------------------------+
-// | 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: /trunk/plugins/language_switch/language_switch-default.css
===================================================================
--- /trunk/plugins/language_switch/language_switch-default.css	(revision 3369)
+++ /trunk/plugins/language_switch/language_switch-default.css	(revision 3369)
@@ -0,0 +1,15 @@
+.flag-pan { width:132px; z-index:100; border-width:1px; border-style: solid; background-color: #999; padding: 2px 5px 10px 5px; }
+.content ul.categoryActions .flag-pan a img.flags { margin: 5px 2px 10px; }
+.content ul.categoryActions .flag-pan a { margin: 0; }
+.menuf { width:30px; height:24px; display: inline; } 
+.menuf ul li a, .menuf ul li a:visited {display:block; text-decoration:none; width:44px; height:27px; text-align:center; line-height:27px; overflow:hidden;}
+.menuf ul {padding:0; margin:0; list-style: none;}
+.menuf ul li {float:left; position:relative; right: 0; top: 0;}
+.menuf ul li ul {display: none;}/* specific to non IE browsers */
+.menuf li a:hover { border:0 !important;}
+.menuf .flags {border-width:1px !important; ; border-style: solid !important; }
+.menuf ul li:hover ul {display:block; position:absolute; top:0px; left:-96px; }
+.menuf ul li:hover ul li ul {display: none;}
+.menuf ul li:hover ul li {display: block;}
+.menuf ul li:hover ul li a {display:block;}
+.menuf ul li:hover ul li:hover ul {display:block; position:absolute; left:0px; top:0;}
Index: /trunk/plugins/language_switch/language_switch-ie6.css
===================================================================
--- /trunk/plugins/language_switch/language_switch-ie6.css	(revision 3369)
+++ /trunk/plugins/language_switch/language_switch-ie6.css	(revision 3369)
@@ -0,0 +1,6 @@
+.menuf ul li a.hide, .menuf ul li a:visited.hide {display:none;}
+.menuf ul li a:hover ul li a.hide {display:none;}
+.menuf ul li a:hover ul { display:block; position:absolute; top:-15%; left:-85%; }
+.menuf ul li a:hover ul li a {display:block; }
+.menuf ul li a:hover ul li a ul {visibility:hidden;}
+.menuf ul li a:hover ul li a:hover ul {visibility:visible; position:absolute; left:105px; top:0;}
Index: /trunk/plugins/language_switch/language_switch.css
===================================================================
--- /trunk/plugins/language_switch/language_switch.css	(revision 3369)
+++ /trunk/plugins/language_switch/language_switch.css	(revision 3369)
@@ -0,0 +1,16 @@
+.flag-pan { width:132px; z-index:100; border:2px solid; background-color: #111; padding: 2px 5px 10px 5px; 
+-moz-border-radius-bottomleft:8px; -moz-border-radius-bottomright:8px; -moz-border-radius-topleft:8px; -moz-border-radius-topright:8px;}
+.content ul.categoryActions .flag-pan a img.flags { margin: 5px 2px 10px; }
+.content ul.categoryActions .flag-pan a { margin: 0; }
+.menuf { width:30px; height:24px; display: inline; } 
+.menuf ul li a, .menuf ul li a:visited {display:block; text-decoration:none; width:44px; height:27px; text-align:center; line-height:27px; overflow:hidden;}
+.menuf ul {padding:0; margin:0; list-style: none;}
+.menuf ul li {float:left; position:relative; right: 0; top: 0;}
+.menuf ul li ul {display: none;}/* specific to non IE browsers */
+.menuf li a:hover { border:0 !important;}
+.menuf .flags {border:1px solid #000 !important; }
+.menuf ul li:hover ul {display:block; position:absolute; top:0px; left:-96px; }
+.menuf ul li:hover ul li ul {display: none;}
+.menuf ul li:hover ul li {display: block;}
+.menuf ul li:hover ul li a {display:block;}
+.menuf ul li:hover ul li:hover ul {display:block; position:absolute; left:0px; top:0;}
Index: /trunk/plugins/language_switch/language_switch.inc.php
===================================================================
--- /trunk/plugins/language_switch/language_switch.inc.php	(revision 3368)
+++ /trunk/plugins/language_switch/language_switch.inc.php	(revision 3369)
@@ -21,4 +21,6 @@
 // | USA.                                                                  |
 // +-----------------------------------------------------------------------+
+if (!defined('LANGUAGE_SWITCH_PATH'))
+define('LANGUAGE_SWITCH_PATH' , PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/');
 function language_switch()
 {
@@ -67,6 +69,51 @@
 }
 //if ( isset( $_GET['lang']) ) { redirect( make_index_url() ); }
+function Lang_flags()
+{
+  global $user, $template;
+  $available_lang = get_languages();
+	$lsw = array();
+  foreach ( $available_lang as $code => $displayname )
+  {
+    $qlc_url = add_url_params( make_index_url(), array( 'lang' => $code ) );
+    $qlc_alt = ucwords( $displayname );
+    $qlc_img =  'plugins/language_switch/icons/'
+       . $code . '.jpg';
+    if ( $code !== $user['language'] and file_exists(PHPWG_ROOT_PATH.$qlc_img) )
+    {
+      $lsw['flags'][$code] = Array(
+				'url' => $qlc_url,
+				'alt' => $qlc_alt,
+				'img' => $qlc_img,
+			) ;
+    } else {
+			$lsw['Active'] = Array(
+				'url' => $qlc_url,
+				'alt' => $qlc_alt,
+				'img' => $qlc_img,
+			);
+		}
+  }
+	$template->set_filename('language_flags', dirname(__FILE__) . '/flags.tpl');
+	$lsw['side'] = ceil(sqrt(count($available_lang)));
+	$template->assign(array(
+		'lang_switch'=> $lsw,
+		'LANGUAGE_SWITCH_PATH' => LANGUAGE_SWITCH_PATH,
+	));
+	$flags = $template->parse('language_flags',true);
+	$template->clear_assign('lang_switch');
+	$template->concat( 'PLUGIN_INDEX_ACTIONS', $flags);
+	// In state of making a $flags each time TODO Caching $flags[$user['language']]
+}
 
-function Lang_flags()
+if (!function_exists('Componant_exists')) {
+	function Componant_exists($path, $file)
+	{
+	  return file_exists( $path . $file);
+	}
+}
+
+// Should be deleted later
+function Lang_flags_previous_function()
 {
   global $user, $template;
Index: /trunk/plugins/language_switch/main.inc.php
===================================================================
--- /trunk/plugins/language_switch/main.inc.php	(revision 3368)
+++ /trunk/plugins/language_switch/main.inc.php	(revision 3369)
@@ -24,5 +24,5 @@
 /*
 Plugin Name: Language Switch
-Version: 2.0.2
+Version: 2.0.2a
 Description: Switch to another language from flags on your gallery home page.
 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=123
