Index: /extensions/user_tags/CHANGELOG
===================================================================
--- /extensions/user_tags/CHANGELOG	(revision 11740)
+++ /extensions/user_tags/CHANGELOG	(revision 11741)
@@ -1,2 +1,6 @@
+User Tags 0.6.0 - 2011-07-14
+================================
+* Make plugin works as expected using webservice.
+
 User Tags 0.5.2 - 2011-05-29
 ================================
Index: /extensions/user_tags/MANIFEST
===================================================================
--- /extensions/user_tags/MANIFEST	(revision 11740)
+++ /extensions/user_tags/MANIFEST	(revision 11741)
@@ -1,7 +1,8 @@
 user_tags/js/jquery.addtags.js
 user_tags/BUGS
-user_tags/include/t4u_admin_action.inc.php
+user_tags/include/t4u_ws.class.php
 user_tags/include/t4u_config.class.php
 user_tags/include/t4u_content.class.php
+user_tags/include/autoload.inc.php
 user_tags/include/constants.inc.php
 user_tags/include/default_values.inc.php
Index: /extensions/user_tags/admin.php
===================================================================
--- /extensions/user_tags/admin.php	(revision 11740)
+++ /extensions/user_tags/admin.php	(revision 11741)
@@ -26,10 +26,6 @@
 load_language('plugin.lang', T4U_PLUGIN_LANG);
 
-$me = get_plugin_data($plugin_id);
+$me = t4u_Config::getInstance();
 $save_config = false;
-
-if (!empty($_GET['action']) && in_array($_GET['action'], array('add', 'get'))) {
-  include_once T4U_PLUGIN_ROOT . "/include/t4u_admin_action.inc.php";
-}
 
 $status_options[null] = '----------';
Index: /extensions/user_tags/css/style.css
===================================================================
--- /extensions/user_tags/css/style.css	(revision 11740)
+++ /extensions/user_tags/css/style.css	(revision 11741)
@@ -1,6 +1,6 @@
-#flash-messages{position:fixed;width:60%;display:none;top:50%;left:200px;font-size:.85em;}
-#flash-messages div{margin-left:120px;min-height:30px;padding:10px;font-weight:bold;}
-#flash-messages div.errors{color:red;background-color:#ffe1e1;border:1px solid red;}
-#flash-messages div.infos{color:green;background-color:#98fb98;}
+.flash-messages{position:fixed;width:60%;display:none;top:50%;left:200px;font-size:.85em;}
+.flash-messages div{margin-left:120px;min-height:30px;padding:10px;font-weight:bold;}
+.flash-messages div.errors{color:red;background-color:#ffe1e1;border:1px solid red;}
+.flash-messages div.infos{color:green;background-color:#98fb98;}
 #t4u-update{float:right;}
 #t4u-cancel,#t4u-update{margin-top:5px;}
Index: /extensions/user_tags/include/autoload.inc.php
===================================================================
--- /extensions/user_tags/include/autoload.inc.php	(revision 11741)
+++ /extensions/user_tags/include/autoload.inc.php	(revision 11741)
@@ -0,0 +1,42 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | User Tags  - a plugin for Piwigo                                      |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2010-2011 Nicolas Roudaire        http://www.nikrou.net  |
+// +-----------------------------------------------------------------------+
+// | 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., 51 Franklin Street, Fifth Floor, Boston,            |
+// | MA 02110-1301 USA.                                                    |
+// +-----------------------------------------------------------------------+
+
+global $__t4u_autoload;
+$__t4u_autoload['t4u_Ws'] = T4U_PLUGIN_ROOT . '/include/t4u_ws.class.php';
+$__t4u_autoload['t4u_Config'] = T4U_PLUGIN_ROOT . '/include/t4u_config.class.php';
+$__t4u_autoload['t4u_Content'] = T4U_PLUGIN_ROOT . '/include/t4u_content.class.php';
+
+
+if (function_exists('spl_autoload_register')) {
+  spl_autoload_register('t4u_autoload');
+} else {
+  function __autoload($name) {
+    t4u_autoload($name);
+  }
+}
+
+function t4u_autoload($name) {
+  global $__t4u_autoload;
+
+  if (!empty($__t4u_autoload[$name])) {
+    require_once $__t4u_autoload[$name];
+  }
+}
Index: /extensions/user_tags/include/constants.inc.php
===================================================================
--- /extensions/user_tags/include/constants.inc.php	(revision 11740)
+++ /extensions/user_tags/include/constants.inc.php	(revision 11741)
@@ -26,3 +26,4 @@
 define('T4U_IMGS', PHPWG_PLUGINS_PATH . basename(T4U_PLUGIN_ROOT). '/imgs');
 define('T4U_JS', PHPWG_PLUGINS_PATH . basename(T4U_PLUGIN_ROOT). '/js');
+define('T4U_WS', 'user_tags.tags.');
 ?>
Index: /extensions/user_tags/include/default_values.inc.php
===================================================================
--- /extensions/user_tags/include/default_values.inc.php	(revision 11740)
+++ /extensions/user_tags/include/default_values.inc.php	(revision 11741)
@@ -21,5 +21,4 @@
 
 $default_values = array();
-$default_values['t4u_permission_add'] = null;
-$default_values['t4u_permission_delete'] = null;
+$default_values['t4u_permission_update'] = null;
 ?>
Index: tensions/user_tags/include/t4u_admin_action.inc.php
===================================================================
--- /extensions/user_tags/include/t4u_admin_action.inc.php	(revision 11740)
+++ 	(revision )
@@ -1,96 +1,0 @@
-<?php
-// +-----------------------------------------------------------------------+
-// | User Tags  - a plugin for Piwigo                                      |
-// +-----------------------------------------------------------------------+
-// | Copyright(C) 2010-2011 Nicolas Roudaire        http://www.nikrou.net  |
-// +-----------------------------------------------------------------------+
-// | 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., 51 Franklin Street, Fifth Floor, Boston,            |
-// | MA 02110-1301 USA.                                                    |
-// +-----------------------------------------------------------------------+
-
-if (!defined('PHPWG_ROOT_PATH')) {
-  die('Hacking attempt!');
-}
-
-if (!empty($_GET['action']) && ($_GET['action']=='add') 
-    && isset($_POST['tags']) && $me->getPermission('add')) {
-  include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
-
-  if (empty($_POST['tags'])) {
-    $_POST['tags'] = array();
-  }
-  $tag_ids = __get_tag_ids($_POST['tags']);
-  set_tags($tag_ids, $_POST['image_id']);
-
-  if (isset($_SERVER['HTTP_X_REQUESTED_WITH'])) {
-    header("Content-Type: application/json");
-    $message['info'] = l10n('Tags updated');
-
-    echo json_encode($message);
-    exit();
-  } else {
-    redirect(get_root_url().$_POST['referer']);
-  }
-} elseif (!empty($_GET['action']) && $_GET['action']=='get' && $me->getPermission('add')) {
-  $query = '
-SELECT
-    id AS tag_id,
-    name AS tag_name
-  FROM '.TAGS_TABLE;
-
-  if (!empty($_GET['q'])) {
-    $query .= ' WHERE url_name like \'%'.pwg_db_real_escape_string($_GET['q']).'%\';';
-  } else {
-    $query .= ';';
-  }
-  header("Content-Type: application/json");
-  echo json_encode(__get_taglist($query));
-  exit();
-}
-
-/*
- * temporary functions before piwigo 2.3
- * See admin/include/functions.php in piwigo core
- */
-function __get_taglist($query) {
-  $result = pwg_query($query);
-
-  $taglist = array();
-  while ($row = pwg_db_fetch_assoc($result)) {
-    $taglist[] = array('name' => $row['tag_name'],
-		       'id' => '~~'.$row['tag_id'].'~~'
-		       );
-  }
-
-  $cmp = create_function('$a,$b', 'return strcasecmp($a[\'name\'], $b[\'name\']);');
-  usort($taglist, $cmp);
-
-  return $taglist;
-}
-
-function __get_tag_ids($raw_tags) {
-  $tag_ids = array();
-  $raw_tags = explode(',',$raw_tags);
-
-  foreach ($raw_tags as $raw_tag) {
-    if (preg_match('/^~~(\d+)~~$/', $raw_tag, $matches)) {
-      $tag_ids[] = $matches[1];
-    } else {
-      $tag_ids[] = tag_id_from_tag_name($raw_tag);
-    }
-  }
-
-  return $tag_ids;
-}
-?>
Index: /extensions/user_tags/include/t4u_config.class.php
===================================================================
--- /extensions/user_tags/include/t4u_config.class.php	(revision 11740)
+++ /extensions/user_tags/include/t4u_config.class.php	(revision 11741)
@@ -22,7 +22,6 @@
 class t4u_Config
 {
-    private 
-      $config = array(), 
-      $plugin_dir;
+  private $config = array();
+  protected static $instance; 
 
   public function __construct($plugin_dir, $plugin_name) {
@@ -35,7 +34,16 @@
 
     if (!file_exists($this->get_config_filename())) {
+      $this->setDefaults();
       $this->save_config();
     }
   }
+
+  public static function getInstance() { 
+    if (!isset(self::$instance)) { 
+      self::$instance = new t4u_Config(T4U_PLUGIN_ROOT, T4U_PLUGIN_NAME); 
+    } 
+    return self::$instance; 
+  }
+
 
   public function load_config() {
@@ -45,5 +53,4 @@
       $this->config = $c;
     }
-    $this->setDefaults();
   }
 
@@ -100,15 +107,18 @@
   
   public function getActionUrl($action, $method='POST') {
-    $url = get_root_url().'admin.php?page=plugin';
-    $file = basename($this->plugin_dir) . '/' .'admin.php';
-    if (strtoupper($method)=='POST') {
-	$url .= '&amp;section='.urlencode($file);
-	$url .= '&amp;action='.urlencode($action);
-    } else {
-	$url .= '&section='.$file;
-	$url .= '&action='.$action;
-    }
+    $ws = get_root_url();
+    $ws .= 'ws.php?format=json&method=user_tags.tags.list';
 
-    return $url;
+    /* $url = get_root_url().'admin.php?page=plugin'; */
+    /* $file = basename($this->plugin_dir) . '/' .'admin.php'; */
+    /* if (strtoupper($method)=='POST') { */
+    /* 	$url .= '&amp;section='.urlencode($file); */
+    /* 	$url .= '&amp;action='.urlencode($action); */
+    /* } else { */
+    /* 	$url .= '&section='.$file; */
+    /* 	$url .= '&action='.$action; */
+    /* } */
+
+    return $ws;
   }
 
Index: /extensions/user_tags/include/t4u_content.class.php
===================================================================
--- /extensions/user_tags/include/t4u_content.class.php	(revision 11740)
+++ /extensions/user_tags/include/t4u_content.class.php	(revision 11741)
@@ -30,12 +30,16 @@
 
     if (!$this->plugin_config->hasPermission('add')) {
-      return false;
+      return $content;
     }
+
+    load_language('plugin.lang', T4U_PLUGIN_LANG);
 
     $template->assign('T4U_JS', T4U_JS);
     $template->assign('T4U_CSS', T4U_CSS);
     $template->assign('T4U_IMGS', T4U_IMGS);
-    $template->assign('T4U_ADD_SCRIPT', $this->plugin_config->getActionUrl('add', 'GET'));
-    $template->assign('T4U_GET_SCRIPT', $this->plugin_config->getActionUrl('get', 'GET'));
+    $template->assign('T4U_PERMISSION_DELETE', $this->plugin_config->hasPermission('delete'));
+    $template->assign('T4U_UPDATE_SCRIPT', get_root_url().'ws.php?format=json&method='.T4U_WS.'update');
+    $template->assign('T4U_UPDATE_METHOD', T4U_WS.'update');
+    $template->assign('T4U_GET_SCRIPT', get_root_url().'ws.php?format=json&method='.T4U_WS.'list');
     $template->assign('T4U_IMAGE_ID', $picture['id']);
     $template->assign('T4U_REFERER', urlencode($picture['url']));
@@ -51,5 +55,8 @@
 
     $template->set_filename('add_tags', T4U_TEMPLATE.'/add_tags.tpl');
-    $template->assign_var_from_handle('PLUGIN_PICTURE_BEFORE', 'add_tags');
+
+    $plugin_picture_before = $template->get_template_vars('PLUGIN_PICTURE_BEFORE');
+    $plugin_picture_before .= $template->parse('add_tags', true);
+    $template->append('PLUGIN_PICTURE_BEFORE', $plugin_picture_before);
 
     return $content;
Index: /extensions/user_tags/include/t4u_ws.class.php
===================================================================
--- /extensions/user_tags/include/t4u_ws.class.php	(revision 11741)
+++ /extensions/user_tags/include/t4u_ws.class.php	(revision 11741)
@@ -0,0 +1,132 @@
+<?php
+// +-----------------------------------------------------------------------+
+// | User Tags  - a plugin for Piwigo                                      |
+// +-----------------------------------------------------------------------+
+// | Copyright(C) 2010-2011 Nicolas Roudaire        http://www.nikrou.net  |
+// +-----------------------------------------------------------------------+
+// | 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., 51 Franklin Street, Fifth Floor, Boston,            |
+// | MA 02110-1301 USA.                                                    |
+// +-----------------------------------------------------------------------+
+
+include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
+
+class t4u_Ws
+{
+  public function addMethods($arr) {
+    $service = &$arr[0];
+
+    $service->addMethod(T4U_WS.'list', array($this, 'tagsList'), 
+			array(),
+			'retrieves a list of tags than can be filtered'
+			);
+
+    $service->addMethod(T4U_WS.'update', array($this, 'updateTags'), 
+			array('image_id' => array(),
+			      'tags' => array('default' => array())
+			      ),
+			'Updates (add or remove) tags associated to an image (POST method only)'
+			);
+  }
+
+  public function tagsList($params, &$service) {
+    $query = '
+SELECT
+    id AS tag_id,
+    name AS tag_name
+  FROM '.TAGS_TABLE.'
+;';
+    
+    $tagslist = $this->__makeTagsList($query);
+    unset($tagslist['__associative_tags']);
+    $cmp = create_function('$a,$b', 'return strcasecmp($a[\'name\'], $b[\'name\']);');
+    usort($tagslist, $cmp);
+    
+    return $tagslist;
+  }
+
+  public function updateTags($params, &$service) {
+    if (!$service->isPost()) {
+      return new PwgError(405, "This method requires HTTP POST");
+    }
+
+    if (!t4u_Config::getInstance()->hasPermission('add') && !t4u_Config::getInstance()->hasPermission('delete')) { 
+      return array('error' => l10n('You are not allowed to add nor delete tags'));
+    }
+
+    if (empty($params['tags'])) {
+      $params['tags'] = array();
+    }
+    $message = '';
+
+    $query = '
+SELECT
+    tag_id,
+    name AS tag_name
+  FROM '.IMAGE_TAG_TABLE.' AS it
+    JOIN '.TAGS_TABLE.' AS t ON t.id = it.tag_id
+  WHERE image_id = '.(int) $params['image_id'].'
+;';
+    
+    $current_tags = $this->__makeTagsList($query);
+    $current_tags_ids = array_keys($current_tags['__associative_tags']);
+    if (empty($params['tags'])) {
+      $tags_to_associate = array();
+    } else {
+      $tags_to_associate = explode(',', $params['tags']);
+    }
+
+    $removed_tags = array_diff($current_tags_ids, $tags_to_associate);
+    $new_tags = array_diff($tags_to_associate, $current_tags_ids);
+
+    if (count($removed_tags)>0) {
+      if (!t4u_Config::getInstance()->hasPermission('delete')) { 
+	$message['error'][] = l10n('You are not allowed to delete tags');
+      } else {
+	$message['info'] = l10n('Tags updated');
+      }
+    }
+    if (count($new_tags)>0) {
+      if (!t4u_Config::getInstance()->hasPermission('add')) { 
+	$message['error'][] = l10n('You are not allowed to add tags');
+	$tags_to_associate = array_diff($tags_to_associate, $new_tags);
+      } else {
+	$message['info'] = l10n('Tags updated');
+      }
+    } 
+
+    if (!empty($tags_to_associate)) {
+      $tag_ids = get_tag_ids(implode(',', $tags_to_associate));
+      set_tags($tag_ids, $params['image_id']);  
+    }
+    
+    return $message;
+  }
+
+  private function __makeTagsList($query) {
+    $result = pwg_query($query);
+    
+    $tagslist = array();
+    $associative_tags = array();
+    while ($row = pwg_db_fetch_assoc($result)) {
+      $associative_tags['~~'.$row['tag_id'].'~~'] = $row['tag_name'];
+      $tagslist[] = array('id' => '~~'.$row['tag_id'].'~~',
+			  'name' => $row['tag_name']
+			  );
+      
+    }
+    $tagslist['__associative_tags'] = $associative_tags;
+    
+    return $tagslist;
+  }
+}
Index: /extensions/user_tags/init.php
===================================================================
--- /extensions/user_tags/init.php	(revision 11740)
+++ /extensions/user_tags/init.php	(revision 11741)
@@ -27,7 +27,7 @@
 
 include_once T4U_PLUGIN_ROOT . "/include/constants.inc.php";
-include_once T4U_PLUGIN_ROOT . "/include/t4u_config.class.php";
+include_once T4U_PLUGIN_ROOT . "/include/autoload.inc.php";
 
-$plugin_config = new t4u_Config(T4U_PLUGIN_ROOT, T4U_PLUGIN_NAME);
+$plugin_config = t4u_Config::getInstance();
 $plugin_config->load_config();
 
Index: /extensions/user_tags/js/jquery.addtags.js
===================================================================
--- /extensions/user_tags/js/jquery.addtags.js	(revision 11740)
+++ /extensions/user_tags/js/jquery.addtags.js	(revision 11741)
@@ -1,1 +1,1 @@
-eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(6($){7 3s={1U:"5w 5x a 5V 2Z",2v:"5S w",2s:"5Z...",3A:"&60;",41:4D,2H:1,1e:C,1u:C,2i:"4L",3S:"4s",3W:"q",2P:",",2N:J,2R:C,3N:J,4k:1D,16:C,2o:C,2I:C,2Y:J};7 26={3y:"c-B-5b",c:"c-B-c",3i:"c-B-4T-c",3C:"c-B-1n-c",2z:"c-B-3t-c",31:"c-B-4U-c",G:"c-B-G",4i:"c-B-G-E",4m:"c-B-G-4Z",2r:"c-B-3t-G-E",3z:"c-B-B-c"};7 S={2B:0,1S:1,1o:2};7 y={3k:8,3j:9,3m:13,3o:27,5D:32,4W:33,4V:34,1o:35,4X:36,28:37,2c:38,2a:39,2e:40,3n:4P,3p:4O};$.4e.3Y=6(1b,1Q){7 3=$.2G({},3s,1Q||{});r k.Q(6(){1n $.25(k,1b,3)})};$.25=6(B,1b,3){4(3u(1b)==="4R"){3.W=1b;4(3.22===4S){4(3.W.3a("://")===-1){3.22=J}h{3.22=(50.51.1y(/\\/+/g)[1]!==3.W.1y(/\\/+/g)[1])}}}h 4(3u(1b)==="5a"){3.2W=1b}4(3.u){3.u=$.2G({},26,3.u)}h 4(3.2u){3.u={};$.Q(26,6(3v,l){3.u[3v]=l+"-"+3.2u})}h{3.u=26}7 Z=[];7 19=0;7 1H=1n $.25.3V();7 2q;7 1J;7 n=$("<B 1E=\\"2C\\"  57=\\"53\\">").17({52:"54"}).X(6(){4(3.1e===C||3.1e!==19){4n()}}).20(6(){10()}).4N("55 3x 20 1I",3I).3x(6(o){7 V;7 1h;5d(o.U){O y.28:O y.2a:O y.2c:O y.2e:4(!$(k).v()){V=R.2J();1h=R.3q();4((V.D&&V.A(0)===x)||(1h.D&&1h.A(0)===x)){4(o.U===y.28||o.U===y.2c){1d($(x),S.2B)}h{1d($(x),S.1S)}}h 4((o.U===y.28||o.U===y.2c)&&V.D){1m($(V.A(0)))}h 4((o.U===y.2a||o.U===y.2e)&&1h.D){1m($(1h.A(0)))}}h{7 1s=C;4(o.U===y.2e||o.U===y.2a){1s=$(N).3q()}h{1s=$(N).2J()}4(1s.D){1W(1s)}r J}2f;O y.3k:V=R.2J();4(!$(k).v().D){4(x){2F($(x))}h 4(V.D){1m($(V.A(0)))}r J}h 4($(k).v().D===1){10()}h{2A(6(){2x()},5)}2f;O y.3j:O y.3m:O y.3n:O y.3p:4(N){2M($(N));r J}h 4(3.2Y){4($(k).v().D>0){2k($(k).v(),$(k).v(),1D);$(k).v("")}r J}2f;O y.3o:10();r 1D;4H:4(4G.4C(o.4B)){2A(6(){2x()},5)}2f}});7 M=$(B).1g().v("").X(6(){n.X()}).20(6(){n.20()});7 x=C;7 P=0;7 N=C;7 1c=$("<4p />").I(3.u.3y).23(6(o){7 t=$(o.1r).1z("t");4(t&&t.A(0)&&$.f(t.A(0),"1j")){3F(t)}h{4(x){1d($(x),S.1o)}n.X()}}).4o(6(o){7 t=$(o.1r).1z("t");4(t&&x!==k){t.I(3.u.31)}}).5e(6(o){7 t=$(o.1r).1z("t");4(t&&x!==k){t.2d(3.u.31)}}).2D(M);7 R=$("<t />").I(3.u.3z).1l(1c).1C(n);7 G=$("<18>").I(3.u.G).1l("5N").1g();7 2X=$("<5O/>").2y(n).17({1x:"3b",2t:-3K,2w:-3K,2S:"5L",3J:n.17("3J"),3L:n.17("3L"),3M:n.17("3M"),3O:n.17("3O"),5H:"5I"});M.v("");7 H=3.2R||M.f("5J");4(3.3N&&$.1t(3.16)){H=3.16.1w(M,H)}4(H&&H.D){$.Q(H,6(K,l){2E(l.d,l.z)})}6 3I(){4(1J===(1J=n.v())){r}7 3H=1J.1v(/&/g,\'&61;\').1v(/\\s/g,\' \').1v(/</g,\'&62;\').1v(/>/g,\'&5X;\');2X.1f(3H);n.2S(2X.2S()+30)}6 5W(T){r((T>=48&&T<=5E)||(T>=5m&&T<=5n)||(T>=5o&&T<=5p)||(T>=5l&&T<=5g))}6 3G(d,l){2U(d,l,3.u.3C)}6 2E(d,l){2U(d,l,3.u.c)}6 2U(d,l,3B){7 21=$("<t><1R>"+l+"</1R></t>").I(3B).2D(R);$("<1R>"+3.3A+"</1R>").I(3.u.3i).1l(21).23(6(){2F($(k).5r());r J});7 11={"d":d,"z":l};$.f(21.A(0),"1j",11);Z=Z.1P(0,P).2T([11]).2T(Z.1P(P));P++;7 1O=$.3f(Z,6(1L){r 1L.d});M.v(1O.3h(3.2P));19+=1;r 21}6 2M(E){7 11=$.f(E.A(0),"1j");2k(11.d,11.z,J)}6 2k(d,z,3E){7 H={d:d,z:z};7 1i=3.2o;4(19>0&&3.2N){7 1A=C;1c.1K().Q(6(){7 2l=$(k);7 2n=$.f(2l.A(0),"1j");4(2n&&2n.d===H.d){1A=2l;r J}});4(1A){1m(1A);R.2y(1A);n.X();r}}4(3E){3G(H.d,H.z)}h{2E(H.d,H.z)}4(3.1e!==C&&19>=3.1e){n.1g();10();r}h{n.X()}n.v("");10();4($.1t(1i)){1i.1w(M,H)}}6 1m(c){c.I(3.u.2z);x=c.A(0);n.v("");10()}6 1d(c,1x){c.2d(3.u.2z);x=C;4(1x===S.2B){R.2D(c);P--}h 4(1x===S.1S){R.2y(c);P++}h{R.1l(1c);P=19}n.X()}6 3F(c){7 3P=x;4(x){1d($(x),S.1o)}4(3P===c.A(0)){1d(c,S.1o)}h{1m(c)}}6 2F(c){7 11=$.f(c.A(0),"1j");7 1i=3.2I;7 K=c.5B().D;4(K>P){K--}c.4f();x=C;n.X();Z=Z.1P(0,K).2T(Z.1P(K+1));4(K<P){P--}7 1O=$.3f(Z,6(1L){r 1L.d});M.v(1O.3h(3.2P));19-=1;4(3.1e!==C){n.2m().v("").X()}4($.1t(1i)){1i.1w(M,11)}}6 10(){G.1g().4j();N=C}6 1q(){G.17({1x:"3b",2t:$(1c).4c().2t+$(1c).4Q(),2w:$(1c).4c().2w,5c:4w}).2m()}6 3Z(){4(3.2s){G.1f("<p>"+3.2s+"</p>");1q()}}6 4n(){4(3.1U){G.1f("<p>"+3.1U+"</p>");1q()}}6 4q(l,2Z){r l.1v(1n 4y("(?![^&;]+;)(?!<[^<>]*)("+2Z+")(?![^<>]*>)(?![^&;]+;)","4z"),"<b>$1</b>")}6 1G(m,w){4(w&&w.D){G.4j();7 1T=$("<4p>").1l(G).4o(6(o){1W($(o.1r).1z("t"))}).5K(6(o){2M($(o.1r).1z("t"));r J}).1g();$.Q(w,6(K,l){7 1B=$("<t>"+4q(l.z,m)+"</t>").1l(1T);4(K%2){1B.I(3.u.4i)}h{1B.I(3.u.4m)}4(K===0){1W(1B)}$.f(1B.A(0),"1j",{"d":l.d,"z":l.z})});1q();4(3.4k){1T.5y("5s")}h{1T.2m()}}h{4(3.2v){G.1f("<p>"+3.2v+"</p>");1q()}}}6 1W(E){4(E){4(N){4g($(N))}E.I(3.u.2r);N=E.A(0)}}6 4g(E){E.2d(3.u.2r);N=C}6 2x(){7 m=n.v().24();4(m&&m.D){4(x){1d($(x),S.1S)}4(m.D>=3.2H){3Z();5t(2q);2q=2A(6(){42(m)},3.41)}h{10()}}}6 42(m){7 2h=1H.A(m);4(2h){1G(m,2h)}h{4(3.W){7 L={};L.f={};4(3.W.3a("?")>-1){7 2g=3.W.1y("?");L.W=2g[0];7 3X=2g[1].1y("&");$.Q(3X,6(K,l){7 2p=l.1y("=");L.f[2p[0]]=2p[1]})}h{L.W=3.W}L.f[3.3W]=m;L.1E=3.2i;L.3R=3.3S;4(3.22){L.3R="5q"}L.5j=6(w){4($.1t(3.16)){w=3.16.1w(M,w)}1H.2K(m,3.1u?w[3.1u]:w);4(n.v().24()===m){1G(m,3.1u?w[3.1u]:w)}};$.5h(L)}h 4(3.2W){7 w=$.5U(3.2W,6(3U){r 3U.z.24().3a(m.24())>-1});4($.1t(3.16)){w=3.16.1w(M,w)}1H.2K(m,w);1G(m,w)}}}};$.25.3V=6(1Q){7 3=$.2G({43:4d},1Q);7 f={};7 1N=0;7 44=6(){f={};1N=0};k.2K=6(m,w){4(1N>3.43){44()}4(!f[m]){1N+=1}f[m]=w};k.A=6(m){r f[m]}}}(2O));7 $j=2O.5P();(6($){$.2b=6(2L,f){$(2L).1f(\'\');$(2L).1g().1C(f).5M(4d).4F(4E)};$.4e.2b=6(f){k.Q(6(){1n $.2b(k,f)})};r k})(2O);6 2Q(E){$j(\'#F-1I\').2d(\'F-15\').4I(\'15\');r}6 3e(E){$j(\'#14\').1C(\'<1F l="\'+E.d+\'">\'+E.z+\'</1F>\');2Q()}6 3D(E){$j(\'#14\').1K(\'1F\').Q(6(i){4($j(k).2C()===E.z){$j(k).4f()}});2Q()}6 3w(f){7 1p=\'\';$j(\'#F-1I\').I(\'F-15\').1X(\'15\',\'15\');4(f.4b){1p=\'<18 2j="4t">\'+f.4b+\'</18>\'}h 4(f.4a){1p=\'<18 2j="4u">\'+f.4a+\'</18>\'}4(1p!==\'\'){$j(\'#1a\').1C(\'<18 d="45-46"></18>\');$j(\'#45-46\').2b(1p)}}$j(4v).4K(6(){7 Y=\'<29 56="\'+1k.3r+\'" 2i="3l" d="F-3c-29">\';Y+=\'<47 d="14" z="14">\';Y+=58;Y+=\'</47>\';Y+=\'<B d="F-3d-d" 1E="49" z="3Q" l="\'+1k.59+\'">\';Y+=\'<B d="F-1Z" 1E="49" z="1Z" l="\'+1k.4Y+\'">\';Y+=\'<B d="F-1I" 1E="3g" 15="15" 2j="F-15" l="\'+1V.4x+\'">\';Y+=\'</29>\';4($j(\'#1a\').D>0){7 1M,1Y;4($j(\'#1a\').A(0).4r===\'4M\'){1M=\'#1a 4h.4J\';1Y=\'#1a 4h.l\'}h{1M=\'#1a\';1Y=\'#1a\'}$j(1M).1C(\'<5F d="F-5R" 5Q="\'+1k.5T+\'" 5Y="\'+1V.3T+\'">\').1X(\'5f\',1V.3T).I(\'F-5i\').23(6(){$j(k).5A(\'23\');$j(1Y).1f(Y);7 2V=[];$j(\'#14\').1K(\'1F\').Q(6(){2V.5C({d:$j(k).1X(\'d\'),z:$j(k).2C()})});$j.5u(1k[\'5v\'],6(f){$j(\'#14\').3Y(f,{1U:1V.4A,2u:\'5z\',2H:2,1e:5G,2N:1D,2R:2V,2I:3D,2o:3e,2Y:1D})});$j(\'#F-3c-29\').3g(6(e){e.4l();7 12=\'3Q=\'+$j(\'#F-3d-d\',$j(k)).v();12+=\'&1Z=\'+$j(\'#F-1Z\',$j(k)).v();12+=\'&14=\';$j(\'#14\').1K(\'1F\').Q(6(i){12+=$j(k).1X(\'l\')+\',\'});12=12.5k(0,12.D-1);$j.3l(1k.3r,12,6(f){3w(f)});e.4l()})})}});',62,375,'|||settings|if||function|var|||||token|id||data||else|||this|value|query|input_box|event|||return||li|classes|val|results|selected_token|KEY|name|get|input|null|length|item|t4u|dropdown|li_data|addClass|false|index|ajax_params|hidden_input|selected_dropdown_item|case|selected_token_index|each|input_token|POSITION|keycode|keyCode|previous_token|url|focus|newRow|saved_tokens|hide_dropdown|token_data|serialized_form||tags|disabled|onResult|css|div|token_count|Tags|url_or_data|token_list|deselect_token|tokenLimit|html|hide|next_token|callback|tokeninput|path|appendTo|select_token|new|END|message|show_dropdown|target|dropdown_item|isFunction|jsonContainer|replace|call|position|split|closest|found_existing_token|this_li|append|true|type|option|populate_dropdown|cache|update|input_val|children|el|icon_selector|size|token_ids|slice|options|span|AFTER|dropdown_ul|hintText|vocab|select_dropdown_item|attr|input_selector|referer|blur|this_token|crossDomain|click|toLowerCase|TokenList|DEFAULT_CLASSES||LEFT|form|RIGHT|flashMessage|UP|removeClass|DOWN|break|parts|cached_results|method|class|_add_token|existing_token|show|existing_data|onAdd|kv|timeout|selectedDropdownItem|searchingText|top|theme|noResultsText|left|do_search|insertAfter|selectedToken|setTimeout|BEFORE|text|insertBefore|insert_token|delete_token|extend|minChars|onDelete|prev|add|source|add_token|preventDuplicates|jQuery|tokenDelimiter|t4u_on_change|prePopulate|width|concat|_insert_token|existing_tags|local_data|input_resizer|allowNewItems|term||highlightedToken|||||||||indexOf|absolute|addtags|image|t4u_on_add|map|submit|join|tokenDelete|TAB|BACKSPACE|post|ENTER|NUMPAD_ENTER|ESCAPE|COMMA|next|t4u_add_script|DEFAULT_SETTINGS|selected|typeof|key|t4u_form_sucess|keydown|tokenList|inputToken|deleteText|className|tokenNew|t4u_on_delete|new_token|toggle_select_token|insert_new_token|escaped|resize_input|fontSize|9999|fontFamily|fontWeight|processPrePopulate|letterSpacing|previous_selected_token|image_id|dataType|contentType|click_to_add_tags|row|Cache|queryParam|param_array|tokenInput|show_dropdown_searching||searchDelay|run_search|max_size|flush|flash|messages|select||hidden|error|info|offset|500|fn|remove|deselect_dropdown_item|td|dropdownItem|empty|animateDropdown|preventDefault|dropdownItem2|show_dropdown_hint|mouseover|ul|highlight_term|nodeName|json|infos|errors|document|999|update_tags|RegExp|gi|start_to_type|which|fromCharCode|300|3000|fadeOut|String|default|removeAttr|label|ready|GET|TR|bind|188|108|outerHeight|string|undefined|delete|highlighted|PAGE_DOWN|PAGE_UP|HOME|t4u_referer|item2|location|href|outline|off|none|keyup|action|autocomplete|related_tags|t4u_image_id|object|list|zindex|switch|mouseout|title|222|ajax|clickable|success|substring|219|96|111|186|192|jsonp|parent|fast|clearTimeout|getJSON|t4u_get_script|Type|in|slideDown|facebook|unbind|prevAll|push|SPACE|90|img|100|whiteSpace|nowrap|pre|mousedown|auto|fadeIn|body|tester|noConflict|src|edit|No|t4u_edit_icon|grep|search|is_printable_character|gt|alt|Searching|times|amp|lt'.split('|'),0,{}))
+eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('(6($){7 4q={2a:"4T 4S a 4U 2F",2R:"4V A",2E:"4X...",3S:"&4W;",47:4R,3j:1,1f:E,1J:E,23:"4Q",4c:"3n",4b:"q",2A:",",3b:J,3l:E,4f:J,4w:1I,1b:E,3c:E,2Y:E,1X:J,2X:J};7 1Y={4p:"c-n-4t",c:"c-n-c",2N:"c-n-4L-c",1B:"c-n-4K-c",2K:"c-n-1a-c",2v:"c-n-4x-c",2t:"c-n-4M-c",G:"c-n-G",4v:"c-n-G-z",4B:"c-n-G-4N",2O:"c-n-4x-G-z",45:"c-n-n-c"};7 W={2G:0,1V:1,1E:2};7 y={3J:8,3P:9,3u:13,3m:27,4P:32,4O:33,4Y:34,1E:35,4Z:36,2b:37,25:38,20:39,26:40,3C:59,3A:58};$.2U.3r=6(1d,1U){7 3=$.3h({},4q,1U||{});v m.P(6(){1a $.21(m,1d,3)})};$.2U.5a=6(z){2u(z.d,z.u)};$.21=6(n,1d,3){4(3x(1d)==="5b"){3.10=1d;4(3.2d===3d){4(3.10.3k("://")===-1){3.2d=J}l{3.2d=(5d.5c.1F(/\\/+/g)[1]!==3.10.1F(/\\/+/g)[1])}}}l 4(3x(1d)==="4J"){3.3i=1d}4(3.k){3.k=$.3h({},1Y,3.k)}l 4(3.3g){3.k={};$.P(1Y,6(3t,h){3.k[3t]=h+"-"+3.3g})}l{3.k=1Y}7 V=[];7 17=0;7 1Z=1a $.21.49();7 2L;7 2m;7 t=$("<n 1s=\\"2W\\"  57=\\"56\\">").18({51:"50"}).T(6(){4(3.1f===E||3.1f!==17){3T()}}).24(6(){16()}).52("53 3R 24 29",41).3R(6(w){7 R;7 1n;55(w.Z){Q y.2b:Q y.20:Q y.25:Q y.26:4(!$(m).B()){R=U.2D();1n=U.3K();4((R.D&&R.C(0)===x)||(1n.D&&1n.C(0)===x)){4(w.Z===y.2b||w.Z===y.25){19($(x),W.2G)}l{19($(x),W.1V)}}l 4((w.Z===y.2b||w.Z===y.25)&&R.D){1h($(R.C(0)))}l 4((w.Z===y.20||w.Z===y.26)&&1n.D){1h($(1n.C(0)))}}l{7 1q=E;4(w.Z===y.26||w.Z===y.20){1q=$(N).3K()}l{1q=$(N).2D()}4(1q.D){22(1q)}v J}1T;Q y.3J:R=U.2D();4(!$(m).B().D){4(x){4(3.1X||$(x).1r(\'1L.\'+3.k.2N).D>0){2w($(x))}}l 4(R.D){1h($(R.C(0)))}v J}l 4($(m).B().D===1){16()}l{2Q(6(){2P()},5)}1T;Q y.3P:Q y.3u:Q y.3C:Q y.3A:4(N){2H($(N));v J}l 4(3.2X){4($(m).B().D>0){2J($(m).B(),$(m).B(),1I);$(m).B("")}v J}1T;Q y.3m:16();v 1I;4I:4(4D.4C(w.4F)){2Q(6(){2P()},5)}1T}});7 M=$(n).1l().B("").T(6(){t.T()}).24(6(){t.24()});7 x=E;7 O=0;7 N=E;7 1c=$("<2Z />").H(3.k.4p).2l(6(w){7 o=$(w.1w).1x("o");4(o&&o.C(0)&&$.f(o.C(0),"1g")){3F(o)}l{4(x){19($(x),W.1E)}t.T()}}).4o(6(w){7 o=$(w.1w).1x("o");4(o&&x!==m){o.H(3.k.2t)}}).4H(6(w){7 o=$(w.1w).1x("o");4(o&&x!==m){o.1m(3.k.2t)}}).2y(M);7 U=$("<o />").H(3.k.45).1j(1c).1G(t);7 G=$("<1e>").H(3.k.G).1j("3s").1l();7 2r=$("<4E/>").2x(t).18({1p:"3v",2I:-43,2C:-43,2q:"4G",4e:t.18("4e"),4a:t.18("4a"),4d:t.18("4d"),3y:t.18("3y"),5o:"69"});M.B("");7 F=3.3l||M.f("63");4(3.4f&&$.1H(3.1b)){F=3.1b.1M(M,F)}4(F&&F.D){$.P(F,6(L,h){2u(h.d,h.u)})}6 41(){4(2m===(2m=t.B())){v}7 4y=2m.1u(/&/g,\'&6b;\').1u(/\\s/g,\' \').1u(/</g,\'&5T;\').1u(/>/g,\'&5U;\');2r.1o(4y);t.2q(2r.2q()+30)}6 5V(Y){v((Y>=48&&Y<=5Y)||(Y>=5X&&Y<=5W)||(Y>=5Z&&Y<=5Q)||(Y>=5P&&Y<=5f))}6 3H(d,h){1N(d,h,3.k.2K)}6 3I(d,h){1N(d,h,3.k.1B)}6 2u(d,h){1N(d,h,3.k.c)}6 1N(d,h,1C){7 1v=$("<o><1L>"+h+"</1L></o>").H(1C).2y(U);4(1C==3.k.2K||1C==3.k.1B||3.1X){$("<1L>"+3.3S+"</1L>").H(3.k.2N).1j(1v).2l(6(){2w($(m).62());v J})}4(1C==3.k.1B){1v.1m(3.k.1B).H(3.k.c)}7 15={"d":d,"u":h};$.f(1v.C(0),"1g",15);V=V.2g(0,O).2p([15]).2p(V.2g(O));O++;7 2c=$.3D(V,6(2f){v 2f.d});M.B(2c.3q(3.2A));17+=1;v 1v}6 2H(z){7 15=$.f(z.C(0),"1g");2J(15.d,15.u,J)}6 2J(d,u,3O){7 F={d:d,u:u};7 1i=3.3c;4(17>0&&3.3b){7 1D=E;1c.1r().P(6(){7 2M=$(m);7 2n=$.f(2M.C(0),"1g");4(2n&&((2n.d===F.d)||(2n.u===F.u))){1D=2M;v J}});4(1D){1h(1D);U.2x(1D);t.T();v}}4(3O){3H(F.d,F.u)}l{3I(F.d,F.u)}4(3.1f!==E&&17>=3.1f){t.1l();16();v}l{t.T()}t.B("");16();4($.1H(1i)){1i.1M(M,F)}}6 1h(c){c.H(3.k.2v);x=c.C(0);t.B("");16()}6 19(c,1p){c.1m(3.k.2v);x=E;4(1p===W.2G){U.2y(c);O--}l 4(1p===W.1V){U.2x(c);O++}l{U.1j(1c);O=17}t.T()}6 3F(c){7 3G=x;4(x){19($(x),W.1E)}4(3G===c.C(0)){19(c,W.1E)}l{1h(c)}}6 2w(c){7 15=$.f(c.C(0),"1g");7 1i=3.2Y;7 L=c.5N().D;4(L>O){L--}c.4k();x=E;t.T();V=V.2g(0,L).2p(V.2g(L+1));4(L<O){O--}7 2c=$.3D(V,6(2f){v 2f.d});M.B(2c.3q(3.2A));17-=1;4(3.1f!==E){t.2B().B("").T()}4($.1H(1i)){1i.1M(M,15)}}6 16(){G.1l().3W();N=E}6 1t(){G.18({1p:"3v",2I:$(1c).3w().2I+$(1c).5g(),2C:$(1c).3w().2C,5j:5k}).2B()}6 3Z(){4(3.2E){G.1o("<p>"+3.2E+"</p>");1t()}}6 3T(){4(3.2a){G.1o("<p>"+3.2a+"</p>");1t()}}6 4u(h,2F){v h.1u(1a 5l("(?![^&;]+;)(?!<[^<>]*)("+2F+")(?![^<>]*>)(?![^&;]+;)","5x"),"<b>$1</b>")}6 1S(r,A){4(A&&A.D){G.3W();7 1Q=$("<2Z>").1j(G).4o(6(w){22($(w.1w).1x("o"))}).5I(6(w){2H($(w.1w).1x("o"));v J}).1l();$.P(A,6(L,h){7 1y=$("<o>"+4u(h.u,r)+"</o>").1j(1Q);4(L%2){1y.H(3.k.4v)}l{1y.H(3.k.4B)}4(L===0){22(1y)}$.f(1y.C(0),"1g",{"d":h.d,"u":h.u})});1t();4(3.4w){1Q.5J("5K")}l{1Q.2B()}}l{4(3.2R){G.1o("<p>"+3.2R+"</p>");1t()}}}6 22(z){4(z){4(N){46($(N))}z.H(3.k.2O);N=z.C(0)}}6 46(z){z.1m(3.k.2O);N=E}6 2P(){7 r=t.B().1R();4(r&&r.D){4(x){19($(x),W.1V)}4(r.D>=3.3j){3Z();5y(2L);2L=2Q(6(){4g(r)},3.47)}l{16()}}}6 4g(r){7 2o=1Z.C(r);4(2o){1S(r,2o)}l{4(3.10){7 K={};K.f={};4(3.10.3k("?")>-1){7 2z=3.10.1F("?");K.10=2z[0];7 4i=2z[1].1F("&");$.P(4i,6(L,h){7 2s=h.1F("=");K.f[2s[0]]=2s[1]})}l{K.10=3.10}K.f[3.4b]=r;K.1s=3.23;K.3B=3.4c;4(3.2d){K.3B="5D"}K.5E=6(A){4($.1H(3.1b)){A=3.1b.1M(M,A)}1Z.3e(r,3.1J?A[3.1J]:A);4(t.B().1R()===r){1S(r,3.1J?A[3.1J]:A)}};$.5C(K)}l 4(3.3i){7 A=$.5B(3.3i,6(4h){v 4h.u.1R().3k(r.1R())>-1});4($.1H(3.1b)){A=3.1b.1M(M,A)}1Z.3e(r,A);1S(r,A)}}}};$.21.49=6(1U){7 3=$.3h({3Y:42},1U);7 f={};7 1W=0;7 3X=6(){f={};1W=0};m.3e=6(r,A){4(1W>3.3Y){3X()}4(!f[r]){1W+=1}f[r]=A};m.C=6(r){v f[r]}}}(3f));7 $j=3f.5z();(6($){$.2k=6(2V,f){$(2V).1o(\'\');$(2V).1l().1G(f).5A(42).5F(5G)};$.2U.2k=6(f){m.P(6(){1a $.2k(m,f)})};v m})(3f);6 2T(z){$j(\'#I-29\').1m(\'I-12\').5L(\'12\');v}6 4A(z){$j(\'#11\').1G(\'<1K h="\'+z.d+\'">\'+z.u+\'</1K>\');2T()}6 3p(z){$j(\'#11\').1r(\'1K\').P(6(i){4($j(m).2W()===z.u){$j(m).4k()}});2T()}6 3N(f){7 1z=\'\';$j(\'#I-29\').H(\'I-12\').1P(\'12\',\'12\');4(f.4z!==3d){1z=\'<1e 28="5M">\'+f.4z+\'</1e>\';7 4n=\'c-n-1a-c-1A\',4m=\'c-n-c-1A\';$j(\'2Z.c-n-4t-1A o.c-n-1a-c-1A\').1m(4n).H(4m)}4(f.4l!==3d){1z+=\'<1e 28="5H">\'+f.4l+\'</1e>\'}4(1z!==\'\'){$j(\'.3a-31\').2k(1z)}}$j(5w).5m(6(){4($j(\'.3a-31\').D==0){$j(\'3s\').1G(\'<1e 28="3a-31"></1e>\')}7 S=\'<2e 5h="\'+14.3M+\'" 23="3L" d="I-44-2e">\';S+=\'<3z d="11" u="11">\';S+=5i;S+=\'</3z>\';S+=\'<n d="I-3Q-d" 1s="3o" u="4r" h="\'+14.5n+\'">\';S+=\'<n d="I-1O" 1s="3o" u="1O" h="\'+14.5O+\'">\';S+=\'<n d="I-29" 1s="4s" 12="12" 28="I-12" h="\'+2i.5u+\'">\';S+=\'</2e>\';4($j(\'#1k\').D>0){7 2h,2j;4($j(\'#1k\').C(0).5v===\'5t\'){2h=\'#1k 3V.5s\';2j=\'#1k 3V.h\'}l{2h=\'#1k\';2j=\'#1k\'}$j(2h).1G(\'<5p d="I-5q" 5r="\'+14.60+\'" 6a="\'+2i.3E+\'">\').1P(\'64\',2i.3E).H(\'I-65\').2l(6(){$j(m).6c(\'2l\');$j(2j).1o(S);7 2S=[];$j(\'#11\').1r(\'1K\').P(6(){2S.67({d:$j(m).1P(\'d\'),u:$j(m).2W()})});$j.68(14[\'66\'],6(f){$j(\'#11\').3r(f.3U,{2a:2i.61,3g:\'1A\',3j:2,1f:5S,3b:1I,3l:2S,1X:14.5R,2Y:3p,3c:4A,2X:1I})});$j(\'#I-44-2e\').4s(6(e){e.4j();7 X=\'4r=\'+$j(\'#I-3Q-d\',$j(m)).B();X+=\'&23=\'+14.5e;X+=\'&1O=\'+$j(\'#I-1O\',$j(m)).B();X+=\'&11=\';$j(\'#11\').1r(\'1K\').P(6(i){X+=$j(m).1P(\'h\')+\',\'});X=X.54(0,X.D-1);$j.3L(14.3M,X,6(f){3N(f.3U)},\'3n\');e.4j()})})}});',62,385,'|||settings|if||function|var|||||token|id||data||value|||classes|else|this|input|li|||query||input_box|name|return|event|selected_token|KEY|item|results|val|get|length|null|li_data|dropdown|addClass|t4u|false|ajax_params|index|hidden_input|selected_dropdown_item|selected_token_index|each|case|previous_token|newRow|focus|input_token|saved_tokens|POSITION|serialized_form|keycode|keyCode|url|tags|disabled||path|token_data|hide_dropdown|token_count|css|deselect_token|new|onResult|token_list|url_or_data|div|tokenLimit|tokeninput|select_token|callback|appendTo|Tags|hide|removeClass|next_token|html|position|dropdown_item|children|type|show_dropdown|replace|this_token|target|closest|this_li|message|facebook|tokenChoosed|className|found_existing_token|END|split|append|isFunction|true|jsonContainer|option|span|call|_insert_token|referer|attr|dropdown_ul|toLowerCase|populate_dropdown|break|options|AFTER|size|canDelete|DEFAULT_CLASSES|cache|RIGHT|TokenList|select_dropdown_item|method|blur|UP|DOWN||class|update|hintText|LEFT|token_ids|crossDomain|form|el|slice|icon_selector|vocab|input_selector|flashMessage|click|input_val|existing_data|cached_results|concat|width|input_resizer|kv|highlightedToken|insert_token|selectedToken|delete_token|insertAfter|insertBefore|parts|tokenDelimiter|show|left|prev|searchingText|term|BEFORE|add_token|top|_add_token|tokenNew|timeout|existing_token|tokenDelete|selectedDropdownItem|do_search|setTimeout|noResultsText|existing_tags|t4u_on_change|fn|source|text|allowNewItems|onDelete|ul||messages|||||||||flash|preventDuplicates|onAdd|undefined|add|jQuery|theme|extend|local_data|minChars|indexOf|prePopulate|ESCAPE|json|hidden|t4u_on_delete|join|tokenInput|body|key|ENTER|absolute|offset|typeof|letterSpacing|select|COMMA|dataType|NUMPAD_ENTER|map|click_to_add_tags|toggle_select_token|previous_selected_token|insert_new_token|insert_choosed_token|BACKSPACE|next|post|t4u_update_script|t4u_form_success|new_token|TAB|image|keydown|deleteText|show_dropdown_hint|result|td|empty|flush|max_size|show_dropdown_searching||resize_input|500|9999|addtags|inputToken|deselect_dropdown_item|searchDelay||Cache|fontFamily|queryParam|contentType|fontWeight|fontSize|processPrePopulate|run_search|row|param_array|preventDefault|remove|error|normal_class|new_class|mouseover|tokenList|DEFAULT_SETTINGS|image_id|submit|list|highlight_term|dropdownItem|animateDropdown|selected|escaped|info|t4u_on_add|dropdownItem2|fromCharCode|String|tester|which|auto|mouseout|default|object|choosed|delete|highlighted|item2|PAGE_UP|SPACE|GET|300|in|Type|search|No|times|Searching|PAGE_DOWN|HOME|none|outline|bind|keyup|substring|switch|off|autocomplete|188|108|insertToken|string|href|location|t4u_update_method|222|outerHeight|action|related_tags|zindex|999|RegExp|ready|t4u_image_id|whiteSpace|img|edit|src|label|TR|update_tags|nodeName|document|gi|clearTimeout|noConflict|fadeIn|grep|ajax|jsonp|success|fadeOut|3000|errors|mousedown|slideDown|fast|removeAttr|infos|prevAll|t4u_referer|219|192|t4u_permission_delete|100|lt|gt|is_printable_character|111|96|90|186|t4u_edit_icon|start_to_type|parent|pre|title|clickable|t4u_get_script|push|getJSON|nowrap|alt|amp|unbind'.split('|'),0,{}))
Index: /extensions/user_tags/language/fr_FR/plugin.lang.php
===================================================================
--- /extensions/user_tags/language/fr_FR/plugin.lang.php	(revision 11740)
+++ /extensions/user_tags/language/fr_FR/plugin.lang.php	(revision 11741)
@@ -3,5 +3,5 @@
 // | User Tags  - a plugin for Piwigo                                      |
 // +-----------------------------------------------------------------------+
-// | Copyright(C) 2010 Nicolas Roudaire             http://www.nikrou.net  |
+// | Copyright(C) 2010-2011 Nicolas Roudaire        http://www.nikrou.net  |
 // +-----------------------------------------------------------------------+
 // | This program is free software; you can redistribute it and/or modify  |
@@ -20,18 +20,20 @@
 // +-----------------------------------------------------------------------+
 
+// admin
+$lang['Add permission updated'] = 'La permission "ajout" a été mise à jour';
+$lang['Be careful, whatever the configuration value is, new tag can be deleted anyway'] = 'Attention, quelle que soit la valeur de ce paramètre de configuration, les nouveaux tags pourront être supprimés.';
+$lang['Delete permission updated'] = 'La permission "suppression" a été mise à jour';
+$lang['That plugin allow visitors to add tags to image.'] = 'Ce plugin permet aux visiteurs de votre galerie d\'ajouter des tags aux images.';
+$lang['Who can add tags?'] = 'Qui peut ajouter des tags ?';
+$lang['Who can delete related tags?'] = 'Qui peut supprimer les tags déjà liés à une image ?';
+$lang['You can choose which users (per status) can add and delete tags.'] = 'Vous pouvez définir quel type d\'utilisateur peut ajouter/supprimer des tags.';
+
+// public
 $lang['Click to add tags'] = 'Cliquez pour ajouter des tags';
 $lang['Start to type'] = 'Commencez à taper';
+$lang['Tags updated'] = 'Les tags ont été mis à jour';
 $lang['Update tags'] = 'Mettre à jour les tags';
-$lang['Tags updated'] = 'Les tags ont été mis à jour';
-$lang['Cancel'] = 'Annuler';
-
-// admin
-$lang['That plugin allow visitors to add tags to image.'] = 'Ce plugin permet aux visiteurs de votre galerie d\'ajouter des tags aux images.';
-$lang['You can choose which users (per status) can add and delete tags.'] = 'Vous pouvez définir quel type d\'utilisateur peut ajouter/supprimer des tags.';
-$lang['Be careful, whatever the configuration value is, new tag can be deleted anyway'] = 'Attention, quelle que soit la valeur de ce paramètre de configuration, les nouveaux tags pourront être supprimés.';
-$lang['Who can add tags?'] = 'Qui peut ajouter des tags ?';
-$lang['Who can delete related tags?'] = 'Qui peut supprimer les tags déjà liés à une image ?';
-
-$lang['Add permission updated'] = 'La permission "ajout" a été mise à jour';
-$lang['Delete permission updated'] = 'La permission "suppression" a été mise à jour';
+$lang['You are not allowed to add nor delete tags'] = 'Vous n\êtes pas autorisé à ajouter, ni supprimer de tags';
+$lang['You are not allowed to add tags'] = 'Vous n\êtes pas autorisé à ajouter de tags';
+$lang['You are not allowed to delete tags'] = 'Vous n\êtes pas autorisé à supprimer de tags';
 ?>
Index: /extensions/user_tags/language/templates/plugin.lang.php
===================================================================
--- /extensions/user_tags/language/templates/plugin.lang.php	(revision 11740)
+++ /extensions/user_tags/language/templates/plugin.lang.php	(revision 11741)
@@ -3,5 +3,5 @@
 // | User Tags  - a plugin for Piwigo                                      |
 // +-----------------------------------------------------------------------+
-// | Copyright(C) 2010 Nicolas Roudaire             http://www.nikrou.net  |
+// | Copyright(C) 2010-2011 Nicolas Roudaire        http://www.nikrou.net  |
 // +-----------------------------------------------------------------------+
 // | This program is free software; you can redistribute it and/or modify  |
@@ -24,8 +24,5 @@
 $lang['Be careful, whatever the configuration value is, new tag can be deleted anyway'] = '';
 $lang['Delete permission updated'] = '';
-$lang['Submit'] = '';
-$lang['Tags updated'] = '';
 $lang['That plugin allow visitors to add tags to image.'] = '';
-$lang['User Tags'] = '';
 $lang['Who can add tags?'] = '';
 $lang['Who can delete related tags?'] = '';
@@ -35,4 +32,8 @@
 $lang['Click to add tags'] = '';
 $lang['Start to type'] = '';
+$lang['Tags updated'] = '';
 $lang['Update tags'] = '';
+$lang['You are not allowed to add nor delete tags'] = '';
+$lang['You are not allowed to add tags'] = '';
+$lang['You are not allowed to delete tags'] = '';
 ?>
Index: /extensions/user_tags/main.inc.php
===================================================================
--- /extensions/user_tags/main.inc.php	(revision 11740)
+++ /extensions/user_tags/main.inc.php	(revision 11741)
@@ -22,5 +22,5 @@
 /*
 Plugin Name: User Tags
-Version: 0.5.2
+Version: 0.6.0
 Description: Allow visitors to add tag to images
 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=441
Index: /extensions/user_tags/public.php
===================================================================
--- /extensions/user_tags/public.php	(revision 11740)
+++ /extensions/user_tags/public.php	(revision 11741)
@@ -24,10 +24,4 @@
 }
 
-if (!empty($_GET['action']) && in_array($_GET['action'], array('add', 'get'))) {
-  include_once T4U_PLUGIN_ROOT . "/include/t4u_admin_action.inc.php";
-}
-
-include_once T4U_PLUGIN_ROOT . "/include/t4u_content.class.php";
-
 $public_content = new t4u_Content($plugin_config);
 add_event_handler('render_element_content', 
@@ -36,3 +30,8 @@
 		  2
 		  );
+
+$t4u_ws = new t4u_Ws();
+add_event_handler('ws_add_methods', 
+		  array($t4u_ws, 'addMethods')
+		  );
 ?>
Index: /extensions/user_tags/template/add_tags.tpl
===================================================================
--- /extensions/user_tags/template/add_tags.tpl	(revision 11740)
+++ /extensions/user_tags/template/add_tags.tpl	(revision 11741)
@@ -8,5 +8,7 @@
 {/foreach}
 var path = new Array();
-path['t4u_add_script'] = "{$T4U_ADD_SCRIPT}";
+path['t4u_permission_delete'] = "{$T4U_PERMISSION_DELETE}";
+path['t4u_update_script'] = "{$T4U_UPDATE_SCRIPT}";
+path['t4u_update_method'] = "{$T4U_UPDATE_METHOD}";
 path['t4u_image_id'] = "{$T4U_IMAGE_ID}";
 path['t4u_referer'] = "{$T4U_REFERER}";
