Index: /extensions/File_Uploader/admin.php
===================================================================
--- /extensions/File_Uploader/admin.php	(revision 19472)
+++ /extensions/File_Uploader/admin.php	(revision 19472)
@@ -0,0 +1,50 @@
+<?php
+//Chech whether we are indeed included by Piwigo.
+if (!defined('FILE_UPLOADER_PATH')) die('Hacking attempt!');
+
+//Load globals
+global $template, $conf, $page;
+
+//Library for tabs
+include_once(PHPWG_ROOT_PATH .'admin/include/tabsheet.class.php');
+
+//Load translation files
+load_language('plugin.lang', FILE_UPLOADER_PATH);
+
+//Check access and exit when user status is not ok
+check_status(ACCESS_ADMINISTRATOR);
+
+//Initialization
+$my_base_url = get_admin_plugin_menu_link(__FILE__);
+
+//Tab management
+if (!isset($_GET['tab']))
+    $page['tab'] = 'upload';
+else
+    $page['tab'] = $_GET['tab'];
+
+$tabsheet = new tabsheet();
+$tabsheet->add('upload',
+               l10n('Upload'),
+               $my_base_url.'&amp;tab=upload');
+$tabsheet->add('configuration',
+               l10n('Configuration'),
+               $my_base_url.'&amp;tab=configuration');
+$tabsheet->add('help',
+               l10n('Help'),
+               $my_base_url.'&amp;tab=help');
+$tabsheet->select($page['tab']);
+$tabsheet->assign();
+
+switch ($page['tab']) {
+	case 'configuration':
+		include_once(dirname(__FILE__).'/admin/admin_configuration.php');
+		break;
+	case 'help':
+		include_once(dirname(__FILE__).'/admin/admin_help.php');
+		break;
+	default:
+		include_once(dirname(__FILE__).'/admin/admin_upload.php');
+		break;
+}
+?>
Index: /extensions/File_Uploader/admin/admin.css
===================================================================
--- /extensions/File_Uploader/admin/admin.css	(revision 19472)
+++ /extensions/File_Uploader/admin/admin.css	(revision 19472)
@@ -0,0 +1,36 @@
+.file_uploader_center {
+    text-align: center;
+}
+
+.file_uploader_center form {
+    text-align: center;
+}
+
+.property {
+	font-weight: bold;
+}
+	
+.file_uploader_error {
+	border-color: #ff7070;
+	background-color: #FFe5e5;
+}
+
+.file_uploader_error_description {
+	background-color: red;
+	color: white;
+	padding: 0 5px;
+	border-radius: 10px;
+	font-weight: bold;
+	cursor: help;
+}
+
+.file_uploader_help_title {
+	text-align:center;
+	font-weight:bold;
+	font-size:150%;
+	margin-top:2em;
+}
+
+.file_uploader_help_content {
+	text-align:left;
+}
Index: /extensions/File_Uploader/admin/admin_configuration.php
===================================================================
--- /extensions/File_Uploader/admin/admin_configuration.php	(revision 19472)
+++ /extensions/File_Uploader/admin/admin_configuration.php	(revision 19472)
@@ -0,0 +1,35 @@
+<?php
+//Initialization
+$conf_file_uploader = unserialize($conf['file_uploader']);
+
+//Save config
+if (isset($_POST['submit'])) { 
+	//New parameters	
+	foreach ($conf_file_uploader as $file_uploader_checkbox => $value) {
+		if(isset($_POST['file_uploader_checkbox'][$file_uploader_checkbox]) && ($_POST['file_uploader_checkbox'][$file_uploader_checkbox] == 1))
+			$conf_file_uploader[$file_uploader_checkbox] = 1;
+		else
+			$conf_file_uploader[$file_uploader_checkbox] = 0;
+	}
+	
+	//Save
+	conf_update_param('file_uploader', serialize($conf_file_uploader));
+	array_push($page['infos'], l10n('Information data registered in database'));
+}
+
+//Parameters of the template
+foreach ($conf_file_uploader as $file_uploader_key => $value)
+	$file_uploader_checked[$file_uploader_key] = (($conf_file_uploader[$file_uploader_key] == 1) ? 'checked = "checked"' : '');
+
+$template->assign('file_uploader_checked', $file_uploader_checked);
+
+//Add our template to the global template
+$template->set_filenames(
+	array(
+		'plugin_admin_content_general' => dirname(__FILE__).'/admin_configuration.tpl'
+	)
+);
+ 
+//Assign the template contents to ADMIN_CONTENT
+$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content_general');
+?>
Index: /extensions/File_Uploader/admin/admin_configuration.tpl
===================================================================
--- /extensions/File_Uploader/admin/admin_configuration.tpl	(revision 19472)
+++ /extensions/File_Uploader/admin/admin_configuration.tpl	(revision 19472)
@@ -0,0 +1,18 @@
+<div class="titrePage">
+  <h2>{'File Uploader Plugin'|@translate}</h2>
+</div>
+
+<form method="post" action="" ENCTYPE="multipart/form-data"> 
+	<fieldset>
+		<legend>{'Configuration'|@translate}</legend>
+		<p>
+			<label><input type="checkbox" name="file_uploader_checkbox[new_tab]" value="1" {$file_uploader_checked.new_tab}> {'Open pdf in a new tab'|@translate}</label>
+		</p>
+		<p>
+			<label><input type="checkbox" name="file_uploader_checkbox[overwrite]" value="1" {$file_uploader_checked.overwrite}> {'Overwrite files without notice'|@translate}</label>
+		</p>
+	</fieldset>
+	<p class="file_uploader_center">
+		<input class="submit" type="submit" value="{'Submit'|@translate}" name="submit"/>
+	</p>
+</form>
Index: /extensions/File_Uploader/admin/admin_help.php
===================================================================
--- /extensions/File_Uploader/admin/admin_help.php	(revision 19472)
+++ /extensions/File_Uploader/admin/admin_help.php	(revision 19472)
@@ -0,0 +1,11 @@
+<?php
+//Add our template to the global template
+$template->set_filenames(
+	array(
+		'plugin_admin_content_help' => dirname(__FILE__).'/admin_help.tpl'
+	)
+);
+ 
+//Assign the template contents to ADMIN_CONTENT
+$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content_help');
+?>
Index: /extensions/File_Uploader/admin/admin_help.tpl
===================================================================
--- /extensions/File_Uploader/admin/admin_help.tpl	(revision 19472)
+++ /extensions/File_Uploader/admin/admin_help.tpl	(revision 19472)
@@ -0,0 +1,28 @@
+<p class="file_uploader_help_title">
+	{'Help'|@translate}
+</p>
+<p class="file_uploader_help_content">
+	{'The Upload tab allows you to upload "non picture" files to your gallerie. Fill in the form to upload and synchronize your file.'|@translate}<br />
+	{'The Configuration tab allows you to customize the plugin in two ways:'|@translate}
+</p>
+	<ul>
+		<li>{'Open pdf in a new tab'|@translate}{': Check to open pdf files in a new tab instead of downloading them.'|@translate}</li>
+		<li>{'Overwrite files without notice'|@translate}{': Check to overwrite files during upload if a file with the same name already exists.'|@translate}</li>
+	</ul>
+<p class="file_uploader_help_content">
+	{'You can use this plugin with the plugin <a href="http://fr.piwigo.org/ext/extension_view.php?eid=654">Media Icon</a> to add an icon to your "non picture" files.'|@translate}
+</p>
+<p class="file_uploader_help_title">
+	{'Donate'|@translate}
+</p>
+<p class="file_uploader_help_content">
+	{'I spent a lot of time to make this plugin works. If it is useful for you, do not hesitate a donation ;) Thank you for your generosity.'|@translate}
+</p>
+<div class="file_uploader_center">
+	<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
+		<input type="hidden" name="cmd" value="_s-xclick">
+		<input type="hidden" name="hosted_button_id" value="3LKVRW5H8ZSVE">
+		<input type="image" src="https://www.paypalobjects.com/en_GB/i/btn/btn_donate_LG.gif" border="0" name="submit" alt="PayPal  The safer, easier way to pay online.">
+		<img alt="" border="0" src="https://www.paypalobjects.com/fr_FR/i/scr/pixel.gif" width="1" height="1">
+	</form>
+</div>
Index: /extensions/File_Uploader/admin/admin_upload.php
===================================================================
--- /extensions/File_Uploader/admin/admin_upload.php	(revision 19472)
+++ /extensions/File_Uploader/admin/admin_upload.php	(revision 19472)
@@ -0,0 +1,214 @@
+<?php
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+include_once(PHPWG_ROOT_PATH . 'include/functions.inc.php');
+
+global $template, $conf, $user, $page;
+
+if (isset($_POST['submit'])) {
+	$file_uploader_errors = array();
+	$file_uploader_upload_file = array();
+
+	if($_FILES['file_uploader_file']['size'] != 0) {
+		$file_uploader_upload_file = file_uploader_upload_file($_FILES['file_uploader_file']);
+		if(count($file_uploader_upload_file['errors']) != 0)
+			$file_uploader_errors['file'] = $file_uploader_upload_file['errors'];
+	} else {
+		$file_uploader_errors['file']['no_file'] = 'Specify a file to upload';
+	}
+	
+	if($_FILES['file_uploader_thumbnail']['size'] != 0 && $_FILES['file_uploader_file']['size'] != 0) {
+		$file_uploader_upload_thumbnail = file_uploader_upload_thumbnail($_FILES['file_uploader_thumbnail'], $file_uploader_upload_file['name_wo_extension'], $file_uploader_upload_file['extension']);
+		if(count($file_uploader_upload_thumbnail['errors']) != 0)
+			$file_uploader_errors['thumbnail'] = $file_uploader_upload_thumbnail['errors'];
+	} else {
+		$file_uploader_errors['thumbnail']['no_file'] = 'Specify a thumbnail for your file';
+	}
+	
+	if (count($file_uploader_errors) == 0) {
+		file_uploader_synchronize($file_uploader_upload_file, $_POST['file_uploader'], $file_uploader_upload_thumbnail);
+		array_push($page['infos'], l10n('File uploaded and synchronized'));
+	} else {
+		array_push($page['errors'], l10n('There have been errors. See below'));
+		$template->assign('file_uploader_errors', $file_uploader_errors);
+		$template->assign('file_uploader', $_POST['file_uploader']);
+	}
+}
+
+function file_uploader_upload_file($file_uploader_file) {
+	include('static.inc.php');
+	
+	global $conf;
+	$conf_file_uploader = unserialize($conf['file_uploader']);
+	
+	$file_uploader_file_tmp = $file_uploader_file['tmp_name'];
+	$file_uploader_file_name = preg_replace('/[^a-zA-Z0-9s.]/', '_', $file_uploader_file['name']);
+	$file_uploader_file_name_wo_extension = substr($file_uploader_file_name, 0, strrpos($file_uploader_file_name, '.'));
+	$file_uploader_file_extension = strtolower(substr(strrchr($file_uploader_file['name'], '.'),1));
+	$file_uploader_file_size = filesize($file_uploader_file['tmp_name']);
+	$file_uploader_file_directory = $file_uploader_galleries_dir.$file_uploader_destination_folder[$file_uploader_file_extension];
+	$file_uploader_file_destination = $file_uploader_file_directory.'/'.$file_uploader_file_name;
+	$file_uploader_errors = array();
+	$return = array();
+	
+	$return['name_wo_extension'] = $file_uploader_file_name_wo_extension;
+	$return['extension'] = $file_uploader_file_extension;
+	$return['folder'] = $file_uploader_destination_folder[$file_uploader_file_extension];
+	$return['destination'] = $file_uploader_file_destination;
+	$return['size'] = $file_uploader_file_size;
+	$return['overwrite'] = false;
+	
+	//If the directory does not exist, we create it
+	if (!file_exists($file_uploader_file_directory))
+		if(!mkdir($file_uploader_file_directory))
+			$file_uploader_errors['upload_error'] = l10n('Unable to create folder ').$file_uploader_file_directory;
+	//If the physical category si not in database, we add it
+	if (mysql_num_rows(pwg_query('SELECT id FROM '.CATEGORIES_TABLE.' WHERE name = "'.$file_uploader_destination_folder[$file_uploader_file_extension].'";')) == 0){
+		$next_id = pwg_db_nextval('id', CATEGORIES_TABLE);
+		$category_rank = pwg_db_fetch_assoc(pwg_query('SELECT MAX(rank) FROM '.CATEGORIES_TABLE.';'));
+		$category_rank = $category_rank['MAX(rank)'] + 1;
+		pwg_query('INSERT INTO '.CATEGORIES_TABLE.' (id, name, dir, rank, status, visible, uppercats, global_rank) VALUES ('.$next_id.', "'.$file_uploader_destination_folder[$file_uploader_file_extension].'", "'.$file_uploader_destination_folder[$file_uploader_file_extension].'", '.$category_rank.', "'.$conf['newcat_default_status'].'", "'.boolean_to_string($conf['newcat_default_visible']).'", "'.$next_id.'", '.$category_rank.');');
+	}
+	
+	if ($file_uploader_file['error'] !== UPLOAD_ERR_OK) {
+		switch ($_FILES['file_uploader_file']['error']) {
+			case UPLOAD_ERR_INI_SIZE:
+				$file_uploader_errors['upload_error'] = l10n('File exceeds the upload_max_filesize directive in php.ini');
+				break;
+			case UPLOAD_ERR_PARTIAL:
+				$file_uploader_errors['upload_error'] = l10n('File was only partially uploaded');
+				break;
+			case UPLOAD_ERR_NO_FILE:
+				$file_uploader_errors['upload_error'] = l10n('No file to upload');
+				break;
+			case UPLOAD_ERR_NO_TMP_DIR:
+				$file_uploader_errors['upload_error'] = l10n('Missing a temporary folder');
+				break;
+			case UPLOAD_ERR_CANT_WRITE:
+				$file_uploader_errors['upload_error'] = l10n('Failed to write file to disk');
+				break;
+			case UPLOAD_ERR_EXTENSION:
+				$file_uploader_errors['upload_error'] = l10n('File upload stopped by extension');
+				break;
+			default:
+				$file_uploader_errors['upload_error'] = l10n('Upload error');
+		} 
+	} else if(!in_array($file_uploader_file_extension, $file_uploader_allowed_file_extension)) {
+		$file_uploader_errors['filetype'] = l10n('Type of file not supported');
+	} else if (file_exists($file_uploader_file_destination)) {
+		if ($conf_file_uploader['overwrite'] == 1)
+			$return['overwrite'] = true;
+		else
+			$file_uploader_errors['already_exist'] = l10n('File with this name already exists. You should rename this file.');
+	} else if (!move_uploaded_file($file_uploader_file_tmp, $file_uploader_file_destination)) {
+		$file_uploader_errors['move_uploaded_file'] = l10n('Can\'t upload file to galleries directory');
+	}
+	
+	$return['errors'] = $file_uploader_errors;
+	
+	return $return;
+}
+
+
+function file_uploader_upload_thumbnail($file_uploader_thumbnail, $file_uploader_file_name_wo_extension, $file_uploader_file_extension) {
+	include('static.inc.php');
+	
+	$file_uploader_thumbnail_tmp = $file_uploader_thumbnail['tmp_name'];
+	$file_uploader_thumbnail_extension = strtolower(substr(strrchr($file_uploader_thumbnail['name'], '.'),1));
+	$file_uploader_thumbnail_size = filesize($file_uploader_thumbnail['tmp_name']);
+	$file_uploader_thumbnail_directory = $file_uploader_galleries_dir.$file_uploader_destination_folder[$file_uploader_file_extension].'/pwg_representative';
+	$file_uploader_thumbnail_destination = $file_uploader_thumbnail_directory.'/'.$file_uploader_file_name_wo_extension.'.'.$file_uploader_thumbnail_extension;
+	$file_uploader_errors = array();
+	$return = array();
+	
+	$return['extension'] = $file_uploader_thumbnail_extension;
+	
+	if (!file_exists($file_uploader_thumbnail_directory))
+		if(!mkdir($file_uploader_thumbnail_directory))
+			$file_uploader_errors['upload_error'] = l10n('Unable to create folder ').$file_uploader_thumbnail_directory;
+	
+	if ($file_uploader_thumbnail['error'] !== UPLOAD_ERR_OK) {
+		switch ($_FILES['file_uploader_thumbnail']['error']) {
+			case UPLOAD_ERR_INI_SIZE:
+				$file_uploader_errors['upload_error'] = l10n('File exceeds the upload_max_filesize directive in php.ini');
+				break;
+			case UPLOAD_ERR_PARTIAL:
+				$file_uploader_errors['upload_error'] = l10n('File was only partially uploaded');
+				break;
+			case UPLOAD_ERR_NO_FILE:
+				$file_uploader_errors['upload_error'] = l10n('No file to upload');
+				break;
+			case UPLOAD_ERR_NO_TMP_DIR:
+				$file_uploader_errors['upload_error'] = l10n('Missing a temporary folder');
+				break;
+			case UPLOAD_ERR_CANT_WRITE:
+				$file_uploader_errors['upload_error'] = l10n('Failed to write file to disk');
+				break;
+			case UPLOAD_ERR_EXTENSION:
+				$file_uploader_errors['upload_error'] = l10n('File upload stopped by extension');
+				break;
+			default:
+				$file_uploader_errors['upload_error'] = l10n('Upload error');
+		} 
+	} else if(!in_array($file_uploader_thumbnail_extension, $file_uploader_allowed_thumbnail_extension)) {
+		$file_uploader_errors['filetype'] = l10n('The thumbnail must be a picture');
+	} else if (!move_uploaded_file($file_uploader_thumbnail_tmp, $file_uploader_thumbnail_destination)) {
+		$file_uploader_errors['move_uploaded_file'] = l10n('Can\'t upload file to galleries directory');
+	}
+	
+	$return['errors'] = $file_uploader_errors;
+	
+	return $return;
+}
+
+
+function file_uploader_synchronize($file_uploader_file, $file_uploader_file_properties, $file_uploader_thumbnail) {
+	global $user;
+	
+	//Current date
+	list($dbnow) = pwg_db_fetch_row(pwg_query('SELECT NOW();'));
+
+	//Database registration
+	$file_path = pwg_db_real_escape_string($file_uploader_file['destination']);
+	$insert = array(
+		'file' => substr(strrchr($file_path, '/'), 1),
+		'name' => pwg_db_real_escape_string($file_uploader_file_properties['title']),
+		'comment' => pwg_db_real_escape_string($file_uploader_file_properties['description']),
+		'date_available' => $dbnow,
+		'path' => $file_path,
+		'representative_ext' => $file_uploader_thumbnail['extension'],
+		'filesize' => $file_uploader_file['size'],
+		'md5sum' => md5_file($file_path),
+		'added_by' => $user['id'],
+	);
+	
+	if ($file_uploader_file['overwrite']) {
+		$query = 'SELECT id FROM '.IMAGES_TABLE.' WHERE path = "'.$file_path.'";';
+		$image_id = pwg_db_fetch_assoc(pwg_query($query));
+		
+		single_update(IMAGES_TABLE, $insert, array('id' => $image_id['id']));
+	} else {
+		single_insert(IMAGES_TABLE, $insert);
+		$image_id = pwg_db_insert_id(IMAGES_TABLE);
+	}
+
+	$physical_category_id = pwg_db_fetch_assoc(pwg_query('SELECT id FROM '.CATEGORIES_TABLE.' WHERE name = "'.$file_uploader_file['folder'].'";'));
+	
+	if(isset($file_uploader_file_properties['category']) and count($file_uploader_file_properties['category']) > 0) {
+		associate_images_to_categories(
+			array($image_id),
+			array($file_uploader_file_properties['category'], $physical_category_id['id'])
+		);
+	}
+	
+	@fill_caddie(array($image_id));
+}
+
+
+//Categories
+$query = 'SELECT id,name,uppercats,global_rank FROM '.CATEGORIES_TABLE.';';
+display_select_cat_wrapper($query, array(), 'category_parent_options');
+
+$template->set_filenames(array('plugin_admin_content' => dirname(__FILE__) . '/admin_upload.tpl')); 
+$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
+?>
Index: /extensions/File_Uploader/admin/admin_upload.tpl
===================================================================
--- /extensions/File_Uploader/admin/admin_upload.tpl	(revision 19472)
+++ /extensions/File_Uploader/admin/admin_upload.tpl	(revision 19472)
@@ -0,0 +1,62 @@
+{include file='include/colorbox.inc.tpl'}
+{include file='include/add_album.inc.tpl'}
+
+<div class="titrePage">
+  <h2>{'File Uploader Plugin'|@translate}</h2>
+</div>
+<div class="file_uploader_form">
+	<form method="post" enctype="multipart/form-data">
+		<fieldset>
+			<legend>{'Choose a file'|@translate}</legend>
+			<p class="file_uploader_center">
+				<label>
+					<span class="property">{'File to upload:'|@translate}</span>
+				</label>
+				<input name="file_uploader_file" type="file" value=""{if isset($file_uploader_errors.file)} class="file_uploader_error"{/if}>
+				{foreach from=$file_uploader_errors.file item=error_description}<span class="file_uploader_error_description" title="{$error_description}">!</span>{/foreach}
+			</p>
+		</fieldset>
+		<fieldset>
+			<legend>{'Choose a thumbnail'|@translate}</legend>
+			<p class="file_uploader_center">
+				<label>
+					<span class="property">{'Thumbnail to upload:'|@translate}</span>
+				</label>
+				<input name="file_uploader_thumbnail" type="file" value=""{if isset($file_uploader_errors.thumbnail)} class="file_uploader_error"{/if}>
+				{foreach from=$file_uploader_errors.thumbnail item=error_description}<span class="file_uploader_error_description" title="{$error_description}">!</span>{/foreach}
+			</p>
+			<p class="file_uploader_center">
+				{'You can use a personnal image or convert your file to an image using a desktop program or a web service such as'|@translate} <a href="http://www.zamzar.com" alt="Zamzar" title="Zamzar">Zamzar</a>.
+			</p>
+		</fieldset>
+		<fieldset>
+			<legend>{'Properties'|@translate}</legend>
+			<p class="file_uploader_center">
+				<label for="file_uploader_title_input">
+					<span class="property">{'Title:'|@translate}</span>
+				</label>
+				<input size="50" id="file_uploader_title_input" type="text" name="file_uploader[title]" value="{$file_uploader.title}"{if isset($file_uploader_errors.title)} class="file_uploader_error"{/if}>
+				{if isset($file_uploader_errors.title)}<span class="file_uploader_error_description" title="{$file_uploader_errors.title}">!</span>{/if}
+			</p>
+			<p class="file_uploader_center">
+				<label for="file_uploader_description_input">
+					<span class="property">{'Description:'|@translate}</span>
+				</label><br />
+				<textarea cols="50" rows="5" id="file_uploader_description_input" type="text" name="file_uploader[description]"{if isset($file_uploader_errors.description)} class="file_uploader_error"{/if}>{$file_uploader.description}</textarea>
+				{if isset($file_uploader_errors.description)}<span class="file_uploader_error_description" title="{$file_uploader_errors.description}">!</span>{/if}
+			</p>
+			<p class="file_uploader_center">
+				<label for="file_uploader_album_select">
+					<span class="property">{'Album:'|@translate}</span>
+				</label>
+				<select style="width:400px" name="file_uploader[category]" id="file_uploader_album_select" size="1">
+					{html_options options=$category_parent_options selected=$file_uploader.category}
+				</select>
+				<br />{'... or '|@translate}<a href="#" class="addAlbumOpen" title="{'create a new album'|@translate}">{'create a new album'|@translate}</a>
+			</p>
+			</fieldset>
+		<p>
+			<input class="submit" name="submit" type="submit" value="{'Submit'|@translate}" />
+		</p>
+	</form>
+</div>
Index: /extensions/File_Uploader/admin/index.php
===================================================================
--- /extensions/File_Uploader/admin/index.php	(revision 19472)
+++ /extensions/File_Uploader/admin/index.php	(revision 19472)
@@ -0,0 +1,30 @@
+<?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: /extensions/File_Uploader/admin/static.inc.php
===================================================================
--- /extensions/File_Uploader/admin/static.inc.php	(revision 19472)
+++ /extensions/File_Uploader/admin/static.inc.php	(revision 19472)
@@ -0,0 +1,19 @@
+<?php
+	$file_uploader_galleries_dir = PHPWG_ROOT_PATH.'galleries/';
+	
+	$file_uploader_allowed_file_extension = array('pdf', 'doc', 'docx', 'odt', 'xls', 'xlsx', 'ods', 'ppt', 'pptx', 'odp');
+	$file_uploader_allowed_thumbnail_extension = array('jpg', 'jpeg', 'gif', 'png');
+	
+	$file_uploader_destination_folder = array(
+		'pdf' => 'pdf',
+		'doc' => 'documents',
+		'docx' => 'documents',
+		'odt' => 'documents',
+		'xls' => 'spreadsheets',
+		'xlsx' => 'spreadsheets',
+		'ods' => 'spreadsheets',
+		'ppt' => 'presentations',
+		'pptx' => 'presentations',
+		'odp' => 'presentations',
+	);
+?>
Index: /extensions/File_Uploader/config_default.inc.php
===================================================================
--- /extensions/File_Uploader/config_default.inc.php	(revision 19472)
+++ /extensions/File_Uploader/config_default.inc.php	(revision 19472)
@@ -0,0 +1,8 @@
+<?php
+
+$config_default = array(
+	'new_tab' => 1,
+	'overwrite' => 0,
+);
+
+?>
Index: /extensions/File_Uploader/index.php
===================================================================
--- /extensions/File_Uploader/index.php	(revision 19472)
+++ /extensions/File_Uploader/index.php	(revision 19472)
@@ -0,0 +1,30 @@
+<?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: /extensions/File_Uploader/language/en_UK/description.txt
===================================================================
--- /extensions/File_Uploader/language/en_UK/description.txt	(revision 19472)
+++ /extensions/File_Uploader/language/en_UK/description.txt	(revision 19472)
@@ -0,0 +1,1 @@
+Upload files to Piwigo
Index: /extensions/File_Uploader/language/en_UK/index.php
===================================================================
--- /extensions/File_Uploader/language/en_UK/index.php	(revision 19472)
+++ /extensions/File_Uploader/language/en_UK/index.php	(revision 19472)
@@ -0,0 +1,30 @@
+<?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.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/File_Uploader/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/File_Uploader/language/en_UK/plugin.lang.php	(revision 19472)
+++ /extensions/File_Uploader/language/en_UK/plugin.lang.php	(revision 19472)
@@ -0,0 +1,57 @@
+<?php
+$lang['File Uploader Plugin'] = 'File Uploader Plugin';
+
+//admin.php
+$lang['Upload'] = 'Upload';
+$lang['Configuration'] = 'Configuration';
+$lang['Help'] = 'Help';
+
+//admin_upload.php
+$lang['Specify a file to upload'] = 'Specify a file to upload';
+$lang['Specify a thumbnail for your file'] = 'Specify a thumbnail for your file';
+$lang['Unable to create folder '] = 'Unable to create folder ';
+$lang['File exceeds the upload_max_filesize directive in php.ini'] = 'File exceeds the upload_max_filesize directive in php.ini';
+$lang['File was only partially uploaded'] = 'File was only partially uploaded';
+$lang['No file to upload'] = 'No file to upload';
+$lang['Missing a temporary folder'] = 'Missing a temporary folder';
+$lang['Failed to write file to disk'] = 'Failed to write file to disk';
+$lang['File upload stopped by extension'] = 'File upload stopped by extension';
+$lang['Upload error'] = 'Upload error';
+$lang['Type of file not supported'] = 'Type of file not supported';
+$lang['File with this name already exists. You should rename this file.'] = 'File with this name already exists. You should rename this file.';
+$lang['Invalid file name'] = 'Invalid file name';
+$lang['Can\'t copy file to galleries directory'] = 'Can\'t copy file to galleries directory';
+$lang['The thumbnail must be a picture'] = 'The thumbnail must be a picture';
+$lang['File uploaded and synchronized'] = 'File uploaded and synchronized';
+$lang['There have been errors. See below'] = 'There have been errors. See below';
+
+//admin_upload.tpl
+$lang['Choose a file'] = 'Choose a file';
+$lang['File to upload:'] = 'File to upload:';
+$lang['Choose a thumbnail'] = 'Choose a thumbnail';
+$lang['Thumbnail to upload:'] = 'Thumbnail to upload:';
+$lang['You can use a personnal image or convert your file to an image using a desktop program or a web service such as'] = 'You can use a personnal image or convert your file to an image using a desktop program or a web service such as';
+$lang['Properties'] = 'Properties';
+$lang['Album:'] = 'Album:';
+$lang['Title:'] = 'Title:';
+$lang['... or '] = '... or ';
+$lang['create a new album'] = 'create a new album';
+
+//admin_configuration.tpl
+$lang['Open pdf in a new tab'] = 'Open pdf in a new tab';
+$lang['Overwrite files without notice'] = 'Overwrite files without notice';
+
+//admin_help.tpl
+$lang['The Upload tab allows you to upload "non picture" files to your gallerie. Fill in the form to upload and synchronize your file.'] = 'The Upload tab allows you to upload "non picture" files to your gallerie. Fill in the form to upload and synchronize your file.';
+$lang['The Configuration tab allows you to customize the plugin in two ways:'] = 'The Configuration tab allows you to customize the plugin in two ways:';
+$lang[': Check to open pdf files in a new tab instead of downloading them.'] = ': Check to open pdf files in a new tab instead of downloading them.';
+$lang[': Check to overwrite files during upload if a file with the same name already exists.'] = ': Check to overwrite files during upload if a file with the same name already exists.';
+$lang['You can use this plugin with the plugin <a href="http://fr.piwigo.org/ext/extension_view.php?eid=654">Media Icon</a> to add an icon to your "non picture" files.'] = 'You can use this plugin with the plugin <a href="http://fr.piwigo.org/ext/extension_view.php?eid=654">Media Icon</a> to add an icon to your "non picture" files.';
+$lang['Donate'] = 'Donate';
+$lang['I spent a lot of time to make this plugin works. If it is useful for you, do not hesitate a donation ;) Thank you for your generosity.'] = 'I spent a lot of time to make this plugin works. If it is useful for you, do not hesitate a donation ;) Thank you for your generosity.';
+
+
+//pdf2tab
+//picture.php
+$lang['Open the file in a new tab'] = 'Open the file in a new tab';
+?>
Index: /extensions/File_Uploader/language/fr_FR/description.txt
===================================================================
--- /extensions/File_Uploader/language/fr_FR/description.txt	(revision 19472)
+++ /extensions/File_Uploader/language/fr_FR/description.txt	(revision 19472)
@@ -0,0 +1,1 @@
+Trasférer des fichiers vers Piwigo
Index: /extensions/File_Uploader/language/fr_FR/index.php
===================================================================
--- /extensions/File_Uploader/language/fr_FR/index.php	(revision 19472)
+++ /extensions/File_Uploader/language/fr_FR/index.php	(revision 19472)
@@ -0,0 +1,30 @@
+<?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.                                                                  |
+// +-----------------------------------------------------------------------+
+
+// Recursive call
+$url = '../';
+header( 'Request-URI: '.$url );
+header( 'Content-Location: '.$url );
+header( 'Location: '.$url );
+exit();
+?>
Index: /extensions/File_Uploader/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/File_Uploader/language/fr_FR/plugin.lang.php	(revision 19472)
+++ /extensions/File_Uploader/language/fr_FR/plugin.lang.php	(revision 19472)
@@ -0,0 +1,57 @@
+<?php
+$lang['File Uploader Plugin'] = 'Plugin File Uploader';
+
+//admin.php
+$lang['Upload'] = 'Ajouter';
+$lang['Configuration'] = 'Configuration';
+$lang['Help'] = 'Aide';
+
+//admin_upload.php
+$lang['Specify a file to upload'] = 'Choisir un fichier à ajouter';
+$lang['Specify a thumbnail for your file'] = 'Choisir une miniature pour votre fichier';
+$lang['Unable to create folder '] = 'Error lors de la création du répertoire ';
+$lang['File exceeds the upload_max_filesize directive in php.ini'] = 'Le fichier dépasse la taille upload_max_filesize définie dans php.ini';
+$lang['File was only partially uploaded'] = 'Le fichier n\'a été que partiellement transmis';
+$lang['No file to upload'] = 'Aucun fichier à transférer';
+$lang['Missing a temporary folder'] = 'Aucun répertoire temporaire paramétré';
+$lang['Failed to write file to disk'] = 'Echec lors de l\'écriture sur le disque';
+$lang['File upload stopped by extension'] = 'Transfert du fichier arrêtée par une extension';
+$lang['Upload error'] = 'Erreur lors du transfert';
+$lang['Type of file not supported'] = 'Type de fichier non supporté';
+$lang['File with this name already exists. You should rename this file.'] = 'Un fichier avec le même nom existe déjà. Vous devriez renommer ce fichier.';
+$lang['Invalid file name'] = 'Nom de fichier non valide';
+$lang['Can\'t copy file to galleries directory'] = 'Copie ver le répertoire galleries impossible';
+$lang['The thumbnail must be a picture'] = 'La miniature doit être une image';
+$lang['File uploaded and synchronized'] = 'Fichier transféré et synchronisé';
+$lang['There have been errors. See below'] = 'Il y a eu des erreurs';
+
+//admin_upload.tpl
+$lang['Choose a file'] = 'Choisir un fichier';
+$lang['File to upload:'] = 'Fichier à transférer :';
+$lang['Choose a thumbnail'] = 'Choisir une miniature';
+$lang['Thumbnail to upload:'] = 'Miniature à transférer :';
+$lang['You can use a personnal image or convert your file to an image using a desktop program or a web service such as'] = 'Voux pouvez utiliser une image personnelle ou convertir votre fichier en image à l\'aide d\'un programme ou d\'un site web comme';
+$lang['Properties'] = 'Propriétés';
+$lang['Album:'] = 'Album :';
+$lang['Title:'] = 'Titre :';
+$lang['... or '] = '... ou ';
+$lang['create a new album'] = 'créer un nouvel album';
+
+//admin_configuration.tpl
+$lang['Open pdf in a new tab'] = 'Ouvrir les pdf dans un nouvel onglet';
+$lang['Overwrite files without notice'] = 'Remplacer les fichiers sans avertissement';
+
+//admin_help.tpl
+$lang['The Upload tab allows you to upload "non picture" files to your gallerie. Fill in the form to upload and synchronize your file.'] = 'L\'onglet Ajouter permet de transférer des fichier "non images" vers votre galerie. Remplissez le formulaire pour transférer et synchroniser votre fichier.';
+$lang['The Configuration tab allows you to customize the plugin in two ways:'] = 'L\'onglet configuration permet de personnaliser l\'extension de deux manières :';
+$lang[': Check to open pdf files in a new tab instead of downloading them.'] = ' : Cocher pour ouvrir les fichiers pdf dans un nouvel onglet au lieu de les télécharger.';
+$lang[': Check to overwrite files during upload if a file with the same name already exists.'] = ' : Cocher pour remplacer les fichiers pendant le transfert si un fichier avec le même nom existe déjà.';
+$lang['You can use this plugin with the plugin <a href="http://fr.piwigo.org/ext/extension_view.php?eid=654">Media Icon</a> to add an icon to your "non picture" files.'] = 'Vous pouvez utiliser ce plugin avec le plugin <a href="http://fr.piwigo.org/ext/extension_view.php?eid=654">Media Icon</a> pour ajouter une icône aux fichiers "non images".';
+$lang['Donate'] = 'Dons';
+$lang['I spent a lot of time to make this plugin works. If it is useful for you, do not hesitate a donation ;) Thank you for your generosity.'] = 'J\'ai passé beaucoup de temps à développer cette extension. Si elle vous est utile, n\'hésitez pas à faire un don ;) Merci pour votre générosité.';
+
+
+//pdf2tab
+//picture.php
+$lang['Open the file in a new tab'] = 'Ouvrir le fichier dans un nouvel onglet';
+?>
Index: /extensions/File_Uploader/language/index.php
===================================================================
--- /extensions/File_Uploader/language/index.php	(revision 19472)
+++ /extensions/File_Uploader/language/index.php	(revision 19472)
@@ -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/File_Uploader/main.inc.php
===================================================================
--- /extensions/File_Uploader/main.inc.php	(revision 19472)
+++ /extensions/File_Uploader/main.inc.php	(revision 19472)
@@ -0,0 +1,60 @@
+<?php
+/*
+Plugin Name: File Uploader
+Version: 2.4.a
+Description: Upload files to the galleries folder and synchronise them with database
+Plugin URI: http://fr.piwigo.org/ext/extension_view.php?eid=
+Author: Julien1311
+*/
+
+//Check whether we are indeed included by Piwigo.
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+global $conf;
+
+define('FILE_UPLOADER_DIR' , basename(dirname(__FILE__)));
+define('FILE_UPLOADER_PATH' , PHPWG_PLUGINS_PATH.FILE_UPLOADER_DIR.'/');
+define('FILE_UPLOADER_ADMIN',   get_root_url() . 'admin.php?page=plugin-file_uploader');
+define('FILE_UPLOADER_PDF2TAB_PATH' , FILE_UPLOADER_PATH.'pdf2tab/');
+
+/* +-----------------------------------------------------------------------+
+ * | Plugin admin                                                          |
+ * +-----------------------------------------------------------------------+ */
+
+// Add an entry to the plugins menu
+add_event_handler('get_admin_plugin_menu_links', 'file_uploader_admin_menu');
+
+function file_uploader_admin_menu($menu) {
+	array_push(
+		$menu, array(
+			'NAME'  => 'File Uploader',
+			'URL'   => FILE_UPLOADER_ADMIN,
+		)
+	);      
+	return $menu;
+}
+
+/* +-----------------------------------------------------------------------+
+ * | Plugin code                                                           |
+ * +-----------------------------------------------------------------------+ */
+$conf_file_uploader = unserialize($conf['file_uploader']);
+if ($conf_file_uploader['new_tab'] == 1) {
+	load_language('plugin.lang', FILE_UPLOADER_PATH);
+	include_once(FILE_UPLOADER_PDF2TAB_PATH.'thumbnails.php');
+	include_once(FILE_UPLOADER_PDF2TAB_PATH.'picture.php');
+}
+
+	
+/* +-----------------------------------------------------------------------+
+ * | CSS Style                                                             |
+ * +-----------------------------------------------------------------------+ */
+
+add_event_handler('loc_end_page_header', 'file_uploader_css');
+
+function file_uploader_css() {
+	global $template;
+
+	//add a stylesheet
+	$template->append('head_elements', '<link rel="stylesheet" type="text/css" href="'.FILE_UPLOADER_PATH.'admin/admin.css">');
+}
+?>
Index: /extensions/File_Uploader/maintain.inc.php
===================================================================
--- /extensions/File_Uploader/maintain.inc.php	(revision 19472)
+++ /extensions/File_Uploader/maintain.inc.php	(revision 19472)
@@ -0,0 +1,20 @@
+<?php
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+function plugin_install() {
+	include(dirname(__FILE__).'/config_default.inc.php');
+
+	$query = 'INSERT INTO '.CONFIG_TABLE.' (param,value,comment) VALUES ("file_uploader" ,"'.addslashes(serialize($config_default)).'", "File Uploader plugin parameters");';
+	pwg_query($query);
+}
+
+function plugin_activate() {
+
+}
+
+function plugin_uninstall() {
+	$query = 'DELETE FROM ' . CONFIG_TABLE . ' WHERE (param="file_uploader");';
+	pwg_query($query);
+}
+
+?>
Index: /extensions/File_Uploader/pdf2tab/index.php
===================================================================
--- /extensions/File_Uploader/pdf2tab/index.php	(revision 19472)
+++ /extensions/File_Uploader/pdf2tab/index.php	(revision 19472)
@@ -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/File_Uploader/pdf2tab/picture.php
===================================================================
--- /extensions/File_Uploader/pdf2tab/picture.php	(revision 19472)
+++ /extensions/File_Uploader/pdf2tab/picture.php	(revision 19472)
@@ -0,0 +1,13 @@
+<?php
+add_event_handler('render_element_content','file_uploader_pdf2tab_add_tag_picture',EVENT_HANDLER_PRIORITY_NEUTRAL+10,2);
+
+function file_uploader_pdf2tab_add_tag_picture($content, $element_info) {
+	if (strrchr($element_info['file'], ".") == ".pdf") {
+		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);
+	}
+	
+	return $content;
+}
+?>
Index: /extensions/File_Uploader/pdf2tab/template/index.php
===================================================================
--- /extensions/File_Uploader/pdf2tab/template/index.php	(revision 19472)
+++ /extensions/File_Uploader/pdf2tab/template/index.php	(revision 19472)
@@ -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/File_Uploader/pdf2tab/template/pdf2tab_thumbnails.tpl
===================================================================
--- /extensions/File_Uploader/pdf2tab/template/pdf2tab_thumbnails.tpl	(revision 19472)
+++ /extensions/File_Uploader/pdf2tab/template/pdf2tab_thumbnails.tpl	(revision 19472)
@@ -0,0 +1,24 @@
+{html_head}
+{literal}
+<script type="text/javascript">
+	//Add a link to the thumbnail
+	function file_uploader_pdf2tab_link() {
+		$("img[file_uploader$=pdf]").closest('a').attr("target","_blank");
+{/literal}
+		$("img[file_uploader$=pdf]").attr("title","{'Open the file in a new tab'|@translate}");
+{literal}
+		$("img[file_uploader$=pdf]").closest('a').attr("href",$("img[file_uploader$=pdf]").attr("file_uploader"));
+	}
+  
+	//When the document has finiched to load
+	jQuery(document).ready(function(){
+		file_uploader_pdf2tab_link();
+	});
+  
+	//Allow pdf2tab to work with RV Thumb Scroller 
+	jQuery(window).bind("RVTS_loaded", function(){
+		file_uploader_pdf2tab_link();
+	});
+</script>
+{/literal}
+{/html_head}
Index: /extensions/File_Uploader/pdf2tab/thumbnails.php
===================================================================
--- /extensions/File_Uploader/pdf2tab/thumbnails.php	(revision 19472)
+++ /extensions/File_Uploader/pdf2tab/thumbnails.php	(revision 19472)
@@ -0,0 +1,25 @@
+<?php
+add_event_handler('loc_end_index_thumbnails', 'file_uploader_pdf2tab_thumbnails');
+
+function file_uploader_pdf2tab_thumbnails($tpl_thumbnails_var) {
+	global $template;
+
+	$template->set_prefilter('index_thumbnails', 'file_uploader_pdf2tab_add_tag_thumbnails');
+	
+	$template->set_filename('pdf2tab_template_thumbnails', dirname(__FILE__).'/template/pdf2tab_thumbnails.tpl');
+	$template->concat('PLUGIN_INDEX_CONTENT_END', $template->parse('pdf2tab_template_thumbnails', true));
+	
+	return $tpl_thumbnails_var;
+}
+
+function file_uploader_pdf2tab_add_tag_thumbnails($content, &$smarty) {
+	global $template;
+
+	$search = 'class="thumbnail"';
+	
+	$replacement = 'class="thumbnail" file_uploader="{$thumbnail.path}"';
+	$content= str_replace($search, $replacement, $content);
+
+	return $content;
+}
+?>
