Changeset 11081 for extensions/user_tags


Ignore:
Timestamp:
05/27/11 23:02:05 (9 years ago)
Author:
nikrou
Message:

Fix incompatibility with piwigo 2.2
Change jquery plugin from fcbkcomplete to tokeninput

Location:
extensions/user_tags
Files:
2 deleted
15 edited

Legend:

Unmodified
Added
Removed
  • extensions/user_tags/CHANGELOG

    r9284 r11081  
     1User Tags 0.5.0 - 2011-05-27 
     2================================ 
     3* Fix incompatibility with piwigo 2.2 
     4* Change jquery plugin from fcbkcomplete to tokeninput 
     5 
    16User Tags 0.4.2 - 2011-02-19 
    27================================ 
  • extensions/user_tags/MANIFEST

    r9284 r11081  
     1user_tags/js/jquery.addtags.js 
    12user_tags/BUGS 
    2 user_tags/imgs/edit.png 
     3user_tags/include/t4u_admin_action.inc.php 
     4user_tags/include/t4u_config.class.php 
     5user_tags/include/t4u_content.class.php 
     6user_tags/include/constants.inc.php 
     7user_tags/include/default_values.inc.php 
     8user_tags/maintain.inc.php 
    39user_tags/MANIFEST 
    4 user_tags/maintain.inc.php 
    5 user_tags/template/add_tags.tpl 
    6 user_tags/template/admin.tpl 
    7 user_tags/js/jquery.addtags.js 
    8 user_tags/js/jquery.fcbkcomplete.js 
     10user_tags/init.php 
    911user_tags/main.inc.php 
    10 user_tags/language/fr_FR/help/readme.html 
    11 user_tags/language/fr_FR/help/index.php 
     12user_tags/COPYING 
     13user_tags/language/es_ES/plugin.lang.php 
     14user_tags/language/es_ES/index.php 
     15user_tags/language/es_ES/description.txt 
     16user_tags/language/es_ES/help/index.php 
     17user_tags/language/es_ES/help/readme.html 
     18user_tags/language/en_UK/plugin.lang.php 
     19user_tags/language/en_UK/index.php 
     20user_tags/language/en_UK/description.txt 
     21user_tags/language/en_UK/help/index.php 
     22user_tags/language/en_UK/help/readme.html 
     23user_tags/language/de_DE/plugin.lang.php 
     24user_tags/language/de_DE/index.php 
     25user_tags/language/de_DE/description.txt 
     26user_tags/language/de_DE/help/index.php 
     27user_tags/language/de_DE/help/readme.html 
     28user_tags/language/lv_LV/plugin.lang.php 
     29user_tags/language/lv_LV/index.php 
     30user_tags/language/lv_LV/description.txt 
     31user_tags/language/lv_LV/help/index.php 
     32user_tags/language/lv_LV/help/readme.html 
     33user_tags/language/no_NO/plugin.lang.php 
     34user_tags/language/no_NO/index.php 
     35user_tags/language/no_NO/description.txt 
     36user_tags/language/no_NO/help/index.php 
     37user_tags/language/no_NO/help/readme.html 
     38user_tags/language/it_IT/plugin.lang.php 
     39user_tags/language/it_IT/index.php 
     40user_tags/language/it_IT/description.txt 
     41user_tags/language/it_IT/help/index.php 
     42user_tags/language/it_IT/help/readme.html 
     43user_tags/language/zh_CN/plugin.lang.php 
     44user_tags/language/zh_CN/index.php 
     45user_tags/language/zh_CN/description.txt 
     46user_tags/language/zh_CN/help/index.php 
     47user_tags/language/zh_CN/help/readme.html 
     48user_tags/language/hu_HU/plugin.lang.php 
     49user_tags/language/hu_HU/index.php 
     50user_tags/language/hu_HU/description.txt 
     51user_tags/language/hu_HU/help/index.php 
     52user_tags/language/hu_HU/help/readme.html 
     53user_tags/language/fr_FR/plugin.lang.php 
    1254user_tags/language/fr_FR/index.php 
    1355user_tags/language/fr_FR/description.txt 
    14 user_tags/language/fr_FR/plugin.lang.php 
    15 user_tags/language/de_DE/help/readme.html 
    16 user_tags/language/de_DE/help/index.php 
    17 user_tags/language/de_DE/index.php 
    18 user_tags/language/de_DE/description.txt 
    19 user_tags/language/de_DE/plugin.lang.php 
    20 user_tags/language/no_NO/help/readme.html 
    21 user_tags/language/no_NO/help/index.php 
    22 user_tags/language/no_NO/index.php 
    23 user_tags/language/no_NO/description.txt 
    24 user_tags/language/no_NO/plugin.lang.php 
     56user_tags/language/fr_FR/help/index.php 
     57user_tags/language/fr_FR/help/readme.html 
     58user_tags/language/templates/plugin.lang.php 
    2559user_tags/language/templates/index.php 
    26 user_tags/language/templates/plugin.lang.php 
    27 user_tags/language/en_UK/help/readme.html 
    28 user_tags/language/en_UK/help/index.php 
    29 user_tags/language/en_UK/index.php 
    30 user_tags/language/en_UK/description.txt 
    31 user_tags/language/en_UK/plugin.lang.php 
    32 user_tags/language/lv_LV/help/readme.html 
    33 user_tags/language/lv_LV/help/index.php 
    34 user_tags/language/lv_LV/index.php 
    35 user_tags/language/lv_LV/description.txt 
    36 user_tags/language/lv_LV/plugin.lang.php 
    37 user_tags/language/it_IT/help/readme.html 
    38 user_tags/language/it_IT/help/index.php 
    39 user_tags/language/it_IT/index.php 
    40 user_tags/language/it_IT/description.txt 
    41 user_tags/language/it_IT/plugin.lang.php 
    42 user_tags/language/es_ES/help/readme.html 
    43 user_tags/language/es_ES/help/index.php 
    44 user_tags/language/es_ES/index.php 
    45 user_tags/language/es_ES/description.txt 
    46 user_tags/language/es_ES/plugin.lang.php 
    47 user_tags/language/hu_HU/help/readme.html 
    48 user_tags/language/hu_HU/help/index.php 
    49 user_tags/language/hu_HU/index.php 
    50 user_tags/language/hu_HU/description.txt 
    51 user_tags/language/hu_HU/plugin.lang.php 
     60user_tags/css/admin.css 
     61user_tags/css/style.css 
     62user_tags/css/imgs/close.png 
     63user_tags/public.php 
     64user_tags/admin.php 
     65user_tags/imgs/edit.png 
    5266user_tags/CHANGELOG 
    53 user_tags/include/constants.inc.php 
    54 user_tags/include/t4u_content.class.php 
    55 user_tags/include/default_values.inc.php 
    56 user_tags/include/t4u_config.class.php 
    57 user_tags/include/t4u_admin_action.inc.php 
    58 user_tags/admin.php 
    59 user_tags/COPYING 
    60 user_tags/css/style.css 
    61 user_tags/css/admin.css 
    62 user_tags/css/imgs/close.png 
    63 user_tags/init.php 
    64 user_tags/public.php 
    65 user_tags/TODO 
     67user_tags/template/admin.tpl 
     68user_tags/template/add_tags.tpl 
  • extensions/user_tags/admin.php

    r6846 r11081  
    33// | User Tags  - a plugin for Piwigo                                      | 
    44// +-----------------------------------------------------------------------+ 
    5 // | Copyright(C) 2010 Nicolas Roudaire             http://www.nikrou.net  | 
     5// | Copyright(C) 2010-2011 Nicolas Roudaire        http://www.nikrou.net  | 
    66// +-----------------------------------------------------------------------+ 
    77// | This program is free software; you can redistribute it and/or modify  | 
     
    2929$save_config = false; 
    3030 
     31if (!empty($_GET['action']) && in_array($_GET['action'], array('add', 'get'))) { 
     32  include_once T4U_PLUGIN_ROOT . "/include/t4u_admin_action.inc.php"; 
     33} 
     34 
    3135$status_options[null] = '----------'; 
    3236foreach (get_enums(USER_INFOS_TABLE, 'status') as $status) { 
     
    3842      && $_POST['permission_add']!=$me->getPermission('add')) { 
    3943    $me->setPermission('add', $_POST['permission_add']); 
    40     array_push($GLOBALS['page']['infos'], l10n('Add permission updated')); 
     44    $page['infos'][] = l10n('Add permission updated'); 
    4145    $save_config = true; 
    4246  } 
     
    4448      && $_POST['permission_delete']!=$me->getPermission('delete')) { 
    4549    $me->setPermission('delete', $_POST['permission_delete']); 
    46     array_push($GLOBALS['page']['infos'], l10n('Delete permission updated')); 
     50    $page['infos'] = l10n('Delete permission updated'); 
    4751    $save_config = true; 
    4852  } 
     
    5357} 
    5458 
    55 $GLOBALS['template']->set_filenames(array('plugin_admin_content' => T4U_TEMPLATE . '/admin.tpl')); 
    56 $GLOBALS['template']->assign('T4U_CSS', T4U_CSS); 
     59$template->set_filenames(array('plugin_admin_content' => T4U_TEMPLATE . '/admin.tpl')); 
     60$template->assign('T4U_CSS', T4U_CSS); 
    5761 
    58 $GLOBALS['template']->assign('T4U_PERMISSION_ADD', $me->getPermission('add'));  
    59 $GLOBALS['template']->assign('T4U_PERMISSION_DELETE', $me->getPermission('delete'));  
    60 $GLOBALS['template']->assign('STATUS_OPTIONS', $status_options); 
    61 $GLOBALS['template']->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); 
     62$template->assign('T4U_PERMISSION_ADD', $me->getPermission('add')); 
     63$template->assign('T4U_PERMISSION_DELETE', $me->getPermission('delete')); 
     64$template->assign('STATUS_OPTIONS', $status_options); 
     65$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); 
    6266 
    63 $GLOBALS['template']->assign('U_HELP', get_root_url().'admin/popuphelp.php?page=readme'); 
     67$template->assign('U_HELP', get_root_url().'admin/popuphelp.php?page=readme'); 
    6468?> 
  • extensions/user_tags/css/style.css

    r6818 r11081  
    88.t4u-clickable{cursor:pointer;} 
    99#t4u-addtags-form .t4u-disabled{color:#999;border-color:#666;} 
    10 ul.holder{margin:0;border:1px solid #999;overflow:hidden;padding:4px 5px;} 
    11 *:first-child+html ul.holder{padding-bottom:2px;} 
    12 * html ul.holder{padding-bottom:2px;} 
    13 ul.holder li{float:left;list-style-type:none;margin:2px 5px;white-space:nowrap;} 
    14 ul.holder li.bit-box{-moz-border-radius:6px;-webkit-border-radius:6px;border-radius:6px;border:1px solid #CAD8F3;background:#DEE7F8;padding:1px 5px 2px 2px;} 
    15 ul.holder li.bit-box-focus{border-color:#598BEC;background:#598BEC;color:#fff;} 
    16 ul.holder li.bit-input input{width:auto;overflow:visible;margin:0;border:0;outline:0;padding:3px 0 2px 2px;} 
    17 ul.holder li.bit-input input.smallinput{width:20px;} 
    18 #add{border:1px solid #999;width:550px;margin:50px;padding:20px 30px 10px 10px;} 
    19 form ol li{list-style-type:none;} 
    20 form ol{font:11px "Lucida Grande","Verdana";margin:0;padding:0;} 
    21 form ol li.input-text{margin-bottom:10px;list-style-type:none;padding-bottom:10px;} 
    22 form ol li.input-text label{font-weight:bold;cursor:pointer;display:block;font-size:13px;margin-bottom:10px;} 
    23 form ol li.input-text input{width:500px;padding:5px 5px 6px 6px;font:11px "Lucida Grande","Verdana";border:1px solid #999;} 
    24 form ul.holder{width:auto;max-width:500px;} 
    25 ul.holder li.bit-box{padding-right:15px;position:relative;z-index:1000;} 
    26 ul.holder li.bit-hover{background:#BBCEF1;border:1px solid #6D95E0;} 
    27 ul.holder li.bit-box-focus{border-color:#598BEC;background:#598BEC;color:#fff;} 
    28 ul.holder li.bit-box a.closebutton{position:absolute;right:4px;top:5px;display:block;width:7px;height:7px;font-size:1px;background:url(./imgs/close.png);} 
    29 ul.holder li.bit-box a.closebutton:hover{background-position:7px;} 
    30 ul.holder li.bit-box-focus a.closebutton,ul.holder li.bit-box-focus a.closebutton:hover{background-position:bottom;} 
    31 .facebook-auto{display:none;position:absolute;width:512px;background:#eee;} 
    32 .facebook-auto .default{padding:5px 7px;border:1px solid #ccc;border-width:0 1px 1px;font-family:"Lucida Grande","Verdana";font-size:11px;} 
    33 .facebook-auto ul{display:none;margin:0;padding:0;overflow:auto;position:absolute;z-index:9999;} 
    34 .facebook-auto ul li{padding:5px 12px;z-index:1000;cursor:pointer;margin:0;list-style-type:none;border:1px solid #ccc;border-width:0 1px 1px;font:11px "Lucida Grande","Verdana";background-color:#eee;} 
    35 .facebook-auto ul li em{font-weight:bold;font-style:normal;background:#ccc;} 
    36 .facebook-auto ul li.auto-focus{background:#4173CC;color:#fff;} 
    37 .facebook-auto ul li.auto-focus em{background:none;} 
    38 .deleted{background-color:#4173CC!important;color:#fff!important;} 
    39 .ie6fix{height:1px;width:1px;position:absolute;top:0;left:0;z-index:1;} 
     10ul.token-input-list-facebook{overflow:hidden;height:auto!important;height:1%;width:400px;border:1px solid #8496ba;cursor:text;font-size:12px;font-family:Verdana;min-height:1px;z-index:999;margin:0;padding:0;background-color:#fff;list-style-type:none;clear:left;} 
     11ul.token-input-list-facebook li input{border:0;width:100px;padding:3px 8px;background-color:white;margin:2px 0;-webkit-appearance:caret;} 
     12li.token-input-token-facebook,li.token-input-new-token-facebook{overflow:hidden;height:auto!important;height:15px;margin:3px;padding:1px 3px;background-color:#eff2f7;color:#000;cursor:default;border:1px solid #ccd5e4;font-size:11px;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;float:left;white-space:nowrap;} 
     13li.token-input-new-token-facebook{background-color:#FAF;} 
     14li.token-input-token-facebook span{margin-left:5px;cursor:pointer;} 
     15li.token-input-selected-token-facebook{background-color:#5670a6;border:1px solid #3b5998;color:#fff;} 
     16li.token-input-input-token-facebook{float:left;margin:0;padding:0;list-style-type:none;} 
     17div.token-input-dropdown-facebook{position:absolute;width:400px;background-color:#fff;overflow:hidden;border-left:1px solid #ccc;border-right:1px solid #ccc;border-bottom:1px solid #ccc;cursor:default;font-size:11px;font-family:Verdana;z-index:1;} 
     18div.token-input-dropdown-facebook p{margin:0;padding:5px;font-weight:bold;color:#777;} 
     19div.token-input-dropdown-facebook ul{margin:0;padding:0;} 
     20div.token-input-dropdown-facebook ul li{background-color:#fff;padding:3px;margin:0;list-style-type:none;} 
     21div.token-input-dropdown-facebook ul li.token-input-dropdown-item-facebook{background-color:#fff;} 
     22div.token-input-dropdown-facebook ul li.token-input-dropdown-item2-facebook{background-color:#fff;} 
     23div.token-input-dropdown-facebook ul li em{font-weight:bold;font-style:normal;} 
     24div.token-input-dropdown-facebook ul li.token-input-selected-dropdown-item-facebook{background-color:#3b5998;color:#fff;} 
  • extensions/user_tags/include/default_values.inc.php

    r6806 r11081  
    33// | User Tags  - a plugin for Piwigo                                      | 
    44// +-----------------------------------------------------------------------+ 
    5 // | Copyright(C) 2010 Nicolas Roudaire             http://www.nikrou.net  | 
     5// | Copyright(C) 2010-2011 Nicolas Roudaire        http://www.nikrou.net  | 
    66// +-----------------------------------------------------------------------+ 
    77// | This program is free software; you can redistribute it and/or modify  | 
  • extensions/user_tags/include/t4u_admin_action.inc.php

    r9037 r11081  
    2525 
    2626if (!empty($_GET['action']) && ($_GET['action']=='add')  
    27     && isset($_POST['tags']) && $plugin_config->getPermission('add') ) { 
     27    && isset($_POST['tags']) && $me->getPermission('add')) { 
    2828  include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); 
    2929 
     
    3131    $_POST['tags'] = array(); 
    3232  } 
    33   $tag_ids = get_fckb_tag_ids($_POST['tags']); 
     33  $tag_ids = __get_tag_ids($_POST['tags']); 
    3434  set_tags($tag_ids, $_POST['image_id']); 
    3535 
    3636  if (isset($_SERVER['HTTP_X_REQUESTED_WITH'])) { 
    3737    header("Content-Type: application/json"); 
    38     $message['info'] = 'Tags updated'; 
     38    $message['info'] = l10n('Tags updated'); 
    3939 
    4040    echo json_encode($message); 
    4141    exit(); 
    4242  } else { 
    43     redirect(get_absolute_root_url().$_POST['referer']); 
     43    redirect(get_root_url().$_POST['referer']); 
    4444  } 
    45 } elseif (!empty($_GET['action']) && $_GET['action']=='get' && $plugin_config->getPermission('add') ) { 
    46   include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); 
    47        
     45} elseif (!empty($_GET['action']) && $_GET['action']=='get' && $me->getPermission('add')) { 
    4846  $query = ' 
    4947SELECT 
    5048    id AS tag_id, 
    5149    name AS tag_name 
    52   FROM '.TAGS_TABLE.' 
    53 ;'; 
     50  FROM '.TAGS_TABLE; 
     51 
     52  if (!empty($_GET['q'])) { 
     53    $query .= ' WHERE url_name like \'%'.pwg_db_real_escape_string($_GET['q']).'%\';'; 
     54  } else { 
     55    $query .= ';'; 
     56  } 
    5457  header("Content-Type: application/json"); 
    55   echo json_encode(get_fckb_taglist($query)); 
     58  echo json_encode(__get_taglist($query)); 
    5659  exit(); 
    5760} 
     61 
     62/* 
     63 * temporary functions before piwigo 2.3 
     64 * See admin/include/functions.php in piwigo core 
     65 */ 
     66function __get_taglist($query) { 
     67  $result = pwg_query($query); 
     68 
     69  $taglist = array(); 
     70  while ($row = pwg_db_fetch_assoc($result)) { 
     71    $taglist[] = array('name' => $row['tag_name'], 
     72                       'id' => '~~'.$row['tag_id'].'~~' 
     73                       ); 
     74  } 
     75 
     76  $cmp = create_function('$a,$b', 'return strcasecmp($a[\'name\'], $b[\'name\']);'); 
     77  usort($taglist, $cmp); 
     78 
     79  return $taglist; 
     80} 
     81 
     82function __get_tag_ids($raw_tags) { 
     83  $tag_ids = array(); 
     84  $raw_tags = explode(',',$raw_tags); 
     85 
     86  foreach ($raw_tags as $raw_tag) { 
     87    if (preg_match('/^~~(\d+)~~$/', $raw_tag, $matches)) { 
     88      $tag_ids[] = $matches[1]; 
     89    } else { 
     90      $tag_ids[] = tag_id_from_tag_name($raw_tag); 
     91    } 
     92  } 
     93 
     94  return $tag_ids; 
     95} 
    5896?> 
  • extensions/user_tags/include/t4u_config.class.php

    r9037 r11081  
    9999  } 
    100100   
    101   public function getActionUrl($base_url, $action) { 
    102     global $conf; 
    103  
    104     $url = $base_url; 
    105     if ($conf['question_mark_in_urls']) { 
    106       $url .= '&'; 
     101  public function getActionUrl($action, $method='POST') { 
     102    $url = get_root_url().'admin.php?page=plugin'; 
     103    $file = basename($this->plugin_dir) . '/' .'admin.php'; 
     104    if (strtoupper($method)=='POST') { 
     105        $url .= '&section='.urlencode($file); 
     106        $url .= '&action='.urlencode($action); 
    107107    } else { 
    108       $url .= '?';       
     108        $url .= '&section='.$file; 
     109        $url .= '&action='.$action; 
    109110    } 
    110     $url .= 'action='.$action;            
    111111 
    112112    return $url; 
  • extensions/user_tags/include/t4u_content.class.php

    r9037 r11081  
    3030 
    3131    if (!$this->plugin_config->hasPermission('add')) { 
    32       return $content; 
    33     } 
    34  
    35     load_language('plugin.lang', T4U_PLUGIN_LANG); 
    36  
    37     if (version_compare(PHPWG_VERSION, '2.2', '>=') || (PHPWG_VERSION=='Colibri')) { 
    38       $template->func_combine_script(array('id' => 'jquery', 
    39                                            'path' => 'themes/default/js/jquery.min.js' 
    40                                            ), 
    41                                      $template->smarty 
    42                                      ); 
    43     } else { 
    44       $template->func_known_script(array('id' => 'jquery', 
    45                                          'src' => get_root_url().'themes/default/js/jquery.packed.js' 
    46                                          ), 
    47                                    $template->smarty 
    48                                    ); 
     32      return false; 
    4933    } 
    5034 
     
    5236    $template->assign('T4U_CSS', T4U_CSS); 
    5337    $template->assign('T4U_IMGS', T4U_IMGS); 
    54     $template->assign('T4U_ADD_SCRIPT', $this->plugin_config->getActionUrl($picture['url'], 'add')); 
    55     $template->assign('T4U_GET_SCRIPT', $this->plugin_config->getActionUrl($picture['url'], 'get')); 
     38    $template->assign('T4U_ADD_SCRIPT', $this->plugin_config->getActionUrl('add', 'GET')); 
     39    $template->assign('T4U_GET_SCRIPT', $this->plugin_config->getActionUrl('get', 'GET')); 
    5640    $template->assign('T4U_IMAGE_ID', $picture['id']); 
    57     $template->assign('T4U_REFERER', htmlentities($picture['url'])); 
     41    $template->assign('T4U_REFERER', urlencode($picture['url'])); 
    5842    $template->assign('T4U_PERMISSION_DELETE', $this->plugin_config->hasPermission('delete')); 
    5943 
  • extensions/user_tags/js/jquery.addtags.js

    r9037 r11081  
    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}('(4($){$.l=4(u,3){$(u).n(\'\');$(u).Y().m(3).13(Q).X(1c)};$.R.l=4(3){9.T(4(){U $.l(9,3)})};K 9})(15);4 D(3){c h=\'12: \';$(\'#2-r\').C(\'2-7\').y(\'7\',\'7\');g(3.A){h=\'<a t="S">\'+8[3.A]+\'</a>\'}W g(3.M){h=\'<a t="Z">\'+8[3.M]+\'</a>\'}g(h!=\'\'){$(\'#o p.f\').m(\'<a 6="P-O"></a>\');$(\'#P-O\').l(h)}}4 x(1a){$(\'#2-r\').11(\'2-7\').17(\'7\');K}$(4(){c 5=\'<i 14="\'+b[\'L\']+\'" 16="F" 6="2-G-i">\';5+=\'<B 6="d" q="d">\';5+=1b;5+=\'</B>\';5+=\'<v 6="2-19-6" s="I" q="18" f="\'+b[\'10\']+\'">\';5+=\'<v 6="2-H" s="I" q="H" f="\'+b[\'V\']+\'">\';5+=\'<v 6="2-r" s="E" 7="7" t="2-7" f="\'+8[\'1u\']+\'">\';5+=\'</i>\';g($(\'#o\').1A>0){$(\'#o p.1B\').m(\'<1z 6="2-1y" 1w="\'+b[\'1x\']+\'" 1D="\'+8[\'z\']+\'">\').y(\'1d\',8[\'z\']).C(\'2-1I\').J(4(){$(9).1K(\'J\');c w=$(9).1J().1H(\'p.f\');c 1E=w.n();w.n(5);$(\'#d\').1F({1C:b[\'1v\'],1j:8[\'1k\'],1i:N,1h:N,1e:j,1f:j,1g:j,1l:x,1m:x,1s:1t,1r:j});$(\'#2-G-i\').E(4(e){c k=$(9).1q();g(k.1n(\'d%1o%1p=\')==-1){k+=\'&d=\'}$.F(b[\'L\'],k,4(3){D(3)});e.1G()})})}});',62,109,'||t4u|data|function|newRow|id|disabled|vocab|this|div|path|var|tags||value|if|message|form|true|serialized_form|flashMessage|append|html|Tags|td|name|update|type|class|source|input|tags_value|t4u_onchange|attr|click_to_add_tags|info|select|addClass|t4u_form_sucess|submit|post|addtags|referer|hidden|click|return|t4u_add_script|error|false|messages|flash|500|fn|infos|each|new|t4u_referer|else|fadeOut|hide|errors|t4u_image_id|removeClass|Message|fadeIn|action|jQuery|method|removeAttr|image_id|image|item|related_tags|3000|title|filter_hide|firstselected|filter_selected|filter_case|cache|complete_text|start_to_type|onremove|onselect|lastIndexOf|5B|5D|serialize|newel|maxitems|100|update_tags|t4u_get_script|src|t4u_edit_icon|edit|img|length|label|json_url|alt|old_tags_value|fcbkcomplete|preventDefault|find|clickable|parent|unbind'.split('|'),0,{})) 
     1eval(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 3e={1Y:"4G 4F a 4I 2u",2i:"4K u",2v:"4C...",3v:"&4x;",42:4z,2F:1,1a:C,1v:C,2J:"4H",4h:"55",3S:"q",2A:",",2I:H,2H:C,3x:H,4q:1D,15:C,2z:C,2x:C,2s:H};7 25={3l:"c-y-4Z",c:"c-y-c",3t:"c-y-4R-c",3C:"c-y-1l-c",2n:"c-y-3u-c",2V:"c-y-4W-c",E:"c-y-E",4i:"c-y-E-B",4j:"c-y-E-4V",2p:"c-y-3u-E-B",3i:"c-y-y-c"};7 U={2j:0,1X:1,1p:2};7 x={3j:8,3s:9,3q:13,3p:27,54:32,4X:33,4Y:34,1p:35,4U:36,26:37,24:38,2b:39,2c:40,3K:4T,3n:4P};$.4a.3Z=6(1c,1N){7 3=$.2S({},3e,1N||{});r k.O(6(){1l $.1O(k,1c,3)})};$.1O=6(y,1c,3){4(3k(1c)==="4Q"){3.T=1c;4(3.22===50){4(3.T.2O("://")===-1){3.22=H}j{3.22=(58.59.1w(/\\/+/g)[1]!==3.T.1w(/\\/+/g)[1])}}}j 4(3k(1c)==="5a"){3.2P=1c}4(3.t){3.t=$.2S({},25,3.t)}j 4(3.2D){3.t={};$.O(25,6(3f,h){3.t[3f]=h+"-"+3.2D})}j{3.t=25}7 R=[];7 1b=0;7 1I=1l $.1O.45();7 2o;7 1E;7 m=$("<y 1B=\\"2q\\"  56=\\"52\\">").17({51:"53"}).W(6(){4(3.1a===C||3.1a!==1b){4p()}}).1K(6(){14()}).4N("5c 3B 1K 29",3A).3B(6(o){7 Y;7 1f;4y(o.X){P x.26:P x.2b:P x.24:P x.2c:4(!$(k).v()){Y=S.2U();1f=S.3D();4((Y.D&&Y.A(0)===w)||(1f.D&&1f.A(0)===w)){4(o.X===x.26||o.X===x.24){18($(w),U.2j)}j{18($(w),U.1X)}}j 4((o.X===x.26||o.X===x.24)&&Y.D){1g($(Y.A(0)))}j 4((o.X===x.2b||o.X===x.2c)&&1f.D){1g($(1f.A(0)))}}j{7 1r=C;4(o.X===x.2c||o.X===x.2b){1r=$(N).3D()}j{1r=$(N).2U()}4(1r.D){20(1r)}r H}1L;P x.3j:Y=S.2U();4(!$(k).v().D){4(w){2C($(w))}j 4(Y.D){1g($(Y.A(0)))}r H}j 4($(k).v().D===1){14()}j{2g(6(){2k()},5)}1L;P x.3s:P x.3q:P x.3K:P x.3n:4(N){2B($(N));r H}j 4(3.2s){4($(k).v().D>0){2f($(k).v(),$(k).v(),1D);$(k).v("")}r H}1L;P x.3p:14();r 1D;4A:4(4t.4v(o.4S)){2g(6(){2k()},5)}1L}});7 K=$(y).1h().v("").W(6(){m.W()}).1K(6(){m.1K()});7 w=C;7 M=0;7 N=C;7 19=$("<4n />").I(3.t.3l).1G(6(o){7 n=$(o.1t).1n("n");4(n&&n.A(0)&&$.f(n.A(0),"1j")){3G(n)}j{4(w){18($(w),U.1p)}m.W()}}).4m(6(o){7 n=$(o.1t).1n("n");4(n&&w!==k){n.I(3.t.2V)}}).5d(6(o){7 n=$(o.1t).1n("n");4(n&&w!==k){n.23(3.t.2V)}}).2h(K);7 S=$("<n />").I(3.t.3i).1k(19).1A(m);7 E=$("<1d>").I(3.t.E).1k("5Q").1h();7 2Q=$("<5L/>").2K(m).17({1o:"3o",2Z:-3h,2y:-3h,2X:"5G",3I:m.17("3I"),3F:m.17("3F"),3z:m.17("3z"),3y:m.17("3y"),5I:"5S"});K.v("");7 G=3.2H||K.f("5J");4(3.3x&&$.1u(3.15)){G=3.15.1y(K,G)}4(G&&G.D){$.O(G,6(J,h){2l(h.d,h.z)})}6 3A(){4(1E===(1E=m.v())){r}7 3E=1E.1s(/&/g,\'&5V;\').1s(/\\s/g,\' \').1s(/</g,\'&5T;\').1s(/>/g,\'&5U;\');2Q.16(3E);m.2X(2Q.2X()+30)}6 5Y(V){r((V>=48&&V<=5D)||(V>=5m&&V<=5l)||(V>=5n&&V<=5o)||(V>=5p&&V<=5j))}6 3w(d,h){3a(d,h,3.t.3C)}6 2l(d,h){3a(d,h,3.t.c)}6 3a(d,h,3N){7 1Q=$("<n><1P>"+h+"</1P></n>").I(3N).2h(S);$("<1P>"+3.3v+"</1P>").I(3.t.3t).1k(1Q).1G(6(){2C($(k).3U());r H});7 12={"d":d,"z":h};$.f(1Q.A(0),"1j",12);R=R.1T(0,M).2G([12]).2G(R.1T(M));M++;7 1Z=$.3r(R,6(21){r 21.d});K.v(1Z.3c(3.2A));1b+=1;r 1Q}6 2B(B){7 12=$.f(B.A(0),"1j")2f(12.d,12.z,H)}6 2f(d,z,3O){7 G={d:d,z:z};7 1i=3.2z;4(1b>0&&3.2I){7 1q=C;19.1R().O(6(){7 2L=$(k);7 2e=$.f(2L.A(0),"1j");4(2e&&2e.d===G.d){1q=2L;r H}});4(1q){1g(1q);S.2K(1q);m.W();r}}4(3O){3w(G.d,G.z)}j{2l(G.d,G.z)}4(3.1a!==C&&1b>=3.1a){m.1h();14();r}j{m.W()}m.v("");14();4($.1u(1i)){1i.1y(K,G)}}6 1g(c){c.I(3.t.2n);w=c.A(0);m.v("");14()}6 18(c,1o){c.23(3.t.2n);w=C;4(1o===U.2j){S.2h(c);M--}j 4(1o===U.1X){S.2K(c);M++}j{S.1k(19);M=1b}m.W()}6 3G(c){7 3M=w;4(w){18($(w),U.1p)}4(3M===c.A(0)){18(c,U.1p)}j{1g(c)}}6 2C(c){7 12=$.f(c.A(0),"1j");7 1i=3.2x;7 J=c.5B().D;4(J>M)J--;c.4e();w=C;m.W();R=R.1T(0,J).2G(R.1T(J+1));4(J<M)M--;7 1Z=$.3r(R,6(21){r 21.d});K.v(1Z.3c(3.2A));1b-=1;4(3.1a!==C){m.2r().v("").W()}4($.1u(1i)){1i.1y(K,12)}}6 14(){E.1h().4l();N=C}6 1x(){E.17({1o:"3o",2Z:$(19).4r().2Z+$(19).5P(),2y:$(19).4r().2y,5w:5v}).2r()}6 41(){4(3.2v){E.16("<p>"+3.2v+"</p>");1x()}}6 4p(){4(3.1Y){E.16("<p>"+3.1Y+"</p>");1x()}}6 4k(h,2u){r h.1s(1l 5u("(?![^&;]+;)(?!<[^<>]*)("+2u+")(?![^<>]*>)(?![^&;]+;)","5s"),"<b>$1</b>")}6 1J(l,u){4(u&&u.D){E.4l();7 1V=$("<4n>").1k(E).4m(6(o){20($(o.1t).1n("n"))}).5t(6(o){2B($(o.1t).1n("n"));r H}).1h();$.O(u,6(J,h){7 1z=$("<n>"+4k(h.z,l)+"</n>").1k(1V);4(J%2){1z.I(3.t.4i)}j{1z.I(3.t.4j)}4(J===0){20(1z)}$.f(1z.A(0),"1j",{"d":h.d,"z":h.z})});1x();4(3.4q){1V.5A("5z")}j{1V.2r()}}j{4(3.2i){E.16("<p>"+3.2i+"</p>");1x()}}}6 20(B){4(B){4(N){3Y($(N))}B.I(3.t.2p);N=B.A(0)}}6 3Y(B){B.23(3.t.2p);N=C}6 2k(){7 l=m.v().1F();4(l&&l.D){4(w){18($(w),U.1X)}4(l.D>=3.2F){41();5g(2o);2o=2g(6(){3X(l)},3.42)}j{14()}}}6 3X(l){7 2E=1I.A(l);4(2E){1J(l,2E)}j{4(3.T){7 L={};L.f={};4(3.T.2O("?")>-1){7 2M=3.T.1w("?");L.T=2M[0];7 3W=2M[1].1w("&");$.O(3W,6(J,h){7 3b=h.1w("=");L.f[3b[0]]=3b[1]})}j{L.T=3.T}L.f[3.3S]=l;L.1B=3.2J;L.3R=3.4h;4(3.22){L.3R="5E"}L.5k=6(u){4($.1u(3.15)){u=3.15.1y(K,u)}1I.2W(l,3.1v?u[3.1v]:u);4(m.v().1F()===l){1J(l,3.1v?u[3.1v]:u)}};$.5Z(L)}j 4(3.2P){7 u=$.5W(3.2P,6(4d){r 4d.z.1F().2O(l.1F())>-1});4($.1u(3.15)){u=3.15.1y(K,u)}1I.2W(l,u);1J(l,u)}}}};$.1O.45=6(1N){7 3=$.2S({47:46},1N);7 f={};7 1M=0;7 49=6(){f={};1M=0};k.2W=6(l,u){4(1M>3.47){49()}4(!f[l]){1M+=1}f[l]=u};k.A=6(l){r f[l]}}}(4f));(6($){$.28=6(2T,f){$(2T).16(\'\');$(2T).1h().1A(f).4M(46).4E(4D)};$.4a.28=6(f){k.O(6(){1l $.28(k,f)})};r k})(4f);6 2w(B){2N.2Y(\'2w\');2N.2Y(B);$(\'#Z\').1A(\'<1C h="\'+B.d+\'">\'+B.z+\'</1C>\');2a()}6 3m(B){$(\'#Z\').1R(\'1C\').O(6(i){4($(k).2q()==B.z){$(k).4e()}});2a()}6 2a(B){2N.2Y(\'2a\');$(\'#F-29\').23(\'F-11\').4w(\'11\');r}6 3J(f){7 1m=\'\';$(\'#F-29\').I(\'F-11\').1H(\'11\',\'11\');4(f.4c){1m=\'<1d 2m="4s">\'+f.4c+\'</1d>\'}j 4(f.44){1m=\'<1d 2m="4B">\'+f.44+\'</1d>\'}4(1m!=\'\'){$(\'#2R 31.h\').1A(\'<1d d="43-3V"></1d>\');$(\'#43-3V\').28(1m)}}$(6(){7 Q=\'<1U 57="\'+1e[\'3g\']+\'" 2J="3P" d="F-3d-1U">\';Q+=\'<3T d="Z" z="Z">\';Q+=5b;Q+=\'</3T>\';Q+=\'<y d="F-3L-d" 1B="4g" z="3H" h="\'+1e[\'4O\']+\'">\';Q+=\'<y d="F-1S" 1B="4g" z="1S" h="\'+1e[\'5y\']+\'">\';Q+=\'<y d="F-29" 1B="3Q" 11="11" 2m="F-11" h="\'+1W[\'4u\']+\'">\';Q+=\'</1U>\';4($(\'#2R\').D>0){$(\'#2R 31.4L\').1A(\'<5N d="F-5M" 5O="\'+1e[\'5K\']+\'" 5F="\'+1W[\'4b\']+\'">\').1H(\'5H\',1W[\'4b\']).I(\'F-5R\').1G(6(){$(k).5X(\'1G\');7 2d=$(k).3U().5f(\'31.h\');7 5e=2d.16();2d.16(Q);7 2t=[];$(\'#Z\').1R(\'1C\').O(6(){2t.5h({d:$(k).1H(\'d\'),z:$(k).2q()})});$.5i(1e[\'5q\'],6(f){$(\'#Z\').3Z(f,{1Y:1W[\'5r\'],2D:\'5C\',2F:2,1a:5x,2I:1D,2H:2t,2x:3m,2z:2w,2s:1D})});$(\'#F-3d-1U\').3Q(6(e){e.4o();7 10=\'3H=\'+$(\'#F-3L-d\',$(k)).v();10+=\'&1S=\'+$(\'#F-1S\',$(k)).v();10+=\'&Z=\';$(\'#Z\').1R(\'1C\').O(6(i){10+=$(k).1H(\'h\')+\',\'});10=10.4J(0,10.D-1);$.3P(1e[\'3g\'],10,6(f){3J(f)});e.4o()})})}});',62,372,'|||settings|if||function|var|||||token|id||data||value||else|this|query|input_box|li|event|||return||classes|results|val|selected_token|KEY|input|name|get|item|null|length|dropdown|t4u|li_data|false|addClass|index|hidden_input|ajax_params|selected_token_index|selected_dropdown_item|each|case|newRow|saved_tokens|input_token|url|POSITION|keycode|focus|keyCode|previous_token|tags|serialized_form|disabled|token_data||hide_dropdown|onResult|html|css|deselect_token|token_list|tokenLimit|token_count|url_or_data|div|path|next_token|select_token|hide|callback|tokeninput|appendTo|new|message|closest|position|END|found_existing_token|dropdown_item|replace|target|isFunction|jsonContainer|split|show_dropdown|call|this_li|append|type|option|true|input_val|toLowerCase|click|attr|cache|populate_dropdown|blur|break|size|options|TokenList|span|this_token|children|referer|slice|form|dropdown_ul|vocab|AFTER|hintText|token_ids|select_dropdown_item|el|crossDomain|removeClass|UP|DEFAULT_CLASSES|LEFT||flashMessage|update|t4u_on_change|RIGHT|DOWN|tags_value|existing_data|_add_token|setTimeout|insertBefore|noResultsText|BEFORE|do_search|insert_token|class|selectedToken|timeout|selectedDropdownItem|text|show|allowNewItems|existing_tags|term|searchingText|t4u_on_add|onDelete|left|onAdd|tokenDelimiter|add_token|delete_token|theme|cached_results|minChars|concat|prePopulate|preventDuplicates|method|insertAfter|existing_token|parts|console|indexOf|local_data|input_resizer|Tags|extend|source|prev|highlightedToken|add|width|log|top||td|||||||||_insert_token|kv|join|addtags|DEFAULT_SETTINGS|key|t4u_add_script|9999|inputToken|BACKSPACE|typeof|tokenList|t4u_on_delete|COMMA|absolute|ESCAPE|ENTER|map|TAB|tokenDelete|selected|deleteText|insert_new_token|processPrePopulate|letterSpacing|fontWeight|resize_input|keydown|tokenNew|next|escaped|fontFamily|toggle_select_token|image_id|fontSize|t4u_form_sucess|NUMPAD_ENTER|image|previous_selected_token|className|new_token|post|submit|dataType|queryParam|select|parent|messages|param_array|run_search|deselect_dropdown_item|tokenInput||show_dropdown_searching|searchDelay|flash|error|Cache|500|max_size||flush|fn|click_to_add_tags|info|row|remove|jQuery|hidden|contentType|dropdownItem|dropdownItem2|highlight_term|empty|mouseover|ul|preventDefault|show_dropdown_hint|animateDropdown|offset|infos|String|update_tags|fromCharCode|removeAttr|times|switch|300|default|errors|Searching|3000|fadeOut|in|Type|GET|search|substring|No|label|fadeIn|bind|t4u_image_id|188|string|delete|which|108|HOME|item2|highlighted|PAGE_UP|PAGE_DOWN|list|undefined|outline|off|none|SPACE|json|autocomplete|action|location|href|object|related_tags|keyup|mouseout|old_tags_value|find|clearTimeout|push|getJSON|222|success|111|96|186|192|219|t4u_get_script|start_to_type|gi|mousedown|RegExp|999|zindex|100|t4u_referer|fast|slideDown|prevAll|facebook|90|jsonp|alt|auto|title|whiteSpace|pre|t4u_edit_icon|tester|edit|img|src|outerHeight|body|clickable|nowrap|lt|gt|amp|grep|unbind|is_printable_character|ajax'.split('|'),0,{})) 
  • extensions/user_tags/language/en_UK/plugin.lang.php

    r6798 r11081  
    33// | User Tags  - a plugin for Piwigo                                      | 
    44// +-----------------------------------------------------------------------+ 
    5 // | Copyright(C) 2010 Nicolas Roudaire             http://www.nikrou.net  | 
     5// | Copyright(C) 2010-2011 Nicolas Roudaire        http://www.nikrou.net  | 
    66// +-----------------------------------------------------------------------+ 
    77// | This program is free software; you can redistribute it and/or modify  | 
     
    2020// +-----------------------------------------------------------------------+ 
    2121 
    22 // only to change default values (see language/templates/plugin.lang.php) 
     22/* 
     23 * The purpose of that file is to provide a way to overwrite 
     24 * default translation. 
     25 * See language/templates/plugin.lang.php for available keys 
     26 */ 
    2327?> 
  • extensions/user_tags/language/templates/plugin.lang.php

    r6813 r11081  
    2020// +-----------------------------------------------------------------------+ 
    2121 
     22// admin 
     23$lang['Add permission updated'] = ''; 
     24$lang['Be careful, whatever the configuration value is, new tag can be deleted anyway'] = ''; 
     25$lang['Delete permission updated'] = ''; 
     26$lang['Submit'] = ''; 
     27$lang['Tags updated'] = ''; 
     28$lang['That plugin allow visitors to add tags to image.'] = ''; 
     29$lang['User Tags'] = ''; 
     30$lang['Who can add tags?'] = ''; 
     31$lang['Who can delete related tags?'] = ''; 
     32$lang['You can choose which users (per status) can add and delete tags.'] = ''; 
     33 
     34// public 
    2235$lang['Click to add tags'] = ''; 
    2336$lang['Start to type'] = ''; 
    2437$lang['Update tags'] = ''; 
    25 $lang['Tags updated'] = ''; 
    26 $lang['Cancel'] = ''; 
    27  
    28 // admin 
    29 $lang['That plugin allow visitors to add tags to image.'] = ''; 
    30 $lang['You can choose which users (per status) can add and delete tags.'] = ''; 
    31 $lang['Be careful, whatever the configuration value is, new tag can be deleted anyway'] = ''; 
    32 $lang['Who can add tags?'] = ''; 
    33 $lang['Who can delete related tags?'] = ''; 
    34  
    35 $lang['Add permission updated'] = ''; 
    36 $lang['Delete permission updated'] = ''; 
    3738?> 
  • extensions/user_tags/main.inc.php

    r9284 r11081  
    2222/* 
    2323Plugin Name: User Tags 
    24 Version: 0.4.2 
     24Version: 0.5.0 
    2525Description: Allow visitors to add tag to images 
    2626Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=441 
  • extensions/user_tags/maintain.inc.php

    r6895 r11081  
    33// | User Tags  - a plugin for Piwigo                                      | 
    44// +-----------------------------------------------------------------------+ 
    5 // | Copyright(C) 2010 Nicolas Roudaire             http://www.nikrou.net  | 
     5// | Copyright(C) 2010-2011 Nicolas Roudaire        http://www.nikrou.net  | 
    66// +-----------------------------------------------------------------------+ 
    77// | This program is free software; you can redistribute it and/or modify  | 
     
    3636  $config_file = $GLOBALS['conf']['local_data_dir'].'/plugins/'; 
    3737  $config_file .= basename(dirname(__FILE__)).'.dat'; 
    38   unlink($config_file); 
     38  if (file_exists($config_file)) { 
     39    unlink($config_file); 
     40  } 
    3941} 
    4042?> 
  • extensions/user_tags/public.php

    r6846 r11081  
    33// | User Tags  - a plugin for Piwigo                                      | 
    44// +-----------------------------------------------------------------------+ 
    5 // | Copyright(C) 2010 Nicolas Roudaire             http://www.nikrou.net  | 
     5// | Copyright(C) 2010-2011 Nicolas Roudaire        http://www.nikrou.net  | 
    66// +-----------------------------------------------------------------------+ 
    77// | This program is free software; you can redistribute it and/or modify  | 
  • extensions/user_tags/template/add_tags.tpl

    r9056 r11081  
    1 {html_head} 
    2 <script type="text/javascript" src="{$ROOT_URL}{$T4U_JS}/jquery.fcbkcomplete.js"></script> 
    3 <script type="text/javascript"> 
     1{combine_css path="$T4U_CSS/style.css"} 
     2{combine_script id="addtags" require="jquery" path="$T4U_JS/jquery.addtags.js"} 
     3 
     4{footer_script require="addtags"} 
    45var related_tags = ''; 
    5 var option_class = 'selected'; 
    6 {if ($T4U_PERMISSION_DELETE==false)} 
    7 option_class += ' locked';  
    8 {/if} 
    96{foreach from=$T4U_RELATED_TAGS item=tag key=id} 
    10 related_tags += '<option value="{$id}" class="'+option_class+'">{$tag}</option>'; 
     7related_tags += '<option value="{$id}">{$tag}</option>'; 
    118{/foreach} 
    129var path = new Array(); 
     
    2118vocab['start_to_type'] = "{'Start to type'|@translate}..."; 
    2219vocab['update_tags'] = "{'Update tags'|@translate}"; 
    23 vocab['Tags updated'] = "{'Tags updated'|@translate}"; 
    24 </script> 
    25 <script type="text/javascript" src="{$ROOT_URL}{$T4U_JS}/jquery.addtags.js"></script> 
    26 <link rel="stylesheet" type="text/css" href="{$ROOT_URL}{$T4U_CSS}/style.css"> 
    27 {/html_head} 
     20{/footer_script} 
Note: See TracChangeset for help on using the changeset viewer.