Index: extensions/gvideo/admin.php
===================================================================
--- extensions/gvideo/admin.php	(revision 26469)
+++ extensions/gvideo/admin.php	(revision 26470)
@@ -1,14 +1,8 @@
 <?php
-if (!defined('GVIDEO_PATH')) die('Hacking attempt!');
+defined('GVIDEO_PATH') or die('Hacking attempt!');
 
 global $template, $page, $conf;
 
-if (is_string($conf['gvideo']))
-{
-  $conf['gvideo'] = unserialize($conf['gvideo']);
-}
-
 $page['tab'] = (isset($_GET['tab'])) ? $_GET['tab'] : $page['tab'] = 'add';
-
 
 if ($page['tab'] != 'photo')
@@ -34,4 +28,2 @@
   
 $template->assign_var_from_handle('ADMIN_CONTENT', 'gvideo_content');
-
-?>
Index: extensions/gvideo/admin/add.php
===================================================================
--- extensions/gvideo/admin/add.php	(revision 26469)
+++ extensions/gvideo/admin/add.php	(revision 26470)
@@ -1,7 +1,8 @@
 <?php
-if (!defined('GVIDEO_PATH')) die('Hacking attempt!');
+defined('GVIDEO_PATH') or die('Hacking attempt!');
 
 include_once(GVIDEO_PATH.'include/functions.inc.php');
 include_once(PHPWG_ROOT_PATH . 'admin/include/functions_upload.inc.php');
+
 
 if (isset($_POST['add_video']))
@@ -11,5 +12,5 @@
   if (empty($_POST['url']))
   {
-    array_push($page['errors'], l10n('Please fill the video URL'));
+    $page['errors'][] = l10n('Please fill the video URL');
   }
   else if ( ($video = parse_video_url($_POST['url'], isset($_POST['safe_mode']))) === false )
@@ -17,14 +18,14 @@
     if (isset($_POST['safe_mode']))
     {
-      array_push($page['errors'], l10n('an error happened'));
+      $page['errors'][] = l10n('an error happened');
     }
     else
     {
-      array_push($page['errors'], l10n('Unable to contact host server'));
-      array_push($page['errors'], l10n('Try in safe-mode'));
+      $page['errors'][] = l10n('Unable to contact host server');
+      $page['errors'][] = l10n('Try in safe-mode');
     }
     $_POST['safe_mode'] = true;
   }
-  
+
   if (count($page['errors']) == 0)
   {
@@ -33,7 +34,7 @@
       $_POST['width'] = $_POST['height'] = '';
     }
-    else if ( !preg_match('#^([0-9]+)$#', $_POST['width']) or !preg_match('#^([0-9]+)$#', $_POST['height']) )
+    else if (!preg_match('#^([0-9]+)$#', $_POST['width']) or !preg_match('#^([0-9]+)$#', $_POST['height']))
     {
-      array_push($page['errors'], l10n('Width and height must be integers'));
+      $page['errors'][] = l10n('Width and height must be integers');
       $_POST['width'] = $_POST['height'] = '';
     }
@@ -55,6 +56,6 @@
     $category = pwg_db_fetch_assoc(pwg_query($query));
       
-    array_push($page['infos'], sprintf(
-      l10n('Video successfully added. <a href="%s">View</a>'), 
+    $page['infos'][] = l10n(
+      'Video successfully added. <a href="%s">View</a>', 
       make_picture_url(array(
         'image_id' => $image_id,
@@ -65,5 +66,5 @@
           ),
         ))
-      ));
+      );
     unset($_POST);
   }
@@ -72,5 +73,5 @@
 // categories
 $query = '
-SELECT id,name,uppercats,global_rank
+SELECT id, name, uppercats, global_rank
   FROM '.CATEGORIES_TABLE.'
 ;';
@@ -101,5 +102,3 @@
   ));
 
-$template->set_filename('gvideo_content', dirname(__FILE__) . '/template/add.tpl');
-
-?>
+$template->set_filename('gvideo_content', realpath(GVIDEO_PATH . 'admin/template/add.tpl'));
Index: extensions/gvideo/admin/config.php
===================================================================
--- extensions/gvideo/admin/config.php	(revision 26469)
+++ extensions/gvideo/admin/config.php	(revision 26470)
@@ -1,4 +1,4 @@
 <?php
-if (!defined('GVIDEO_PATH')) die('Hacking attempt!');
+defined('GVIDEO_PATH') or die('Hacking attempt!');
 
 if (isset($_POST['save_config']))
@@ -28,5 +28,5 @@
   
   conf_update_param('gvideo', serialize($conf['gvideo']));
-  array_push($page['infos'], l10n('Information data registered in database'));
+  $page['infos'][] = l10n('Information data registered in database');
 }
 
@@ -39,5 +39,3 @@
 
 
-$template->set_filename('gvideo_content', dirname(__FILE__) . '/template/config.tpl');
-
-?>
+$template->set_filename('gvideo_content', realpath(GVIDEO_PATH . 'admin/template/config.tpl'));
Index: extensions/gvideo/admin/photo.php
===================================================================
--- extensions/gvideo/admin/photo.php	(revision 26469)
+++ extensions/gvideo/admin/photo.php	(revision 26470)
@@ -1,28 +1,7 @@
 <?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.                                                                  |
-// +-----------------------------------------------------------------------+
-
-if(!defined("PHPWG_ROOT_PATH")) die ("Hacking attempt!");
+defined('GVIDEO_PATH') or die ("Hacking attempt!");
 
 include_once(GVIDEO_PATH.'include/functions.inc.php');
+include_once(PHPWG_ROOT_PATH . 'admin/include/functions_upload.inc.php');
 
 
@@ -30,5 +9,4 @@
 // | Basic checks                                                          |
 // +-----------------------------------------------------------------------+
-
 check_status(ACCESS_ADMINISTRATOR);
 
@@ -47,8 +25,10 @@
 $tabsheet->assign();
 
+$page['active_menu'] = get_active_menu('photo');
+
 // +-----------------------------------------------------------------------+
 // | Picture infos                                                         |
 // +-----------------------------------------------------------------------+
-global $gvideo;
+global $gvideo; // request from GVIDEO_TABLE done when building tabsheet
 
 $query = '
@@ -68,18 +48,18 @@
   if (empty($_POST['url']))
   {
-    array_push($page['errors'], l10n('Please fill the video URL'));
+    $page['errors'][] = l10n('Please fill the video URL');
   }
   else if ($gvideo['url']!=$_POST['url'])
   {
-    if( ($video = parse_video_url($_POST['url'], isset($_POST['safe_mode']))) === false )
+    if ( ($video = parse_video_url($_POST['url'], isset($_POST['safe_mode']))) === false )
     {
       if (isset($_POST['safe_mode']))
       {
-        array_push($page['errors'], l10n('an error happened'));
+        $page['errors'][] = l10n('an error happened');
       }
       else
       {
-        array_push($page['errors'], l10n('Unable to contact host server'));
-        array_push($page['errors'], l10n('Try in safe-mode'));
+        $page['errors'][] = l10n('Unable to contact host server');
+        $page['errors'][] = l10n('Try in safe-mode');
       }
     }
@@ -92,5 +72,4 @@
   if (count($page['errors']) == 0)
   {
-    include_once(PHPWG_ROOT_PATH . 'admin/include/functions_upload.inc.php');
 
     if ( $gvideo['url'] != $video['url'] )
@@ -100,5 +79,6 @@
       $thumb_name = $video['type'].'-'.$video['video_id'].'-'.uniqid().'.'.$thumb_ext;
       $thumb_source = $conf['data_location'].$thumb_name;
-      if ( empty($video['thumbnail']) or gvideo_download_remote_file($video['thumbnail'], $thumb_source) !== true )
+      
+      if (empty($video['thumbnail']) or gvideo_download_remote_file($video['thumbnail'], $thumb_source) !== true)
       {
         $thumb_source = $conf['data_location'].get_filename_wo_extension($thumb_name).'.jpg';
@@ -115,5 +95,5 @@
         );
         
-      if ( $_POST['sync_description'] and !empty($video['description']) )
+      if ($_POST['sync_description'] and !empty($video['description']))
       {
         $updates['comment'] = pwg_db_real_escape_string($video['description']);
@@ -123,5 +103,5 @@
         $updates['comment'] = null;
       }
-      if ( $_POST['sync_tags'] and !empty($video['tags']) )
+      if ($_POST['sync_tags'] and !empty($video['tags']))
       {
         set_tags(get_tag_ids(implode(',', $video['tags'])), $image_id);
@@ -141,7 +121,7 @@
       $_POST['width'] = $_POST['height'] = '';
     }
-    else if ( !preg_match('#^([0-9]+)$#', $_POST['width']) or !preg_match('#^([0-9]+)$#', $_POST['height']) )
-    {
-      array_push($page['errors'], l10n('Width and height must be integers'));
+    else if (!preg_match('#^([0-9]+)$#', $_POST['width']) or !preg_match('#^([0-9]+)$#', $_POST['height']))
+    {
+      $page['errors'][] = l10n('Width and height must be integers');
       $_POST['width'] = $_POST['height'] = '';
     }
@@ -167,5 +147,5 @@
       );
       
-    array_push($page['infos'], l10n('Video successfully updated'));
+    $page['infos'][] = l10n('Video successfully updated');
     $gvideo = array_merge($gvideo, $updates);
   }
@@ -177,11 +157,7 @@
 if (isset($_FILES['photo_update']))
 {
-  include_once(PHPWG_ROOT_PATH.'admin/include/functions_upload.inc.php');
-  
   if ($_FILES['photo_update']['error'] !== UPLOAD_ERR_OK)
   {
-    array_push($page['errors'],
-      file_upload_error_message($_FILES['photo_update']['error'])
-      );
+    $page['errors'][] = file_upload_error_message($_FILES['photo_update']['error']);
   }
   else
@@ -195,5 +171,5 @@
       );
 
-    array_push($page['infos'], l10n('The thumbnail was updated'));
+    $page['infos'][] = l10n('The thumbnail was updated');
   }
 }
@@ -202,9 +178,6 @@
 // | Add film frame                                                        |
 // +-----------------------------------------------------------------------+
-if ( function_exists('imagecreatetruecolor') and isset($_GET['add_film_frame']) )
-{
-  include_once(GVIDEO_PATH . '/include/functions.inc.php');
-  include_once(PHPWG_ROOT_PATH . 'admin/include/functions_upload.inc.php');
-  
+if (function_exists('imagecreatetruecolor') and isset($_GET['add_film_frame']))
+{
   $thumb_source = $conf['data_location'].$picture['file'];
   
@@ -242,5 +215,3 @@
 ));
 
-$template->set_filename('gvideo_content', dirname(__FILE__).'/template/photo.tpl');
-
-?>
+$template->set_filename('gvideo_content', realpath(GVIDEO_PATH . 'admin/template/photo.tpl'));
Index: extensions/gvideo/admin/template/add.tpl
===================================================================
--- extensions/gvideo/admin/template/add.tpl	(revision 26469)
+++ extensions/gvideo/admin/template/add.tpl	(revision 26470)
@@ -1,7 +1,7 @@
-{combine_css path=$GVIDEO_PATH|@cat:"admin/template/style.css"}
+{combine_css path=$GVIDEO_PATH|cat:'admin/template/style.css'}
 {include file='include/colorbox.inc.tpl'}
 {include file='include/add_album.inc.tpl'}
 
-{footer_script}{literal}
+{footer_script}
 jQuery("input[data-toggle]").change(function() {
   $('#'+ $(this).data('toggle')).toggle();
@@ -17,5 +17,6 @@
   $(".providersInfo").toggle();
 });
-{/literal}{/footer_script}
+{/footer_script}
+
 
 <div class="titrePage">
@@ -25,19 +26,19 @@
 <form method="post" action="" class="properties">
 <fieldset>
-  <legend>{'Properties'|@translate}</legend>
+  <legend>{'Properties'|translate}</legend>
   
   <ul>
     <li>
       <label>
-        <span class="property">{'Album'|@translate}</span>
+        <span class="property">{'Album'|translate}</span>
         <select style="width:400px" name="category" id="albumSelect" size="1">
           {html_options options=$category_parent_options selected=$POST.category}
         </select>
       </label>
-      {'... or '|@translate}<a href="#" class="addAlbumOpen" title="{'create a new album'|@translate}">{'create a new album'|@translate}</a>
+      {'... or '|translate}<a href="#" class="addAlbumOpen" title="{'create a new album'|translate}">{'create a new album'|translate}</a>
     </li>
     <li>
       <label>
-        <span class="property">{'Video URL'|@translate}</span>
+        <span class="property">{'Video URL'|translate}</span>
         <input type="text" name="url" value="{$POST.url}" style="width:400px;">
       </label>
@@ -45,7 +46,7 @@
   {if $gd_available}
     <li>
-      <span class="property">{'Thumbnail'|@translate}</span>
-      <label><input type="checkbox" name="add_film_frame" value="true" {if $POST.add_film_frame}checked="checked"{/if}> {'Add film effect'|@translate} </label>
-      <a class="showInfo" title="<img src='{$GVIDEO_PATH}admin/template/example-frame.jpg'>">i</a>
+      <span class="property">{'Thumbnail'|translate}</span>
+      <label><input type="checkbox" name="add_film_frame" value="true" {if $POST.add_film_frame}checked="checked"{/if}> {'Add film effect'|translate} </label>
+      <a class="icon-info-circled-1 showInfo" title="<img src='{$GVIDEO_PATH}admin/template/example-frame.jpg'>"></a>
     </li>
   {/if}
@@ -54,11 +55,11 @@
 
 <fieldset>
-  <legend>{'Configuration'|@translate}</legend>
+  <legend>{'Configuration'|translate}</legend>
   
   <ul>
     <li>
-      <span class="property">{'Video size'|@translate}</span>
-      <label><input type="radio" name="size_common" value="true" {if $POST.size_common != 'false'}checked="checked"{/if} data-toggle="size"> {'Use common setting'|@translate}</label>
-      <label><input type="radio" name="size_common" value="false" {if $POST.size_common == 'false'}checked="checked"{/if} data-toggle="size"> {'Change'|@translate}</label>
+      <span class="property">{'Video size'|translate}</span>
+      <label><input type="radio" name="size_common" value="true" {if $POST.size_common != 'false'}checked="checked"{/if} data-toggle="size"> {'Use common setting'|translate}</label>
+      <label><input type="radio" name="size_common" value="false" {if $POST.size_common == 'false'}checked="checked"{/if} data-toggle="size"> {'Change'|translate}</label>
     </li>
     <li {if $POST.size_common != 'false'}style="display:none;"{/if} id="size">
@@ -68,22 +69,22 @@
     </li>
     <li>
-      <span class="property">{'Autoplay'|@translate}</span>
-      <label><input type="radio" name="autoplay_common" value="true" {if $POST.autoplay_common != 'false'}checked="checked"{/if} data-toggle="autoplay"> {'Use common setting'|@translate}</label>
-      <label><input type="radio" name="autoplay_common" value="false" {if $POST.autoplay_common == 'false'}checked="checked"{/if} data-toggle="autoplay"> {'Change'|@translate}</label>
+      <span class="property">{'Autoplay'|translate}</span>
+      <label><input type="radio" name="autoplay_common" value="true" {if $POST.autoplay_common != 'false'}checked="checked"{/if} data-toggle="autoplay"> {'Use common setting'|translate}</label>
+      <label><input type="radio" name="autoplay_common" value="false" {if $POST.autoplay_common == 'false'}checked="checked"{/if} data-toggle="autoplay"> {'Change'|translate}</label>
     </li>
     <li {if $POST.autoplay_common != 'false'}style="display:none;"{/if} id="autoplay">
       <span class="property">&nbsp;</span>
-      <label><input type="radio" name="autoplay" value="0" {if $POST.autoplay == '0'}checked="checked"{/if}> {'No'|@translate}</label>
-      <label><input type="radio" name="autoplay" value="1" {if $POST.autoplay == '1'}checked="checked"{/if}> {'Yes'|@translate}</label>
+      <label><input type="radio" name="autoplay" value="0" {if $POST.autoplay == '0'}checked="checked"{/if}> {'No'|translate}</label>
+      <label><input type="radio" name="autoplay" value="1" {if $POST.autoplay == '1'}checked="checked"{/if}> {'Yes'|translate}</label>
     </li>
     <li>
-      <span class="property">{'Get video description'|@translate}</span>
-      <label><input type="radio" name="sync_description" value="1" {if $gvideo.sync_description}checked="checked"{/if}> {'Yes'|@translate}</label>
-      <label><input type="radio" name="sync_description" value="0" {if not $gvideo.sync_description}checked="checked"{/if}> {'No'|@translate}</label>
+      <span class="property">{'Get video description'|translate}</span>
+      <label><input type="radio" name="sync_description" value="1" {if $gvideo.sync_description}checked="checked"{/if}> {'Yes'|translate}</label>
+      <label><input type="radio" name="sync_description" value="0" {if not $gvideo.sync_description}checked="checked"{/if}> {'No'|translate}</label>
     </li>
     <li>
-      <span class="property">{'Get video tags'|@translate}</span>
-      <label><input type="radio" name="sync_tags" value="1" {if $gvideo.sync_tags}checked="checked"{/if}> {'Yes'|@translate}</label>
-      <label><input type="radio" name="sync_tags" value="0" {if not $gvideo.sync_tags}checked="checked"{/if}> {'No'|@translate}</label>
+      <span class="property">{'Get video tags'|translate}</span>
+      <label><input type="radio" name="sync_tags" value="1" {if $gvideo.sync_tags}checked="checked"{/if}> {'Yes'|translate}</label>
+      <label><input type="radio" name="sync_tags" value="0" {if not $gvideo.sync_tags}checked="checked"{/if}> {'No'|translate}</label>
     </li>
   </ul>  
@@ -92,11 +93,11 @@
 
 <p style="text-align:left;">
-  <input type="submit" name="add_video" value="{'Add'|@translate}">
-  <label style="font-weight:bold;"><input type="checkbox" name="safe_mode" {if $POST.safe_mode}checked="checked"{/if}> {'Safe-mode'|@translate}</label>
-  <a class="showInfo" title="{'In safe-mode, the plugin does\'t try to contact the video host, usefull on some websites where remote connections are blocked.'|@translate}">i</a>
+  <input type="submit" name="add_video" value="{'Add'|translate}">
+  <label style="font-weight:bold;"><input type="checkbox" name="safe_mode" {if $POST.safe_mode}checked="checked"{/if}> {'Safe-mode'|translate}</label>
+  <a class="icon-info-circled-1 showInfo" title="{'In safe-mode, the plugin does\'t try to contact the video host, usefull on some websites where remote connections are blocked.'|translate|escape:html}"></a>
 </p>
 
 <fieldset style="margin-top:40px;">
-  <legend>{'Supported services'|@translate}</legend>
+  <legend>{'Supported services'|translate}</legend>
   
   <ul class="services">
@@ -104,28 +105,28 @@
       <img class="icon" src="{$GVIDEO_PATH}admin/template/icons/youtube.png">
       <a href="http://www.youtube.com" target="_blank">YouTube</a>
-      <span class="providersInfo">{'Videos can be unlisted but not private.'|@translate}<br></span>
+      <span class="providersInfo">{'Videos can be unlisted but not private.'|translate}<br></span>
     </li>
     <li>
       <img class="icon" src="{$GVIDEO_PATH}admin/template/icons/vimeo.png">
       <a href="http://www.vimeo.com" target="_blank">Vimeo</a>
-      <span class="providersInfo">{'Videos can be unlisted and private if the gallery website is within the authorized domains (PRO).'|@translate}<br></span>
+      <span class="providersInfo">{'Videos can be unlisted and private if the gallery website is within the authorized domains (PRO).'|translate}<br></span>
     </li>
     <li>
       <img class="icon" src="{$GVIDEO_PATH}admin/template/icons/dailymotion.png">
       <a href="http://www.dailymotion.com" target="_blank">Dailymotion</a>
-      <span class="providersInfo">{'Videos can be private if you use the private permalink.'|@translate}<br></span>
+      <span class="providersInfo">{'Videos can be private if you use the private permalink.'|translate}<br></span>
     </li>
     <li>
       <img class="icon" src="{$GVIDEO_PATH}admin/template/icons/wat.png">
       <a href="http://www.wat.tv" target="_blank">Wat</a>
-      <span class="providersInfo" style="font-style:italic;">{'No privacy option.'|@translate}<br></span>
+      <span class="providersInfo" style="font-style:italic;">{'No privacy option.'|translate}<br></span>
     </li>
     <li>
       <img class="icon" src="{$GVIDEO_PATH}admin/template/icons/wideo.png">
       <a href="http://www.wideo.fr" target="_blank">Wideo</a>
-      <span class="providersInfo" style="font-style:italic;">{'No privacy option.'|@translate}<br></span>
+      <span class="providersInfo" style="font-style:italic;">{'No privacy option.'|translate}<br></span>
     </li>
     <li>
-      <a class="showProvidersInfo">{'Show privacy details'|@translate}</a>
+      <a class="showProvidersInfo">{'Show privacy details'|translate}</a>
     </li>
   </ul>
Index: extensions/gvideo/admin/template/config.tpl
===================================================================
--- extensions/gvideo/admin/template/config.tpl	(revision 26469)
+++ extensions/gvideo/admin/template/config.tpl	(revision 26470)
@@ -1,10 +1,11 @@
-{combine_css path=$GVIDEO_PATH|@cat:"admin/template/style.css"}
+{combine_css path=$GVIDEO_PATH|cat:'admin/template/style.css'}
 
-{footer_script}{literal}
+{footer_script}
 jQuery('label.color input').change(function() {
   $('label.color').removeClass('active');
   $('label.color input:checked').parent('label').addClass('active');
 });
-{/literal}{/footer_script}
+{/footer_script}
+
 
 <div class="titrePage">
@@ -14,26 +15,26 @@
 <form method="post" action="" class="properties">
 <fieldset>
-  <legend>{'Common configuration'|@translate}</legend>
+  <legend>{'Common configuration'|translate}</legend>
   
   <ul>
     <li>
-      <span class="property">{'Video size'|@translate}</span>
+      <span class="property">{'Video size'|translate}</span>
       <input type="text" name="width" value="{$gvideo.width}" size="4"> &times;
       <input type="text" name="height" value="{$gvideo.height}" size="4"> px
     </li>
     <li>
-      <span class="property">{'Autoplay'|@translate}</span>
-      <label><input type="radio" name="autoplay" value="1" {if $gvideo.autoplay}checked="checked"{/if}> {'Yes'|@translate}</label>
-      <label><input type="radio" name="autoplay" value="0" {if not $gvideo.autoplay}checked="checked"{/if}> {'No'|@translate}</label>
+      <span class="property">{'Autoplay'|translate}</span>
+      <label><input type="radio" name="autoplay" value="1" {if $gvideo.autoplay}checked="checked"{/if}> {'Yes'|translate}</label>
+      <label><input type="radio" name="autoplay" value="0" {if not $gvideo.autoplay}checked="checked"{/if}> {'No'|translate}</label>
     </li>
     <li>
-      <span class="property">{'Get video description'|@translate}</span>
-      <label><input type="radio" name="sync_description" value="1" {if $gvideo.sync_description}checked="checked"{/if}> {'Yes'|@translate}</label>
-      <label><input type="radio" name="sync_description" value="0" {if not $gvideo.sync_description}checked="checked"{/if}> {'No'|@translate}</label>
+      <span class="property">{'Get video description'|translate}</span>
+      <label><input type="radio" name="sync_description" value="1" {if $gvideo.sync_description}checked="checked"{/if}> {'Yes'|translate}</label>
+      <label><input type="radio" name="sync_description" value="0" {if not $gvideo.sync_description}checked="checked"{/if}> {'No'|translate}</label>
     </li>
     <li>
-      <span class="property">{'Get video tags'|@translate}</span>
-      <label><input type="radio" name="sync_tags" value="1" {if $gvideo.sync_tags}checked="checked"{/if}> {'Yes'|@translate}</label>
-      <label><input type="radio" name="sync_tags" value="0" {if not $gvideo.sync_tags}checked="checked"{/if}> {'No'|@translate}</label>
+      <span class="property">{'Get video tags'|translate}</span>
+      <label><input type="radio" name="sync_tags" value="1" {if $gvideo.sync_tags}checked="checked"{/if}> {'Yes'|translate}</label>
+      <label><input type="radio" name="sync_tags" value="0" {if not $gvideo.sync_tags}checked="checked"{/if}> {'No'|translate}</label>
     </li>
   </ul>
@@ -41,9 +42,9 @@
 
 <div class="left"><fieldset>
-  <legend><img class="icon" src="{$GVIDEO_PATH}admin/template/icons/vimeo.png"> {'Vimeo player'|@translate}</legend>
+  <legend><img class="icon" src="{$GVIDEO_PATH}admin/template/icons/vimeo.png"> {'Vimeo player'|translate}</legend>
   
   <ul>
     <li>
-      <span class="property">{'Color'|@translate}</span>
+      <span class="property">{'Color'|translate}</span>
     {foreach from=$vimeo_colors item=color}
       <label class="color {$themeconf.name} {if $gvideo.vimeo.color == $color}active{/if}" style="background:#{$color};"><input type="radio" name="vimeo[color]" value="{$color}" {if $gvideo.vimeo.color == $color}checked="checked"{/if}></label>
@@ -51,8 +52,8 @@
     </li>
     <li>
-      <span class="property">{'Display'|@translate}</span>
-      <label><input type="checkbox" name="vimeo[title]" value="1" {if $gvideo.vimeo.title}checked="checked"{/if}> {'Title'|@translate}</label>
-      <label><input type="checkbox" name="vimeo[portrait]" value="1" {if $gvideo.vimeo.portrait}checked="checked"{/if}> {'Author portrait'|@translate}</label>
-      <label><input type="checkbox" name="vimeo[byline]" value="1" {if $gvideo.vimeo.byline}checked="checked"{/if}> {'Author name'|@translate}</label>
+      <span class="property">{'Display'|translate}</span>
+      <label><input type="checkbox" name="vimeo[title]" value="1" {if $gvideo.vimeo.title}checked="checked"{/if}> {'Title'|translate}</label>
+      <label><input type="checkbox" name="vimeo[portrait]" value="1" {if $gvideo.vimeo.portrait}checked="checked"{/if}> {'Author portrait'|translate}</label>
+      <label><input type="checkbox" name="vimeo[byline]" value="1" {if $gvideo.vimeo.byline}checked="checked"{/if}> {'Author name'|translate}</label>
     </li>
   </ul>
@@ -60,9 +61,9 @@
 
 <div class="right"><fieldset>
-  <legend><img class="icon" src="{$GVIDEO_PATH}admin/template/icons/dailymotion.png"> {'Dailymotion player'|@translate}</legend>
+  <legend><img class="icon" src="{$GVIDEO_PATH}admin/template/icons/dailymotion.png"> {'Dailymotion player'|translate}</legend>
   
   <ul>
     <li>
-      <span class="property">{'Color'|@translate}</span>
+      <span class="property">{'Color'|translate}</span>
     {foreach from=$dailymotion_colors item=color}
       <label class="color {$themeconf.name} {if $gvideo.dailymotion.color == $color}active{/if}" style="background:#{$color};"><input type="radio" name="dailymotion[color]" value="{$color}" {if $gvideo.dailymotion.color == $color}checked="checked"{/if}></label>
@@ -70,7 +71,7 @@
     </li>
     <li>
-      <span class="property">{'Display'|@translate}</span>
-      <label><input type="checkbox" name="dailymotion[logo]" value="1" {if $gvideo.dailymotion.logo}checked="checked"{/if}> {'Logo'|@translate}</label>
-      <label><input type="checkbox" name="dailymotion[title]" value="1" {if $gvideo.dailymotion.title}checked="checked"{/if}> {'Title'|@translate}</label>
+      <span class="property">{'Display'|translate}</span>
+      <label><input type="checkbox" name="dailymotion[logo]" value="1" {if $gvideo.dailymotion.logo}checked="checked"{/if}> {'Logo'|translate}</label>
+      <label><input type="checkbox" name="dailymotion[title]" value="1" {if $gvideo.dailymotion.title}checked="checked"{/if}> {'Title'|translate}</label>
     </li>
   </ul>
@@ -79,5 +80,5 @@
 <div style="clear:right;"></div>
 
-<p style="text-align:left;"><input type="submit" name="save_config" value="{'Save Settings'|@translate}"></p>
+<p style="text-align:left;"><input type="submit" name="save_config" value="{'Save Settings'|translate}"></p>
 
 </form>
Index: extensions/gvideo/admin/template/photo.tpl
===================================================================
--- extensions/gvideo/admin/template/photo.tpl	(revision 26469)
+++ extensions/gvideo/admin/template/photo.tpl	(revision 26470)
@@ -1,5 +1,5 @@
-{combine_css path=$GVIDEO_PATH|@cat:"admin/template/style.css"}
+{combine_css path=$GVIDEO_PATH|cat:'admin/template/style.css'}
 
-{footer_script}{literal}
+{footer_script}
 jQuery("input[data-toggle]").change(function() {
   $block = $('#'+ $(this).data('toggle'));
@@ -10,13 +10,13 @@
   }
 });
-{/literal}
 
 var border = jQuery("input[name='url']").css('border');
 
-jQuery("input[name='url']").keyup(function() {ldelim}
-  if ($(this).val() != "{$GVIDEO.url}") {ldelim}
+jQuery("input[name='url']").keyup(function() {
+  if ($(this).val() != "{$GVIDEO.url}") {
     $(this).css('border', '1px solid #c00');
     $(".video_update").show();
-  } else {ldelim}
+  }
+  else {
     $(this).css('border', border);
     $(".video_update").hide();
@@ -25,24 +25,25 @@
 {/footer_script}
 
-<h2>{$TITLE} &#8250; {'Edit photo'|@translate} {$TABSHEET_TITLE}</h2>
+
+<h2>{$TITLE} &#8250; {'Edit photo'|translate} {$TABSHEET_TITLE}</h2>
 
 <fieldset>
-  <legend>{'Thumbnail'|@translate}</legend>
+  <legend>{'Thumbnail'|translate}</legend>
   <table>
     <tr>
       <td id="albumThumbnail">
-        <img src="{$TN_SRC}" alt="{'Thumbnail'|@translate}" class="Thumbnail">
+        <img src="{$TN_SRC}" alt="{'Thumbnail'|translate}" class="Thumbnail">
       </td>
       <td id="albumLinks" style="width:400px;vertical-align:top;">
         <ul style="padding-left:15px;margin:0;">
         {if $U_ADD_FILM_FRAME}
-          <li style="margin:10px 0 20px 0;"><a href="{$U_ADD_FILM_FRAME}">{'Add film effect'|@translate}</a></li>
+          <li style="margin:10px 0 20px 0;"><a href="{$U_ADD_FILM_FRAME}">{'Add film effect'|translate}</a></li>
         {/if}
         
           <li>
             <form id="photo_update" method="post" action="{$F_ACTION}" enctype="multipart/form-data">
-              {'Upload a new thumbnail'|@translate}<br>
+              {'Upload a new thumbnail'|translate}<br>
               <input type="file" size="20" name="photo_update">
-              <input class="submit" type="submit" value="{'Send'|@translate}" name="photo_update">
+              <input class="submit" type="submit" value="{'Send'|translate}" name="photo_update">
             </form>
           </li>
@@ -55,28 +56,28 @@
 <form action="{$F_ACTION}" method="post" id="catModify">
   <fieldset>
-    <legend>{'Properties'|@translate}</legend>
+    <legend>{'Properties'|translate}</legend>
 
     <p>
-      <b>{'Video URL'|@translate}</b>
+      <b>{'Video URL'|translate}</b>
       <input type="text" name="url" value="{$GVIDEO.url}" style="width:400px;">
-      <span class="video_update warning" style="display:none;"> {'Changing the url will reset video description, name and thumbnail'|@translate}</span>
+      <span class="video_update warning" style="display:none;"> {'Changing the url will reset video description, name and thumbnail'|translate}</span>
     </p>
     
     <p class="video_update">
-      <b>{'Get video description'|@translate}</b>
-      <label><input type="radio" name="sync_description" value="1" {if $GVIDEO.sync_description}checked="checked"{/if}> {'Yes'|@translate}</label>
-      <label><input type="radio" name="sync_description" value="0" {if not $GVIDEO.sync_description}checked="checked"{/if}> {'No'|@translate}</label>
+      <b>{'Get video description'|translate}</b>
+      <label><input type="radio" name="sync_description" value="1" {if $GVIDEO.sync_description}checked="checked"{/if}> {'Yes'|translate}</label>
+      <label><input type="radio" name="sync_description" value="0" {if not $GVIDEO.sync_description}checked="checked"{/if}> {'No'|translate}</label>
     </p>
     
     <p class="video_update">
-      <b>{'Get video tags'|@translate}</b>
-      <label><input type="radio" name="sync_tags" value="1" {if $GVIDEO.sync_tags}checked="checked"{/if}> {'Yes'|@translate}</label>
-      <label><input type="radio" name="sync_tags" value="0" {if not $GVIDEO.sync_tags}checked="checked"{/if}> {'No'|@translate}</label>
+      <b>{'Get video tags'|translate}</b>
+      <label><input type="radio" name="sync_tags" value="1" {if $GVIDEO.sync_tags}checked="checked"{/if}> {'Yes'|translate}</label>
+      <label><input type="radio" name="sync_tags" value="0" {if not $GVIDEO.sync_tags}checked="checked"{/if}> {'No'|translate}</label>
     </p>
     
     <p>
-      <b>{'Video size'|@translate}</b>
-      <label><input type="radio" name="size_common" value="true" {if $GVIDEO.size_common == 'true'}checked="checked"{/if} data-toggle="size"> {'Use common setting'|@translate}</label>
-      <label><input type="radio" name="size_common" value="false" {if $GVIDEO.size_common != 'true'}checked="checked"{/if} data-toggle="size"> {'Change'|@translate}</label>
+      <b>{'Video size'|translate}</b>
+      <label><input type="radio" name="size_common" value="true" {if $GVIDEO.size_common == 'true'}checked="checked"{/if} data-toggle="size"> {'Use common setting'|translate}</label>
+      <label><input type="radio" name="size_common" value="false" {if $GVIDEO.size_common != 'true'}checked="checked"{/if} data-toggle="size"> {'Change'|translate}</label>
       
       <span style="display:{if $GVIDEO.size_common == 'true'}none{else}block{/if};" id="size">
@@ -87,18 +88,18 @@
     
     <p>
-      <b>{'Autoplay'|@translate}</b>
-      <label><input type="radio" name="autoplay_common" value="true" {if $GVIDEO.autoplay_common == 'true'}checked="checked"{/if} data-toggle="autoplay"> {'Use common setting'|@translate}</label>
-      <label><input type="radio" name="autoplay_common" value="false" {if $GVIDEO.autoplay_common != 'true'}checked="checked"{/if} data-toggle="autoplay"> {'Change'|@translate}</label>
+      <b>{'Autoplay'|translate}</b>
+      <label><input type="radio" name="autoplay_common" value="true" {if $GVIDEO.autoplay_common == 'true'}checked="checked"{/if} data-toggle="autoplay"> {'Use common setting'|translate}</label>
+      <label><input type="radio" name="autoplay_common" value="false" {if $GVIDEO.autoplay_common != 'true'}checked="checked"{/if} data-toggle="autoplay"> {'Change'|translate}</label>
       
       <span style="display:{if $GVIDEO.autoplay_common == 'true'}none{else}block{/if};" id="autoplay">
-        <label><input type="radio" name="autoplay" value="0" {if $GVIDEO.autoplay == '0'}checked="checked"{/if}> {'No'|@translate}</label>
-        <label><input type="radio" name="autoplay" value="1" {if $GVIDEO.autoplay == '1'}checked="checked"{/if}> {'Yes'|@translate}</label>
+        <label><input type="radio" name="autoplay" value="0" {if $GVIDEO.autoplay == '0'}checked="checked"{/if}> {'No'|translate}</label>
+        <label><input type="radio" name="autoplay" value="1" {if $GVIDEO.autoplay == '1'}checked="checked"{/if}> {'Yes'|translate}</label>
       </span>
     </p>
 
     <p style="margin:0;">
-      <label style="font-weight:bold;"><input type="checkbox" name="safe_mode"> {'Safe-mode'|@translate}</label>
+      <label style="font-weight:bold;"><input type="checkbox" name="safe_mode"> {'Safe-mode'|translate}</label>
       <br>
-      <input class="submit" type="submit" value="{'Save Settings'|@translate}" name="save_properties">
+      <input class="submit" type="submit" value="{'Save Settings'|translate}" name="save_properties">
     </p>
   </fieldset>
Index: extensions/gvideo/admin/template/style.css
===================================================================
--- extensions/gvideo/admin/template/style.css	(revision 26469)
+++ extensions/gvideo/admin/template/style.css	(revision 26470)
@@ -42,14 +42,4 @@
     visibility:hidden;
   }
-  
-.showInfo {
-  position:static;
-  display:inline-block;
-  padding:1px 7px;
-  width:4px;
-  height:16px;
-  line-height:16px;
-  font-size:0.8em;
-}
 
 ul.services li {
Index: extensions/gvideo/include/events.inc.php
===================================================================
--- extensions/gvideo/include/events.inc.php	(revision 26470)
+++ extensions/gvideo/include/events.inc.php	(revision 26470)
@@ -0,0 +1,94 @@
+<?php
+defined('GVIDEO_PATH') or die('Hacking attempt!');
+
+/**
+ * some stuff at the begining of picture.php
+ */
+function gvideo_prepare_picture($picture)
+{
+  if ($picture['current']['is_gvideo'])
+  {
+    // remove default parser
+    remove_event_handler('render_element_content', 'default_picture_content', EVENT_HANDLER_PRIORITY_NEUTRAL);
+    
+    // add custom parser
+    add_event_handler('render_element_content', 'gvideo_element_content', EVENT_HANDLER_PRIORITY_NEUTRAL-10, 2);
+  }
+  
+  return $picture;
+}
+
+/**
+ * replace content on picture page
+ */
+function gvideo_element_content($content, $element_info)
+{
+  if (!$element_info['is_gvideo'])
+  {
+    return $content;
+  }
+  
+  global $page, $picture, $template, $conf;
+  
+  // remove some actions
+  $template->assign('U_SLIDESHOW_START', null);
+  $template->assign('U_METADATA', null);
+  $template->append('current', array('U_DOWNLOAD' => null), true);
+  
+  $query = '
+SELECT *
+  FROM '.GVIDEO_TABLE.'
+  WHERE picture_id = '.$element_info['id'].'
+;';
+  $video = pwg_db_fetch_assoc(pwg_query($query));
+  
+  if (empty($video['width']))
+  {
+    $video['width'] = $conf['gvideo']['width'];
+    $video['height'] = $conf['gvideo']['height'];
+  }
+  if (empty($video['autoplay']))
+  {
+    $video['autoplay'] = $conf['gvideo']['autoplay'];
+  }
+  
+  $video['config'] = $conf['gvideo'];
+  if ($video['type'] == 'dailymotion')
+  {
+    $colors = array(
+      'F7FFFD' => 'foreground=%23F7FFFD&amp;highlight=%23FFC300&amp;background=%23171D1B',
+      'E02C72' => 'foreground=%23E02C72&amp;highlight=%23BF4B78&amp;background=%23260F18',
+      '92ADE0' => 'foreground=%2392ADE0&amp;highlight=%23A2ACBF&amp;background=%23202226',
+      'E8D9AC' => 'foreground=%23E8D9AC&amp;highlight=%23FFF6D9&amp;background=%23493D27',
+      'C2E165' => 'foreground=%23C2E165&amp;highlight=%23809443&amp;background=%23232912',
+      '052880' => 'foreground=%23FF0099&amp;highlight=%23C9A1FF&amp;background=%23052880',
+      'FF0000' => 'foreground=%23FF0000&amp;highlight=%23FFFFFF&amp;background=%23000000',
+      '834596' => 'foreground=%23834596&amp;highlight=%23CFCFCF&amp;background=%23000000',
+      );
+    $video['config']['dailymotion']['color'] = $colors[ $video['config']['dailymotion']['color'] ];
+  }
+  
+  $template->assign('GVIDEO', $video);
+  
+  global $user;
+  // hide stripped overlay preventing to click on video object
+  if (strpos('stripped', $user['theme']) !== false)
+  {
+    $template->block_html_style(null, '.hideTabs{ display:none !important; }');
+  }
+
+  $template->set_filename('gvideo_content', realpath(GVIDEO_PATH . 'template/video_'.$video['type'].'.tpl'));
+  return $template->parse('gvideo_content', true);
+}
+
+/**
+ * clean table at element deletion
+ */
+function gvideo_delete_elements($ids)
+{
+  $query = '
+DELETE FROM '.GVIDEO_TABLE.'
+  WHERE picture_id IN ('.implode(',', $ids).')
+;';
+  pwg_query($query);
+}
Index: extensions/gvideo/include/gvideo.inc.php
===================================================================
--- extensions/gvideo/include/gvideo.inc.php	(revision 26469)
+++ 	(revision )
@@ -1,112 +1,0 @@
-<?php
-if (!defined('GVIDEO_PATH')) die('Hacking attempt!');
-
-/**
- * some stuff at the begining of picture.php
- */
-function gvideo_prepare_picture($picture)
-{
-  if ($picture['current']['is_gvideo'])
-  {
-    // remove default parser
-    remove_event_handler('render_element_content', 'default_picture_content', EVENT_HANDLER_PRIORITY_NEUTRAL);
-  
-    // remove autosize
-    global $pwg_loaded_plugins, $autosize_ctrl;
-    
-    if ( isset($pwg_loaded_plugins['Autosize']) and isset($autosize_ctrl) )
-    {
-      remove_event_handler('render_element_content', array(&$autosize_ctrl, 'autosize_calcContent'), EVENT_HANDLER_PRIORITY_NEUTRAL-11, 2); 
-      remove_event_handler('render_element_content', array(&$autosize_ctrl, 'init_1'), EVENT_HANDLER_PRIORITY_NEUTRAL-9, 2); 
-      remove_event_handler('render_element_content', array(&$autosize_ctrl, 'init'), EVENT_HANDLER_PRIORITY_NEUTRAL-1, 2);
-      remove_event_handler('render_element_content', array(&$autosize_ctrl, 'init2'), EVENT_HANDLER_PRIORITY_NEUTRAL+1, 2);
-      remove_event_handler('loc_after_page_header', array(&$autosize_ctrl, 'cl_autosize_script_1'));
-      remove_event_handler('loc_after_page_header', array(&$autosize_ctrl, 'cl_autosize_script_2'));
-      remove_event_handler('loc_after_page_header', array(&$autosize_ctrl, 'cl_autosize_script_3'));
-      remove_event_handler('loc_after_page_header', array(&$autosize_ctrl, 'cl_autosize_affiche'), EVENT_HANDLER_PRIORITY_NEUTRAL+21);
-    }
-  }
-  
-  return $picture;
-}
-
-/**
- * replace content on picture page
- */
-function gvideo_element_content($content, $element_info)
-{
-  if (!$element_info['is_gvideo'])
-  {
-    return $content;
-  }
-  
-  global $page, $picture, $template, $conf;
-  
-  if (is_string($conf['gvideo']))
-  {
-    $conf['gvideo'] = unserialize($conf['gvideo']);
-  }
-  
-  // remove some actions
-  $template->assign('U_SLIDESHOW_START', null);
-  $template->assign('U_METADATA', null);
-  $template->append('current', array('U_DOWNLOAD' => null), true);
-  
-  $query = '
-SELECT *
-  FROM '.GVIDEO_TABLE.'
-  WHERE picture_id = '.$element_info['id'].'
-;';
-  $video = pwg_db_fetch_assoc(pwg_query($query));
-  
-  if (empty($video['width']))
-  {
-    $video['width'] = $conf['gvideo']['width'];
-    $video['height'] = $conf['gvideo']['height'];
-  }
-  if (empty($video['autoplay']))
-  {
-    $video['autoplay'] = $conf['gvideo']['autoplay'];
-  }
-  
-  $video['config'] = $conf['gvideo'];
-  if ($video['type'] == 'dailymotion')
-  {
-    $colors = array(
-      'F7FFFD' => 'foreground=%23F7FFFD&amp;highlight=%23FFC300&amp;background=%23171D1B',
-      'E02C72' => 'foreground=%23E02C72&amp;highlight=%23BF4B78&amp;background=%23260F18',
-      '92ADE0' => 'foreground=%2392ADE0&amp;highlight=%23A2ACBF&amp;background=%23202226',
-      'E8D9AC' => 'foreground=%23E8D9AC&amp;highlight=%23FFF6D9&amp;background=%23493D27',
-      'C2E165' => 'foreground=%23C2E165&amp;highlight=%23809443&amp;background=%23232912',
-      '052880' => 'foreground=%23FF0099&amp;highlight=%23C9A1FF&amp;background=%23052880',
-      'FF0000' => 'foreground=%23FF0000&amp;highlight=%23FFFFFF&amp;background=%23000000',
-      '834596' => 'foreground=%23834596&amp;highlight=%23CFCFCF&amp;background=%23000000',
-      );
-    $video['config']['dailymotion']['color'] = $colors[ $video['config']['dailymotion']['color'] ];
-  }
-  
-  $template->assign('GVIDEO', $video);
-  
-  global $user;
-  if (strpos('stripped', $user['theme']) !== false)
-  {
-    $template->append('head_elements', '<style type="text/css">.hideTabs{display:none !important;}</style>');
-  }
-
-  $template->set_filename('gvideo_content', realpath(GVIDEO_PATH . 'template/video_'.$video['type'].'.tpl'));
-  return $template->parse('gvideo_content', true);
-}
-
-/**
- * clean table at element deletion
- */
-function gvideo_delete_elements($ids)
-{
-  $query = '
-DELETE FROM '.GVIDEO_TABLE.'
-  WHERE picture_id IN ('.implode(',', $ids).')
-;';
-  pwg_query($query);
-}
-
-?>
Index: extensions/gvideo/include/install.inc.php
===================================================================
--- extensions/gvideo/include/install.inc.php	(revision 26469)
+++ 	(revision )
@@ -1,261 +1,0 @@
-<?php
-if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
-
-global $prefixeTable;
-
-// defined here only because it's more convenient
-define('gvideo_path', PHPWG_PLUGINS_PATH . GVIDEO_ID . '/');
-define('gvideo_table', $prefixeTable.'image_video');
-
-/**
- * installation
- */
-function gvideo_install() 
-{
-  global $conf;
-  
-  // configuration
-  if (empty($conf['gvideo']))
-  {
-    $gvideo_default_config = serialize(array(
-      'autoplay' => 0,
-      'width' => 640,
-      'height' => 360,
-      'sync_description' => 1,
-      'sync_tags' => 1,
-      'vimeo' => array(
-        'title' => 1,
-        'portrait' => 1,
-        'byline' => 1,
-        'color' => '00adef',
-        ),
-      'dailymotion' => array(
-        'logo' => 1,
-        'title' => 1,
-        'color' => 'F7FFFD',
-        ),
-      'youtube' => array(),
-      'wat' => array(),
-      'wideo' => array(),
-      ));
-    
-    conf_update_param('gvideo', $gvideo_default_config);
-    $conf['gvideo'] = $gvideo_default_config;
-  }
-  else
-  {
-    if (is_string($conf['gvideo']))
-    {
-      $conf['gvideo'] = unserialize($conf['gvideo']);
-    }
-    
-    if (!isset($conf['gvideo']['sync_description']))
-    {
-      $conf['gvideo']['sync_description'] = 1;
-      $conf['gvideo']['sync_tags'] = 1;
-      
-      conf_update_param('gvideo', serialize($conf['gvideo']));
-    }
-  }
-  
-  // create table
-  $query = '
-CREATE TABLE IF NOT EXISTS `'.gvideo_table.'` (
-  `picture_id` mediumint(8) NOT NULL,
-  `url` varchar(255) DEFAULT NULL,
-  `type` varchar(64) NOT NULL,
-  `video_id` varchar(128) NOT NULL,
-  `width` smallint(9) DEFAULT NULL,
-  `height` smallint(9) DEFAULT NULL,
-  `autoplay` tinyint(1) DEFAULT NULL
-) ENGINE=MyISAM DEFAULT CHARSET=utf8
-;';
-  pwg_query($query);
-  
-  // update video_id lenght
-  $query = 'ALTER TABLE `'.gvideo_table.'` CHANGE `video_id` `video_id` VARCHAR(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;';
-  pwg_query($query);
-  
-  // new collumn in images table
-  $result = pwg_query('SHOW COLUMNS FROM '.IMAGES_TABLE.' LIKE "is_gvideo";');
-  if (!pwg_db_num_rows($result))
-  {
-    pwg_query('ALTER TABLE `' . IMAGES_TABLE . '` ADD `is_gvideo` TINYINT(1) NOT NULL DEFAULT 0;');
-    
-    $query = '
-UPDATE '.IMAGES_TABLE.'
-  SET is_gvideo = 1
-  WHERE id IN(
-    SELECT picture_id FROM '.gvideo_table.'
-    )
-;';
-    pwg_query($query);
-  }
-  
-  // remove old configuration
-  if (isset($conf['PY_GVideo']))
-  {
-    pwg_query('DELETE FROM `'. CONFIG_TABLE .'` WHERE param = "PY_GVideo" LIMIT 1;');
-    unset($conf['PY_GVideo']);
-  }
-  
-  // updade video files
-  gvideo_update_24();
-}
-
-
-/**
- * update from 2.3 to 2.4
- */
-function gvideo_update_24()
-{
-  global $conf;
-  
-  // search existing videos
-  $query = '
-SELECT *
-  FROM '.IMAGES_TABLE.'
-  WHERE
-    file LIKE "%.gvideo"
-    OR file LIKE "%.dm"
-    OR file LIKE "%.ytube"
-    OR file LIKE "%.wideo"
-    OR file LIKE "%.vimeo"
-    OR file LIKE "%.wat"
-;';
-  $result = pwg_query($query);
-  
-  if (!pwg_db_num_rows($result))
-  {
-    return;
-  }
-  
-  if (!isset($conf['prefix_thumbnail']))
-  {
-    $conf['prefix_thumbnail'] = 'TN-';
-  }
-
-  if (!isset($conf['dir_thumbnail']))
-  {
-    $conf['dir_thumbnail'] = 'thumbnail';
-  }
-  
-  set_time_limit(600);
-  include_once(gvideo_path . 'include/functions.inc.php');
-  include_once(PHPWG_ROOT_PATH . 'admin/include/functions_upload.inc.php');
-  
-  $videos_inserts = array();
-  $images_updates = array();
-  $images_delete = array();
-  
-  while ($img = pwg_db_fetch_assoc($result))
-  {
-    $file_content = file_get_contents($img['path']);
-    list($file['id'], $file['height'], $file['width'], ) = explode('/', $file_content);
-    $file['type'] = get_extension($img['path']);
-    
-    switch ($file['type'])
-    {
-      case 'vimeo':
-        $video = array(
-          'type' => 'vimeo',
-          'url' => 'http://vimeo.com/'.$file['id'],
-          );
-        break;
-      case 'dm':
-        $video = array(
-          'type' => 'dailymotion',
-          'url' => 'http://dailymotion.com/video/'.$file['id'],
-          );
-        break;
-      case 'ytube':
-        $video = array(
-          'type' => 'youtube',
-          'url' => 'http://youtube.com/watch?v='.$file['id'],
-          );
-        break;
-      case 'wideo':
-        $video = array(
-          'type' => 'wideo',
-          'url' => 'http://wideo.fr/video/'.$file['id'].'.html',
-          );
-        break;
-      case 'wat':
-        $video = array(
-          'type' => 'wat',
-          'url' => null,
-          );
-        break;
-      case 'gvideo': // closed
-      default:
-        array_push($images_delete, $img['id']);
-        continue;
-    }
-    
-    $real_path = str_replace($img['file'], null, str_replace('././', './', $img['path']));
-    
-    // get existing thumbnail
-    $thumb = $real_path.$conf['dir_thumbnail'].'/'.$conf['prefix_thumbnail'].get_filename_wo_extension($img['file']).'.*';
-    $thumb = glob($thumb);
-    if (!empty($thumb))
-    {
-      $thumb_name = $video['type'].'-'.$file['id'].'-'.uniqid().'.'.get_extension($thumb[0]);
-      $thumb_source = $conf['data_location'].$thumb_name;
-      copy($thumb[0], $thumb_source);
-    }
-    else
-    {
-      $thumb_name = $video['type'].'-'.$file['id'].'-'.uniqid().'.jpg';
-      $thumb_source = $conf['data_location'].$thumb_name;
-      copy(gvideo_path.'mimetypes/'.$video['type'].'.jpg', $thumb_source);
-      add_film_frame($thumb_source);
-    }
-    
-    // update element
-    $image_id = add_uploaded_file($thumb_source, $thumb_name, null, null, $img['id']);
-    
-    // update path and rename the file
-    $img['new_path'] = $real_path.$thumb_name;
-    rename($img['path'], $img['new_path']); // why ? what's the purpose of this line ?
-    array_push($images_updates, array(
-      'id' => $img['id'],
-      'path' => $img['new_path'],
-      'is_gvideo' => 1,
-      ));
-    
-    if (empty($file['width'])) $file['width'] = '';
-    if (empty($file['height'])) $file['height'] = '';
-    
-    // register video    
-    array_push($videos_inserts, array(
-      'picture_id' => $image_id,
-      'url' => $video['url'],
-      'type' => $video['type'],
-      'video_id' => $file['id'],
-      'width' => $file['width'],
-      'height' => $file['height'],
-      'autoplay' => '',
-      ));
-      
-    unset($thumb_source, $thumb_name, $file, $video, $url);
-  }
-  
-  // delete obsolete elements
-  delete_elements($images_delete);
-  
-  // registers videos
-  mass_inserts(
-    gvideo_table,
-    array('picture_id', 'url', 'type', 'video_id', 'width', 'height', 'autoplay'),
-    $videos_inserts
-    );
-    
-  // update images
-  mass_updates(
-    IMAGES_TABLE,
-    array('primary'=>array('id'), 'update'=>array('path', 'is_gvideo')),
-    $images_updates
-    );
-}
-
-?>
Index: extensions/gvideo/main.inc.php
===================================================================
--- extensions/gvideo/main.inc.php	(revision 26469)
+++ extensions/gvideo/main.inc.php	(revision 26470)
@@ -4,14 +4,14 @@
 Version: auto
 Description: Add videos from Dailymotion, Youtube, Vimeo, Wideo and Wat.
-Plugin URI: http://piwigo.org/ext/extension_view.php?eid=136
-Author: Mistic & P@t
+Plugin URI: auto
+Author: Mistic
 Author URI: http://www.strangeplanet.fr
 */
 
-if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
+defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
 
 global $prefixeTable;
 
-defined('GVIDEO_ID') or define('GVIDEO_ID', basename(dirname(__FILE__)));
+define('GVIDEO_ID',      basename(dirname(__FILE__)));
 define('GVIDEO_PATH',    PHPWG_PLUGINS_PATH . GVIDEO_ID . '/');
 define('GVIDEO_ADMIN',   get_root_url() . 'admin.php?page=plugin-' . GVIDEO_ID);
@@ -22,50 +22,30 @@
 add_event_handler('init', 'gvideo_init');
 add_event_handler('picture_pictures_data', 'gvideo_prepare_picture');
-add_event_handler('render_element_content', 'gvideo_element_content', EVENT_HANDLER_PRIORITY_NEUTRAL-10, 2);
 
 if (defined('IN_ADMIN'))
 {
-  add_event_handler('delete_elements', 'gvideo_delete_elements');
   add_event_handler('get_admin_plugin_menu_links', 'gvideo_admin_menu');
   add_event_handler('tabsheet_before_select','gvideo_tab', EVENT_HANDLER_PRIORITY_NEUTRAL+10, 2); 
 }
 
-include_once(GVIDEO_PATH . 'include/gvideo.inc.php');
+add_event_handler('delete_elements', 'gvideo_delete_elements');
+
+include_once(GVIDEO_PATH . 'include/events.inc.php');
 
 
 /**
- * update & load language
+ * init
  */
 function gvideo_init()
 {
-  global $pwg_loaded_plugins;
+  global $conf;
   
-  if (
-    GVIDEO_VERSION == 'auto' or
-    $pwg_loaded_plugins[GVIDEO_ID]['version'] == 'auto' or
-    version_compare($pwg_loaded_plugins[GVIDEO_ID]['version'], GVIDEO_VERSION, '<')
-  )
-  {
-    include_once(GVIDEO_PATH . 'include/install.inc.php');
-    gvideo_install();
-    
-    if ( $pwg_loaded_plugins[GVIDEO_ID]['version'] != 'auto' and GVIDEO_VERSION !='auto' )
-    {
-      $query = '
-UPDATE '. PLUGINS_TABLE .'
-SET version = "'. GVIDEO_VERSION .'"
-WHERE id = "'. GVIDEO_ID .'"';
-      pwg_query($query);
-      
-      $pwg_loaded_plugins[GVIDEO_ID]['version'] = GVIDEO_VERSION;
-      
-      if (defined('IN_ADMIN'))
-      {
-        $_SESSION['page_infos'][] = 'Embedded Videos updated to version '. GVIDEO_VERSION;
-      }
-    }
-  }
+  include_once(GVIDEO_PATH . 'maintain.inc.php');
+  $maintain = new gvideo_maintain(GVIDEO_ID);
+  $maintain->autoUpdate(GVIDEO_VERSION, 'install');
   
   load_language('plugin.lang', GVIDEO_PATH);
+  
+  $conf['gvideo'] = unserialize($conf['gvideo']);
 }
 
@@ -75,8 +55,8 @@
 function gvideo_admin_menu($menu) 
 {
-  array_push($menu, array(
+  $menu[] = array(
     'NAME' => 'Embedded Videos',
     'URL' => GVIDEO_ADMIN,
-  ));
+    );
   return $menu;
 }
@@ -109,4 +89,2 @@
   return $sheets;
 }
-
-?>
Index: extensions/gvideo/maintain.inc.php
===================================================================
--- extensions/gvideo/maintain.inc.php	(revision 26469)
+++ extensions/gvideo/maintain.inc.php	(revision 26470)
@@ -1,35 +1,286 @@
 <?php
-if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
-
-defined('GVIDEO_ID') or define('GVIDEO_ID', basename(dirname(__FILE__)));
-include_once(PHPWG_PLUGINS_PATH . GVIDEO_ID . '/include/install.inc.php');
-
-
-/* install */
-function plugin_install() 
+defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
+
+class gvideo_maintain extends PluginMaintain
 {
-  gvideo_install();
+  private $installed = false;
   
-  define('gvideo_installed', true);
+  private $default_conf = array(
+    'autoplay' => 0,
+    'width' => 640,
+    'height' => 360,
+    'sync_description' => 1,
+    'sync_tags' => 1,
+    'vimeo' => array(
+      'title' => 1,
+      'portrait' => 1,
+      'byline' => 1,
+      'color' => '00adef',
+      ),
+    'dailymotion' => array(
+      'logo' => 1,
+      'title' => 1,
+      'color' => 'F7FFFD',
+      ),
+    'youtube' => array(),
+    'wat' => array(),
+    'wideo' => array(),
+    );
+    
+  private $table;
+  
+  function __construct($plugin_id)
+  {
+    global $prefixeTable;
+    
+    parent::__construct($plugin_id);
+    
+    $this->table = $prefixeTable . 'image_video';
+  }
+
+  function install($plugin_version, &$errors=array())
+  {
+    global $conf;
+
+    // add config parameter
+    if (empty($conf['gvideo']))
+    {
+      $conf['gvideo'] = serialize($this->default_conf);
+      conf_update_param('gvideo', $conf['gvideo']);
+    }
+    else
+    {
+      $old_conf = is_string($conf['gvideo']) ? unserialize($conf['gvideo']) : $conf['gvideo'];
+
+      if (!isset($old_conf['sync_description']))
+      {
+        $old_conf['sync_description'] = 1;
+        $old_conf['sync_tags'] = 1;
+        
+        $conf['gvideo'] = serialize($old_conf);
+        conf_update_param('gvideo', $conf['gvideo']);
+      }
+    }
+
+    // create table
+  $query = '
+CREATE TABLE IF NOT EXISTS `' . $this->table . '` (
+  `picture_id` mediumint(8) NOT NULL,
+  `url` varchar(255) DEFAULT NULL,
+  `type` varchar(64) NOT NULL,
+  `video_id` varchar(128) NOT NULL,
+  `width` smallint(9) DEFAULT NULL,
+  `height` smallint(9) DEFAULT NULL,
+  `autoplay` tinyint(1) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=utf8
+;';
+    pwg_query($query);
+    
+    // update video_id lenght
+    $query = 'ALTER TABLE `' . $this->table . '` CHANGE `video_id` `video_id` VARCHAR(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;';
+    pwg_query($query);
+    
+    // new collumn in images table
+    $result = pwg_query('SHOW COLUMNS FROM `' . IMAGES_TABLE . '` LIKE "is_gvideo";');
+    if (!pwg_db_num_rows($result))
+    {
+      pwg_query('ALTER TABLE `' . IMAGES_TABLE . '` ADD `is_gvideo` TINYINT(1) NOT NULL DEFAULT 0;');
+      
+      $query = '
+UPDATE `' . IMAGES_TABLE . '`
+  SET is_gvideo = 1
+  WHERE id IN(
+    SELECT picture_id FROM `' . $this->table . '`
+    )
+;';
+      pwg_query($query);
+    }
+    
+    // remove old configuration
+    if (isset($conf['PY_GVideo']))
+    {
+      conf_delete_param('PY_GVideo');
+    }
+    
+    // updade video files
+    $this->update_24();
+
+    $this->installed = true;
+  }
+
+  function activate($plugin_version, &$errors=array())
+  {
+    if (!$this->installed)
+    {
+      $this->install($plugin_version, $errors);
+    }
+  }
+
+  function deactivate()
+  {
+  }
+
+  function uninstall()
+  {
+    conf_delete_param('gvideo');
+
+    pwg_query('DROP TABLE `' . $this->table . '`;');
+
+    pwg_query('ALTER TABLE `'. IMAGES_TABLE .'` DROP `is_gvideo`;');
+  }
+  
+  /**
+   * update from 2.3 to 2.4
+   */
+  function update_24()
+  {
+    global $conf;
+    
+    // search existing videos
+  $query = '
+SELECT *
+  FROM '.IMAGES_TABLE.'
+  WHERE
+    file LIKE "%.gvideo"
+    OR file LIKE "%.dm"
+    OR file LIKE "%.ytube"
+    OR file LIKE "%.wideo"
+    OR file LIKE "%.vimeo"
+    OR file LIKE "%.wat"
+;';
+    $result = pwg_query($query);
+    
+    if (!pwg_db_num_rows($result))
+    {
+      return;
+    }
+    
+    if (!isset($conf['prefix_thumbnail']))
+    {
+      $conf['prefix_thumbnail'] = 'TN-';
+    }
+
+    if (!isset($conf['dir_thumbnail']))
+    {
+      $conf['dir_thumbnail'] = 'thumbnail';
+    }
+    
+    set_time_limit(600);
+    include_once(gvideo_path . 'include/functions.inc.php');
+    include_once(PHPWG_ROOT_PATH . 'admin/include/functions_upload.inc.php');
+    
+    $videos_inserts = array();
+    $images_updates = array();
+    $images_delete = array();
+    
+    while ($img = pwg_db_fetch_assoc($result))
+    {
+      $file_content = file_get_contents($img['path']);
+      list($file['id'], $file['height'], $file['width'], ) = explode('/', $file_content);
+      $file['type'] = get_extension($img['path']);
+      
+      switch ($file['type'])
+      {
+        case 'vimeo':
+          $video = array(
+            'type' => 'vimeo',
+            'url' => 'http://vimeo.com/'.$file['id'],
+            );
+          break;
+        case 'dm':
+          $video = array(
+            'type' => 'dailymotion',
+            'url' => 'http://dailymotion.com/video/'.$file['id'],
+            );
+          break;
+        case 'ytube':
+          $video = array(
+            'type' => 'youtube',
+            'url' => 'http://youtube.com/watch?v='.$file['id'],
+            );
+          break;
+        case 'wideo':
+          $video = array(
+            'type' => 'wideo',
+            'url' => 'http://wideo.fr/video/'.$file['id'].'.html',
+            );
+          break;
+        case 'wat':
+          $video = array(
+            'type' => 'wat',
+            'url' => null,
+            );
+          break;
+        case 'gvideo': // closed
+        default:
+          $images_delete[] = $img['id'];
+          continue;
+      }
+      
+      $real_path = str_replace($img['file'], null, str_replace('././', './', $img['path']));
+      
+      // get existing thumbnail
+      $thumb = $real_path.$conf['dir_thumbnail'].'/'.$conf['prefix_thumbnail'].get_filename_wo_extension($img['file']).'.*';
+      $thumb = glob($thumb);
+      if (!empty($thumb))
+      {
+        $thumb_name = $video['type'].'-'.$file['id'].'-'.uniqid().'.'.get_extension($thumb[0]);
+        $thumb_source = $conf['data_location'].$thumb_name;
+        copy($thumb[0], $thumb_source);
+      }
+      else
+      {
+        $thumb_name = $video['type'].'-'.$file['id'].'-'.uniqid().'.jpg';
+        $thumb_source = $conf['data_location'].$thumb_name;
+        copy(gvideo_path.'mimetypes/'.$video['type'].'.jpg', $thumb_source);
+        add_film_frame($thumb_source);
+      }
+      
+      // update element
+      $image_id = add_uploaded_file($thumb_source, $thumb_name, null, null, $img['id']);
+      
+      // update path and rename the file
+      $img['new_path'] = $real_path.$thumb_name;
+      rename($img['path'], $img['new_path']); // why ? what's the purpose of this line ?
+      
+      $images_updates[] = array(
+        'id' => $img['id'],
+        'path' => $img['new_path'],
+        'is_gvideo' => 1,
+        );
+      
+      if (empty($file['width'])) $file['width'] = '';
+      if (empty($file['height'])) $file['height'] = '';
+      
+      // register video    
+      $videos_inserts[] = array(
+        'picture_id' => $image_id,
+        'url' => $video['url'],
+        'type' => $video['type'],
+        'video_id' => $file['id'],
+        'width' => $file['width'],
+        'height' => $file['height'],
+        'autoplay' => '',
+        );
+        
+      unset($thumb_source, $thumb_name, $file, $video, $url);
+    }
+    
+    // delete obsolete elements
+    delete_elements($images_delete);
+    
+    // registers videos
+    mass_inserts(
+      gvideo_table,
+      array('picture_id', 'url', 'type', 'video_id', 'width', 'height', 'autoplay'),
+      $videos_inserts
+      );
+      
+    // update images
+    mass_updates(
+      IMAGES_TABLE,
+      array('primary'=>array('id'), 'update'=>array('path', 'is_gvideo')),
+      $images_updates
+      );
+  }
 }
-
-/* activate */
-function plugin_activate()
-{
-  if (!defined('gvideo_installed'))
-  {
-    gvideo_install();
-  }
-}
-
-/* uninstall */
-function plugin_uninstall() 
-{
-  global $prefixeTable;
-  
-  pwg_query('DELETE FROM `'. CONFIG_TABLE .'` WHERE param = "gvideo" LIMIT 1;');
-  pwg_query('DROP TABLE `'.$prefixeTable.'image_video`;');
-  pwg_query('ALTER TABLE `' . IMAGES_TABLE . '` DROP `is_gvideo`;');
-}
-
-?>
