Index: /extensions/custom_download_link/language/en_UK/description.txt
===================================================================
--- /extensions/custom_download_link/language/en_UK/description.txt	(revision 27503)
+++ /extensions/custom_download_link/language/en_UK/description.txt	(revision 27503)
@@ -0,0 +1,1 @@
+Add a specific download button on the page of the photo
Index: /extensions/custom_download_link/language/en_UK/index.php
===================================================================
--- /extensions/custom_download_link/language/en_UK/index.php	(revision 27503)
+++ /extensions/custom_download_link/language/en_UK/index.php	(revision 27503)
@@ -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/custom_download_link/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/custom_download_link/language/en_UK/plugin.lang.php	(revision 27503)
+++ /extensions/custom_download_link/language/en_UK/plugin.lang.php	(revision 27503)
@@ -0,0 +1,3 @@
+<?php
+$lang['Download Photo'] = 'Download Photo';
+?>
Index: /extensions/custom_download_link/language/fr_FR/description.txt
===================================================================
--- /extensions/custom_download_link/language/fr_FR/description.txt	(revision 27503)
+++ /extensions/custom_download_link/language/fr_FR/description.txt	(revision 27503)
@@ -0,0 +1,1 @@
+Ajoute un gros bouton de téléchargement sur la page de la photo
Index: /extensions/custom_download_link/language/fr_FR/index.php
===================================================================
--- /extensions/custom_download_link/language/fr_FR/index.php	(revision 27503)
+++ /extensions/custom_download_link/language/fr_FR/index.php	(revision 27503)
@@ -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/custom_download_link/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/custom_download_link/language/fr_FR/plugin.lang.php	(revision 27503)
+++ /extensions/custom_download_link/language/fr_FR/plugin.lang.php	(revision 27503)
@@ -0,0 +1,3 @@
+<?php
+$lang['Download Photo'] = 'Télécharger la photo';
+?>
Index: /extensions/custom_download_link/language/index.php
===================================================================
--- /extensions/custom_download_link/language/index.php	(revision 27503)
+++ /extensions/custom_download_link/language/index.php	(revision 27503)
@@ -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/custom_download_link/main.inc.php
===================================================================
--- /extensions/custom_download_link/main.inc.php	(revision 27503)
+++ /extensions/custom_download_link/main.inc.php	(revision 27503)
@@ -0,0 +1,41 @@
+<?php
+/*
+Plugin Name: Custom Download Link
+Version: auto
+Description: Add a specific download button on the page of the photo
+Plugin URI: http://piwigo.org/ext/extension_view.php?eid=
+Author: plg
+Author URI: http://le-gall.net/pierrick
+*/
+
+if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+
+add_event_handler('loc_begin_picture', 'cdl_deactivate_hd');
+function cdl_deactivate_hd()
+{
+  global $user;
+
+  $user['cdl_enabled_high'] = $user['enabled_high'];
+  $user['enabled_high'] = false;
+}
+
+add_event_handler('loc_end_picture', 'cdl_add_link');
+function cdl_add_link()
+{
+  global $conf, $template, $user, $picture;
+
+  load_language('plugin.lang', PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/');
+  load_language('lang', PHPWG_ROOT_PATH.PWG_LOCAL_DIR, array('no_fallback'=>true, 'local'=>true) );
+
+  $template->set_prefilter('picture', 'cdl_add_link_prefilter');
+  $template->assign('CDL_LINK', get_action_url($picture['current']['id'], 'e', true));
+}
+
+function cdl_add_link_prefilter($content, &$smarty)
+{
+  $search = '{$ELEMENT_CONTENT}';
+  $replace = '{$ELEMENT_CONTENT}<div id="customDownloadLink"><a href="{$CDL_LINK}" rel="nofollow"><img src="plugins/custom_download_link/download_white_32.png"> {\'Download Photo\'|@translate}</a></div>{combine_css path="plugins/custom_download_link/style.css"}';
+  
+  return str_replace($search, $replace, $content);
+}
+?>
Index: /extensions/custom_download_link/style.css
===================================================================
--- /extensions/custom_download_link/style.css	(revision 27503)
+++ /extensions/custom_download_link/style.css	(revision 27503)
@@ -0,0 +1,33 @@
+#customDownloadLink {
+  margin:10px;
+}
+
+#customDownloadLink {
+    background-color: #222222;
+    -moz-border-radius: 10px;
+    -webkit-border-radius: 10px;
+    border-radius: 10px;
+    font-size: 20px;
+    letter-spacing:1px;
+    line-height: 50px;
+    margin: 10px auto;
+    width: 300px;
+}
+
+#customDownloadLink img {
+    border:none;
+    margin:0;
+    margin-bottom:-10px;
+}
+
+#customDownloadLink a {
+    color:#ddd;
+    border:none;
+    text-decoration:none;
+}
+
+#customDownloadLink a:hover {
+    color:#fff;
+    border:none;
+    text-decoration:none;
+}
