Index: extensions/reset_level/index.php
===================================================================
--- extensions/reset_level/index.php	(revision 11529)
+++ extensions/reset_level/index.php	(revision 31521)
@@ -1,26 +1,3 @@
 <?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 );
Index: extensions/reset_level/initadmin.php
===================================================================
--- extensions/reset_level/initadmin.php	(revision 31521)
+++ extensions/reset_level/initadmin.php	(revision 31521)
@@ -0,0 +1,62 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | reset level plugin for piwigo                                         |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2011-2016 ddtddt               http://temmii.com/piwigo/ |
+// +-----------------------------------------------------------------------+
+// | 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.                                                                  |
+// +-----------------------------------------------------------------------+
+
+
+add_event_handler('loading_lang', 'reset_level_loading_lang');	  
+function reset_level_loading_lang(){
+  load_language('plugin.lang', DELLE_PATH);
+}
+
+add_event_handler('loc_begin_admin', 'plugrlPf');
+add_event_handler('loc_begin_admin_page', 'plugrlaction');
+
+function plugrlPf(){
+  global $template;
+  $admin_base_url = $_SERVER['REQUEST_URI'];
+  $template->set_prefilter('maintenance', 'plugrlPT');
+  $template->assign(
+    array(
+		'U_RESETLEVEL' => $admin_base_url . '&amp;resetlevel&amp;pwg_token='.get_pwg_token(),
+  ));
+}
+
+function plugrlPT($content, &$smarty){
+  $search = '#	</li>
+</ul>#';
+  $replacement = '
+    	</li>
+</ul>
+    <ul>
+	  <li><a href="{$U_RESETLEVEL}" title="{\'delle_all\'|@translate}" onclick="return confirm(\'{\'Are you sure?\'|@translate|@escape:javascript}\');"><span class="icon-arrows-cw"></span>{\'delle_purgeall\'|@translate}</a></li>
+    </ul>';
+  return preg_replace($search, $replacement, $content);
+}
+
+function plugrlaction(){
+  if (isset($_GET['resetlevel'])){
+  //$admin_base_url=explode('&resetlevel', $_SERVER['REQUEST_URI']);
+  $query = 'UPDATE ' . IMAGES_TABLE . ' SET level= \'0\';';
+  $result = pwg_query($query);
+  invalidate_user_cache();
+  $_SESSION['page_infos'] = array(l10n('delle_totalok'));
+  redirect(get_root_url().'admin.php?page=maintenance');
+  } 
+}
Index: extensions/reset_level/language/en_UK/description.txt
===================================================================
--- extensions/reset_level/language/en_UK/description.txt	(revision 11529)
+++ extensions/reset_level/language/en_UK/description.txt	(revision 31521)
@@ -1,1 +1,1 @@
-Reset all the levels of confidentiality for all photos in the gallery 'for all'
+From maintenance page, reset all the levels of confidentiality for all photos in the gallery 'for all'
Index: extensions/reset_level/language/en_UK/index.php
===================================================================
--- extensions/reset_level/language/en_UK/index.php	(revision 11529)
+++ extensions/reset_level/language/en_UK/index.php	(revision 31521)
@@ -1,26 +1,3 @@
 <?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 );
Index: extensions/reset_level/language/en_UK/plugin.lang.php
===================================================================
--- extensions/reset_level/language/en_UK/plugin.lang.php	(revision 11529)
+++ extensions/reset_level/language/en_UK/plugin.lang.php	(revision 31521)
@@ -1,6 +1,23 @@
 <?php
-
-$lang['delle_onglet_all'] = 'Reset Level';
-$lang['delle_all'] = 'Discount level of confidentiality "for all " for all photos in the gallery';
+// +-----------------------------------------------------------------------+
+// | reset level plugin for piwigo                                         |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2011-2016 ddtddt               http://temmii.com/piwigo/ |
+// +-----------------------------------------------------------------------+
+// | 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['delle_all'] = 'Discount level of confidentiality for all photos in the gallery: for all';
 $lang['delle_purgeall'] = 'Reset levels of privacy';
 $lang['delle_totalok'] = 'All Photos now have a level of confidentiality "for all "';
Index: extensions/reset_level/language/fr_FR/description.txt
===================================================================
--- extensions/reset_level/language/fr_FR/description.txt	(revision 11529)
+++ extensions/reset_level/language/fr_FR/description.txt	(revision 31521)
@@ -1,1 +1,1 @@
-Remettre tous les niveaux de confidentialité de toutes les photos de la galerie à 'pour tous'
+Depuis la page maintenance, remettre tous les niveaux de confidentialité de toutes les photos de la galerie à 'pour tous'
Index: extensions/reset_level/language/fr_FR/index.php
===================================================================
--- extensions/reset_level/language/fr_FR/index.php	(revision 11529)
+++ extensions/reset_level/language/fr_FR/index.php	(revision 31521)
@@ -1,26 +1,3 @@
 <?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 );
Index: extensions/reset_level/language/fr_FR/plugin.lang.php
===================================================================
--- extensions/reset_level/language/fr_FR/plugin.lang.php	(revision 11529)
+++ extensions/reset_level/language/fr_FR/plugin.lang.php	(revision 31521)
@@ -1,6 +1,23 @@
 <?php
-
-$lang['delle_onglet_all'] = 'Reset Level';
-$lang['delle_all'] = 'Remise du niveau de confidentialité à "pour tous" pour toutes les photos de la galerie';
+// +-----------------------------------------------------------------------+
+// | reset level plugin for piwigo                                         |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2011-2016 ddtddt               http://temmii.com/piwigo/ |
+// +-----------------------------------------------------------------------+
+// | 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['delle_all'] = 'Remise du niveau de confidentialité pour toutes les photos de la galerie à : pour tous';
 $lang['delle_purgeall'] = 'Réinitialisation des niveaux de confidentialité';
 $lang['delle_totalok'] = 'Toutes les photos ont maintenant un niveau de confidentialité à "pour tous"';
Index: extensions/reset_level/language/index.php
===================================================================
--- extensions/reset_level/language/index.php	(revision 11529)
+++ extensions/reset_level/language/index.php	(revision 31521)
@@ -1,26 +1,3 @@
 <?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 );
Index: extensions/reset_level/language/it_IT/index.php
===================================================================
--- extensions/reset_level/language/it_IT/index.php	(revision 11529)
+++ extensions/reset_level/language/it_IT/index.php	(revision 31521)
@@ -1,26 +1,3 @@
 <?php
-// +-----------------------------------------------------------------------+
-// | Piwigo - a PHP based photo gallery                                    |
-// +-----------------------------------------------------------------------+
-// | Copyright(C) 2008-2011 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 );
Index: extensions/reset_level/language/it_IT/plugin.lang.php
===================================================================
--- extensions/reset_level/language/it_IT/plugin.lang.php	(revision 11529)
+++ extensions/reset_level/language/it_IT/plugin.lang.php	(revision 31521)
@@ -1,6 +1,23 @@
 <?php
-
-$lang['delle_onglet_all'] = 'Reset Level';
-$lang['delle_all'] = 'Reinizializzare il livello di confidenzialità a "per tutti" a tutte le foto della galleria';
+// +-----------------------------------------------------------------------+
+// | reset level plugin for piwigo                                         |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2011-2016 ddtddt               http://temmii.com/piwigo/ |
+// +-----------------------------------------------------------------------+
+// | 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['delle_all'] = 'Reinizializzare il livello di confidenzialità a tutte le foto della galleria a : per tutti';
 $lang['delle_purgeall'] = 'Reinizializzare i livelli di confidenzialità';
 $lang['delle_totalok'] = 'Tutte le foto sono ora impostate su un livello di confidenzialità a "per tutti"';
Index: extensions/reset_level/main.inc.php
===================================================================
--- extensions/reset_level/main.inc.php	(revision 11529)
+++ extensions/reset_level/main.inc.php	(revision 31521)
@@ -6,6 +6,26 @@
 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=517
 Author: ddtddt
-Author URI: http://piwigo.org/
+Author URI: http://temmii.com/piwigo/
 */
+
+// +-----------------------------------------------------------------------+
+// | reset level plugin for piwigo                                         |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2011-2016 ddtddt               http://temmii.com/piwigo/ |
+// +-----------------------------------------------------------------------+
+// | 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.                                                                  |
+// +-----------------------------------------------------------------------+
 
 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
@@ -15,13 +35,17 @@
 define('DELLE_DIR' , basename(dirname(__FILE__)));
 define('DELLE_PATH' , PHPWG_PLUGINS_PATH . DELLE_DIR . '/');
-load_language('plugin.lang', DELLE_PATH);
 
-add_event_handler('get_admin_plugin_menu_links', 'delle_admin_menu');
-function delle_admin_menu($menu)
-{
-  array_push($menu, array(
-	'NAME' => 'Reset level',
-    'URL' => get_admin_plugin_menu_link(DELLE_PATH . 'admin/admin.php')));
-  return $menu;
+// Plugin for admin
+if (script_basename() == 'admin') {
+    include_once(dirname(__FILE__) . '/initadmin.php');
 }
+
+
+
+
+
+
+  
+
+
 ?>
Index: extensions/reset_level/obsolete.list
===================================================================
--- extensions/reset_level/obsolete.list	(revision 31521)
+++ extensions/reset_level/obsolete.list	(revision 31521)
@@ -0,0 +1,4 @@
+admin/index.php
+admin/admin.php
+admin/admin.tpl
+admin/
