Index: /extensions/pdf2tab/admin.php
===================================================================
--- /extensions/pdf2tab/admin.php	(revision 19811)
+++ /extensions/pdf2tab/admin.php	(revision 19811)
@@ -0,0 +1,15 @@
+<?php
+//Chech whether we are indeed included by Piwigo.
+if (!defined('PDF2TAB_PATH')) die('Hacking attempt!');
+
+//Load globals
+global $conf;
+
+//Load translation files
+load_language('plugin.lang', PDF2TAB_PATH);
+
+//Check access and exit when user status is not ok
+check_status(ACCESS_ADMINISTRATOR);
+
+include_once(PDF2TAB_PATH.'admin/admin_config.php');
+?>
Index: /extensions/pdf2tab/admin/admin_config.php
===================================================================
--- /extensions/pdf2tab/admin/admin_config.php	(revision 19811)
+++ /extensions/pdf2tab/admin/admin_config.php	(revision 19811)
@@ -0,0 +1,31 @@
+<?php
+//Initialization
+$conf_pdf2tab = unserialize($conf['pdf2tab']);
+
+load_language('plugin.lang', PDF2TAB_PATH);
+
+//Save config
+if (isset($_POST['submit'])) { 
+	$conf_pdf2tab['extensions'] = $_POST['pdf2tab_extensions'];
+	$conf_pdf2tab['extensions'] = explode(',', $conf_pdf2tab['extensions']);
+	
+	//Save
+	conf_update_param('pdf2tab', serialize($conf_pdf2tab));
+	array_push($page['infos'], l10n('Information data registered in database'));
+}
+
+//Parameters of the template
+if ($conf_pdf2tab['extensions'][0]=='')
+		$conf_pdf2tab['extensions'] = null;
+$template->assign('pdf2tab_extensions',$conf_pdf2tab['extensions']);
+
+//Add our template to the global template
+$template->set_filenames(
+	array(
+		'plugin_admin_content_general' => dirname(__FILE__).'/admin_config.tpl'
+	)
+);
+ 
+//Assign the template contents to ADMIN_CONTENT
+$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content_general');
+?>
Index: /extensions/pdf2tab/admin/admin_config.tpl
===================================================================
--- /extensions/pdf2tab/admin/admin_config.tpl	(revision 19811)
+++ /extensions/pdf2tab/admin/admin_config.tpl	(revision 19811)
@@ -0,0 +1,44 @@
+{include file='include/colorbox.inc.tpl'}
+
+{combine_script id='jquery.tokeninput' load='async' require='jquery' path='themes/default/js/plugins/jquery.tokeninput.js'}
+{footer_script require='jquery.tokeninput'}
+jQuery(document).ready(function() {ldelim}
+	jQuery('select[name="pdf2tab_extensions"]').tokenInput(
+		[{foreach from=$extensions item=extension name=extensions}{ldelim}"{$extension|@escape:'javascript'}"{rdelim}{if !$smarty.foreach.extensions.last},{/if}{/foreach}],
+    {ldelim}
+      hintText: '{'pdf2tab_hint_text'|@translate}',
+      noResultsText: '',
+      searchingText: '',
+      newText: '',
+      animateDropdown: false,
+      preventDuplicates: true,
+      allowCreation: true
+    }
+  );
+
+  jQuery("a.preview-box").colorbox();
+});
+{/footer_script}
+
+
+<div class="titrePage">
+  <h2>{'pdf2tab_name'|@translate}</h2>
+</div>
+
+<form method="post" action="" class="pdf2tab properties" ENCTYPE="multipart/form-data"> 
+	<fieldset>
+    <legend>{'pdf2tab_configuration'|@translate}</legend>
+	<p>
+		{'pdf2tab_supported_extensions_description'|@translate}
+	</p>
+	<p>	
+		<select class="pdf2tab_select" name="pdf2tab_extensions">
+			{foreach from=$pdf2tab_extensions item=pdf2tab_extension}
+				<option value="{$pdf2tab_extension}" class="selected">{$pdf2tab_extension}</option>
+			{/foreach}
+		</select>
+	</p>
+	</fieldset>
+  
+	<p><input class="submit" type="submit" value="{'Submit'|@translate}" name="submit"/></p>
+</form>
Index: /extensions/pdf2tab/css/admin.css
===================================================================
--- /extensions/pdf2tab/css/admin.css	(revision 19811)
+++ /extensions/pdf2tab/css/admin.css	(revision 19811)
@@ -0,0 +1,4 @@
+form.pdf2tab li {
+	clear: none !important;
+	font-weight: normal;
+}
Index: tensions/pdf2tab/include/constants.inc.php
===================================================================
--- /extensions/pdf2tab/include/constants.inc.php	(revision 19810)
+++ 	(revision )
@@ -1,14 +1,0 @@
-<?php
-$supported_extensions = array(
-							"pdf",
-							"docx",
-							"doc",
-							"odt",
-							"xlsx",
-							"xls",
-							"ods",
-							"pptx",
-							"ppt",
-							"odp",
-						);
-?>
Index: /extensions/pdf2tab/include/picture.inc.php
===================================================================
--- /extensions/pdf2tab/include/picture.inc.php	(revision 19810)
+++ /extensions/pdf2tab/include/picture.inc.php	(revision 19811)
@@ -5,7 +5,9 @@
 
 function pdf2tab_add_links_picture($content, $element_info) {
-	include_once('constants.inc.php');
-
-	if (in_array(strtolower(substr(strrchr($element_info['file'], "."),1)), $supported_extensions)) {
+	global $conf;
+	
+	$conf_pdf2tab = unserialize($conf['pdf2tab']);
+	
+	if (in_array(strtolower(substr(strrchr($element_info['file'], "."),1)), $conf_pdf2tab['extensions'])) {
 		$content = pdf2tab_add_link_image($content, $element_info);
 		$content = pdf2tab_add_link_beside_image($content, $element_info);
@@ -17,5 +19,5 @@
 function pdf2tab_add_link_image($content, $element_info) {
 	preg_match('/<\s*img\s+[^>]*?src\s*=\s*(\'|\")(.*?)\\1[^>]*?\/?\s*>/i',$content,$match);
-	$content = str_replace($match[0],'<a href="'.$element_info['element_url'].'" target="_blank" title="'.l10n('Open the file in a new tab').'">'.$match[0].'</a>',$content);
+	$content = str_replace($match[0],'<a href="'.$element_info['element_url'].'" target="_blank" title="'.l10n('pdf2tab_tooltip').'">'.$match[0].'</a>',$content);
 	
 	return $content;
@@ -23,5 +25,5 @@
 
 function pdf2tab_add_link_beside_image($content, $element_info) {
-	$content .= '<p class="imageComment"><a href="'.$element_info['element_url'].'" target="_blank" title="'.l10n('Open the file in a new tab').'">'.l10n('Open the file in a new tab').'</a>';
+	$content .= '<p class="imageComment"><a href="'.$element_info['element_url'].'" target="_blank" title="'.l10n('pdf2tab_tooltip').'">'.l10n('pdf2tab_tooltip').'</a>';
 	
 	return $content;
Index: /extensions/pdf2tab/include/thumbnails.inc.php
===================================================================
--- /extensions/pdf2tab/include/thumbnails.inc.php	(revision 19810)
+++ /extensions/pdf2tab/include/thumbnails.inc.php	(revision 19811)
@@ -5,10 +5,11 @@
 
 function pdf2tab_thumbnails($tpl_thumbnails_var) {
-	global $template;
-	include_once('constants.inc.php');
+	global $template, $conf;
+	
+	$conf_pdf2tab = unserialize($conf['pdf2tab']);
 	
 	$template->set_prefilter('index_thumbnails', 'pdf2tab_add_tag_thumbnails');
 	
-	$template->assign('pdf2tab_supported_extensions', $supported_extensions);
+	$template->assign('pdf2tab_supported_extensions', $conf_pdf2tab['extensions']);
 	$template->set_filename('pdf2tab_template_thumbnails', PDF2TAB_ABSOLUTE_PATH.'template/thumbnails.tpl');
 	$template->concat('PLUGIN_INDEX_CONTENT_END', $template->parse('pdf2tab_template_thumbnails', true));
Index: /extensions/pdf2tab/install/config_default.inc.php
===================================================================
--- /extensions/pdf2tab/install/config_default.inc.php	(revision 19811)
+++ /extensions/pdf2tab/install/config_default.inc.php	(revision 19811)
@@ -0,0 +1,5 @@
+<?php
+$config_default = array(
+	'extensions' => array('pdf', 'docx',	'doc', 'odt', 'xlsx', 'xls', 'ods', 'pptx', 'ppt', 'odp'),
+);
+?>
Index: /extensions/pdf2tab/install/functions.inc.php
===================================================================
--- /extensions/pdf2tab/install/functions.inc.php	(revision 19811)
+++ /extensions/pdf2tab/install/functions.inc.php	(revision 19811)
@@ -0,0 +1,33 @@
+<?php
+function pdf2tab_install($config) {
+	$query = 'INSERT INTO '.CONFIG_TABLE.' (param,value,comment) VALUES ("pdf2tab" ,"'.pwg_db_real_escape_string(serialize($config)).'", "PDF2Tab plugin parameters");';
+	pwg_query($query);
+}
+
+function pdf2tab_update_db() {
+	global $conf;
+	include(dirname(__FILE__).'/config_default.inc.php');
+
+	$config = array();
+	if (isset($conf['pdf2tab']))
+		$conf_pdf2tab = unserialize($conf['pdf2tab']);
+	
+	if (isset($conf_pdf2tab)) {
+		foreach ($config_default as $key => $value) {
+			if (isset($conf_pdf2tab[$key]))
+				$config[$key] = $conf_pdf2tab[$key];
+			else
+				$config[$key] = $config_default[$key];
+		}
+		pdf2tab_delete_conf("pdf2tab");
+		pdf2tab_install($config);
+	} else {
+		pdf2tab_install($config_default);
+	}
+}
+
+function pdf2tab_delete_conf($where) {
+	$query = 'DELETE FROM ' . CONFIG_TABLE . ' WHERE (param="'.$where.'");';
+	pwg_query($query);
+}
+?>
Index: /extensions/pdf2tab/install/index.php
===================================================================
--- /extensions/pdf2tab/install/index.php	(revision 19811)
+++ /extensions/pdf2tab/install/index.php	(revision 19811)
@@ -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: /extensions/pdf2tab/language/da_DK/plugin.lang.php
===================================================================
--- /extensions/pdf2tab/language/da_DK/plugin.lang.php	(revision 19810)
+++ /extensions/pdf2tab/language/da_DK/plugin.lang.php	(revision 19811)
@@ -21,4 +21,4 @@
 // | USA.                                                                  |
 // +-----------------------------------------------------------------------+
-$lang['Open the file in a new tab'] = 'Åbn filen i et nyt faneblad';
+$lang['pdf2tab_tooltip'] = 'Åbn filen i et nyt faneblad';
 ?>
Index: /extensions/pdf2tab/language/de_DE/plugin.lang.php
===================================================================
--- /extensions/pdf2tab/language/de_DE/plugin.lang.php	(revision 19810)
+++ /extensions/pdf2tab/language/de_DE/plugin.lang.php	(revision 19811)
@@ -21,4 +21,4 @@
 // | USA.                                                                  |
 // +-----------------------------------------------------------------------+
-$lang['Open the file in a new tab'] = 'Öffne die Datei in einem neuen Tab';
+$lang['pdf2tab_tooltip'] = 'Öffne die Datei in einem neuen Tab';
 ?>
Index: /extensions/pdf2tab/language/el_GR/plugin.lang.php
===================================================================
--- /extensions/pdf2tab/language/el_GR/plugin.lang.php	(revision 19810)
+++ /extensions/pdf2tab/language/el_GR/plugin.lang.php	(revision 19811)
@@ -21,4 +21,4 @@
 // | USA.                                                                  |
 // +-----------------------------------------------------------------------+
-$lang['Open the file in a new tab'] = 'Ανοίξτε το αρχείο σε μια νέα καρτέλα';
+$lang['pdf2tab_tooltip'] = 'Ανοίξτε το αρχείο σε μια νέα καρτέλα';
 ?>
Index: /extensions/pdf2tab/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/pdf2tab/language/en_UK/plugin.lang.php	(revision 19810)
+++ /extensions/pdf2tab/language/en_UK/plugin.lang.php	(revision 19811)
@@ -1,4 +1,10 @@
 <?php
 //picture.php
-$lang['Open the file in a new tab'] = 'Open the file in a new tab';
+$lang['pdf2tab_tooltip'] = 'Open the file in a new tab';
+
+//admin_config.php
+$lang['pdf2tab_name'] = 'PDF2Tab Plugin';
+$lang['pdf2tab_configuration'] = 'Configuration';
+$lang['pdf2tab_supported_extensions_description'] = 'Type in the extensions PDF2Tab will handle.';
+$lang['pdf2tab_hint_text'] = 'Type in an extension';
 ?>
Index: /extensions/pdf2tab/language/es_ES/plugin.lang.php
===================================================================
--- /extensions/pdf2tab/language/es_ES/plugin.lang.php	(revision 19810)
+++ /extensions/pdf2tab/language/es_ES/plugin.lang.php	(revision 19811)
@@ -1,4 +1,4 @@
 <?php
 //picture.php
-$lang['Open the file in a new tab'] = 'Abrir el archivo en una nueva pestaña';
+$lang['pdf2tab_tooltip'] = 'Abrir el archivo en una nueva pestaña';
 ?>
Index: /extensions/pdf2tab/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/pdf2tab/language/fr_FR/plugin.lang.php	(revision 19810)
+++ /extensions/pdf2tab/language/fr_FR/plugin.lang.php	(revision 19811)
@@ -1,4 +1,10 @@
 <?php
 //picture.php
-$lang['Open the file in a new tab'] = 'Ouvrir le fichier dans un nouvel onglet';
+$lang['pdf2tab_tooltip'] = 'Ouvrir le fichier dans un nouvel onglet';
+
+//admin_config.php
+$lang['pdf2tab_name'] = 'Plugin PDF2Tab';
+$lang['pdf2tab_configuration'] = 'Configuration';
+$lang['pdf2tab_supported_extensions_description'] = 'Entrer les extensions que PDF2Tab prendra en charge.';
+$lang['pdf2tab_hint_text'] = 'Entrer une extension';
 ?>
Index: /extensions/pdf2tab/language/it_IT/index.php
===================================================================
--- /extensions/pdf2tab/language/it_IT/index.php	(revision 19811)
+++ /extensions/pdf2tab/language/it_IT/index.php	(revision 19811)
@@ -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: /extensions/pdf2tab/language/it_IT/plugin.lang.php
===================================================================
--- /extensions/pdf2tab/language/it_IT/plugin.lang.php	(revision 19810)
+++ /extensions/pdf2tab/language/it_IT/plugin.lang.php	(revision 19811)
@@ -21,4 +21,4 @@
 // | USA.                                                                  |
 // +-----------------------------------------------------------------------+
-$lang['Open the file in a new tab'] = 'Apri il file in una nuova scheda';
+$lang['pdf2tab_tooltip'] = 'Apri il file in una nuova scheda';
 ?>
Index: /extensions/pdf2tab/language/lv_LV/plugin.lang.php
===================================================================
--- /extensions/pdf2tab/language/lv_LV/plugin.lang.php	(revision 19810)
+++ /extensions/pdf2tab/language/lv_LV/plugin.lang.php	(revision 19811)
@@ -21,4 +21,4 @@
 // | USA.                                                                  |
 // +-----------------------------------------------------------------------+
-$lang['Open the file in a new tab'] = 'Atvērt failu jaunā cilnē';
+$lang['pdf2tab_tooltip'] = 'Atvērt failu jaunā cilnē';
 ?>
Index: /extensions/pdf2tab/language/tr_TR/plugin.lang.php
===================================================================
--- /extensions/pdf2tab/language/tr_TR/plugin.lang.php	(revision 19810)
+++ /extensions/pdf2tab/language/tr_TR/plugin.lang.php	(revision 19811)
@@ -21,4 +21,4 @@
 // | USA.                                                                  |
 // +-----------------------------------------------------------------------+
-$lang['Open the file in a new tab'] = 'Dosyayı yeni bir sekmede aç';
+$lang['pdf2tab_tooltip'] = 'Dosyayı yeni bir sekmede aç';
 ?>
Index: /extensions/pdf2tab/main.inc.php
===================================================================
--- /extensions/pdf2tab/main.inc.php	(revision 19810)
+++ /extensions/pdf2tab/main.inc.php	(revision 19811)
@@ -2,7 +2,7 @@
 /*
 Plugin Name: pdf2tab
-Version: auto
+Version: 2.4.e
 Description: open pdf files in new tab instead of downloading it
-Plugin URI: http://fr.piwigo.org/ext/extension_view.php?eid=655
+Plugin URI: http://piwigo.org/ext/extension_view.php?eid=655
 Author: Julien1311
 */
@@ -14,11 +14,36 @@
 define('PDF2TAB_DIR' , basename(dirname(__FILE__)));
 define('PDF2TAB_PATH' , PHPWG_PLUGINS_PATH.PDF2TAB_DIR.'/');
+define('PDF2TAB_ADMIN' , get_root_url() . 'admin.php?page=plugin-'.PDF2TAB_DIR);
 
+/* +-----------------------------------------------------------------------+
+ * | Plugin admin                                                          |
+ * +-----------------------------------------------------------------------+ */
+
+// Add an entry to the plugins menu
+add_event_handler('get_admin_plugin_menu_links', 'pdf2tab_admin_menu');
+
+function pdf2tab_admin_menu($menu) {
+		array_push($menu, array(
+				'NAME'  => 'PDF2Tab',
+				'URL'   => PDF2TAB_ADMIN,
+		)
+	);     
+	return $menu;
+}
 
 /* +-----------------------------------------------------------------------+
  * | Plugin code                                                          |
  * +-----------------------------------------------------------------------+ */
-	
+
 include_once(PDF2TAB_PATH.'include/thumbnails.inc.php');
 include_once(PDF2TAB_PATH.'include/picture.inc.php');
+
+add_event_handler('loc_begin_admin_page', 'pdf2tab_css');
+
+function pdf2tab_css() {
+	global $template, $conf;
+
+	//add a stylesheet
+	$template->append('head_elements', '<link rel="stylesheet" type="text/css" href="'.PDF2TAB_PATH.'css/admin.css">');
+}
 ?>
Index: /extensions/pdf2tab/maintain.inc.php
===================================================================
--- /extensions/pdf2tab/maintain.inc.php	(revision 19810)
+++ /extensions/pdf2tab/maintain.inc.php	(revision 19811)
@@ -3,13 +3,21 @@
 
 function plugin_install() {
-	
+	include_once(dirname(__FILE__).'/install/functions.inc.php');
+	include_once(dirname(__FILE__).'/install/config_default.inc.php');
+
+	pdf2tab_install($config_default);
 }
 
 function plugin_activate() {
-
+	include_once(dirname(__FILE__).'/install/functions.inc.php');
+	
+	pdf2tab_update_db();
 }
 
 function plugin_uninstall() {
-	
+	include_once(dirname(__FILE__).'/install/functions.inc.php');
+
+	pdf2tab_delete_conf("pdf2tab");
 }
+
 ?>
Index: /extensions/pdf2tab/template/thumbnails.tpl
===================================================================
--- /extensions/pdf2tab/template/thumbnails.tpl	(revision 19810)
+++ /extensions/pdf2tab/template/thumbnails.tpl	(revision 19811)
@@ -22,5 +22,5 @@
 				});
 {/literal}
-				$(this).attr("title","{'Open the file in a new tab'|@translate}");
+				$(this).attr("title","{'pdf2tab_tooltip'|@translate}");
 {literal}
 			}			
