Index: /extensions/oAuth/admin.php
===================================================================
--- /extensions/oAuth/admin.php	(revision 26555)
+++ /extensions/oAuth/admin.php	(revision 26556)
@@ -6,5 +6,5 @@
 if (!$conf['allow_user_registration'])
 {
-  array_push($page['warnings'], l10n('Users are not allowed to register on your gallery. OAuth will not work correctly.'));
+  $page['warnings'][] = l10n('Users are not allowed to register on your gallery. OAuth will not work correctly.');
 }
 
@@ -31,4 +31,2 @@
 // send page content
 $template->assign_var_from_handle('ADMIN_CONTENT', 'oauth_content');
-
-?>
Index: /extensions/oAuth/admin/config.php
===================================================================
--- /extensions/oAuth/admin/config.php	(revision 26555)
+++ /extensions/oAuth/admin/config.php	(revision 26556)
@@ -1,5 +1,4 @@
 <?php
 defined('OAUTH_PATH') or die('Hacking attempt!');
-
 
 if (isset($_POST['save_config']))
@@ -14,5 +13,5 @@
     
   conf_update_param('oauth', serialize($conf['oauth']));
-  array_push($page['infos'], l10n('Information data registered in database'));
+  $page['infos'][] = l10n('Information data registered in database');
 }
 
@@ -21,4 +20,2 @@
 // define template file
 $template->set_filename('oauth_content', realpath(OAUTH_PATH . 'admin/template/config.tpl'));
-
-?>
Index: /extensions/oAuth/admin/providers.php
===================================================================
--- /extensions/oAuth/admin/providers.php	(revision 26555)
+++ /extensions/oAuth/admin/providers.php	(revision 26556)
@@ -19,5 +19,5 @@
         (!@$PROVIDERS_CONFIG[$id]['require_client_id'] and empty($data['keys']['key']))
       ) {
-        array_push($page['errors'], sprintf(l10n('%s: invalid keys'), $PROVIDERS_CONFIG[$id]['provider_name']));
+        $page['errors'][] = l10n('%s: invalid keys', $PROVIDERS_CONFIG[$id]['provider_name']);
       }
     }
@@ -25,5 +25,5 @@
     if ( ($id=='Wordpress' or $id=='Flickr' or $id=='Steam') and $data['enabled'] and !@$providers['OpenID']['enabled'] ) // in the template, OpenID must be before other OpenID based providers
     {
-      array_push($page['errors'], sprintf(l10n('OpenID must be enabled in order to use %s authentication'), $id));
+      $page['errors'][] = l10n('OpenID must be enabled in order to use %s authentication', $id);
     }
     
@@ -52,5 +52,5 @@
     
     file_put_contents(OAUTH_CONFIG, $content);
-    array_push($page['infos'], l10n('Information data registered in database'));
+    $page['infos'][] = l10n('Information data registered in database');
   }
 }
@@ -66,4 +66,2 @@
 // define template file
 $template->set_filename('oauth_content', realpath(OAUTH_PATH . 'admin/template/providers.tpl'));
-
-?>
Index: /extensions/oAuth/admin/template/config.tpl
===================================================================
--- /extensions/oAuth/admin/template/config.tpl	(revision 26555)
+++ /extensions/oAuth/admin/template/config.tpl	(revision 26556)
@@ -1,3 +1,3 @@
-{combine_css path=$OAUTH_PATH|cat:"admin/template/style.css"}
+{combine_css path=$OAUTH_PATH|cat:'admin/template/style.css'}
 {combine_css path=$OAUTH_PATH|cat:'template/oauth_sprites.css'}
 
@@ -12,5 +12,5 @@
       <label>
         <input type="checkbox" name="display_menubar" {if $display_menubar}checked="checked"{/if}>
-        <b>{'Display sign in buttons in the menubar'|@translate}</b>
+        <b>{'Display sign in buttons in the menubar'|translate}</b>
       </label>
     </li>
@@ -19,5 +19,5 @@
       <label>
         <input type="checkbox" name="display_register" {if $display_register}checked="checked"{/if}>
-        <b>{'Display sign in buttons on the register page'|@translate}</b>
+        <b>{'Display sign in buttons on the register page'|translate}</b>
       </label>
     </li>
@@ -28,5 +28,5 @@
   <ul>
     <li>
-      <b>{'Icon size on the identification page'|@translate} :</b><br>
+      <b>{'Icon size on the identification page'|translate} :</b><br>
       <label>
         <input type="radio" name="identification_icon" value="16px" {if $identification_icon=='16px'}checked="checked"{/if}>
@@ -53,5 +53,5 @@
     
     <li>
-      <b>{'Icon size in the menubar'|@translate} :</b><br>
+      <b>{'Icon size in the menubar'|translate} :</b><br>
       <label>
         <input type="radio" name="menubar_icon" value="16px" {if $menubar_icon=='16px'}checked="checked"{/if}>
@@ -79,5 +79,5 @@
 </fieldset>
 
-<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/oAuth/admin/template/providers.tpl
===================================================================
--- /extensions/oAuth/admin/template/providers.tpl	(revision 26555)
+++ /extensions/oAuth/admin/template/providers.tpl	(revision 26556)
@@ -1,6 +1,6 @@
-{combine_css path=$OAUTH_PATH|cat:"admin/template/style.css"}
+{combine_css path=$OAUTH_PATH|cat:'admin/template/style.css'}
 {combine_css path=$OAUTH_PATH|cat:'template/oauth_sprites.css'}
 
-{footer_script}{literal}
+{footer_script}
 jQuery("select.enable").change(function() {
   var $top = $(this).closest("div.provider");
@@ -20,5 +20,5 @@
 
 jQuery("#close_help").click(function() {
-  jQuery("#help_container").animate({"margin-right": "-550px"}, 'fast');
+  jQuery("#help_container").animate({ "margin-right": "-550px" }, 'fast');
   return false;
 });
@@ -30,8 +30,8 @@
   $("#help_container h5").html($top.find("h4").html());
   $("#help_container div").html($top.find("div.help").html());
-  $("#help_container").animate({"margin-right": "0px"}, 'fast');
+  $("#help_container").animate({ "margin-right": "0px" }, 'fast');
   return false;
 });
-{/literal}{/footer_script}
+{/footer_script}
 
 
@@ -41,5 +41,5 @@
 
 <div id="help_container">
-  <a href="#" id="close_help" title="{'Close'|@translate}">&times;</a>
+  <a href="#" id="close_help" title="{'Close'|translate}">&times;</a>
   <h5></h5>
   <div></div>
@@ -60,8 +60,8 @@
       <td>
         <select name="providers[{$p}][enabled]" class="enable">
-          <option value="true" {if $CONFIG[$p].enabled}selected="selected"{/if}>{'Enabled'|@translate}</option>
-          <option value="false" {if not $CONFIG[$p].enabled}selected="selected"{/if}>{'Disabled'|@translate}</option>
+          <option value="true" {if $CONFIG[$p].enabled}selected="selected"{/if}>{'Enabled'|translate}</option>
+          <option value="false" {if not $CONFIG[$p].enabled}selected="selected"{/if}>{'Disabled'|translate}</option>
         </select>
-        <br><a href="#" class="open-help">{'Help'|@translate}</a>
+        <br><a href="#" class="open-help">{'Help'|translate}</a>
       </td>
       
@@ -85,10 +85,10 @@
     {if $provider.new_app_link}
       <ol>
-        <li>{'Go to <a href="%s" target="_blank">%s</a> and create a new application'|@translate|sprintf:$provider.new_app_link:$provider.new_app_link}</li>
+        <li>{'Go to <a href="%s" target="_blank">%s</a> and create a new application'|translate|sprintf:$provider.new_app_link:$provider.new_app_link}</li>
         
       {if $p=='Google'}
-        <li>{'On the <b>APIs & auth -> Credentials</b> tab, <b>Create new client ID</b>'|@translate}</li>
+        <li>{'On the <b>APIs & auth -> Credentials</b> tab, <b>Create new client ID</b>'|translate}</li>
       {else}
-        <li>{'Fill out any required fields such as the application name and description'|@translate}</li>
+        <li>{'Fill out any required fields such as the application name and description'|translate}</li>
       {/if}
         
@@ -96,37 +96,37 @@
         <li>
           {assign var=callback value=$OAUTH_CALLBACK|cat:$p}
-          {'Provide this URL as the Callback/Redirect URL for your application: <em>%s</em>'|@translate|sprintf:$callback}
+          {'Provide this URL as the Callback/Redirect URL for your application: <em>%s</em>'|translate|sprintf:$callback}
         </li>
       {/if}
       
       {if $p=='Live'}
-        <li>{'Put your website domain in the %s fields. It should match with the current hostname: <em>%s</em>'|@translate|sprintf:'<b>Redirect Domain</b>':$SERVERNAME}</li>
+        <li>{'Put your website domain in the %s fields. It should match with the current hostname: <em>%s</em>'|translate|sprintf:'<b>Redirect Domain</b>':$SERVERNAME}</li>
       {elseif $p=='Facebook'}
         <li>{'Go to <b>Settings->Advanced</b> and activate <em>Client OAuth Login</em>.'|translate}</li>
-        <li>{'Put your website domain in the %s fields. It should match with the current hostname: <em>%s</em>'|@translate|sprintf:'<b>Valid OAuth redirect URIs</b>':$SERVERNAME}</li>
+        <li>{'Put your website domain in the %s fields. It should match with the current hostname: <em>%s</em>'|translate|sprintf:'<b>Valid OAuth redirect URIs</b>':$SERVERNAME}</li>
       {elseif $p=='LinkedIn'}
-        <li>{'Put your website domain in the %s fields. It should match with the current hostname: <em>%s</em>'|@translate|sprintf:'<b>Website URL</b>':$SERVERNAME}</li>
-        <li>{'Set <b>%s</b> to <em>%s</em>'|@translate|sprintf:'Application Type':'Web Application'}</li>
-        <li>{'Set <b>%s</b> to <em>%s</em>'|@translate|sprintf:'Default Scope':'r_basicprofile & r_emailaddress'}</li>
+        <li>{'Put your website domain in the %s fields. It should match with the current hostname: <em>%s</em>'|translate|sprintf:'<b>Website URL</b>':$SERVERNAME}</li>
+        <li>{'Set <b>%s</b> to <em>%s</em>'|translate|sprintf:'Application Type':'Web Application'}</li>
+        <li>{'Set <b>%s</b> to <em>%s</em>'|translate|sprintf:'Default Scope':'r_basicprofile & r_emailaddress'}</li>
       {elseif $p=='Yahoo'}
-        <li>{'Put your website domain in the %s fields. It should match with the current hostname: <em>%s</em>'|@translate|sprintf:'<b>Application URL</b>, <b>Application Domain</b>':$SERVERNAME}</li>
-        <li>{'Set <b>%s</b> to <em>%s</em>'|@translate|sprintf:'Kind of Application':'Web-based'}</li>
-        <li>{'Set <b>%s</b> to <em>%s</em>'|@translate|sprintf:'Access Scopes':'This app will only access public...'}</li>
-        <li>{'Once the application is registered update the permissions : set <b>Contacts</b> as <em>Read</em> and <b>Social Directory</b> as <em>Read Public</em>'|@translate}</li>
+        <li>{'Put your website domain in the %s fields. It should match with the current hostname: <em>%s</em>'|translate|sprintf:'<b>Application URL</b>, <b>Application Domain</b>':$SERVERNAME}</li>
+        <li>{'Set <b>%s</b> to <em>%s</em>'|translate|sprintf:'Kind of Application':'Web-based'}</li>
+        <li>{'Set <b>%s</b> to <em>%s</em>'|translate|sprintf:'Access Scopes':'This app will only access public...'}</li>
+        <li>{'Once the application is registered update the permissions : set <b>Contacts</b> as <em>Read</em> and <b>Social Directory</b> as <em>Read Public</em>'|translate}</li>
       {elseif $p=='Twitter'}
-        <li>{'Put your website domain in the %s fields. It should match with the current hostname: <em>%s</em>'|@translate|sprintf:'<b>Website</b>, <b>Callback URL</b>':$SERVERNAME}</li>
+        <li>{'Put your website domain in the %s fields. It should match with the current hostname: <em>%s</em>'|translate|sprintf:'<b>Website</b>, <b>Callback URL</b>':$SERVERNAME}</li>
       {elseif $p=='Tumblr'}
-        <li>{'Put your website domain in the %s fields. It should match with the current hostname: <em>%s</em>'|@translate|sprintf:'<b>Application Website</b>, <b>Default Callback URL</b>':$SERVERNAME}</li>
+        <li>{'Put your website domain in the %s fields. It should match with the current hostname: <em>%s</em>'|translate|sprintf:'<b>Application Website</b>, <b>Default Callback URL</b>':$SERVERNAME}</li>
       {elseif $p=='Instagram'}
-        <li>{'Put your website domain in the %s fields. It should match with the current hostname: <em>%s</em>'|@translate|sprintf:'<b>Website</b>':$SERVERNAME}</li>
+        <li>{'Put your website domain in the %s fields. It should match with the current hostname: <em>%s</em>'|translate|sprintf:'<b>Website</b>':$SERVERNAME}</li>
       {elseif $p=='Google'}
-        <li>{'Set <b>%s</b> to <em>%s</em>'|@translate|sprintf:'Application Type':'Web Application'}</li>
-        <li>{'Put your website domain in the %s fields. It should match with the current hostname: <em>%s</em>'|@translate|sprintf:'<b>Authorized Javascript origins </b>':$SERVERNAME}</li>
+        <li>{'Set <b>%s</b> to <em>%s</em>'|translate|sprintf:'Application Type':'Web Application'}</li>
+        <li>{'Put your website domain in the %s fields. It should match with the current hostname: <em>%s</em>'|translate|sprintf:'<b>Authorized Javascript origins </b>':$SERVERNAME}</li>
       {/if}
       
-        <li>{'Once you have registered, copy and past the created application credentials into this setup page'|@translate}</li>
+        <li>{'Once you have registered, copy and past the created application credentials into this setup page'|translate}</li>
       </ol>
     {else}
-      <p>{'No registration required for OpenID based providers'|@translate}</p> 
+      <p>{'No registration required for OpenID based providers'|translate}</p> 
     {/if}
     </div>
@@ -136,5 +136,5 @@
 </fieldset>
 
-<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/oAuth/admin/template/style.css
===================================================================
--- /extensions/oAuth/admin/template/style.css	(revision 26555)
+++ /extensions/oAuth/admin/template/style.css	(revision 26556)
@@ -1,12 +1,2 @@
-.showInfo {
-  position:static;
-  display:inline-block;
-  padding:1px 6px;
-  width:4px;
-  height:14px;
-  line-height:14px;
-  font-size:0.8em;
-}
-
 .content h4 {
   text-align:left;
Index: /extensions/oAuth/auth.php
===================================================================
--- /extensions/oAuth/auth.php	(revision 26555)
+++ /extensions/oAuth/auth.php	(revision 26556)
@@ -100,5 +100,5 @@
       $template->assign('ERROR', l10n('User not found')); break;
     default:
-      $template->assign('ERROR', sprintf(l10n('An error occured, please contact the gallery owner. <i>Error code : %s</i>'), '<span title="'.$e->getMessage().'">'.$e->getCode().'</span>'));
+      $template->assign('ERROR', l10n('An error occured, please contact the gallery owner. <i>Error code : %s</i>', '<span title="'.$e->getMessage().'">'.$e->getCode().'</span>'));
   }
 }
@@ -117,3 +117,2 @@
 $template->set_filename('index', realpath(OAUTH_PATH . 'template/auth.tpl'));
 $template->pparse('index');
-?>
Index: /extensions/oAuth/include/functions.inc.php
===================================================================
--- /extensions/oAuth/include/functions.inc.php	(revision 26555)
+++ /extensions/oAuth/include/functions.inc.php	(revision 26556)
@@ -46,4 +46,2 @@
   }
 }
-
-?>
Index: tensions/oAuth/include/install.inc.php
===================================================================
--- /extensions/oAuth/include/install.inc.php	(revision 26555)
+++ 	(revision )
@@ -1,28 +1,0 @@
-<?php
-defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
-
-function oauth_install() 
-{
-  global $conf;
-  
-  if (empty($conf['oauth']))
-  {
-    $oauth_default_config = serialize(array(
-      'display_menubar' => true,
-      'display_register' => true,
-      'identification_icon' => '38px',
-      'menubar_icon' => '26px',
-      ));
-  
-    conf_update_param('oauth', $oauth_default_config);
-    $conf['oauth'] = $oauth_default_config;
-  }
-  
-  $result = pwg_query('SHOW COLUMNS FROM `'.USERS_TABLE.'` LIKE "oauth_id";');
-  if (!pwg_db_num_rows($result))
-  {      
-    pwg_query('ALTER TABLE `' . USERS_TABLE . '` ADD `oauth_id` VARCHAR(255) DEFAULT NULL;');
-  }
-}
-
-?>
Index: /extensions/oAuth/include/public_events.inc.php
===================================================================
--- /extensions/oAuth/include/public_events.inc.php	(revision 26555)
+++ /extensions/oAuth/include/public_events.inc.php	(revision 26556)
@@ -1,23 +1,4 @@
 <?php
 defined('OAUTH_PATH') or die('Hacking attempt!');
-
-function oauth_anti_lightbox($tpl_thumbnails_var)
-{
-  global $template, $page;
-  
-  if ($page['section'] == 'collections' && !empty($template->css_by_priority[0]))
-  {
-    foreach ($template->css_by_priority[0] as $file)
-    {
-      if (strpos($file[0], 'colorbox.css') !== false)
-      {
-        $template->assign('OAUTH_NO_LIGHTBOX', true);
-        break;
-      }
-    }
-  }
-  
-  return $tpl_thumbnails_var;
-}
 
 /**
@@ -52,5 +33,5 @@
     list($oauth_id) = pwg_db_fetch_row($result);
     list($provider) = explode('---', $oauth_id);
-    $_SESSION['page_errors'][] = sprintf(l10n('You registered with a %s account, please sign in with the same account.'), $provider);
+    $_SESSION['page_errors'][] = l10n('You registered with a %s account, please sign in with the same account.', $provider);
     
     $redirect_to = get_root_url().'identification.php'; // variable used by identification.php
@@ -96,5 +77,5 @@
         ));
         
-      array_push($page['infos'], l10n('Your registration is almost done, please complete the registration form.'));
+      $page['infos'][] = l10n('Your registration is almost done, please complete the registration form.');
       
       $oauth_id = $provider.'---'.$remote_user->identifier;
@@ -141,5 +122,5 @@
     }
     catch (Exception $e) {
-      array_push($page['errors'], sprintf(l10n('An error occured, please contact the gallery owner. <i>Error code : %s</i>'), $e->getCode()));
+      $page['errors'][] = l10n('An error occured, please contact the gallery owner. <i>Error code : %s</i>', $e->getCode());
     }
   }
@@ -196,5 +177,5 @@
   }
   catch (Exception $e) {
-    array_push($page['errors'], sprintf(l10n('An error occured, please contact the gallery owner. <i>Error code : %s</i>'), $e->getCode()));
+    $page['errors'][] = l10n('An error occured, please contact the gallery owner. <i>Error code : %s</i>', $e->getCode());
   }
 }
@@ -231,5 +212,5 @@
   }
   catch (Exception $e) {
-    $_SESSION['page_errors'][] = sprintf(l10n('An error occured, please contact the gallery owner. <i>Error code : %s</i>'), $e->getCode());
+    $_SESSION['page_errors'][] = l10n('An error occured, please contact the gallery owner. <i>Error code : %s</i>', $e->getCode());
   }
 }
@@ -245,5 +226,5 @@
   $menu = &$menu_ref_arr[0];  
   
-  if ( !$conf['oauth']['display_menubar'] or $menu->get_block('mbIdentification') == null )
+  if (!$conf['oauth']['display_menubar'] or $menu->get_block('mbIdentification') == null)
   {
     return;
@@ -293,4 +274,2 @@
   return str_replace($search, $search.$add, $content);
 }
-
-?>
Index: /extensions/oAuth/main.inc.php
===================================================================
--- /extensions/oAuth/main.inc.php	(revision 26555)
+++ /extensions/oAuth/main.inc.php	(revision 26556)
@@ -11,8 +11,6 @@
 defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
 
-// +-----------------------------------------------------------------------+
-// | Define plugin constants                                               |
-// +-----------------------------------------------------------------------+
-defined('OAUTH_ID') or define('OAUTH_ID', basename(dirname(__FILE__)));
+
+define('OAUTH_ID',      basename(dirname(__FILE__)));
 define('OAUTH_PATH' ,   PHPWG_PLUGINS_PATH . OAUTH_ID . '/');
 define('OAUTH_ADMIN',   get_root_url() . 'admin.php?page=plugin-' . OAUTH_ID);
@@ -22,14 +20,9 @@
 
 
-// +-----------------------------------------------------------------------+
-// | Event handlers                                                        |
-// +-----------------------------------------------------------------------+
-global $conf, $hybridauth_conf;
-
-add_event_handler('init', 'oauth_init');
+// try to load hybridauth config
+global $hybridauth_conf;
 
 include_once(OAUTH_PATH . 'include/functions.inc.php');
 
-// try to load hybridauth config
 if (file_exists(PHPWG_ROOT_PATH.OAUTH_CONFIG))
 {
@@ -37,16 +30,10 @@
 }
 
+
+add_event_handler('init', 'oauth_init');
+
 if (defined('IN_ADMIN'))
 {
   add_event_handler('get_admin_plugin_menu_links', 'oauth_admin_plugin_menu_links');
-  
-  function oauth_admin_plugin_menu_links($menu) 
-  {
-    array_push($menu, array(
-      'NAME' => l10n('OAuth'),
-      'URL' => OAUTH_ADMIN,
-    ));
-    return $menu;
-  }
 }
 else if (!empty($hybridauth_conf) and function_exists('curl_init'))
@@ -61,6 +48,4 @@
   add_event_handler('blockmanager_apply', 'oauth_blockmanager');
   
-  add_event_handler('loc_end_index_thumbnails', 'oauth_anti_lightbox', 41);
-  
   include_once(OAUTH_PATH . 'include/public_events.inc.php');
 }
@@ -72,32 +57,9 @@
 function oauth_init()
 {
-  global $conf, $pwg_loaded_plugins, $page, $hybridauth_conf;
+  global $conf, $page, $hybridauth_conf;
   
-  // apply upgrade if needed
-  if (
-    OAUTH_VERSION == 'auto' or
-    $pwg_loaded_plugins[OAUTH_ID]['version'] == 'auto' or
-    version_compare($pwg_loaded_plugins[OAUTH_ID]['version'], OAUTH_VERSION, '<')
-  )
-  {
-    include_once(OAUTH_PATH . 'include/install.inc.php');
-    oauth_install();
-    
-    if ( $pwg_loaded_plugins[OAUTH_ID]['version'] != 'auto' and OAUTH_VERSION != 'auto' )
-    {
-      $query = '
-UPDATE '. PLUGINS_TABLE .'
-SET version = "'. OAUTH_VERSION .'"
-WHERE id = "'. OAUTH_ID .'"';
-      pwg_query($query);
-      
-      $pwg_loaded_plugins[OAUTH_ID]['version'] = OAUTH_VERSION;
-      
-      if (defined('IN_ADMIN'))
-      {
-        $_SESSION['page_infos'][] = 'OAuth updated to version '. OAUTH_VERSION;
-      }
-    }
-  }
+  include_once(OAUTH_PATH . 'maintain.inc.php');
+  $maintain = new oAuth_maintain(OAUTH_ID);
+  $maintain->autoUpdate(OAUTH_VERSION, 'install');
   
   load_language('plugin.lang', OAUTH_PATH);
@@ -108,11 +70,11 @@
   if (defined('IN_ADMIN'))
   {
-    if ( empty($hybridauth_conf) and strpos(@$_GET['page'],'plugin-'.OAUTH_ID)===false )
+    if (empty($hybridauth_conf) and strpos(@$_GET['page'],'plugin-'.OAUTH_ID)===false)
     {
-      array_push($page['warnings'], '<a href="'.OAUTH_ADMIN.'">'.l10n('OAuth: You need to configure the credentials').'</a>');
+      $page['warnings'][] = '<a href="'.OAUTH_ADMIN.'">'.l10n('OAuth: You need to configure the credentials').'</a>';
     }
     if (!function_exists('curl_init'))
     {
-      array_push($page['warnings'], l10n('OAuth: PHP Curl extension is needed'));
+      $page['warnings'][] = l10n('OAuth: PHP Curl extension is needed');
     }
   }
@@ -136,3 +98,10 @@
 }
 
-?>
+function oauth_admin_plugin_menu_links($menu) 
+{
+  $menu[] = array(
+    'NAME' => l10n('OAuth'),
+    'URL' => OAUTH_ADMIN,
+    );
+  return $menu;
+}
Index: /extensions/oAuth/maintain.inc.php
===================================================================
--- /extensions/oAuth/maintain.inc.php	(revision 26555)
+++ /extensions/oAuth/maintain.inc.php	(revision 26556)
@@ -2,29 +2,53 @@
 defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
 
-defined('OAUTH_ID') or define('OAUTH_ID', basename(dirname(__FILE__)));
-include_once(PHPWG_PLUGINS_PATH . OAUTH_ID . '/include/install.inc.php');
+class oAuth_maintain extends PluginMaintain
+{
+  private $installed = false;
+  
+  private $default_conf = array(
+    'display_menubar' => true,
+    'display_register' => true,
+    'identification_icon' => '38px',
+    'menubar_icon' => '26px',
+    );
 
+  function install($plugin_version, &$errors=array())
+  {
+    global $conf;
 
-function plugin_install() 
-{
-  oauth_install();
-  define('oauth_installed', true);
-}
+    if (empty($conf['oauth']))
+    {
+      $conf['oauth'] = serialize($this->default_conf);
+      conf_update_param('oauth', $conf['oauth']);
+    }
+    
+    $result = pwg_query('SHOW COLUMNS FROM `' . USERS_TABLE . '` LIKE "oauth_id";');
+    if (!pwg_db_num_rows($result))
+    {      
+      pwg_query('ALTER TABLE `' . USERS_TABLE . '` ADD `oauth_id` VARCHAR(255) DEFAULT NULL;');
+    }
 
+    $this->installed = true;
+  }
 
-function plugin_activate()
-{
-  if (!defined('oauth_installed'))
+  function activate($plugin_version, &$errors=array())
   {
-    oauth_install();
+    if (!$this->installed)
+    {
+      $this->install($plugin_version, $errors);
+    }
+  }
+
+  function deactivate()
+  {
+  }
+
+  function uninstall()
+  {
+    conf_delete_param('oauth');
+
+    pwg_query('ALTER TABLE `'. USERS_TABLE .'` DROP `oauth_id`;');
+    
+    @unlink(PHPWG_PLUGINS_PATH . PWG_LOCAL_DIR . 'config/hybridauth.inc.php');
   }
 }
-
-function plugin_uninstall() 
-{
-  pwg_query('DELETE FROM `'. CONFIG_TABLE .'` WHERE param = "oauth" LIMIT 1;');
-  pwg_query('ALTER TABLE `'. USERS_TABLE .'` DROP `oauth_id`;');
-  @unlink(PHPWG_PLUGINS_PATH . PWG_LOCAL_DIR . 'config/hybridauth.inc.php');
-}
-
-?>
Index: /extensions/oAuth/template/auth.tpl
===================================================================
--- /extensions/oAuth/template/auth.tpl	(revision 26555)
+++ /extensions/oAuth/template/auth.tpl	(revision 26556)
@@ -2,6 +2,6 @@
 <html lang="{$lang_info.code}" dir="{$lang_info.direction}">
 <head>
-  <meta http-equiv="Content-Type" content="text/html; charset={$CONTENT_ENCODING}">
-  <title>{'Sign in with %s'|@translate|sprintf:$PROVIDER} | {$GALLERY_TITLE}</title>
+  <meta charset="{$CONTENT_ENCODING}">
+  <title>{'Sign in with %s'|translate:$PROVIDER} | {$GALLERY_TITLE}</title>
 </head>
 
@@ -11,16 +11,16 @@
 {if $ERROR}
   <img id="loader" src="{$OAUTH_PATH}template/images/alert.png">
-  <h3>{'Error...'|@translate}</h3>
+  <h3>{'Error...'|translate}</h3>
   {$ERROR}<br>
-  <a href="#" id="close">{'Close'|@translate}</a>
+  <a href="#" id="close">{'Close'|translate}</a>
   
   <script type="text/javascript"> 
-    document.getElementById('close').onclick = function() {ldelim} window.self.close(); };
+    document.getElementById('close').onclick = function() { window.self.close(); };
   </script>
   
 {elseif $LOADING}
   <img id="loader" src="{$OAUTH_PATH}template/images/ajax-loader-big.gif">
-  <h3>{'Loading...'|@translate}</h3>
-  {'Contacting <b>%s</b>. Please wait.'|@translate|sprintf:$PROVIDER}
+  <h3>{'Loading...'|translate}</h3>
+  {'Contacting <b>%s</b>. Please wait.'|translate:$PROVIDER}
   
   <script type="text/javascript">
Index: /extensions/oAuth/template/identification_common.tpl
===================================================================
--- /extensions/oAuth/template/identification_common.tpl	(revision 26555)
+++ /extensions/oAuth/template/identification_common.tpl	(revision 26556)
@@ -1,33 +1,21 @@
 {combine_css path=$OAUTH_PATH|cat:'template/oauth_sprites.css'}
 
-{html_style}{literal}
-  #openid_form {
-    padding:20px;
-  }
-  #openid_form h3, #openid_form .oauth_38px {
-    display:inline-block;
-    vertical-align:middle;
-    margin:0;
-  }
-  #openid_label.error {
-    color:red;
-    font-weight:bold;
-  }
-{/literal}{/html_style}
+{combine_script id='jquery.colorbox' load='footer' require='jquery' path='themes/default/js/plugins/jquery.colorbox.min.js'}
+{combine_css id='colorbox' path="themes/default/js/plugins/colorbox/style2/colorbox.css"}
 
-{if not isset($OAUTH_NO_LIGHTBOX)}
-{combine_script id='jquery.colorbox' load='footer' require='jquery' path='themes/default/js/plugins/jquery.colorbox.min.js'}
-{combine_css path="themes/default/js/plugins/colorbox/style2/colorbox.css"}
-{/if}
+{html_style}
+#openid_form { padding:20px; }
+#openid_form h3, #openid_form .oauth_38px { display:inline-block; vertical-align:middle; margin:0; }
+#openid_label.error { color:red; font-weight:bold; }
+{/html_style}
 
-{footer_script}{literal}
+{footer_script}
 // redirect, called from the popup
 function redirect(type) {
-{/literal}
-  url = "{$REDIRECT_TO}";
-  if (typeof type != 'undefined' && type != 'default') {ldelim}
+  var url = "{$REDIRECT_TO}";
+  if (typeof type != 'undefined' && type != 'default') {
     url = "{$ABS_ROOT_URL}"+ type +".php";
   }
-{literal}
+
   window.location.href = url;
 }
@@ -49,16 +37,20 @@
     case 'OpenID': case 'Wordpress': case 'Flickr': case 'Steam':
       switch(idp) {
-{/literal}
         case 'OpenID':
-          jQuery("#openid_label").html('{'Please enter your OpenID URL'|@translate|escape:javascript}'); break;
+          jQuery("#openid_label").html('{'Please enter your OpenID URL'|translate|escape:javascript}'); break;
         case 'Wordpress': case 'Flickr': case 'Steam':
-          jQuery("#openid_label").html('{'Please enter your username'|@translate|escape:javascript}'); break;
+          jQuery("#openid_label").html('{'Please enter your username'|translate|escape:javascript}'); break;
       }
       
-      jQuery("#openid_form").css('background-color', $("#the_page #content").css('background-color'));
+      var bg_color = $('#the_page #content').css('background-color');
+      if (!bg_color || bg_color=='transparent') {
+        bg_color = $('body').css('background-color');
+      }
+      jQuery("#openid_form").css('background-color', bg_color);
+
       jQuery("#openid_form .oauth_38px").removeClass().addClass("oauth_38px " + idp.toLowerCase());
       jQuery("#openid_form h3").html(idp);
       jQuery("#openid_form").data('idp', idp);
-{literal}  
+
       jQuery.colorbox({
         inline:true,
@@ -66,12 +58,10 @@
         initialWidth:0,
         initialHeight:0,
-        onComplete:function(){ jQuery.colorbox.resize({speed:0}) } // prevent misalignement when icon not loaded
+        onComplete: function(){ jQuery.colorbox.resize({ speed:0 }) } // prevent misalignement when icon not loaded
       })
       break;
       
     default:
-{/literal}
       open_auth("{$OAUTH_URL}"+ idp);
-{literal}
   }
   
@@ -95,7 +85,7 @@
     case 'Steam': oi = "http://steamcommunity.com/openid/" + oi; break;
   }
-{/literal}  
+
   open_auth("{$OAUTH_URL}OpenID&openid_identifier="+ encodeURI(oi));
-{literal}
+
   jQuery.colorbox.close();
   return false;
@@ -107,5 +97,5 @@
   return false;
 });
-{/literal}{/footer_script}
+{/footer_script}
 
 <div style="display:none;">
@@ -123,6 +113,6 @@
     <div>
       <br>
-      <input type="submit" name="{'Submit'|@translate}">
-      <a href="#" id="openid_cancel">{'Cancel'|@translate}</a>
+      <input type="submit" name="{'Submit'|translate}">
+      <a href="#" id="openid_cancel">{'Cancel'|translate}</a>
     </div>
   </form>
Index: /extensions/oAuth/template/identification_menubar.tpl
===================================================================
--- /extensions/oAuth/template/identification_menubar.tpl	(revision 26555)
+++ /extensions/oAuth/template/identification_menubar.tpl	(revision 26556)
@@ -4,17 +4,13 @@
     {include file=$OAUTH_ABS_PATH|cat:'template/identification_common.tpl'}
   {/if}
-  {html_style}{literal}
-    dl#mbIdentification dd:first-of-type {
-      padding-bottom:0 !important;
-    }
-    #mbIdentification .oauth {
-      margin:0 1px;
-    }
-  {/literal}{/html_style}
+  {html_style}
+    dl#mbIdentification dd:first-of-type { padding-bottom:0 !important; 
+    #mbIdentification .oauth { margin:0 1px; }
+  {/html_style}
   
   <dd>
     <form id="quickconnect">
     <fieldset style="text-align:center;">
-      <legend>{'Or sign in with'|@translate}</legend>
+      <legend>{'Or sign in with'|translate}</legend>
       
     {foreach from=$PROVIDERS item=provider key=p}{strip}
Index: /extensions/oAuth/template/identification_page.tpl
===================================================================
--- /extensions/oAuth/template/identification_page.tpl	(revision 26555)
+++ /extensions/oAuth/template/identification_page.tpl	(revision 26556)
@@ -4,12 +4,10 @@
     {include file=$OAUTH_ABS_PATH|cat:'template/identification_common.tpl'}
   {/if}
-  {html_style}{literal}
-    #oauth_wrap .oauth {
-      margin:0 2px;
-    }
-  {/literal}{/html_style}
+  {html_style}
+    #oauth_wrap .oauth { margin:0 2px; }
+  {/html_style}
     
   <fieldset style="text-align:center;" id="oauth_wrap">
-    <legend>{'Or sign in with'|@translate}</legend>
+    <legend>{'Or sign in with'|translate}</legend>
     
   {foreach from=$PROVIDERS item=provider key=p}{strip}
Index: /extensions/oAuth/template/profile.tpl
===================================================================
--- /extensions/oAuth/template/profile.tpl	(revision 26555)
+++ /extensions/oAuth/template/profile.tpl	(revision 26556)
@@ -1,22 +1,20 @@
-{html_head}{literal}
-<style type="text/css">
-  #oauth {
-    width:400px;
-    height:48px;
-    overflow:hidden;
-    margin:0 auto 15px auto;
-    padding:5px;
-    background:rgba(128,128,128,0.2);
-    border:1px solid #7e7e7e;
-    border-radius:5px;
-  }
-  #oauth .avatar {
-    width:48px;
-    border-radius:5px;
-    margin-right:5px;
-    float:left;
-  }
-</style>
-{/literal}{/html_head}
+{html_style}
+#oauth {
+  width:400px;
+  height:48px;
+  overflow:hidden;
+  margin:0 auto 15px auto;
+  padding:5px;
+  background:rgba(128,128,128,0.2);
+  border:1px solid #7e7e7e;
+  border-radius:5px;
+}
+#oauth .avatar {
+  width:48px;
+  border-radius:5px;
+  margin-right:5px;
+  float:left;
+}
+{/html_style}
 
 <div id="oauth">
@@ -27,6 +25,6 @@
 {/if}
 
-  {'Logged with'|@translate} : <b>{$OAUTH_PROVIDER}</b><br>
-  <b>{'Username'|@translate}</b> : {$OAUTH_USERNAME}<br>
-  {if $OAUTH_PROFILE_URL}<b>{'Profile URL'|@translate}</b> : <a href="{$OAUTH_PROFILE_URL}">{$OAUTH_PROFILE_URL|truncate:40:' ... ':true:true}</a>{/if}
+  {'Logged with'|translate} : <b>{$OAUTH_PROVIDER}</b><br>
+  <b>{'Username'|translate}</b> : {$OAUTH_USERNAME}<br>
+  {if $OAUTH_PROFILE_URL}<b>{'Profile URL'|translate}</b> : <a href="{$OAUTH_PROFILE_URL}">{$OAUTH_PROFILE_URL|truncate:40:' ... ':true:true}</a>{/if}
 </div>
