Index: /extensions/url_uploader/admin.php
===================================================================
--- /extensions/url_uploader/admin.php	(revision 26386)
+++ /extensions/url_uploader/admin.php	(revision 26387)
@@ -22,4 +22,6 @@
 $tabsheet->select('url_uploader');
 $tabsheet->assign();
+
+$page['active_menu'] = get_active_menu('photo');
 
 
@@ -110,8 +112,8 @@
     if (isset($_POST['onUploadError']) and is_array($_POST['onUploadError']) and count($_POST['onUploadError']) > 0)
     {
-      array_push($page['errors'], sprintf(l10n('%d photos not imported'), count($_POST['onUploadError'])));
+      $page['errors'][] = l10n('%d photos not imported', count($_POST['onUploadError']));
       foreach ($_POST['onUploadError'] as $error)
       {
-        array_push($page['errors'], $error);
+        $page['errors'][] = $error;
       }
     }
@@ -140,5 +142,5 @@
       );
 
-    array_push($page['thumbnails'], $thumbnail);
+    $page['thumbnails'][] = $thumbnail;
   }
 
@@ -146,16 +148,10 @@
   {
     // nb uploaded
-    array_push($page['infos'], sprintf(
-      l10n('%d photos uploaded'),
-      count($page['thumbnails'])
-      ));
+    $page['infos'][] = l10n('%d photos uploaded', count($page['thumbnails']));
 
     // level
     if (0 != $_POST['level'])
     {
-      array_push($page['infos'], sprintf(
-        l10n('Privacy level set to "%s"'),
-        l10n(sprintf('Level %d', $_POST['level']))
-        ));
+      $page['infos'][] = l10n('Privacy level set to "%s"', l10n(sprintf('Level %d', $_POST['level'])));
     }
 
@@ -169,9 +165,5 @@
     $category_name = get_cat_display_name_from_id($category_id, 'admin.php?page=album-');
     
-    array_push($page['infos'], sprintf(
-      l10n('Album "%s" now contains %d photos'),
-      '<em>'.$category_name.'</em>',
-      $count
-      ));
+    $page['infos'][] = l10n('Album "%s" now contains %d photos', '<em>'.$category_name.'</em>', $count);
     
     $page['batch_link'] = PHOTOS_ADD_BASE_URL.'&batch='.implode(',', $image_ids);
@@ -189,5 +181,5 @@
 $upload_mode = isset($conf['url_uploader_mode']) ? $conf['url_uploader_mode'] : 'single';
 
-if ( isset($_GET['upload_mode']) and $_GET['upload_mode']!=$upload_mode and in_array($_GET['upload_mode'], $upload_modes) )
+if (isset($_GET['upload_mode']) and $_GET['upload_mode']!=$upload_mode and in_array($_GET['upload_mode'], $upload_modes))
 {
   $upload_mode = $_GET['upload_mode'];
@@ -218,4 +210,2 @@
 // send page content
 $template->assign_var_from_handle('ADMIN_CONTENT', 'urluploader_content');
-
-?>
Index: /extensions/url_uploader/include/functions.inc.php
===================================================================
--- /extensions/url_uploader/include/functions.inc.php	(revision 26386)
+++ /extensions/url_uploader/include/functions.inc.php	(revision 26387)
@@ -13,5 +13,5 @@
       array_slice($sheets, 0, 1) +
       array('url_uploader' => array(
-        'caption' => l10n('URL Uploader'),
+        'caption' => '<span class="icon-link"></span>' . l10n('URL Uploader'),
         'url' => URLUPLOADER_ADMIN,
         )) +
@@ -51,4 +51,2 @@
   return $default;
 }
-
-?>
Index: /extensions/url_uploader/include/ws_functions.inc.php
===================================================================
--- /extensions/url_uploader/include/ws_functions.inc.php	(revision 26386)
+++ /extensions/url_uploader/include/ws_functions.inc.php	(revision 26387)
@@ -20,5 +20,7 @@
       'url_in_comment' => array('default' => true),
       ),
-    'Add image from remote URL.'
+    'Add image from remote URL.',
+    null,
+    array('admin_only'=>true)
     );
 }
@@ -33,4 +35,6 @@
   }
   
+  load_language('plugin.lang', URLUPLOADER_PATH);
+  
   $params = array_map('trim', $params);
   
@@ -41,15 +45,15 @@
   if (empty($params['file_url']))
   {
-    return new PwgError(WS_ERR_INVALID_PARAM, 'File URL is empty');
+    return new PwgError(WS_ERR_INVALID_PARAM, l10n('File URL is empty'));
   }
   // check remote url
   if (!url_is_remote($params['file_url']))
   {
-    return new PwgError(WS_ERR_INVALID_PARAM, 'Invalid file URL');
+    return new PwgError(WS_ERR_INVALID_PARAM, l10n('Invalid file URL'));
   }
   // check file extension
   if (!in_array(strtolower(get_extension($params['file_url'])), $allowed_extensions))
   {
-    return new PwgError(WS_ERR_INVALID_PARAM, 'Invalid file type');
+    return new PwgError(WS_ERR_INVALID_PARAM, l10n('Invalid file type'));
   }
 
@@ -66,5 +70,5 @@
   {
     @unlink($temp_filename);
-    return new PwgError(WS_ERR_INVALID_PARAM, 'Unable to download file');
+    return new PwgError(WS_ERR_INVALID_PARAM, l10n('Unable to download file'));
   }
   // check mime-type
@@ -72,5 +76,5 @@
   {
     @unlink($temp_filename);
-    return new PwgError(WS_ERR_INVALID_PARAM, 'Invalid file type');
+    return new PwgError(WS_ERR_INVALID_PARAM, l10n('Invalid file type'));
   }
 
@@ -131,4 +135,2 @@
     );
 }
-
-?>
Index: /extensions/url_uploader/main.inc.php
===================================================================
--- /extensions/url_uploader/main.inc.php	(revision 26386)
+++ /extensions/url_uploader/main.inc.php	(revision 26387)
@@ -12,26 +12,17 @@
 
 
-// +-----------------------------------------------------------------------+
-// | Define plugin constants                                               |
-// +-----------------------------------------------------------------------+
-defined('URLUPLOADER_ID') or define('URLUPLOADER_ID', basename(dirname(__FILE__)));
+define('URLUPLOADER_ID',      basename(dirname(__FILE__)));
 define('URLUPLOADER_PATH' ,   PHPWG_PLUGINS_PATH . URLUPLOADER_ID . '/');
 define('URLUPLOADER_ADMIN',   get_root_url() . 'admin.php?page=plugin-' . URLUPLOADER_ID);
 
 
-// +-----------------------------------------------------------------------+
-// | Add event handlers                                                    |
-// +-----------------------------------------------------------------------+
 if (defined('IN_ADMIN'))
 {
-  // new tab on photo page
   add_event_handler('tabsheet_before_select', 'urluploader_tabsheet_before_select', EVENT_HANDLER_PRIORITY_NEUTRAL, 2);
 }
 
-// add API function
 add_event_handler('ws_add_methods', 'urluploader_ws_add_methods');
+
 
 include_once(URLUPLOADER_PATH . 'include/functions.inc.php');
 include_once(URLUPLOADER_PATH . 'include/ws_functions.inc.php');
-
-?>
Index: /extensions/url_uploader/maintain.inc.php
===================================================================
--- /extensions/url_uploader/maintain.inc.php	(revision 26386)
+++ /extensions/url_uploader/maintain.inc.php	(revision 26387)
@@ -4,6 +4,4 @@
 function plugin_uninstall() 
 {
-  pwg_query('DELETE FROM `'. CONFIG_TABLE .'` WHERE param = "url_uploader_mode" LIMIT 1;');
+  conf_delete_param('url_uploader_mode');
 }
-
-?>
Index: /extensions/url_uploader/template/photos_add.tpl
===================================================================
--- /extensions/url_uploader/template/photos_add.tpl	(revision 26386)
+++ /extensions/url_uploader/template/photos_add.tpl	(revision 26387)
@@ -1,6 +1,6 @@
-{combine_css path=$URLUPLOADER_PATH|@cat:"template/style.css"}
-{combine_script id="URI" load="footer" path=$URLUPLOADER_PATH|@cat:"template/URI.min.js"}
-{combine_css path=$URLUPLOADER_PATH|@cat:"template/jquery.textarea-lines-numbers.css"}
-{combine_script id="createTextareaWithLines" load="footer" require="jquery.ui.resizable" path=$URLUPLOADER_PATH|@cat:"template/jquery.textarea-lines-numbers.js"}
+{combine_css path=$URLUPLOADER_PATH|cat:'template/style.css'}
+{combine_script id='URI' load='footer' path=$URLUPLOADER_PATH|cat:'template/URI.min.js'}
+{combine_css path=$URLUPLOADER_PATH|cat:'template/jquery.textarea-lines-numbers.css'}
+{combine_script id='createTextareaWithLines' load='footer' require='jquery.ui.resizable' path=$URLUPLOADER_PATH|cat:'template/jquery.textarea-lines-numbers.js'}
 
 {if $upload_mode == 'multiple'}
@@ -8,5 +8,5 @@
 {combine_script id='jquery.jgrowl' load='footer' require='jquery' path='themes/default/js/plugins/jquery.jgrowl_minimized.js' }
 {combine_script id='jquery.ui.progressbar' load='footer'}
-{combine_css path="admin/themes/default/uploadify.jGrowl.css"}
+{combine_css path='themes/default/js/plugins/jquery.jgrowl.css'}
 {/if}
 
@@ -16,285 +16,277 @@
 
 {footer_script}
-var allowed_extensions = new Array('jpeg','jpg','png','gif');
-var errorHead   = '{'ERROR'|@translate|@escape:'javascript'}';
-var errorMsg    = '{'an error happened'|@translate|@escape:'javascript'}';
-
-var lang = new Array();
-lang['Invalid file URL'] = '{'Invalid file URL'|@translate|@escape:'javascript'}';
-lang['Invalid file type'] = '{'Invalid file type'|@translate|@escape:'javascript'}';
-lang['File URL is empty'] = '{'File URL is empty'|@translate|@escape:'javascript'}';
-lang['Unable to download file'] = '{'Unable to download file'|@translate|@escape:'javascript'}';
-lang['Pending'] = '{'Pending'|@translate|@escape:'javascript'}';
-lang['Delete this item'] = '{'Delete this item'|@translate|@escape:'javascript'}';
-
-{literal}
-jQuery("#hideErrors").click(function() {
-    jQuery("#formErrors").hide();
+(function($){
+  var allowed_extensions = new Array('jpeg','jpg','png','gif');
+
+  $('#hideErrors').click(function() {
+    $('#formErrors').hide();
     return false;
   });
   
-jQuery("#uploadWarningsSummary a.showInfo").click(function() {
-    jQuery("#uploadWarningsSummary").hide();
-    jQuery("#uploadWarnings").show();
+  $('#uploadWarningsSummary a.showInfo').click(function() {
+    $('#uploadWarningsSummary').hide();
+    $('#uploadWarnings').show();
     return false;
   });
   
-jQuery("#showPermissions").click(function() {
-    jQuery(this).parent(".showFieldset").hide();
-    jQuery("#permissions").show();
+  $('#showPermissions').click(function() {
+    $(this).parent('.showFieldset').hide();
+    $('#permissions').show();
     return false;
   });
-{/literal}
-
-
-{* <!-- MULTIPLE UPLOAD --> *}
-{if $upload_mode == 'multiple'}
-{literal}
-function checkUploadStart() {
-  var nbErrors = 0;
-  
-  jQuery("#formErrors").hide();
-  jQuery("#formErrors li").hide();
-
-  if (jQuery("#albumSelect option:selected").length == 0) {
-    jQuery("#formErrors #noAlbum").show();
-    nbErrors++;
+
+  {* <!-- MULTIPLE UPLOAD --> *}
+  {if $upload_mode == 'multiple'}
+  function checkUploadStart() {
+    var nbErrors = 0;
+    
+    $('#formErrors').hide();
+    $('#formErrors li').hide();
+
+    if ($('#albumSelect option:selected').length == 0) {
+      $('#formErrors #noAlbum').show();
+      nbErrors++;
+    }
+    
+    var nbFiles = $('table#links tr.pending').length;
+    
+    if (nbFiles == 0) {
+      $('#formErrors #noPhoto').show();
+      nbErrors++;
+    }
+
+    if (nbErrors != 0) {
+      $('#formErrors').show();
+      return false;
+    }
+    else {
+      return true;
+    }
   }
-  
-  var nbFiles = jQuery("table#links tr.pending").length;
-  
-  if (nbFiles == 0) {
-    jQuery("#formErrors #noPhoto").show();
-    nbErrors++;
+
+  function trim (str) {
+    return str.replace(/^\s+/g,'').replace(/\s+$/g,'')
   }
 
-  if (nbErrors != 0) {
-    jQuery("#formErrors").show();
+  $('input[name=add_links]').click(function() {
+    $input = $('textarea#urls');
+    
+    if ($input.val() != '') {
+      $('table#links').show();
+      
+      var lines = $input.val().split('\n');
+      var html = '';
+      $input.val('');
+      
+      for (i in lines) {
+        line = lines[i].split('|');
+        item = {};
+        
+        // no name given
+        if (line.length == 1) {
+          uri = new URI(trim(line[0]));
+          item.name = '';
+        }
+        // name given
+        else {
+          uri = new URI(trim(line[1]));
+          item.name = trim(line[0]);
+        }
+        
+        uri.fragment('');
+        item.url = uri.href();
+        item.short_url = item.url;
+        
+        // shortened url for display
+        if (item.url.length > 40) {
+          item.short_url = item.url.substring(0, 15) + ' ... ' + item.url.substring(item.url.length-15);
+        }
+        
+        // check if consistent url
+        if (uri.is('relative')) {
+          item.status = 'error';
+          item.info = '{'Invalid file URL'|translate|escape:javascript}';
+        }
+        else {
+          // check if good extension
+          if (allowed_extensions.indexOf(uri.suffix().toLowerCase()) == -1) {
+            item.status = 'error';
+            item.info = '{'Invalid file type'|translate|escape:javascript}';
+          }
+          else {
+            item.status = 'pending';
+            item.info = '{'Pending'|translate|escape:javascript}';
+          }
+        }
+        
+        // add link to table
+        html+= '<tr class="'+ item.status + '" data-name="'+ item.name +'" data-url="'+ item.url +'">'+
+          '<td>'+ item.name +'</td>'+
+          '<td><a href="'+ item.url +'">'+ item.short_url +'</a></td>'+
+          '<td>'+ item.info +'</td>'+
+          '<td><a class="delete" title="{'Delete this item'|translate|escape:javascript}">&nbsp;</a></td>'+
+        '</tr>';
+      }
+      
+      $('table#links tbody').append(html);
+    }
+    
+    $input.focus();
     return false;
+  });
+
+  $('table#links').on('click', 'a.delete', function() {
+    $(this).parents('tr').remove();
+    $('textarea#urls').focus();
+  });
+
+  // AJAX MANAGER
+  var import_done = 0;
+  var import_selected = 0;
+  var queuedManager = $.manageAjax.create('queued', {
+    queue: true,  
+    maxRequests: 1
+  });
+
+  function performImport(file_url, category, name, level, url_in_comment, $target) {
+    queuedManager.add({
+      type: 'GET',
+      dataType: 'json',
+      url: 'ws.php',
+      data: {
+        method: 'pwg.images.addRemote',
+        file_url: file_url,
+        category: category,
+        name: name,
+        level: level,
+        url_in_comment: url_in_comment,
+        format: 'json'
+      },
+      success: function(data) {
+        if (data['stat'] == 'ok') {
+          $target.remove();
+          $('#uploadedPhotos').parent('fieldset').show();
+          $('#uploadedPhotos').prepend('<img src="'+ data['result']['thumbnail_url'] +'" class="thumbnail"> ');
+          $('#uploadForm').append('<input type="hidden" name="imageIds[]" value="'+ data['result']['image_id'] +'">');
+        }
+        else {
+          $.jGrowl(name +' : '+ data['message'], { 
+            theme: 'error', sticky: true, 
+            header: '{'ERROR'|translate}'
+          });
+            
+          $target.children('td:nth-child(3)').html(lang[data['message']]);
+          $('#uploadForm').append('<input type="hidden" name="onUploadError[]" value="'+ file_url +' : '+ data['message'] +'">');
+        }
+        
+        import_done++;
+        $('#progressbar').progressbar({ value: import_done });
+        $('#progressCurrent').text(import_done);
+        
+        if (import_done == import_selected) {
+          $('#uploadForm').submit();
+        }
+      },
+      error: function(data) {
+        $.jGrowl(name +' : '+ '{'an error happened'|translate|escape:javascript}', { 
+          theme: 'error', sticky: true, 
+          header: '{'ERROR'|translate}'
+        });
+        
+        $target.children('td:nth-child(3)').html('{'an error happened'|translate|escape:javascript}');
+      }
+    });
   }
-  else {
-    return true;
-  }
-}
-
-function trim (myString) {
-  return myString.replace(/^\s+/g,'').replace(/\s+$/g,'')
-}
-
-jQuery("input[name='add_links']").click(function() {
-  $input = jQuery("textarea#urls");
-  
-  if ($input.val() != "") {
-    jQuery("table#links").show();
-    
-    lines = $input.val().split('\n');
-    $input.val("");
-    
-    for (i in lines) {
-      line = lines[i].split('|');
-      item = new Array;
-      
-      // no name given
-      if (line.length == 1) {
-        uri = new URI(trim(line[0]));
-        item['name'] = "";
-      }
-      // name given
-      else {
-        uri = new URI(trim(line[1]));
-        item['name']= trim(line[0]);
-      }
-      
-      uri.fragment("");
-      item['url'] = uri.href();
-      item['short_url'] = item['url'];
-      
-      // shortened url for display
-      if (item['url'].length > 40) {
-        item['short_url'] = item['url'].substring(0, 17) + ' ... ' + item['url'].substring(item['url'].length-17);
-      }
-      
-      // check if consistent url
-      if (uri.is("relative")) {
-        item['status'] = 'error';
-        item['info'] = lang['Invalid file URL'];
-      }
-      else {
-        // check if good extension
-        if (allowed_extensions.indexOf(uri.suffix().toLowerCase()) == -1) {
-          item['status'] = 'error';
-          item['info'] = lang['Invalid file type'];
-        }
-        else {
-          item['status'] = 'pending';
-          item['info'] = lang['Pending'];
-        }
-      }
-      
-      // add link to table
-      jQuery("table#links tbody").append('<tr class="'+ item['status'] + '" data-name="'+ item['name'] +'" data-url="'+ item['url'] +'">'+
-        '<td>'+ item['name'] +'</td>'+
-        '<td><a href="'+ item['url'] +'">'+ item['short_url'] +'</a></td>'+
-        '<td>'+ item['info'] +'</td>'+
-        '<td><a class="delete" title="'+ lang['Delete this item'] +'">&nbsp;</a></td>'+
-      '</tr>');
-    }
-  }
-  
-  $input.focus();
-  return false;
-});
-
-jQuery("table#links").on("click", "a.delete", function() {
-  $(this).parents("tr").remove();
-  jQuery("textarea#urls").focus();
-});
-
-/* <!-- AJAX MANAGER --> */
-var import_done = 0;
-var import_selected = 0;
-var queuedManager = jQuery.manageAjax.create('queued', {
-  queue: true,  
-  maxRequests: 1
-});
-
-function performImport(file_url, category, name, level, url_in_comment, $target) {
-  queuedManager.add({
-    type: 'GET',
-    dataType: 'json',
-    url: 'ws.php',
-    data: { method: 'pwg.images.addRemote', file_url: file_url, category: category, name: name, level: level, url_in_comment: url_in_comment, format: 'json' },
-    success: function(data) {
-      if (data['stat'] == 'ok') {
-        $target.remove();
-        jQuery("#uploadedPhotos").parent("fieldset").show();
-        jQuery("#uploadedPhotos").prepend('<img src="'+ data['result']['thumbnail_url'] +'" class="thumbnail"> ');
-        jQuery("#uploadForm").append('<input type="hidden" name="imageIds[]" value="'+ data['result']['image_id'] +'">');
-      }
-      else {
-        jQuery.jGrowl(name +' : '+ lang[data['message']], { 
-          theme: 'error', 
-          header: errorHead, 
-          sticky: true 
-          });
-          
-        $target.children("td:nth-child(3)").html(lang[data['message']]);
-        jQuery("#uploadForm").append('<input type="hidden" name="onUploadError[]" value="'+ file_url +' : '+ lang[data['message']] +'">');
-      }
-      
-      import_done++;
-      jQuery("#progressbar").progressbar({value: import_done});
-      jQuery("#progressCurrent").text(import_done);
-      
-      if (import_done == import_selected) {
-        $("#uploadForm").submit();
-      }
-    },
-    error: function(data) {
-      jQuery.jGrowl(name +' : '+ errorMsg, { 
-        theme: 'error', 
-        header: errorHead, 
-        sticky: true 
-        });
-      
-      $target.children("td:nth-child(3)").html(errorMsg);
-    }
-  });
-}
-
-jQuery("input[name='submit_upload']").click(function() {
-  if (!checkUploadStart()) {
+
+  $('input[name=submit_upload]').click(function() {
+    if (!checkUploadStart()) {
+      return false;
+    }
+    
+    import_selected = $('table#links tr.pending').length;
+    
+    $('table#links a.delete').hide();
+    
+    $('#progressbar').progressbar({ max: import_selected, value:0 });
+    $('#progressMax').text(import_selected);
+    $('#progressCurrent').text(0);
+    $('#uploadProgress').show();
+    
+    $('table#links tr.pending').each(function() {
+      performImport(
+        $(this).data('url'),
+        $('select[name=category] option:selected').val(),
+        $(this).data('name'),
+        $('select[name=level] option:selected').val(),
+        $('input[name=url_in_comment]').is(':checked'),
+        $(this)
+        );
+    });
+      
     return false;
-  }
-  
-  import_selected = jQuery("table#links tr.pending").length;
-  
-  jQuery("table#links a.delete").hide();
-  
-  jQuery("#progressbar").progressbar({max: import_selected, value:0});
-  jQuery("#progressMax").text(import_selected);
-  jQuery("#progressCurrent").text(0);
-  jQuery("#uploadProgress").show();
-  
-  jQuery("table#links tr.pending").each(function() {
-    performImport(
-      $(this).data('url'),
-      $("select[name=category] option:selected").val(),
-      $(this).data('name'),
-      $("select[name=level] option:selected").val(),
-      $("input[name=url_in_comment]").is(":checked"),
-      $(this)
-      );
-  });
-    
-  return false;
-});
-
-$("textarea#urls").textareaLinesNumbers({
-  lines:999,
-  trailing:'.'
-});
-{/literal}
+  });
+
+  $('textarea#urls').textareaLinesNumbers({
+    lines:999,
+    trailing:'.'
+  });
 
 
 {* <!-- SINGLE UPLOAD --> *}
 {else}
-{literal}
-function checkUploadStart() {
-  var nbErrors = 0;
-  
-  jQuery("#formErrors").hide();
-  jQuery("#formErrors li").hide();
-
-  if (jQuery("#albumSelect option:selected").length == 0) {
-    jQuery("#formErrors #noAlbum").show();
-    nbErrors++;
+  function checkUploadStart() {
+    var nbErrors = 0;
+    
+    $('#formErrors').hide();
+    $('#formErrors li').hide();
+
+    if ($('#albumSelect option:selected').length == 0) {
+      $('#formErrors #noAlbum').show();
+      nbErrors++;
+    }
+    
+    if ($('input[name=file_url]').val() == '') {
+      $('#formErrors #urlEmpty').show();
+      nbErrors++;
+    }
+    else {
+      uri = new URI($('input[name=file_url]').val());
+      if (uri.is('relative')) {
+        $('#formErrors #urlError').show();
+        nbErrors++;
+      }
+      else if (allowed_extensions.indexOf(uri.suffix().toLowerCase()) == -1) {
+        $('#formErrors #typeError').show();
+        nbErrors++;
+      }
+    }
+
+    if (nbErrors != 0) {
+      $('#formErrors').show();
+      return false;
+    }
+    else {
+      return true;
+    }
   }
-  
-  if (jQuery("input[name='file_url']").val() == "") {
-    jQuery("#formErrors #urlEmpty").show();
-    nbErrors++;
-  }
-  else {
-    uri = new URI(jQuery("input[name='file_url']").val());
-    if (uri.is('relative')) {
-      jQuery("#formErrors #urlError").show();
-      nbErrors++;
-    }
-    else if (allowed_extensions.indexOf(uri.suffix().toLowerCase()) == -1) {
-      jQuery("#formErrors #typeError").show();
-      nbErrors++;
-    }
-  }
-
-  if (nbErrors != 0) {
-    jQuery("#formErrors").show();
-    return false;
-  }
-  else {
-    return true;
-  }
-}
-
-jQuery("input[name='submit_upload']").click(function() {
-  return checkUploadStart();
-});
-{/literal}
+
+  $('input[name=submit_upload]').click(function() {
+    return checkUploadStart();
+  });
 {/if}
 
+}(jQuery));
 {/footer_script}
 
 
-{html_head}{literal}
-<style type="text/css">
+{html_style}
 a.delete {
   background:url('admin/include/uploadify/cancel.png');
 }
-</style>
-{/literal}{/html_head}
+{/html_style}
 
 
 <div class="titrePage">
-  <h2>{'Upload Photos'|@translate} {$TABSHEET_TITLE}</h2>
+  <h2>{'Upload Photos'|translate} {$TABSHEET_TITLE}</h2>
 </div>
 
@@ -302,53 +294,55 @@
 
 {if count($setup_errors) > 0}
-<div class="errors">
-  <ul>
-  {foreach from=$setup_errors item=error}
-    <li>{$error}</li>
-  {/foreach}
-  </ul>
-</div>
+  <div class="errors">
+    <ul>
+    {foreach from=$setup_errors item=error}
+      <li>{$error}</li>
+    {/foreach}
+    </ul>
+  </div>
 {else}
 
-  {if count($setup_warnings) > 0}
-<div class="warnings">
-  <ul>
-    {foreach from=$setup_warnings item=warning}
-    <li>{$warning}</li>
-    {/foreach}
-  </ul>
-  <div class="hideButton" style="text-align:center"><a href="{$hide_warnings_link}">{'Hide'|@translate}</a></div>
-</div>
-  {/if}
+{if count($setup_warnings) > 0}
+  <div class="warnings">
+    <ul>
+      {foreach from=$setup_warnings item=warning}
+      <li>{$warning}</li>
+      {/foreach}
+    </ul>
+    <div class="hideButton" style="text-align:center"><a href="{$hide_warnings_link}">{'Hide'|translate}</a></div>
+  </div>
+{/if}
   
 {if !empty($thumbnails)}
-<fieldset>
-  <legend>{'Uploaded Photos'|@translate}</legend>
-  <div>
-  {foreach from=$thumbnails item=thumbnail}
-    <a href="{$thumbnail.link}" class="externalLink">
-      <img src="{$thumbnail.src}" alt="{$thumbnail.file}" title="{$thumbnail.title}" class="thumbnail">
-    </a>
-  {/foreach}
+  <fieldset>
+    <legend>{'Uploaded Photos'|translate}</legend>
+    <div>
+    {foreach from=$thumbnails item=thumbnail}
+      <a href="{$thumbnail.link}" class="externalLink">
+        <img src="{$thumbnail.src}" alt="{$thumbnail.file}" title="{$thumbnail.title}" class="thumbnail">
+      </a>
+    {/foreach}
+    </div>
+    
+    <p id="batchLink"><a href="{$batch_link}">{$batch_label}</a></p>
+  </fieldset>
+  
+  <p style="margin:10px"><a href="{$another_upload_link}">{'Add another set of photos'|translate}</a></p>
+  
+{else}
+  <div id="formErrors" class="errors" style="display:none">
+    <ul>
+      <li id="noAlbum">{'Select an album'|translate}</li>
+      <li id="noPhoto">{'Select at least one photo'|translate}</li>
+      <li id="urlEmpty">{'File URL is empty'|translate}</li>
+      <li id="urlError">{'Invalid file URL'|translate}</li>
+      <li id="typeError">{'Invalid file type'|translate}</li>
+    </ul>
+    <div class="hideButton" style="text-align:center"><a href="#" id="hideErrors">{'Hide'|translate}</a></div>
   </div>
-  <p id="batchLink"><a href="{$batch_link}">{$batch_label}</a></p>
-</fieldset>
-<p style="margin:10px"><a href="{$another_upload_link}">{'Add another set of photos'|@translate}</a></p>
-{else}
-
-<div id="formErrors" class="errors" style="display:none">
-  <ul>
-    <li id="noAlbum">{'Select an album'|@translate}</li>
-    <li id="noPhoto">{'Select at least one photo'|@translate}</li>
-    <li id="urlEmpty">{'File URL is empty'|@translate}</li>
-    <li id="urlError">{'Invalid file URL'|@translate}</li>
-    <li id="typeError">{'Invalid file type'|@translate}</li>
-  </ul>
-  <div class="hideButton" style="text-align:center"><a href="#" id="hideErrors">{'Hide'|@translate}</a></div>
-</div>
-
-<form id="uploadForm" enctype="multipart/form-data" method="post" action="{$form_action}" class="properties">
+
+  <form id="uploadForm" enctype="multipart/form-data" method="post" action="{$form_action}" class="properties">
     <fieldset>
-      <legend>{'Drop into album'|@translate}</legend>
+      <legend>{'Drop into album'|translate}</legend>
 
       <span id="albumSelection"{if count($category_options) == 0} style="display:none"{/if}>
@@ -356,32 +350,32 @@
         {html_options options=$category_options selected=$category_options_selected}
       </select>
-      <br>{'... or '|@translate}</span><a href="#" class="addAlbumOpen" title="{'create a new album'|@translate}">{'create a new album'|@translate}</a>
+      <br>{'... or '|translate}</span><a href="#" class="addAlbumOpen" title="{'create a new album'|translate}">{'create a new album'|translate}</a>
       
     </fieldset>
 
     <fieldset>
-      <legend>{'Select files'|@translate}</legend>
+      <legend>{'Select files'|translate}</legend>
       
       <p id="uploadWarningsSummary">
-        {'Allowed file types: %s.'|@translate|@sprintf:$upload_file_types}
+        {'Allowed file types: %s.'|translate:$upload_file_types}
       {if isset($max_upload_resolution)}
         {$max_upload_resolution}Mpx
-        <a class="showInfo" title="{'Learn more'|@translate}">i</a>
+        <a class="showInfo" title="{'Learn more'|translate}">i</a>
       {/if}
       </p>
 
       <p id="uploadWarnings">
-        {'Allowed file types: %s.'|@translate|@sprintf:$upload_file_types}
+        {'Allowed file types: %s.'|translate:$upload_file_types}
       {if isset($max_upload_resolution)}
-        {'Approximate maximum resolution: %dM pixels (that\'s %dx%d pixels).'|@translate|@sprintf:$max_upload_resolution:$max_upload_width:$max_upload_height}
+        {'Approximate maximum resolution: %dM pixels (that\'s %dx%d pixels).'|translate:$max_upload_resolution:$max_upload_width:$max_upload_height}
       {/if}
       </p>
 
 {* <!-- SINGLE UPLOAD --> *}
-{if $upload_mode == 'single'}
+    {if $upload_mode == 'single'}
       <ul>
         <li>
           <label>
-            <span class="property">{'File URL'|@translate}</span>
+            <span class="property">{'File URL'|translate}</span>
             <input type="text" name="file_url" size="70">
           </label>
@@ -389,5 +383,5 @@
         <li>
           <label>
-            <span class="property">{'Photo name'|@translate}</span>
+            <span class="property">{'Photo name'|translate}</span>
             <input type="text" name="photo_name" size="40">
           </label>
@@ -396,20 +390,19 @@
           <label>
             <span class="property"><input type="checkbox" name="url_in_comment" checked="checked"></span>
-            {'Add website URL in photo description'|@translate}
+            {'Add website URL in photo description'|translate}
           </label>
         </li>
       </ul>      
       
-      <p id="uploadModeInfos">{'Want to upload many files? Try the <a href="%s">multiple uploader</a> instead.'|@translate|@sprintf:$switch_url}</p>
+      <p id="uploadModeInfos">{'Want to upload many files? Try the <a href="%s">multiple uploader</a> instead.'|translate:$switch_url}</p>
 
 {* <!-- MULTIPLE UPLOAD --> *}
-{else}
-
+    {else}
       <table id="links" class="table2" style="display:none;">
         <thead>
           <tr class="throw">
-            <th style="width:150px;">{'Photo name'|@translate}</th>
-            <th>{'File URL'|@translate}</th>
-            <th style="width:150px;">{'Status'|@translate}</th>
+            <th style="width:150px;">{'Photo name'|translate}</th>
+            <th>{'File URL'|translate}</th>
+            <th style="width:150px;">{'Status'|translate}</th>
             <th style="width:20px;"></th>
           </tr>
@@ -417,29 +410,29 @@
         <tbody>
         </tbody>
-        <tfoot>
-          <tr><th colspan="4">
-          <label>
-            <input type="checkbox" name="url_in_comment" checked="checked">
-            {'Add website URL in photo description'|@translate}
-          </label>
-          </th></tr>
-        </tfoot>
       </table>
       
       <p>
-        {'One link by line, separate photo name and url with a &laquo; | &raquo;. Photo name is optional.'|@translate}
+        {'One link by line, separate photo name and url with a &laquo; | &raquo;. Photo name is optional.'|translate}
         <br>
         <textarea id="urls"></textarea>
       </p>
-      <input type="submit" name="add_links" value="{'Add links'|@translate}">
-      
-      <p id="uploadModeInfos">{'Multiple uploader doesn\'t work? Try the <a href="%s">single uploader</a> instead.'|@translate|@sprintf:$switch_url}</p>
-{/if}
+      
+      <p>
+        <label>
+          <input type="checkbox" name="url_in_comment" checked="checked">
+          {'Add website URL in photo description'|translate}
+        </label>
+      </p>
+      
+      <input type="submit" name="add_links" value="{'Add links'|translate}">
+      
+      <p id="uploadModeInfos">{'Multiple uploader doesn\'t work? Try the <a href="%s">single uploader</a> instead.'|translate:$switch_url}</p>
+    {/if}
     </fieldset>
 
-    <p class="showFieldset"><a id="showPermissions" href="#">{'Manage Permissions'|@translate}</a></p>
+    <p class="showFieldset"><a id="showPermissions" href="#">{'Manage Permissions'|translate}</a></p>
 
     <fieldset id="permissions" style="display:none">
-      <legend>{'Who can see these photos?'|@translate}</legend>
+      <legend>{'Who can see these photos?'|translate}</legend>
 
       <select name="level" size="1">
@@ -449,18 +442,18 @@
     
     <p>
-      <input class="submit" type="submit" name="submit_upload" value="{'Start Upload'|@translate}">
+      <input class="submit" type="submit" name="submit_upload" value="{'Start Upload'|translate}">
     </p>
-</form>
-
-<div id="uploadProgress" style="display:none">
-{'Photo %s of %s'|@translate|@sprintf:'<span id="progressCurrent">1</span>':'<span id="progressMax">10</span>'}
-<br>
-<div id="progressbar"></div>
-</div>
-
-<fieldset style="display:none">
-  <legend>{'Uploaded Photos'|@translate}</legend>
-  <div id="uploadedPhotos"></div>
-</fieldset>
+  </form>
+
+  <div id="uploadProgress" style="display:none">
+    {'Photo %s of %s'|translate:'<span id="progressCurrent">1</span>':'<span id="progressMax">10</span>'}
+    <br>
+    <div id="progressbar"></div>
+  </div>
+
+  <fieldset style="display:none">
+    <legend>{'Uploaded Photos'|translate}</legend>
+    <div id="uploadedPhotos"></div>
+  </fieldset>
 
 {/if} {* empty($thumbnails) *}
