Index: /extensions/theme_switch/trunk/default.css
===================================================================
--- /extensions/theme_switch/trunk/default.css	(revision 16241)
+++ /extensions/theme_switch/trunk/default.css	(revision 16241)
@@ -0,0 +1,14 @@
+#themeSwitchBox {
+	padding: 0.5em 5px;
+	border-radius: 4px;
+	z-index: 100;
+	text-align:left;
+	display: none;
+	position: absolute;
+	left: 0; top: 0; /*left, right set through js*/
+}
+
+#themeSwitchBox .switchBoxTitle {
+  padding-bottom:5px;
+  margin-bottom:5px;
+}
Index: tensions/theme_switch/trunk/flags.tpl
===================================================================
--- /extensions/theme_switch/trunk/flags.tpl	(revision 16240)
+++ 	(revision )
@@ -1,48 +1,0 @@
-</ul>
-<ul class="categoryActions">
-<li class="theme_menuf">
-	<div>
-		<ul>
-			<li>
-				<a rel="nofollow" href="#">
-					<img class="theme_flag" src="{$theme_switch.Active.img}" alt="{$theme_switch.Active.alt}" title="{$theme_switch.Active.alt}"/>
-				</a>
-				<!--[if lte IE 6]>
-					<a rel="nofollow" href="#">
-						<img class="theme_flag" src="{$theme_switch.Active.img}" alt="{$theme_switch.Active.alt}" title="{$theme_switch.Active.alt}"/>
-						<table>
-							<tr>
-								<td>
-				<![endif]-->
-									<ul class="theme_flag-pan">
-									{foreach from=$theme_switch.flags key=code item=flag name=f}
-										<li>
-											<a rel="nofollow" href="{$SCRIPT_NAME}{$flag.url}">
-												<img class="theme_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.name =='Sylvia'}
-<link rel="stylesheet" type="text/css" href="{$ROOT_URL}{$THEME_SWITCH_PATH|@cat:'theme_switch.css'}"> 
-{else}
-<link rel="stylesheet" type="text/css" href="{$ROOT_URL}{$THEME_SWITCH_PATH|@cat:'theme_switch-default.css'}"> 
-{/if}
-{if Componant_exists($theme_SWITCH_PATH, 'theme_switch-local.css')}
-<link rel="stylesheet" type="text/css" href="{$ROOT_URL}{$THEME_SWITCH_PATH|@cat:'theme_switch-local.css'}"> 
-{/if}
-<!--[if lte IE 6]>
-<link rel="stylesheet" type="text/css" href="{$ROOT_URL}{$THEME_SWITCH_PATH|@cat:'theme_switch-ie6.css'}"> 
-<![endif]-->
-{/html_head}
Index: tensions/theme_switch/trunk/language/ca_ES/plugin.lang.php
===================================================================
--- /extensions/theme_switch/trunk/language/ca_ES/plugin.lang.php	(revision 16240)
+++ 	(revision )
@@ -1,24 +1,0 @@
-<?php
-// +-----------------------------------------------------------------------+
-// | Piwigo - a PHP based photo gallery                                    |
-// +-----------------------------------------------------------------------+
-// | Copyright(C) 2008-2012 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.                                                                  |
-// +-----------------------------------------------------------------------+
-$lang['theme'] = 'Tema:';
-?>
Index: tensions/theme_switch/trunk/language/cs_CZ/plugin.lang.php
===================================================================
--- /extensions/theme_switch/trunk/language/cs_CZ/plugin.lang.php	(revision 16240)
+++ 	(revision )
@@ -1,25 +1,0 @@
-<?php
-// +-----------------------------------------------------------------------+
-// | Piwigo - a PHP based picture gallery                                  |
-// | Theme switch plugin                                                   |
-// +-----------------------------------------------------------------------+
-// | Copyright(C) 2008      Pavel Budka                http://pbudka.co.cc |
-// +-----------------------------------------------------------------------+
-// | 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.                                                                  |
-// +-----------------------------------------------------------------------+
-
-$lang['theme'] = 'Téma:';
-
-?>
Index: /extensions/theme_switch/trunk/language/de_DE/description.txt
===================================================================
--- /extensions/theme_switch/trunk/language/de_DE/description.txt	(revision 16240)
+++ /extensions/theme_switch/trunk/language/de_DE/description.txt	(revision 16241)
@@ -1,1 +1,1 @@
-Ermöglicht angemeldete oder nicht angemeldete Benutzer die Veränderung des Galerie-Layouts (durch die Umstellung auf ein anderes Thema) auf der Galerie-Startseite. Basierend auf "Language switch". Der Schalter kann Themanamen oder Themasymbole zeigen, dies hängt von der Konfiguration ab. Details finden Sie in der Datei main.inc.php.
+Ermöglicht angemeldete oder nicht angemeldete Benutzer die Veränderung des Galerie-Layouts (durch die Umstellung auf ein anderes Thema) auf der Galerie-Startseite. Basierend auf "Language switch". Der Schalter kann Themanamen oder Themasymbole zeigen, dies hängt von der Konfiguration ab.
Index: tensions/theme_switch/trunk/language/de_DE/plugin.lang.php
===================================================================
--- /extensions/theme_switch/trunk/language/de_DE/plugin.lang.php	(revision 16240)
+++ 	(revision )
@@ -1,24 +1,0 @@
-<?php
-// +-----------------------------------------------------------------------+
-// | Piwigo - a PHP based picture gallery                                  |
-// | Theme switch plugin                                                   |
-// +-----------------------------------------------------------------------+
-// | Copyright(C) 2008      Pavel Budka                http://pbudka.co.cc |
-// +-----------------------------------------------------------------------+
-// | 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.                                                                  |
-// +-----------------------------------------------------------------------+
-
-$lang['theme'] = "Thema:";
-?>
Index: tensions/theme_switch/trunk/language/el_GR/plugin.lang.php
===================================================================
--- /extensions/theme_switch/trunk/language/el_GR/plugin.lang.php	(revision 16240)
+++ 	(revision )
@@ -1,24 +1,0 @@
-<?php
-// +-----------------------------------------------------------------------+
-// | Piwigo - a PHP based photo gallery                                    |
-// +-----------------------------------------------------------------------+
-// | Copyright(C) 2008-2012 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.                                                                  |
-// +-----------------------------------------------------------------------+
-$lang['theme'] = 'Θέμα:';
-?>
Index: /extensions/theme_switch/trunk/language/en_UK/description.txt
===================================================================
--- /extensions/theme_switch/trunk/language/en_UK/description.txt	(revision 16240)
+++ /extensions/theme_switch/trunk/language/en_UK/description.txt	(revision 16241)
@@ -1,1 +1,1 @@
-Lets logged or unlogged user change appearance of gallery (via switching to different theme) on gallery home page. Based on Language switch. The switch can show theme names or theme icons, depends on configuration. See details in a file main.inc.php.
+Lets users change the theme of the gallery via menu on home page. The switch can show theme names or theme icons, depends on configuration.
Index: tensions/theme_switch/trunk/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/theme_switch/trunk/language/en_UK/plugin.lang.php	(revision 16240)
+++ 	(revision )
@@ -1,24 +1,0 @@
-<?php
-// +-----------------------------------------------------------------------+
-// | Piwigo - a PHP based picture gallery                                  |
-// | Theme switch plugin                                                   |
-// +-----------------------------------------------------------------------+
-// | Copyright(C) 2008      Pavel Budka                http://pbudka.co.cc |
-// +-----------------------------------------------------------------------+
-// | 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.                                                                  |
-// +-----------------------------------------------------------------------+
-
-$lang['theme'] = "Theme:";
-?>
Index: /extensions/theme_switch/trunk/language/es_ES/description.txt
===================================================================
--- /extensions/theme_switch/trunk/language/es_ES/description.txt	(revision 16240)
+++ /extensions/theme_switch/trunk/language/es_ES/description.txt	(revision 16241)
@@ -1,4 +1,1 @@
-Permite cambiar el aspecto visual de la galería en la
-página principal, tanto a usuarios identificados como anónimos, mediante la
-elección de otro ‘tema’. El cambio aplicará literales o iconos del tema,
-dependiendo de la configuración. Vea los detalles en main.inc.php
+Permite cambiar el aspecto visual de la galería en la página principal, tanto a usuarios identificados como anónimos, mediante la elección de otro ‘tema’. El cambio aplicará literales o iconos del tema, dependiendo de la configuración.
Index: tensions/theme_switch/trunk/language/es_ES/plugin.lang.php
===================================================================
--- /extensions/theme_switch/trunk/language/es_ES/plugin.lang.php	(revision 16240)
+++ 	(revision )
@@ -1,24 +1,0 @@
-<?php
-// +-----------------------------------------------------------------------+
-// | Piwigo - a PHP based picture gallery                                  |
-// | Theme switch plugin                                                   |
-// +-----------------------------------------------------------------------+
-// | Copyright(C) 2008      Pavel Budka                http://pbudka.co.cc |
-// +-----------------------------------------------------------------------+
-// | 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.                                                                  |
-// +-----------------------------------------------------------------------+
-
-$lang['theme'] = 'Tema:';
-?>
Index: /extensions/theme_switch/trunk/language/fr_FR/description.txt
===================================================================
--- /extensions/theme_switch/trunk/language/fr_FR/description.txt	(revision 16240)
+++ /extensions/theme_switch/trunk/language/fr_FR/description.txt	(revision 16241)
@@ -1,2 +1,1 @@
-Permet de Changer de thèmes sur la galerie facilement (invité et utilisateurs) à partir d'icônes ou d'une liste présente sur la page d'accueil.
-Voir les détails dans un fichier main.inc.php.
+Permet de Changer de thèmes sur la galerie facilement à partir d'icônes ou d'une liste présente sur la page d'accueil.
Index: tensions/theme_switch/trunk/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/theme_switch/trunk/language/fr_FR/plugin.lang.php	(revision 16240)
+++ 	(revision )
@@ -1,24 +1,0 @@
-<?php
-// +-----------------------------------------------------------------------+
-// | Piwigo - a PHP based picture gallery                                  |
-// | Theme switch plugin                                                   |
-// +-----------------------------------------------------------------------+
-// | Copyright(C) 2008      Pavel Budka                http://pbudka.co.cc |
-// +-----------------------------------------------------------------------+
-// | 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.                                                                  |
-// +-----------------------------------------------------------------------+
-
-$lang['theme'] = "Thème:";
-?>
Index: /extensions/theme_switch/trunk/language/hu_HU/description.txt
===================================================================
--- /extensions/theme_switch/trunk/language/hu_HU/description.txt	(revision 16240)
+++ /extensions/theme_switch/trunk/language/hu_HU/description.txt	(revision 16241)
@@ -1,1 +1,1 @@
-Lehetőv&eacute; teszi a felhaszn&aacute;l&oacute;knak &eacute;s vend&eacute;geknek, hogy megv&aacute;ltoztass&aacute;k a gal&eacute;ria megjelen&eacute;s&eacute;t. Mutathatja a t&eacute;m&aacute;k ikonj&aacute;t &eacute;s/vagy nev&eacute;t, a be&aacute;ll&iacute;t&aacute;st&oacute;l f&uuml;ggően. A r&eacute;szletek a main.inc.php f&aacute;jlban tal&aacute;lhat&oacute;k.
+Lehetőv&eacute; teszi a felhaszn&aacute;l&oacute;knak &eacute;s vend&eacute;geknek, hogy megv&aacute;ltoztass&aacute;k a gal&eacute;ria megjelen&eacute;s&eacute;t. Mutathatja a t&eacute;m&aacute;k ikonj&aacute;t &eacute;s/vagy nev&eacute;t, a be&aacute;ll&iacute;t&aacute;st&oacute;l f&uuml;ggően.
Index: /extensions/theme_switch/trunk/language/hu_HU/index.php
===================================================================
--- /extensions/theme_switch/trunk/language/hu_HU/index.php	(revision 16241)
+++ /extensions/theme_switch/trunk/language/hu_HU/index.php	(revision 16241)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2010 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: tensions/theme_switch/trunk/language/hu_HU/plugin.lang.php
===================================================================
--- /extensions/theme_switch/trunk/language/hu_HU/plugin.lang.php	(revision 16240)
+++ 	(revision )
@@ -1,24 +1,0 @@
-<?php
-// +-----------------------------------------------------------------------+
-// | Piwigo - a PHP based photo 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.                                                                  |
-// +-----------------------------------------------------------------------+
-$lang['theme'] = 'Megjelenítés témája:';
-?>
Index: /extensions/theme_switch/trunk/language/it_IT/description.txt
===================================================================
--- /extensions/theme_switch/trunk/language/it_IT/description.txt	(revision 16240)
+++ /extensions/theme_switch/trunk/language/it_IT/description.txt	(revision 16241)
@@ -1,1 +1,1 @@
-Consente agli utenti registrati o non registrati a modificare l'aspetto della galleria (attraverso lo scambio di diversi temi) sul sito della galleria. Il Plug-in è basato su "Language switch". Il switch può mostrare i nomi dei temi o le icone dei temi, a seconda dalla configurazione. Per ulteriori dettagli controllate il file main.inc.php.
+Consente agli utenti registrati o non registrati a modificare l'aspetto della galleria (attraverso lo scambio di diversi temi) sul sito della galleria. Il Plug-in è basato su "Language switch". Il switch può mostrare i nomi dei temi o le icone dei temi, a seconda dalla configurazione.
Index: tensions/theme_switch/trunk/language/it_IT/plugin.lang.php
===================================================================
--- /extensions/theme_switch/trunk/language/it_IT/plugin.lang.php	(revision 16240)
+++ 	(revision )
@@ -1,24 +1,0 @@
-<?php
-// +-----------------------------------------------------------------------+
-// | Piwigo - a PHP based picture gallery                                  |
-// | Theme switch plugin                                                   |
-// +-----------------------------------------------------------------------+
-// | Copyright(C) 2008      Pavel Budka                http://pbudka.co.cc |
-// +-----------------------------------------------------------------------+
-// | 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.                                                                  |
-// +-----------------------------------------------------------------------+
-
-$lang['theme'] = "Tema:";
-?>
Index: /extensions/theme_switch/trunk/language/lv_LV/description.txt
===================================================================
--- /extensions/theme_switch/trunk/language/lv_LV/description.txt	(revision 16240)
+++ /extensions/theme_switch/trunk/language/lv_LV/description.txt	(revision 16241)
@@ -1,1 +1,1 @@
-Dod iespēju ielogotiem un neielogotiem lietotājiem mainīt galerijas izskatu (pārslēdzoties uz citu tēmu) galerijas mājas lapā. Bazēts uz Valodu pārslēgšdanu. Atkarībā no konfigurācijas, slēdzis rāda tēmu nosaukumus vai tēmu ikonas. Detaļas failā main.inc.php.
+Dod iespēju ielogotiem un neielogotiem lietotājiem mainīt galerijas izskatu (pārslēdzoties uz citu tēmu) galerijas mājas lapā. Bazēts uz Valodu pārslēgšdanu. Atkarībā no konfigurācijas, slēdzis rāda tēmu nosaukumus vai tēmu ikonas.
Index: tensions/theme_switch/trunk/language/lv_LV/plugin.lang.php
===================================================================
--- /extensions/theme_switch/trunk/language/lv_LV/plugin.lang.php	(revision 16240)
+++ 	(revision )
@@ -1,24 +1,0 @@
-<?php
-// +-----------------------------------------------------------------------+
-// | Piwigo - a PHP based picture gallery                                  |
-// | Theme switch plugin                                                   |
-// +-----------------------------------------------------------------------+
-// | Copyright(C) 2008      Pavel Budka                http://pbudka.co.cc |
-// +-----------------------------------------------------------------------+
-// | 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.                                                                  |
-// +-----------------------------------------------------------------------+
-
-$lang['theme'] = "Tēma:";
-?>
Index: /extensions/theme_switch/trunk/language/nb_NO/description.txt
===================================================================
--- /extensions/theme_switch/trunk/language/nb_NO/description.txt	(revision 16240)
+++ /extensions/theme_switch/trunk/language/nb_NO/description.txt	(revision 16241)
@@ -1,1 +1,1 @@
-Lar loggede eller uloggede brukere forandre utseende på galleriet (ved å bytte til en annet tema) på galleriets hjemmeside. Basert på språk bryteren. Bryteren kan vise temaets navn eller tema ikoner, avhengig av konfigurasjonen. Se detaljer i filen main.inc.php.
+Lar loggede eller uloggede brukere forandre utseende på galleriet (ved å bytte til en annet tema) på galleriets hjemmeside. Basert på språk bryteren. Bryteren kan vise temaets navn eller tema ikoner, avhengig av konfigurasjonen.
Index: tensions/theme_switch/trunk/language/nb_NO/plugin.lang.php
===================================================================
--- /extensions/theme_switch/trunk/language/nb_NO/plugin.lang.php	(revision 16240)
+++ 	(revision )
@@ -1,24 +1,0 @@
-<?php
-// +-----------------------------------------------------------------------+
-// | Piwigo - a PHP based picture gallery                                  |
-// | Theme switch plugin                                                   |
-// +-----------------------------------------------------------------------+
-// | Copyright(C) 2008      Pavel Budka                http://pbudka.co.cc |
-// +-----------------------------------------------------------------------+
-// | 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.                                                                  |
-// +-----------------------------------------------------------------------+
-
-$lang['theme'] = "Tema:";
-?>
Index: /extensions/theme_switch/trunk/language/nl_NL/description.txt
===================================================================
--- /extensions/theme_switch/trunk/language/nl_NL/description.txt	(revision 16240)
+++ /extensions/theme_switch/trunk/language/nl_NL/description.txt	(revision 16241)
@@ -1,1 +1,1 @@
-Laat al dan niet ingelogde gebruiker, het uiterlijk van de gallery aanpassen(door te schakelen naar een ander theme) op de gallery home pagina. Gebaseerd op de taal switch. De keuze kan als thema namen of iconen worden weergegeven, afhankelijk van de configuratie. Zie de details in main.inc.php.
+Laat al dan niet ingelogde gebruiker, het uiterlijk van de gallery aanpassen(door te schakelen naar een ander theme) op de gallery home pagina. Gebaseerd op de taal switch. De keuze kan als thema namen of iconen worden weergegeven, afhankelijk van de configuratie.
Index: /extensions/theme_switch/trunk/language/nl_NL/index.php
===================================================================
--- /extensions/theme_switch/trunk/language/nl_NL/index.php	(revision 16241)
+++ /extensions/theme_switch/trunk/language/nl_NL/index.php	(revision 16241)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2010 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: tensions/theme_switch/trunk/language/nl_NL/plugin.lang.php
===================================================================
--- /extensions/theme_switch/trunk/language/nl_NL/plugin.lang.php	(revision 16240)
+++ 	(revision )
@@ -1,24 +1,0 @@
-<?php
-// +-----------------------------------------------------------------------+
-// | Piwigo - a PHP based photo gallery                                    |
-// +-----------------------------------------------------------------------+
-// | Copyright(C) 2008-2012 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.                                                                  |
-// +-----------------------------------------------------------------------+
-$lang['theme'] = 'Thema:';
-?>
Index: /extensions/theme_switch/trunk/language/pl_PL/description.txt
===================================================================
--- /extensions/theme_switch/trunk/language/pl_PL/description.txt	(revision 16240)
+++ /extensions/theme_switch/trunk/language/pl_PL/description.txt	(revision 16241)
@@ -1,1 +1,1 @@
-Umożliwia zalogowanym i niezalogowanym użytkownikom zmieniać wygląd strony głównej galerii (poprzez przełączanie różnych skórek). Bazuje na przełączniku języków. W zależności od konfiguracji przełącznik może mieć postać nazw skórek lub ikon skórek. Więcej szczegółów w pliku main.inc.php
+Umożliwia zalogowanym i niezalogowanym użytkownikom zmieniać wygląd strony głównej galerii (poprzez przełączanie różnych skórek). Bazuje na przełączniku języków. W zależności od konfiguracji przełącznik może mieć postać nazw skórek lub ikon skórek.
Index: tensions/theme_switch/trunk/language/pl_PL/plugin.lang.php
===================================================================
--- /extensions/theme_switch/trunk/language/pl_PL/plugin.lang.php	(revision 16240)
+++ 	(revision )
@@ -1,24 +1,0 @@
-<?php
-// +-----------------------------------------------------------------------+
-// | Piwigo - a PHP based picture gallery                                  |
-// | Theme switch plugin                                                   |
-// +-----------------------------------------------------------------------+
-// | Copyright(C) 2008      Pavel Budka                http://pbudka.co.cc |
-// +-----------------------------------------------------------------------+
-// | 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.                                                                  |
-// +-----------------------------------------------------------------------+
-
-$lang['theme'] = "Skórka:";
-?>
Index: /extensions/theme_switch/trunk/language/pt_PT/description.txt
===================================================================
--- /extensions/theme_switch/trunk/language/pt_PT/description.txt	(revision 16240)
+++ /extensions/theme_switch/trunk/language/pt_PT/description.txt	(revision 16241)
@@ -1,1 +1,1 @@
-Permite que um utilizador registado ou n&atilde;o altere a apar&ecirc;ncia da galeria (atrav&eacute;s de acionamento de um tema diferente) na p&aacute;gina principal da galeria. Baseado na altera&ccedil;&atilde;o de idioma. Este accionamento pode mostrar nomes das matrizes(templatess) ou &iacute;cones das matrizes, depende da configura&ccedil;&atilde;o. Veja os detalhes no arquivo main.inc.php.
+Permite que um utilizador registado ou n&atilde;o altere a apar&ecirc;ncia da galeria (atrav&eacute;s de acionamento de um tema diferente) na p&aacute;gina principal da galeria. Baseado na altera&ccedil;&atilde;o de idioma. Este accionamento pode mostrar nomes das matrizes(templatess) ou &iacute;cones das matrizes, depende da configura&ccedil;&atilde;o.
Index: /extensions/theme_switch/trunk/language/pt_PT/index.php
===================================================================
--- /extensions/theme_switch/trunk/language/pt_PT/index.php	(revision 16241)
+++ /extensions/theme_switch/trunk/language/pt_PT/index.php	(revision 16241)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2010 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: tensions/theme_switch/trunk/language/pt_PT/plugin.lang.php
===================================================================
--- /extensions/theme_switch/trunk/language/pt_PT/plugin.lang.php	(revision 16240)
+++ 	(revision )
@@ -1,24 +1,0 @@
-<?php
-// +-----------------------------------------------------------------------+
-// | Piwigo - a PHP based photo gallery                                    |
-// +-----------------------------------------------------------------------+
-// | Copyright(C) 2008-2012 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.                                                                  |
-// +-----------------------------------------------------------------------+
-$lang['theme'] = 'Tema';
-?>
Index: /extensions/theme_switch/trunk/language/ru_RU/description.txt
===================================================================
--- /extensions/theme_switch/trunk/language/ru_RU/description.txt	(revision 16240)
+++ /extensions/theme_switch/trunk/language/ru_RU/description.txt	(revision 16241)
@@ -1,1 +1,1 @@
-Позволяет залогиненым и незалогиненым пользователям изменять внешний вид галереи (переключать темы) находясь на главной странице. Основан на переключении языка. Переключатель может показывать название темы или иконку темы в зависимости от конфигурации. Подробности смотрите в файле main.inc.php.
+Позволяет залогиненым и незалогиненым пользователям изменять внешний вид галереи (переключать темы) находясь на главной странице. Основан на переключении языка. Переключатель может показывать название темы или иконку темы в зависимости от конфигурации.
Index: tensions/theme_switch/trunk/language/ru_RU/plugin.lang.php
===================================================================
--- /extensions/theme_switch/trunk/language/ru_RU/plugin.lang.php	(revision 16240)
+++ 	(revision )
@@ -1,24 +1,0 @@
-<?php
-// +-----------------------------------------------------------------------+
-// | Piwigo - a PHP based picture gallery                                  |
-// | Theme switch plugin                                                   |
-// +-----------------------------------------------------------------------+
-// | Copyright(C) 2008      Pavel Budka                http://pbudka.co.cc |
-// +-----------------------------------------------------------------------+
-// | 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.                                                                  |
-// +-----------------------------------------------------------------------+
-
-$lang['theme'] = "Тема";
-?>
Index: /extensions/theme_switch/trunk/language/sk_SK/description.txt
===================================================================
--- /extensions/theme_switch/trunk/language/sk_SK/description.txt	(revision 16240)
+++ /extensions/theme_switch/trunk/language/sk_SK/description.txt	(revision 16241)
@@ -1,1 +1,1 @@
-Nechá zaznamenané alebo nezaznamenané používateľské zmeny vzhľadu galérie (cez prepínač na rôzne témy) na úvodnej stránke galérie. Na základe Prepínača jazyka. Prepínač môže zobraziť názvy tém alebo ikony tém, záleží na konfigurácii. Pozrite detaily v súbore main.inc.php.
+Nechá zaznamenané alebo nezaznamenané používateľské zmeny vzhľadu galérie (cez prepínač na rôzne témy) na úvodnej stránke galérie. Na základe Prepínača jazyka. Prepínač môže zobraziť názvy tém alebo ikony tém, záleží na konfigurácii.
Index: tensions/theme_switch/trunk/language/sk_SK/plugin.lang.php
===================================================================
--- /extensions/theme_switch/trunk/language/sk_SK/plugin.lang.php	(revision 16240)
+++ 	(revision )
@@ -1,25 +1,0 @@
-<?php
-// +-----------------------------------------------------------------------+
-// | Piwigo - a PHP based picture gallery                                  |
-// | Theme switch plugin                                                   |
-// +-----------------------------------------------------------------------+
-// | Copyright(C) 2008      Pavel Budka                http://pbudka.co.cc |
-// +-----------------------------------------------------------------------+
-// | 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.                                                                  |
-// +-----------------------------------------------------------------------+
-
-$lang['theme'] = 'Téma:';
-
-?>
Index: /extensions/theme_switch/trunk/language/uk_UA/index.php
===================================================================
--- /extensions/theme_switch/trunk/language/uk_UA/index.php	(revision 16241)
+++ /extensions/theme_switch/trunk/language/uk_UA/index.php	(revision 16241)
@@ -0,0 +1,30 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Piwigo - a PHP based picture gallery                                  |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2008-2010 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: tensions/theme_switch/trunk/language/uk_UA/plugin.lang.php
===================================================================
--- /extensions/theme_switch/trunk/language/uk_UA/plugin.lang.php	(revision 16240)
+++ 	(revision )
@@ -1,24 +1,0 @@
-<?php
-// +-----------------------------------------------------------------------+
-// | Piwigo - a PHP based photo gallery                                    |
-// +-----------------------------------------------------------------------+
-// | Copyright(C) 2008-2012 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.                                                                  |
-// +-----------------------------------------------------------------------+
-$lang['theme'] = 'Тема:';
-?>
Index: /extensions/theme_switch/trunk/main.inc.php
===================================================================
--- /extensions/theme_switch/trunk/main.inc.php	(revision 16240)
+++ /extensions/theme_switch/trunk/main.inc.php	(revision 16241)
@@ -4,4 +4,5 @@
 // | Theme switch plugin                                                   |
 // +-----------------------------------------------------------------------+
+// | Copyright(C) 2012      Piwigo Team                  http://piwigo.org |
 // | Copyright(C) 2010      Pavel Budka               http://budkovi.ic.cz |
 // +-----------------------------------------------------------------------+
@@ -23,27 +24,23 @@
 /*
 Plugin Name: Theme Switch
-Version: 2.1.a
-Description: Lets logged or unlogged user change appearance of gallery (via switching to different theme) on gallery home page. Based on Language switch. The switch can show theme names or theme icons, depends on configuration. See details in a file main.inc.php.
+Version: auto
+Description: Lets users change the theme of the gallery via menu on home page. The switch can show theme names or theme icons, depends on configuration.
 Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=257
-Author: Pavel Budka
+Author: Pavel Budka & Mistic
 Author URI: http://budkovi.ic.cz
 */
 
-include_once(PHPWG_PLUGINS_PATH.'theme_switch/theme_switch.inc.php');
-$theme_controler = new theme_controler();
-add_event_handler('loading_lang', array(&$theme_controler, '_switch'), 5 );
+// in order to use select box instead of thumbnail view, add
+// $conf['theme_switch_mode'] = 'select';
+// in your local configuration
 
-// If you want user to choose from icons then use following handler. 
-// Only themes which have screenshot.png icon provided will be provided to users.
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
 
-add_event_handler('loc_end_index', array(&$theme_controler, '_flags'), 85 );
+define('THEME_SWITCH_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/');
 
-// If you want user to choose using select control then use following handler.
-// All available themes will be provided to users. 
+include_once(THEME_SWITCH_PATH.'theme_switch.inc.php');
 
-add_event_handler('loc_end_index', array(&$theme_controler, '_select'), 15 );
-
-// this is preparation for future version with configuration 
-// add_event_handler('get_admin_plugin_menu_links', array(&$theme_controler,'_theme_admin'));
+add_event_handler('user_init', 'theme_controler_switch');
+add_event_handler('loc_end_index', 'theme_controler_init');
 
 ?>
Index: /extensions/theme_switch/trunk/select.tpl
===================================================================
--- /extensions/theme_switch/trunk/select.tpl	(revision 16241)
+++ /extensions/theme_switch/trunk/select.tpl	(revision 16241)
@@ -0,0 +1,7 @@
+<li>{strip}{'Interface theme'|@translate}:&nbsp;
+<select onchange="javasript:window.location=this.value">
+{foreach from=$theme_switch item=theme}
+  <option value="{$theme.url}" {$theme.select}>{$theme.name}</option>
+{/foreach}
+</select>
+{/strip}</li>
Index: /extensions/theme_switch/trunk/style.css
===================================================================
--- /extensions/theme_switch/trunk/style.css	(revision 16241)
+++ /extensions/theme_switch/trunk/style.css	(revision 16241)
@@ -0,0 +1,14 @@
+#themeSwitchBox {
+  background-color: #555;
+  border: 1px solid #000;
+}
+
+#themeSwitchBox .switchBoxTitle {
+  border-bottom: 1px solid #444;
+}
+#themeSwitchBox a {
+  color:#aaa;
+}
+#themeSwitchBox a:hover {
+  color:#ddd;
+}
Index: tensions/theme_switch/trunk/theme_switch-default.css
===================================================================
--- /extensions/theme_switch/trunk/theme_switch-default.css	(revision 16240)
+++ 	(revision )
@@ -1,16 +1,0 @@
-.theme_flag-pan { width:530px; z-index:800; border-width:1px; border-style: solid; background-color: #999; padding: 2px 5px 10px 5px; }
-.content ul.categoryActions .theme_flag-pan a img.theme_flags { margin: 5px 2px 10px; }
-.content ul.categoryActions .theme_flag-pan a { margin: 0; }
-.theme_menuf { width:40px; height:24px; display: inline; } 
-.theme_menuf ul li a, .theme_menuf ul li a:visited {display:block; text-decoration:none; overflow:hidden;}
-.theme_menuf ul {padding:0; margin:0; list-style: none;}
-.theme_menuf ul li {float:left; position:relative; right: 0; top: 0;}
-.theme_menuf ul li ul {display: none;}/* specific to non IE browsers */
-.theme_menuf li a:hover { border:0 !important;}
-.theme_menuf .theme_flags {width:100px !important; ; height:60px; text-align:center; line-height:80px; border-width:1px !important; ; border-style: solid !important; }
-.theme_menuf .theme_flag {width:44px; height:27px; line-height:27px; text-align:center; border-width:1px !important; ; border-style: solid !important; }
-.theme_menuf ul li:hover ul {display:block; position:absolute; top:0px; left:-420px; }
-.theme_menuf ul li:hover ul li ul {display: none;}
-.theme_menuf ul li:hover ul li {display: block;}
-.theme_menuf ul li:hover ul li a {display:block;}
-.theme_menuf ul li:hover ul li:hover ul {display:block; position:absolute; left:0; top:0;}
Index: tensions/theme_switch/trunk/theme_switch-ie6.css
===================================================================
--- /extensions/theme_switch/trunk/theme_switch-ie6.css	(revision 16240)
+++ 	(revision )
@@ -1,6 +1,0 @@
-.theme_menuf ul li a.hide, .theme_menuf ul li a:visited.hide {display:none;}
-.theme_menuf ul li a:hover ul li a.hide {display:none;}
-.theme_menuf ul li a:hover ul { display:block; position:absolute; top:-15%; left:-85%; }
-.theme_menuf ul li a:hover ul li a {display:block; }
-.theme_menuf ul li a:hover ul li a ul {visibility:hidden;}
-.theme_menuf ul li a:hover ul li a:hover ul {visibility:visible; position:absolute; left:105px; top:0;}
Index: /extensions/theme_switch/trunk/theme_switch.css
===================================================================
--- /extensions/theme_switch/trunk/theme_switch.css	(revision 16240)
+++ /extensions/theme_switch/trunk/theme_switch.css	(revision 16241)
@@ -1,8 +1,7 @@
-@import "theme_switch-default.css";
-
-.theme_flag-pan { border:1px solid; background-color: #111; }
-.theme_menuf .theme_flags {border-color: #000 !important; }
-
-.theme_flag-pan { 	border-radius: 8px; } /* round corners with CSS3 compliant browsers */
-.theme_flag-pan { -moz-border-radius:8px; } 
-.theme_flag-pan { -webkit-border-radius: 8px; }
+.theme-thumb {
+  min-width:80px;
+  max-width:120px;
+  min-height:80px;
+  max-height:120px;
+  margin:2px;
+}
Index: /extensions/theme_switch/trunk/theme_switch.inc.php
===================================================================
--- /extensions/theme_switch/trunk/theme_switch.inc.php	(revision 16240)
+++ /extensions/theme_switch/trunk/theme_switch.inc.php	(revision 16241)
@@ -4,4 +4,5 @@
 // | Theme switch plugin                                                   |
 // +-----------------------------------------------------------------------+
+// | Copyright(C) 2012      Piwigo Team                  http://piwigo.org |
 // | Copyright(C) 2010      Pavel Budka               http://budkovi.ic.cz |
 // +-----------------------------------------------------------------------+
@@ -20,32 +21,27 @@
 // | USA.                                                                  |
 // +-----------------------------------------------------------------------+
-if (!defined('THEME_SWITCH_PATH'))
-define('THEME_SWITCH_PATH' , PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/');
 
-include_once(PHPWG_ROOT_PATH.'admin/include/themes.class.php');
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
 
-class theme_controler {
-static public function _switch()
+function theme_controler_switch()
 {
   global $user, $template, $conf;
-
-  load_language('plugin.lang', dirname(__FILE__).'/');
-
-  if (!defined('PHPWG_ROOT_PATH')) { die('Hacking attempt!'); }
+  
   $same = $user['theme'];
   if ( isset( $_GET['theme']) ) 
   {
-    if ( !empty($_GET['theme']) and
-      file_exists( PHPWG_ROOT_PATH.'themes/'.$_GET['theme']) )
+    if ( !empty($_GET['theme']) and file_exists(PHPWG_THEMES_PATH.$_GET['theme']) )
     {
-      if (is_a_guest() or is_generic())
-        setcookie( 'pwg_theme_switch', $_GET['theme'],
-          time()+60*60*24*30, cookie_path() );
+      if ( is_a_guest() or is_generic() )
+      {
+        pwg_set_session_var('theme_switch', $_GET['theme']);
+      }
       else
       {
-        $query = 'UPDATE '.USER_INFOS_TABLE.'
-        SET theme = \''.$_GET['theme'].'\'
-        WHERE user_id = '.$user['id'].'
-        ;';
+        $query = '
+UPDATE '.USER_INFOS_TABLE.'
+  SET theme = "'.$_GET['theme'].'"
+  WHERE user_id = '.$user['id'].'
+;';
         pwg_query($query);
       }
@@ -53,129 +49,76 @@
     }
   }
-  else
-  // Users have $user['template']/$user['theme'] 
-  // Guest or generic members will use their cookied $user['template']/$user['theme'] !
-  if ((is_a_guest() or is_generic())
-    and isset( $_COOKIE['pwg_theme_switch'] ) )
+  else if ( (is_a_guest() or is_generic()) and pwg_get_session_var('theme_switch')!=null )
   {
-    $user['theme'] = $_COOKIE['pwg_theme_switch'];
+    $user['theme'] = pwg_get_session_var('theme_switch');
   }
-} // function _switch()
-
-static public function _installed_themes()
-// id, name, screenshot  
-{
-$themes = new themes();
-$themes->sort_fs_themes();
-$db_themes = $themes->get_db_themes();
-$db_theme_ids = array();
-foreach ($db_themes as $db_theme)
-{
-  array_push($db_theme_ids, $db_theme['id']);
 }
 
-$active_themes = array();
-
-
-foreach ($themes->fs_themes as $theme_id => $fs_theme)
+function theme_controler_init()
 {
-  if (in_array($theme_id, $db_theme_ids))
-      array_push($active_themes, $fs_theme);
+  global $conf;
+  
+  if ( isset($conf['theme_switch_mode']) and $conf['theme_switch_mode'] == 'select' )
+  {
+    theme_controler_select();
+  }
+  else
+  {
+    theme_controler_thumb();
+  }
 }
 
-return $active_themes;
-} // function  _installed_themes()
+function theme_controler_thumb()
+{
+  global $user, $template, $conf;
+  
+  foreach (get_pwg_themes() as $id => $name)
+  {
+    $img =  PHPWG_THEMES_PATH.$id.'/screenshot.png';
+         
+    if (file_exists($img))
+    {
+      $theme = array(
+        'id' => $id,
+        'name' => $name,
+        'url' => add_url_params( duplicate_index_url(), array('theme'=>$id) ),
+        'img' => $img,
+        );
+        
+      if ($id==$user['theme'])
+      {
+        $template->assign('theme_switch_active', $theme);
+      }
+      
+      $template->append('theme_switch', $theme);
+    }
+  } 
+  
+  $template->assign('THEME_SWITCH_PATH', THEME_SWITCH_PATH);
+  
+  $template->set_filename('theme_thumb', dirname(__FILE__) . '/thumb.tpl');
+  $template->concat('PLUGIN_INDEX_ACTIONS', $template->parse('theme_thumb', true));
+  
+  $template->clear_assign('theme_thumb');
+}
 
+function theme_controler_select()
+{
+  global $user, $template;
 
-static public function _flags()
-// Lets user choose from icons 
-// Only themes which have gif icon provided in icons plugin directory will be provided to users.
-// Gif file name must be the same as theme's name and must be stored in sub directory named according to template's name.  
-{
-  global $user, $template, $conf, $lang;
+  foreach (get_pwg_themes() as $id => $name)
+  {      
+    $template->append('theme_switch', array(
+      'id' => $id,
+      'name' => $name,
+      'url' => add_url_params( duplicate_index_url(), array('theme'=>$id) ),
+      'select' => ($id==$user['theme']) ? 'selected="selected"' :  null,
+      ));
+  }
   
-  $available_theme = get_pwg_themes();
-
-  $url_starting = get_query_string_diff(array('theme'));
+  $template->set_filename('theme_select', dirname(__FILE__) . '/select.tpl');
+  $template->concat('PLUGIN_INDEX_ACTIONS', $template->parse('theme_select', true));
   
-  foreach ( theme_controler::_installed_themes() as $theme ) {
-    $qlc_img =  $theme['screenshot']; // $conf['themes_dir'].'/'.$theme_id.'/'.'screenshot.png';
-         
-    if (file_exists($qlc_img)) {
-      
-      $qlc_url = str_replace(array('=&amp;','?&amp;'),array('&amp;','?'),
-                 add_url_params( $url_starting, array( 'theme' => $theme['id'] )));
-      if (isset($lang['theme']))
-        $qlc_alt = $lang['theme'].' '.ucwords( $theme['name'] );
-      else
-        $qlc_alt = ucwords( $theme['name'] );
-      $qlc_title =  $qlc_alt;
-      $qlc = array ( 
-        'url' => $qlc_url,
-        'alt' => $qlc_alt,
-        'img' => $qlc_img,
-        );
-      if ( $theme['id'] !== $user['theme'])
-        $lsw['flags'][$theme['id']] = $qlc ;
-      else $lsw['Active'] = $qlc;
-      }
-  } 
-    
-  $template->set_filename('theme_flags', dirname(__FILE__) . '/flags.tpl');
-  $lsw['side'] = ceil(sqrt(count($available_theme)));
-  $template->assign(array(
-    'theme_switch'=> $lsw,
-    'THEME_SWITCH_PATH' => THEME_SWITCH_PATH,
-  ));
-  $flags = $template->parse('theme_flags',true);
-  $template->clear_assign('theme_switch');
-  $template->concat( 'PLUGIN_INDEX_ACTIONS', $flags);
-} // function _flags()
-
-
-static public function _select()
-// Lets user choose using select control 
-// All available themes will be provided to users. 
-{
-  global $user, $template, $lang;
-  
-  $available_theme = get_pwg_themes();
-  $url_starting = get_query_string_diff(array('theme'));
-  $options='<li class="selector">'
-   .$lang['theme'].
-    '&nbsp;<select onchange="javasript:window.location=this.value">';
-  foreach ( theme_controler::_installed_themes() as $theme )
-  {
-    $qlc_url = str_replace(array('=&amp;','?&amp;'),array('&amp;','?'),
-      add_url_params( $url_starting, array( 'theme' => $theme['id']  ) ));
-    
-    if ( $theme['id'] == $user['theme'] )
-      $tmp='" selected="selected">';
-    else
-      $tmp='">';
-    $options=$options.'
-    <option label="'.$theme['name'].'" value="'.$qlc_url.$tmp.$theme['name'].'</option>';
-  }
-  $options=$options.'
-  </select></li>';
-  $template->concat( 'PLUGIN_INDEX_ACTIONS',$options);
-} //  function _select() 
-
-static public function _theme_admin($menu)
-// adds menu options for future configuration 
-{
-//  load_language('plugin.lang', dirname(__FILE__).'/');
-  array_push($menu, array('NAME' => 'Theme Switch',
-    'URL' => get_admin_plugin_menu_link(THEME_SWITCH_PATH.'admin/admin.php')));
-  return $menu;
-} // function _theme_admin()
-
-} // class theme_controler
-
-  /* {html_head} usage function */
-  /* See flags.tpl for example (due no catenation available) */
-if (!function_exists('Componant_exists')) {
-  function Componant_exists($path, $file)
-    { return file_exists( $path . $file); }
+  $template->clear_assign('theme_select');
 }
 
Index: /extensions/theme_switch/trunk/thumb.tpl
===================================================================
--- /extensions/theme_switch/trunk/thumb.tpl	(revision 16241)
+++ /extensions/theme_switch/trunk/thumb.tpl	(revision 16241)
@@ -0,0 +1,36 @@
+<li>{strip}<a id="themeSwitchLink" title="{'Interface theme'|@translate}" class="pwg-state-default pwg-button" rel="nofollow">
+  <span class="pwg-icon" style="background:url('{$THEME_SWITCH_PATH}icon.png') center center no-repeat;">&nbsp;</span><span class="pwg-button-text">{'Interface theme'|@translate}</span>
+</a>
+<div id="themeSwitchBox" class="switchBox">
+  <div class="switchBoxTitle">{'Interface theme'|@translate}</div> 
+  {foreach from=$theme_switch item=theme name=t}
+  <a rel="nofollow" href="{$theme.url}" title="{$theme.name}"><img src="{$theme.img}" alt="{$theme.name}" class="theme-thumb"></a>
+  {if ($smarty.foreach.t.index+1)%5 == 0}<br>{/if}
+  {/foreach}
+</div>
+{/strip}</li>
+
+{footer_script require='jquery'}{literal}
+jQuery("#themeSwitchLink").click(function() {
+	var elt = jQuery("#themeSwitchBox");
+	elt.css("left", Math.min(jQuery(this).offset().left, jQuery(window).width() - elt.outerWidth(true) - 5))
+		.css("top", jQuery(this).offset().top + jQuery(this).outerHeight(true))
+		.toggle();
+});
+jQuery("#themeSwitchBox").on("mouseleave", function() {
+	jQuery(this).hide();
+});
+{/literal}{/footer_script}
+
+{* <!-- switchBox structure for theme which don't include default style --> *}
+{if $themeconf.parent != 'default' or (isset($themeconf.load_parent_local_head) and $themeconf.load_parent_local_head == false) }
+{combine_css path=$THEME_SWITCH_PATH|@cat:"default.css"}
+{/if}
+
+{* <!-- stylish for non core themes (should be removed when all themes are updated) --> *}
+{if $themeconf.name != 'clear' and $themeconf.name != 'dark' and $themeconf.name != 'elegant' and $themeconf.name != 'Sylvia'}
+{combine_css path=$THEME_SWITCH_PATH|@cat:"style.css"}
+{/if}
+
+{* <!-- common style specific for LanguageSwitch --> *}
+{combine_css path=$THEME_SWITCH_PATH|@cat:"theme_switch.css"}
