Index: /extensions/title/admin.php
===================================================================
--- /extensions/title/admin.php	(revision 31456)
+++ /extensions/title/admin.php	(revision 31456)
@@ -0,0 +1,233 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Title 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!');
+global $template, $conf, $user;
+include_once(PHPWG_ROOT_PATH .'admin/include/tabsheet.class.php');
+$my_base_url = PHPWG_ROOT_PATH.'admin.php?page=plugin-';
+
+// +-----------------------------------------------------------------------+
+// | Check Access and exit when user status is not ok                      |
+// +-----------------------------------------------------------------------+
+check_status(ACCESS_ADMINISTRATOR);
+
+// Gestion des onglets
+if (!isset($_GET['tab']))
+  $page['tab'] = 'plugtitle';
+else
+  $page['tab'] = $_GET['tab'];
+
+$tabsheet = new tabsheet();
+  $tabsheet->add('plugtitle', l10n('title_tab_plgtitle'), TITLE_ADMIN . '-plugtitle');
+  $PAC = pwg_db_fetch_assoc(pwg_query("SELECT state FROM " . PLUGINS_TABLE . " WHERE id = 'ContactForm';"));
+  if($PAC['state'] == 'active'){
+	$tabsheet->add('contacttitle', l10n('Contact Title'), TITLE_ADMIN . '-contacttitle');
+  }
+  $PAAP = pwg_db_fetch_assoc(pwg_query("SELECT state FROM " . PLUGINS_TABLE . " WHERE id = 'AdditionalPages';"));
+  if($PAAP['state'] == 'active'){
+	$tabsheet->add('AdditionalPagestitle', l10n('Additional Pages Title'), TITLE_ADMIN . '-AdditionalPagestitle');
+  }			   
+$tabsheet->select($page['tab']);
+$tabsheet->assign();
+
+// Tab Title on specials pages
+switch ($page['tab'])
+{
+  case 'plugtitle':
+
+$titlepagelistT = array(
+    l10n('title_select'),
+	'----------------------',
+    l10n('Home'),
+    l10n('Best rated'),
+    l10n('Most visited'),
+	l10n('Recent pictures'),
+	l10n('Recent categories'),
+	l10n('Favorites'),
+	l10n('Tags'),
+	l10n('Comments'),
+	l10n('About'),
+	l10n('search'),
+	l10n('Random pictures'),
+	l10n('Notification'),
+  );
+  
+$titlepagelist = array(
+    '',
+    '',
+    'home',
+    'best_rated',
+    'most_visited',
+	'recent_pics',
+	'recent_cats',
+	'favorites',
+	'tags',
+	'comments',
+	'about',
+	'search',
+	'random',
+	'notification',
+  );
+  
+    $template->assign(
+    'gestionA',
+    array(
+      ));
+
+$template->assign('titlepagelist', $titlepagelist);
+$template->assign('titlepagelistT', $titlepagelistT);
+
+if (isset($_POST['subtitlespecialET']) and (!$_POST['titlelist'])==0)
+	{
+$lire=$_POST['titlelist'];
+	$query = '
+select id,page,title
+  FROM ' . TITLE_TABLE . '
+  WHERE page = \''.$lire.'\'
+  ;';
+$result = pwg_query($query);
+
+$row = pwg_db_fetch_assoc($result);
+$titlepage=$row['page'];
+$titletitle=$row['title'];
+
+  $selected2 = "";
+  
+  $template->assign(
+    'title_edit',
+    array(
+      'VALUE' => $titlepage,
+      'CONTENT' => $titletitle,
+      'SELECTED' => $selected2
+      ));
+	}
+
+if (isset($_POST['subtitlespecial']))
+	{
+	$query = '
+UPDATE ' . TITLE_TABLE . '
+  SET title= \''.$_POST['inser'].'\'
+  WHERE page = \''.$_POST['invisible'].'\'
+    ;';
+$result = pwg_query($query);
+	}
+
+    break;
+	
+	case 'contacttitle':
+	
+	$template->assign('gestB',
+    array('CTBASE' => $conf['contacttitle'],));
+
+if (isset($_POST['submitct']))
+	{
+conf_update_param('contacttitle', $_POST['contacttitle']);
+$template->assign(
+    'gestB',
+    array('CTBASE' => stripslashes($_POST['contacttitle']),));
+	}
+	
+	break;
+
+	case 'AdditionalPagestitle':
+if (!defined('TITLE_AP_TABLE')) define('TITLE_AP_TABLE', $prefixeTable.'title_ap');
+$groups = array();
+$query = '
+select id,title
+  FROM ' . ADD_PAGES_TABLE . '
+  ORDER BY id ASC;';
+$result = pwg_query($query);
+	
+	while ($row = pwg_db_fetch_assoc($result))
+	{
+  $groups[$row['id']] = $row['id'].' : '.$row['title'];
+	}
+	
+	$selected = 0;
+	$options[] = l10n('Choose the page');
+	$options['a'] = '----------------------';
+	
+foreach($groups as $listid => $listid2)
+	{
+    $options[$listid] = $listid2;
+	}
+  $template->assign(
+    'gestionC',
+    array(
+	  'OPTIONS' => $options,
+      'SELECTED' => $selected
+      ));
+	
+	if (isset($_POST['submitchoixAP'])and is_numeric($_POST['APchoix']) and (!$_POST['APchoix'])==0)
+	{
+$lire=$_POST['APchoix'];
+	$query = '
+select id,title
+  FROM ' . TITLE_AP_TABLE . '
+  WHERE id = \''.$lire.'\'
+  ;';
+$result = pwg_query($query);
+$row = pwg_db_fetch_assoc($result);
+$idap=$row['id'];
+$titleap=$row['title'];
+
+$query = '
+select id,title
+  FROM ' . ADD_PAGES_TABLE . '
+  WHERE id = \''.$lire.'\'
+    ;';
+$result = pwg_query($query);
+$row = pwg_db_fetch_assoc($result);
+$idap=$row['id'];
+$nameap=$row['title'];
+
+  $selected3 = 0;
+  
+  $template->assign(
+    'ap_edit',
+    array(
+      'VALUE' => $idap,
+	  'VALUEN' => $nameap,
+      'CONTENT' => $titleap,
+      'SELECTED' => $selected3
+      ));
+	}
+
+if (isset($_POST['submitinsapt']))
+	{
+	$query = '
+DELETE 
+  FROM ' . TITLE_AP_TABLE . '
+  WHERE id = \''.$_POST['invisible'].'\'
+  ;';
+$result = pwg_query($query);
+	$q = '
+INSERT INTO ' . $prefixeTable . 'title_ap(id,title)VALUES ('.$_POST['invisible'].',"'.$_POST['insertitle'].'");';
+    pwg_query($q);
+	}
+	
+	break;
+	
+} 
+
+$template->set_filenames(array('plugin_admin_content' => dirname(__FILE__) . '/admin.tpl')); 
+$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
+?>
Index: /extensions/title/admin.tpl
===================================================================
--- /extensions/title/admin.tpl	(revision 31456)
+++ /extensions/title/admin.tpl	(revision 31456)
@@ -0,0 +1,83 @@
+<div class="titrePage">
+  <h2>{'Page title'|@translate}</h2>
+</div>
+{if isset ($gestionA)}
+		  <h3>{'title_pre'|@translate}</h3>
+	<div>
+		<form method="post" >
+			<fieldset>
+				<legend>{'title_select'|@translate}</legend>
+					{'title_list'|@translate}	
+					{html_options name="titlelist" values=$titlepagelist output=$titlepagelistT selected=$title_edit.VALUE}
+				<br>	
+				<br>
+				<div style="text-align:center;">
+					<input class="submit" name="subtitlespecialET" type="submit" value="{'title_choix'|@translate}" {$TAG_INPUT_ENABLED} />
+				</div>
+			</fieldset>
+		</form>
+	</div>
+	{if isset ($title_edit)}
+	<div>
+		<form method="post" >
+			<fieldset>
+				<legend>{'title_page'|@translate}</legend>
+					<input type="hidden" name="invisible" value="{$title_edit.VALUE}">
+					<input type="text" name="inser" value="{$title_edit.CONTENT}" size="100" maxlenght="100">
+				<br>	
+				<br>
+					<div style="text-align:center;">
+					<input class="submit" name="subtitlespecial" type="submit" value="{'title_insbase'|@translate}" {$TAG_INPUT_ENABLED} />
+					</div>
+			</fieldset>
+		</form>
+	</div>
+	{/if}
+{/if}
+
+{if isset ($gestB)}
+	<form method="post" >
+	 <fieldset id="mainConf">
+			<span class="property">
+				<label for="contacttitle">{'Contact Title'|@translate}</label><br><br>
+			</span>
+			<textarea rows="5" cols="50" class="description" name="contacttitle" id="contacttitle">{$gestB.CTBASE}</textarea>
+  <p>
+    <input class="submit" type="submit" name="submitct" value="{'Submit'|@translate}">
+    <input class="submit" type="reset" name="reset" value="{'Reset'|@translate}">
+  </p>
+  	</form>
+{/if}
+
+{if isset ($gestionC)}
+	<div>
+		<form method="post" >
+			<fieldset>
+				<legend>{'Choose Additional Pages'|@translate}</legend>
+		{html_options name="APchoix" options=$gestionC.OPTIONS selected=$gestionC.SELECTED}
+				<br>	
+				<br>
+					<div style="text-align:center;">
+					<input class="submit" name="submitchoixAP" type="submit" value="{'sumit'|@translate}" />
+					</div>
+			</fieldset>
+		</form>
+	</div>
+	{if isset ($ap_edit)}
+	<div>
+		<form method="post" >
+			<fieldset>
+				<legend>{'Add title for pages'|@translate} {$ap_edit.VALUE}</legend>
+					<input type="hidden" name="invisible" value="{$ap_edit.VALUE}">
+					id&nbsp;:&nbsp;{$ap_edit.VALUE}&nbsp;->&nbsp;{$ap_edit.VALUEN}<br>
+					<textarea rows="5" cols="50" class="description" name="insertitle" id="contacttitle">{$ap_edit.CONTENT}</textarea>
+				<br>	
+				<br>
+					<div style="text-align:center;">
+					<input class="submit" name="submitinsapt" type="submit" value="{'sumit'|@translate}"/>
+					</div>
+			</fieldset>
+		</form>
+	</div>
+	{/if}
+{/if}
Index: /extensions/title/initadmin.php
===================================================================
--- /extensions/title/initadmin.php	(revision 31455)
+++ /extensions/title/initadmin.php	(revision 31456)
@@ -1,5 +1,25 @@
 <?php
+// +-----------------------------------------------------------------------+
+// | Title 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!');
-load_language('plugin.lang', TITLE_PATH);
+//load_language('plugin.lang', TITLE_PATH);
 
 //Add link menu
@@ -9,5 +29,5 @@
   array_push($menu, array(
 	'NAME' => l10n('Page title'),
-    'URL' => get_admin_plugin_menu_link(TITLE_PATH . 'admin/admin.php')));
+    'URL' => get_admin_plugin_menu_link(TITLE_PATH . 'admin.php')));
   return $menu;
 }
@@ -26,66 +46,51 @@
 function titlePadminfT($content, &$smarty)
 	{
-  $search = '#</form>#';
+  $search = '#<p style="margin:40px 0 0 0">#';
   
   $replacement = '
-	<div>
-		<fieldset>
-		  <br>
-			<legend>{\'Title - Plugin title\'|@translate}</legend>
-				{\'title_photo\'|@translate}&nbsp;:&nbsp;<input type="text" name="insertitleP" value="{$titleCONTENT}" size="110" maxlenght="110">
-			<br>	
-			<br>
-				<div style="text-align:center;">
-				<input class="submit" name="subtitlephoto" type="submit" value="{\'title_insbase\'|@translate}" {$TAG_INPUT_ENABLED} />
-				</div>
-		</fieldset>
-	</div>  
-</form>';
+    <p>
+      <strong>{\'title_photo\'|@translate}</strong>
+      <br>
+      <textarea rows="4" cols="80" {if $useED==1}placeholder="{\'Use Extended Description tags...\'|@translate}"{/if} name="insertitleP" id="insertitleP" class="insertitleP">{$titleCONTENT}</textarea>
+    </p>
+	
+<p style="margin:40px 0 0 0">';
 
   return preg_replace($search, $replacement, $content);
 	}
  
-function titlePadminA()
-	{
-		load_language('plugin.lang', TITLE_PATH);
-if (isset($_GET['image_id']))
- {
- 	global $template, $prefixeTable;
-$query = '
-select id,title
-  FROM ' . TITLE_PHOTO_TABLE . '
-  WHERE id = '.$_GET['image_id'].'
-  ;';
-$result = pwg_query($query);
-$row = pwg_db_fetch_assoc($result);
-$titleP=$row['title'];
-  $template->assign(
-    array(
-      'titleCONTENT' => $titleP,
-      ));
- }
- 
-if (isset($_POST['subtitlephoto']))
- {
- 	$query = '
-DELETE 
-  FROM ' . TITLE_PHOTO_TABLE . '
-  WHERE id = '.$_GET['image_id'].'
-  ;';
-$result = pwg_query($query);
-	$q = '
-INSERT INTO ' . $prefixeTable . 'title_photo(id,title)VALUES ('.$_GET['image_id'].',"'.$_POST['insertitleP'].'");';
-    pwg_query($q);
-  
-  $template->assign(
-    array(
-      'titleCONTENT' => $_POST['insertitleP'],
-      ));
+function titlePadminA(){
+  if (isset($_GET['image_id'])){
+	global $template, $prefixeTable;
+	$query = 'select id,title FROM ' . TITLE_PHOTO_TABLE . ' WHERE id = '.$_GET['image_id'].';';
+	$result = pwg_query($query);
+	$row = pwg_db_fetch_assoc($result);
+    $titleP=$row['title'];
+    $PAED = pwg_db_fetch_assoc(pwg_query("SELECT state FROM " . PLUGINS_TABLE . " WHERE id = 'ExtendedDescription';"));
+	if($PAED['state'] == 'active'){
+	  $template->assign('useED',1);
+    }else{
+      $template->assign('useED',0);
+    }
+    $template->assign(
+      array(
+        'titleCONTENT' => $titleP,
+    ));
   }
-	}
+  if (isset($_POST['insertitleP'])){
+	$query = 'DELETE FROM ' . TITLE_PHOTO_TABLE . ' WHERE id = '.$_GET['image_id'].';';
+	$result = pwg_query($query);
+	$q = 'INSERT INTO ' . $prefixeTable . 'title_photo(id,title)VALUES ('.$_GET['image_id'].',"'.$_POST['insertitleP'].'");';
+	pwg_query($q);
+	$template->assign(
+	  array(
+		'titleCONTENT' => $_POST['insertitleP'],
+	));
+  }
+}
 	
 //add prefiltre album
-add_event_handler('loc_end_cat_modify', 'titleAadminf', 60);
-add_event_handler('loc_end_cat_modify', 'titleAadminA', 60);
+add_event_handler('loc_begin_admin', 'titleAadminf', 60);
+add_event_handler('loc_begin_admin_page', 'titleAadminA', 60);
 
 function titleAadminf()
@@ -97,63 +102,48 @@
 function titleAadminfT($content, &$smarty)
  {
-  $search = '#</form>#';
+  $search = '#<p style="margin:0">#';
   
   $replacement = '
-  	<div>
-		<fieldset>
-		  <br>
-			<legend>{\'Title - Plugin title\'|@translate}</legend>
-				{\'title_album\'|@translate}&nbsp;:&nbsp;<input type="text" name="insertitleA" value="{$titleCONTENT}" size="110" maxlenght="110">
-			<br>	
-			<br>
-				<div style="text-align:center;">
-				<input class="submit" name="subtitlealbum" type="submit" value="{\'title_insbase\'|@translate}" {$TAG_INPUT_ENABLED} />
-				</div>
-		</fieldset>
-	</div>
-</form>';
+    <p>
+      <strong>{\'title_album\'|@translate}</strong>
+      <br>
+      <textarea rows="4" cols="80" {if $useED==1}placeholder="{\'Use Extended Description tags...\'|@translate}"{/if} name="insertitleA" id="insertitleA" class="insertitleA">{$titleCONTENT}</textarea>
+    </p>	
+	
+	
+<p style="margin:0">';
 
   return preg_replace($search, $replacement, $content);
  }
 
- function titleAadminA()
-	{ 
-		load_language('plugin.lang', TITLE_PATH);
-if (isset($_GET['cat_id']))
- {
+function titleAadminA(){ 
+  if (isset($_GET['cat_id'])){
  	global $template, $prefixeTable;
-$query = '
-select id,title
-  FROM ' . TITLE_ALBUM_TABLE . '
-  WHERE id = '.$_GET['cat_id'].'
-  ;';
-$result = pwg_query($query);
-$row = pwg_db_fetch_assoc($result);
-$titleA=$row['title'];
-
-  $template->assign(
-    array(
-      'titleCONTENT' => $titleA,
-      ));
- }
- 
-if (isset($_POST['subtitlealbum']))
- {
-	$query = '
-DELETE 
-  FROM ' . TITLE_ALBUM_TABLE . '
-  WHERE id = '.$_GET['cat_id'].'
-  ;';
-$result = pwg_query($query);
-	$q = '
-INSERT INTO ' . $prefixeTable . 'title_album(id,title)VALUES ('.$_GET['cat_id'].',"'.$_POST['insertitleA'].'");';
+	$query = 'select id,title FROM ' . TITLE_ALBUM_TABLE . ' WHERE id = '.$_GET['cat_id'].';';
+	$result = pwg_query($query);
+	$row = pwg_db_fetch_assoc($result);
+	$titleA=$row['title'];
+    $PAED = pwg_db_fetch_assoc(pwg_query("SELECT state FROM " . PLUGINS_TABLE . " WHERE id = 'ExtendedDescription';"));
+	if($PAED['state'] == 'active'){
+	  $template->assign('useED',1);
+    }else{
+      $template->assign('useED',0);
+    }
+	$template->assign(
+      array(
+        'titleCONTENT' => $titleA,
+    ));
+  }
+  if (isset($_POST['insertitleA'])){
+	$query = 'DELETE FROM ' . TITLE_ALBUM_TABLE . ' WHERE id = '.$_GET['cat_id'].';';
+	$result = pwg_query($query);
+	$q = 'INSERT INTO ' . $prefixeTable . 'title_album(id,title)VALUES ('.$_GET['cat_id'].',"'.$_POST['insertitleA'].'");';
     pwg_query($q);
-		
-  $template->assign(
-    array(
-      'titleCONTENT' => $_POST['insertitleA'],
-      ));
+	$template->assign(
+      array(
+        'titleCONTENT' => $_POST['insertitleA'],
+    ));
   }
-	}
+}
 
 ?>
Index: /extensions/title/language/en_UK/index.php
===================================================================
--- /extensions/title/language/en_UK/index.php	(revision 31455)
+++ /extensions/title/language/en_UK/index.php	(revision 31456)
@@ -1,25 +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 = '../';
Index: /extensions/title/language/en_UK/plugin.lang.php
===================================================================
--- /extensions/title/language/en_UK/plugin.lang.php	(revision 31455)
+++ /extensions/title/language/en_UK/plugin.lang.php	(revision 31456)
@@ -1,5 +1,23 @@
 <?php
+// +-----------------------------------------------------------------------+
+// | Title 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['Title - Plugin title'] = 'Page Title - Plugin title';
 $lang['title_insbase'] = 'Saves title in the database';
 $lang['title_photo'] = 'Page title for the photo';
Index: /extensions/title/language/fr_FR/index.php
===================================================================
--- /extensions/title/language/fr_FR/index.php	(revision 31455)
+++ /extensions/title/language/fr_FR/index.php	(revision 31456)
@@ -1,25 +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 = '../';
Index: /extensions/title/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/title/language/fr_FR/plugin.lang.php	(revision 31455)
+++ /extensions/title/language/fr_FR/plugin.lang.php	(revision 31456)
@@ -1,5 +1,23 @@
 <?php
+// +-----------------------------------------------------------------------+
+// | Title 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['Title - Plugin title'] = 'Titre de la page - Plugin title';
 $lang['title_insbase'] = 'Enregistrer le titre dans la base';
 $lang['title_photo'] = 'Titre de la page pour la photo';
Index: /extensions/title/main.inc.php
===================================================================
--- /extensions/title/main.inc.php	(revision 31455)
+++ /extensions/title/main.inc.php	(revision 31456)
@@ -6,6 +6,26 @@
 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=507
 Author: ddtddt
-Author URI: http://piwigo.org/
+Author URI: http://temmii.com/piwigo/
 */
+
+// +-----------------------------------------------------------------------+
+// | Title 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!');
@@ -18,4 +38,10 @@
 define('TITLE_PHOTO_TABLE' , $prefixeTable . 'title_photo');
 define('TITLE_ALBUM_TABLE' , $prefixeTable . 'title_album');
+define('TITLE_ADMIN',get_root_url().'admin.php?page=plugin-'.TITLE_DIR);
+
+add_event_handler('loading_lang', 'title_loading_lang');	  
+function title_loading_lang(){
+  load_language('plugin.lang', TITLE_PATH);
+}
 
 //prefiltre for change <title>
Index: /extensions/title/maintain.class.php
===================================================================
--- /extensions/title/maintain.class.php	(revision 31456)
+++ /extensions/title/maintain.class.php	(revision 31456)
@@ -0,0 +1,138 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | Title 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!');
+
+class title_maintain extends PluginMaintain
+{
+  function install($plugin_version, &$errors=array())
+  {
+    global $conf, $prefixeTable;
+
+    $q = 'CREATE TABLE IF NOT EXISTS ' . $prefixeTable . 'title(
+id SMALLINT( 5 ) UNSIGNED NOT NULL ,
+page VARCHAR( 255 ) NOT NULL ,
+title lONGTEXT NOT NULL ,
+PRIMARY KEY (id))DEFAULT CHARSET=utf8;';
+    pwg_query($q);
+	
+	$q = '
+INSERT INTO ' . $prefixeTable . 'title(id,page,title)VALUES (1,"home","");';
+    pwg_query($q);
+	$q = '
+INSERT INTO ' . $prefixeTable . 'title(id,page,title)VALUES (2,"best_rated","");';
+    pwg_query($q);
+		$q = '
+INSERT INTO ' . $prefixeTable . 'title(id,page,title)VALUES (3,"most_visited","");';
+    pwg_query($q);
+		$q = '
+INSERT INTO ' . $prefixeTable . 'title(id,page,title)VALUES (4,"recent_pics","");';
+    pwg_query($q);
+		$q = '
+INSERT INTO ' . $prefixeTable . 'title(id,page,title)VALUES (5,"recent_cats","");';
+    pwg_query($q);
+		$q = '
+INSERT INTO ' . $prefixeTable . 'title(id,page,title)VALUES (6,"favorites","");';
+    pwg_query($q);	
+		$q = '
+INSERT INTO ' . $prefixeTable . 'title(id,page,title)VALUES (7,"tags","");';
+    pwg_query($q);
+		$q = '
+INSERT INTO ' . $prefixeTable . 'title(id,page,title)VALUES (8,"comments","");';
+    pwg_query($q);
+		$q = '
+INSERT INTO ' . $prefixeTable . 'title(id,page,title)VALUES (9,"about","");';
+    pwg_query($q);
+		$q = '
+INSERT INTO ' . $prefixeTable . 'title(id,page,title)VALUES (10,"search","");';
+    pwg_query($q);
+		$q = '
+INSERT INTO ' . $prefixeTable . 'title(id,page,title)VALUES (11,"random","");';
+    pwg_query($q);
+		$q = '
+INSERT INTO ' . $prefixeTable . 'title(id,page,title)VALUES (12,"notification","");';
+    pwg_query($q);	
+	
+if (!defined('TITLE_PHOTO_TABLE')) define('TITLE_PHOTO_TABLE', $prefixeTable.'title_photo');
+	$query = "CREATE TABLE IF NOT EXISTS ". TITLE_PHOTO_TABLE ." (
+id SMALLINT( 5 ) UNSIGNED NOT NULL ,
+title VARCHAR( 255 ) NOT NULL ,
+PRIMARY KEY (id))DEFAULT CHARSET=utf8;";
+	$result = pwg_query($query);
+
+if (!defined('TITLE_ALBUM_TABLE')) define('TITLE_ALBUM_TABLE', $prefixeTable.'title_album');	
+	$query = "CREATE TABLE IF NOT EXISTS ". TITLE_ALBUM_TABLE ." (
+id SMALLINT( 5 ) UNSIGNED NOT NULL ,
+title VARCHAR( 255 ) NOT NULL ,
+PRIMARY KEY (id))DEFAULT CHARSET=utf8;";
+	$result = pwg_query($query);
+	
+  if (empty($conf['contacttitle']))
+  {
+	conf_update_param('contacttitle', '');
+  }
+  
+  	if (!defined('TITLE_AP_TABLE')) define('TITLE_AP_TABLE', $prefixeTable.'title_ap');	
+	$query = "CREATE TABLE IF NOT EXISTS ". TITLE_AP_TABLE ." (
+id SMALLINT( 5 ) UNSIGNED NOT NULL ,
+title VARCHAR( 255 ) NOT NULL ,
+PRIMARY KEY (id))DEFAULT CHARSET=utf8;";
+	$result = pwg_query($query);
+  }
+
+  function update($old_version, $new_version, &$errors=array())
+  {
+	//$this->install($new_version, $errors);
+	global $conf, $prefixeTable;
+  if (!isset($conf['contacttitle']))
+  {
+	conf_update_param('contacttitle', '');
+  }
+  
+  	if (!defined('TITLE_AP_TABLE')) define('TITLE_AP_TABLE', $prefixeTable.'title_ap');	
+	$query = "CREATE TABLE IF NOT EXISTS ". TITLE_AP_TABLE ." (
+id SMALLINT( 5 ) UNSIGNED NOT NULL ,
+title VARCHAR( 255 ) NOT NULL ,
+PRIMARY KEY (id))DEFAULT CHARSET=utf8;";
+	$result = pwg_query($query);
+	
+  }
+
+  function uninstall()
+  {
+	global $prefixeTable;
+
+	$q = 'DROP TABLE ' . $prefixeTable . 'title;';
+    pwg_query($q);
+	
+	$q = 'DROP TABLE ' . $prefixeTable . 'title_photo;';
+    pwg_query($q);
+
+	$q = 'DROP TABLE ' . $prefixeTable . 'title_album;';
+    pwg_query($q);
+	
+	$q = 'DROP TABLE ' . $prefixeTable . 'title_ap;';
+    pwg_query($q);
+	
+	conf_delete_param('contacttitle');
+
+  }
+}
Index: tensions/title/maintain.inc.php
===================================================================
--- /extensions/title/maintain.inc.php	(revision 31455)
+++ 	(revision )
@@ -1,121 +1,0 @@
-<?php
-
-if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
-
-function plugin_install()
-{
-    global $conf, $prefixeTable;
-
-    $q = 'CREATE TABLE ' . $prefixeTable . 'title(
-id SMALLINT( 5 ) UNSIGNED NOT NULL ,
-page VARCHAR( 255 ) NOT NULL ,
-title lONGTEXT NOT NULL ,
-PRIMARY KEY (id))DEFAULT CHARSET=utf8;';
-    pwg_query($q);
-	
-	$q = '
-INSERT INTO ' . $prefixeTable . 'title(id,page,title)VALUES (1,"home","");';
-    pwg_query($q);
-	$q = '
-INSERT INTO ' . $prefixeTable . 'title(id,page,title)VALUES (2,"best_rated","");';
-    pwg_query($q);
-		$q = '
-INSERT INTO ' . $prefixeTable . 'title(id,page,title)VALUES (3,"most_visited","");';
-    pwg_query($q);
-		$q = '
-INSERT INTO ' . $prefixeTable . 'title(id,page,title)VALUES (4,"recent_pics","");';
-    pwg_query($q);
-		$q = '
-INSERT INTO ' . $prefixeTable . 'title(id,page,title)VALUES (5,"recent_cats","");';
-    pwg_query($q);
-		$q = '
-INSERT INTO ' . $prefixeTable . 'title(id,page,title)VALUES (6,"favorites","");';
-    pwg_query($q);	
-		$q = '
-INSERT INTO ' . $prefixeTable . 'title(id,page,title)VALUES (7,"tags","");';
-    pwg_query($q);
-		$q = '
-INSERT INTO ' . $prefixeTable . 'title(id,page,title)VALUES (8,"comments","");';
-    pwg_query($q);
-		$q = '
-INSERT INTO ' . $prefixeTable . 'title(id,page,title)VALUES (9,"about","");';
-    pwg_query($q);
-		$q = '
-INSERT INTO ' . $prefixeTable . 'title(id,page,title)VALUES (10,"search","");';
-    pwg_query($q);
-		$q = '
-INSERT INTO ' . $prefixeTable . 'title(id,page,title)VALUES (11,"random","");';
-    pwg_query($q);
-		$q = '
-INSERT INTO ' . $prefixeTable . 'title(id,page,title)VALUES (12,"notification","");';
-    pwg_query($q);	
-	
-if (!defined('TITLE_PHOTO_TABLE')) define('TITLE_PHOTO_TABLE', $prefixeTable.'title_photo');
-	$query = "CREATE TABLE IF NOT EXISTS ". TITLE_PHOTO_TABLE ." (
-id SMALLINT( 5 ) UNSIGNED NOT NULL ,
-title VARCHAR( 255 ) NOT NULL ,
-PRIMARY KEY (id))DEFAULT CHARSET=utf8;";
-	$result = pwg_query($query);
-
-if (!defined('TITLE_ALBUM_TABLE')) define('TITLE_ALBUM_TABLE', $prefixeTable.'title_album');	
-	$query = "CREATE TABLE IF NOT EXISTS ". TITLE_ALBUM_TABLE ." (
-id SMALLINT( 5 ) UNSIGNED NOT NULL ,
-title VARCHAR( 255 ) NOT NULL ,
-PRIMARY KEY (id))DEFAULT CHARSET=utf8;";
-	$result = pwg_query($query);
-	
-  if (empty($conf['contacttitle']))
-  {
-	conf_update_param('contacttitle', '');
-  }
-
-  
-  	if (!defined('TITLE_AP_TABLE')) define('TITLE_AP_TABLE', $prefixeTable.'title_ap');	
-	$query = "CREATE TABLE IF NOT EXISTS ". TITLE_AP_TABLE ." (
-id SMALLINT( 5 ) UNSIGNED NOT NULL ,
-title VARCHAR( 255 ) NOT NULL ,
-PRIMARY KEY (id))DEFAULT CHARSET=utf8;";
-	$result = pwg_query($query);
-	
-}
-
-function plugin_activate()
-{
-    global $conf, $prefixeTable;
-  if (!isset($conf['contacttitle']))
-  {
-	conf_update_param('contacttitle', '');
-  }
-  
-  	if (!defined('TITLE_AP_TABLE')) define('TITLE_AP_TABLE', $prefixeTable.'title_ap');	
-	$query = "CREATE TABLE IF NOT EXISTS ". TITLE_AP_TABLE ." (
-id SMALLINT( 5 ) UNSIGNED NOT NULL ,
-title VARCHAR( 255 ) NOT NULL ,
-PRIMARY KEY (id))DEFAULT CHARSET=utf8;";
-	$result = pwg_query($query);
-    
-}
-
-function plugin_uninstall()
-{
-    
-	global $prefixeTable;
-
-	$q = 'DROP TABLE ' . $prefixeTable . 'title;';
-    pwg_query($q);
-	
-	$q = 'DROP TABLE ' . $prefixeTable . 'title_photo;';
-    pwg_query($q);
-
-	$q = 'DROP TABLE ' . $prefixeTable . 'title_album;';
-    pwg_query($q);
-	
-	$q = 'DROP TABLE ' . $prefixeTable . 'title_ap;';
-    pwg_query($q);
-	
-	conf_delete_param('contacttitle');
-
-}
-
-
-?>
Index: /extensions/title/obsolete.list
===================================================================
--- /extensions/title/obsolete.list	(revision 31456)
+++ /extensions/title/obsolete.list	(revision 31456)
@@ -0,0 +1,3 @@
+maintain.inc.php
+admin/admin.php
+admin/admin.tpl
