Index: /extensions/title/initadmin.php
===================================================================
--- /extensions/title/initadmin.php	(revision 14974)
+++ /extensions/title/initadmin.php	(revision 14975)
@@ -16,5 +16,5 @@
 //add prefiltre photo
 add_event_handler('loc_begin_admin', 'titlePadminf',60);
-add_event_handler('loc_begin_admin', 'titlePadminA',60);
+add_event_handler('loc_begin_admin_page', 'titlePadminA',60);
 
 function titlePadminf()
@@ -26,22 +26,20 @@
 function titlePadminfT($content, &$smarty)
 	{
-  $search = '#<form id="associations"#';
+  $search = '#</form>#';
   
   $replacement = '
 	<div>
-		<form method="post" >
-			<fieldset>
-			  <br>
-				<legend>{\'Title - Plugin title\'|@translate}</legend>
-					{\'title_photo\'|@translate}&nbsp;:&nbsp;<input type="text" name="inser" 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>
-		</form>
+		<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 id="associations"';
+</form>';
 
   return preg_replace($search, $replacement, $content);
@@ -49,5 +47,5 @@
  
 function titlePadminA()
-	{ 
+	{
 		load_language('plugin.lang', TITLE_PATH);
 if (isset($_GET['image_id']))
@@ -62,5 +60,4 @@
 $row = mysql_fetch_array($result);
 $titleP=$row['title'];
-
   $template->assign(
     array(
@@ -78,10 +75,10 @@
 $result = pwg_query($query);
 	$q = '
-INSERT INTO ' . $prefixeTable . 'title_photo(id,title)VALUES ('.$_GET['image_id'].',"'.$_POST['inser'].'");';
+INSERT INTO ' . $prefixeTable . 'title_photo(id,title)VALUES ('.$_GET['image_id'].',"'.$_POST['insertitleP'].'");';
     pwg_query($q);
   
   $template->assign(
     array(
-      'titleCONTENT' => $_POST['inser'],
+      'titleCONTENT' => $_POST['insertitleP'],
       ));
   }
@@ -95,30 +92,25 @@
  {
 	global $template;
-	$template->set_prefilter('categories', 'titleAadminfT');
+	$template->set_prefilter('album_properties', 'titleAadminfT');
  }
 
 function titleAadminfT($content, &$smarty)
  {
-  $search = '#name="reset">
-</p>#';
+  $search = '#</form>#';
   
-  $replacement = 'name="reset">
-</p>
-
+  $replacement = '
   	<div>
-		<form method="post" >
-			<fieldset>
-			  <br>
-				<legend>{\'Title - Plugin title\'|@translate}</legend>
-					{\'title_album\'|@translate}&nbsp;:&nbsp;<input type="text" name="inser" 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>
-		</form>
+		<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>';
 
   return preg_replace($search, $replacement, $content);
@@ -155,10 +147,10 @@
 $result = pwg_query($query);
 	$q = '
-INSERT INTO ' . $prefixeTable . 'title_album(id,title)VALUES ('.$_GET['cat_id'].',"'.$_POST['inser'].'");';
+INSERT INTO ' . $prefixeTable . 'title_album(id,title)VALUES ('.$_GET['cat_id'].',"'.$_POST['insertitleA'].'");';
     pwg_query($q);
 		
   $template->assign(
     array(
-      'titleCONTENT' => $_POST['inser'],
+      'titleCONTENT' => $_POST['insertitleA'],
       ));
   }
