Changeset 26025


Ignore:
Timestamp:
12/18/13 18:48:06 (6 years ago)
Author:
mistic100
Message:

update for 2.6

Location:
extensions/EasyCaptcha
Files:
2 added
1 deleted
19 edited

Legend:

Unmodified
Added
Removed
  • extensions/EasyCaptcha/admin.php

    r24234 r26025  
    2020 
    2121  $conf['EasyCaptcha'] = array( 
    22     'activate_on'     => array( 
     22    'activate_on' => array( 
    2323      'picture'     => in_array('picture', $_POST['activate_on']), 
    2424      'category'    => in_array('category', $_POST['activate_on']) || !$loaded['category'], 
     
    4949      'sel'   => check_color($_POST['tictac']['sel']), 
    5050      ), 
     51    'lastmod' => time(), 
    5152    ); 
    5253 
    5354  conf_update_param('EasyCaptcha', serialize($conf['EasyCaptcha'])); 
    54   array_push($page['infos'], l10n('Information data registered in database')); 
     55  $page['infos'][] = l10n('Information data registered in database'); 
    5556} 
    5657 
     
    6364  while (($item = readdir($dh)) !== false ) 
    6465  { 
    65     if ($item!=='.' && $item!=='..' && is_dir($dir.'/'.$item) && file_exists($dir.'/'.$item.'/conf.inc.php')) 
     66    if ($item!=='.' && $item!=='..' && 
     67        is_dir($dir.'/'.$item) && file_exists($dir.'/'.$item.'/conf.inc.php') 
     68      ) 
    6669    { 
    6770      $drag_images = include($dir.'/'.$item.'/conf.inc.php'); 
     
    8083  'easycaptcha' => $conf['EasyCaptcha'], 
    8184  'loaded' => $loaded, 
    82   'THEMES' => list_themes(EASYCAPTCHA_PATH.'drag'), 
     85  'THEMES' => list_themes(EASYCAPTCHA_PATH . 'drag'), 
    8386  'EASYCAPTCHA_PATH' => EASYCAPTCHA_PATH, 
    84   'EASYCAPTCHA_ABS_PATH' => realpath(EASYCAPTCHA_PATH).'/', 
     87  'EASYCAPTCHA_ABS_PATH' => realpath(EASYCAPTCHA_PATH) . '/', 
     88  'DRAG_CSS' => file_get_contents(EASYCAPTCHA_PATH . 'template/drag.css'), 
    8589  )); 
    8690 
    87 $template->set_filename('plugin_admin_content', realpath(EASYCAPTCHA_PATH.'template/admin.tpl')); 
     91$template->set_filename('plugin_admin_content', realpath(EASYCAPTCHA_PATH . 'template/admin.tpl')); 
    8892$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); 
    8993 
     
    101105  else if (strlen($hex) != 6) 
    102106  { 
    103     $page['errors'][] = sprintf(l10n('Invalid color code <i>%s</i>'), '#'.$hex); 
     107    $page['errors'][] = l10n('Invalid color code <i>%s</i>', '#'.$hex); 
    104108    $hex = '000000'; 
    105109  } 
  • extensions/EasyCaptcha/include/category.inc.php

    r24215 r26025  
    1515{ 
    1616  $search = '{$comment_add.CONTENT}</textarea></p>'; 
    17   return str_replace($search, $search."\n{\$EASYCAPTCHA}", $content); 
     17  return str_replace($search, $search."\n{\$EASYCAPTCHA_CONTENT}", $content); 
    1818} 
    1919 
  • extensions/EasyCaptcha/include/common.inc.php

    r24215 r26025  
    2828  $conf['EasyCaptcha']['drag']['selected'] = array_rand($conf['EasyCaptcha']['drag']['selection']); 
    2929  $conf['EasyCaptcha']['drag']['text']     = l10n($drag_images[ $conf['EasyCaptcha']['drag']['selected'] ]); 
    30   $conf['EasyCaptcha']['drag']['key']      = $conf['EasyCaptcha']['challenge'] .'-'. pwg_password_hash($conf['secret_key'] . $conf['EasyCaptcha']['drag']['selected']); 
    31  
    32   $template->assign('EASYCAPTCHA_CONF', $conf['EasyCaptcha']['drag']); 
     30  $conf['EasyCaptcha']['key']      = $conf['EasyCaptcha']['challenge'] .'-'. pwg_password_hash($conf['secret_key'] . $conf['EasyCaptcha']['drag']['selected']); 
    3331} 
    3432// Tic-tac-toe 
    3533else if ($conf['EasyCaptcha']['challenge'] == 'tictac') 
    3634{ 
    37   $conf['EasyCaptcha']['tictac']['key'] = $conf['EasyCaptcha']['challenge'] .'-0'; 
    38   $template->assign('EASYCAPTCHA_CONF', $conf['EasyCaptcha']['tictac']); 
     35  $conf['EasyCaptcha']['key'] = $conf['EasyCaptcha']['challenge'] .'-0'; 
    3936} 
    4037else 
     
    4643 
    4744$template->assign(array( 
    48   'EASYCAPTCHA_CHALLENGE' => $conf['EasyCaptcha']['challenge'], 
     45  'EASYCAPTCHA' => $conf['EasyCaptcha'], 
    4946  'EASYCAPTCHA_PATH' => EASYCAPTCHA_PATH, 
    5047  'EASYCAPTCHA_ABS_PATH' => realpath(EASYCAPTCHA_PATH).'/', 
     
    5249 
    5350$template->set_filename('EasyCaptcha', realpath(EASYCAPTCHA_PATH.'template/'.$conf['EasyCaptcha']['template'].'.tpl')); 
    54 $template->assign_var_from_handle('EASYCAPTCHA', 'EasyCaptcha'); 
     51$template->assign_var_from_handle('EASYCAPTCHA_CONTENT', 'EasyCaptcha'); 
    5552 
    5653 
  • extensions/EasyCaptcha/include/contactform.inc.php

    r24215 r26025  
    1515{ 
    1616  $search = '{$contact.content}</textarea></td>'; 
    17   return str_replace($search, $search."\n{\$EASYCAPTCHA}", $content); 
     17  return str_replace($search, $search."\n{\$EASYCAPTCHA_CONTENT}", $content); 
    1818} 
    1919 
  • extensions/EasyCaptcha/include/guestbook.inc.php

    r24215 r26025  
    1515{ 
    1616  $search = '#{\$comment_add\.CONTENT}</textarea>(\s*)</td>(\s*)</tr>#'; 
    17   $replace = '{\$comment_add.CONTENT}</textarea>$1</td>$2</tr>'."\n".'{\$EASYCAPTCHA}'; 
     17  $replace = '{\$comment_add.CONTENT}</textarea>$1</td>$2</tr>'."\n".'{\$EASYCAPTCHA_CONTENT}'; 
    1818  return preg_replace($search, $replace, $content); 
    1919} 
  • extensions/EasyCaptcha/include/picture.inc.php

    r24215 r26025  
    1515{ 
    1616  $search = '{$comment_add.CONTENT}</textarea></p>'; 
    17   return str_replace($search, $search."\n{\$EASYCAPTCHA}", $content); 
     17  return str_replace($search, $search."\n{\$EASYCAPTCHA_CONTENT}", $content); 
    1818} 
    1919 
  • extensions/EasyCaptcha/include/register.inc.php

    r24215 r26025  
    1515{ 
    1616  $search = '<input type="checkbox" name="send_password_by_mail" id="send_password_by_mail" value="1" checked="checked">'; 
    17   return str_replace($search, $search."\n{\$EASYCAPTCHA}", $content); 
     17  return str_replace($search, $search."\n{\$EASYCAPTCHA_CONTENT}", $content); 
    1818} 
    1919 
  • extensions/EasyCaptcha/language/en_UK/plugin.lang.php

    r24340 r26025  
    3535$lang['This challenge requires that JavaScript is enabled on the visitor browser. About 1% of Internet users have Javascript disabled.'] = 'This challenge requires that JavaScript is enabled in the visitor\'s browser. About 1% of Internet users have JavaScript disabled.'; 
    3636$lang['We detected that Crypto Captcha plugin is available on your gallery. Both plugins can be used at the same time, but you should not under any circumstances activate both of them on the same page.'] = 'We detected that Crypto Captcha plugin is available in your gallery. Both plugins can be used at the same time, but you should not under any circumstances activate both of them on the same page.'; 
     37$lang['Nowhere'] = 'Nowhere'; 
    3738?> 
  • extensions/EasyCaptcha/language/fr_FR/plugin.lang.php

    r24972 r26025  
    3535$lang['This challenge requires that JavaScript is enabled on the visitor browser. About 1% of Internet users have Javascript disabled.'] = 'Ce test requiert que JavaScript soit activé sur le navigateur du visiteur. Environ 1% des utilisateurs d\'Internet ont JavaScript désactivé.'; 
    3636$lang['We detected that Crypto Captcha plugin is available on your gallery. Both plugins can be used at the same time, but you should not under any circumstances activate both of them on the same page.'] = 'Nous avons détecté que Crypto Captcha est activé sur votre galerie. Les deux plugins peuvent fonctionner en même temps, mais sous aucun prétexte ils ne doivent être activés sur les mêmes pages.'; 
     37$lang['Nowhere'] = 'Nulle part'; 
    3738?> 
  • extensions/EasyCaptcha/main.inc.php

    r24234 r26025  
    1111defined('PHPWG_ROOT_PATH') or die('Hacking attempt!'); 
    1212 
    13 // TODO : test on mobile 
     13// TODO : captcha on mobile 
    1414if (mobile_theme()) 
    1515{ 
     
    1717} 
    1818 
    19 defined('EASYCAPTCHA_ID') or define('EASYCAPTCHA_ID', basename(dirname(__FILE__))); 
    20 define('EASYCAPTCHA_PATH' , PHPWG_PLUGINS_PATH . EASYCAPTCHA_ID . '/'); 
    21 define('EASYCAPTCHA_ADMIN', get_root_url() . 'admin.php?page=plugin-' . EASYCAPTCHA_ID); 
     19define('EASYCAPTCHA_ID',      basename(dirname(__FILE__))); 
     20define('EASYCAPTCHA_PATH' ,   PHPWG_PLUGINS_PATH . EASYCAPTCHA_ID . '/'); 
     21define('EASYCAPTCHA_ADMIN',   get_root_url() . 'admin.php?page=plugin-' . EASYCAPTCHA_ID); 
    2222define('EASYCAPTCHA_VERSION', 'auto'); 
    2323 
     
    4040  global $conf, $pwg_loaded_plugins; 
    4141 
    42   if ( 
    43     EASYCAPTCHA_VERSION == 'auto' or 
    44     $pwg_loaded_plugins[EASYCAPTCHA_ID]['version'] == 'auto' or 
    45     version_compare($pwg_loaded_plugins[EASYCAPTCHA_ID]['version'], EASYCAPTCHA_VERSION, '<') 
    46   ) 
    47   { 
    48     include_once(EASYCAPTCHA_PATH . 'include/install.inc.php'); 
    49     easycaptcha_install(); 
    50  
    51     if ( $pwg_loaded_plugins[EASYCAPTCHA_ID]['version'] != 'auto' && EASYCAPTCHA_VERSION != 'auto' ) 
    52     { 
    53       $query = ' 
    54 UPDATE '. PLUGINS_TABLE .' 
    55 SET version = "'. EASYCAPTCHA_VERSION .'" 
    56 WHERE id = "'. EASYCAPTCHA_ID .'"'; 
    57       pwg_query($query); 
    58  
    59       $pwg_loaded_plugins[EASYCAPTCHA_ID]['version'] = EASYCAPTCHA_VERSION; 
    60     } 
    61   } 
     42  include_once(EASYCAPTCHA_PATH . 'maintain.inc.php'); 
     43  $maintain = new EasyCaptcha_maintain(EASYCAPTCHA_ID); 
     44  $maintain->autoUpdate(EASYCAPTCHA_VERSION, 'install'); 
    6245 
    6346  load_language('plugin.lang', EASYCAPTCHA_PATH); 
     
    7154  global $conf, $pwg_loaded_plugins, $page; 
    7255 
    73   if (!is_a_guest()) return; 
     56  if (!is_a_guest()) 
     57  { 
     58    return; 
     59  } 
    7460 
    75   if ( script_basename() == 'register' && $conf['EasyCaptcha']['activate_on']['register'] ) 
     61  if (script_basename() == 'register' && $conf['EasyCaptcha']['activate_on']['register']) 
    7662  { 
    7763    $conf['EasyCaptcha']['template'] = 'register'; 
    7864    include(EASYCAPTCHA_PATH . 'include/register.inc.php'); 
    7965  } 
    80   else if ( script_basename() == 'picture' && $conf['EasyCaptcha']['activate_on']['picture'] ) 
     66  else if (script_basename() == 'picture' && $conf['EasyCaptcha']['activate_on']['picture']) 
    8167  { 
    8268    $conf['EasyCaptcha']['template'] = 'comment'; 
     
    9581      include(EASYCAPTCHA_PATH . 'include/category.inc.php'); 
    9682    } 
    97     else if ( $page['section'] == 'contact' && $conf['EasyCaptcha']['activate_on']['contactform'] ) 
     83    else if ($page['section'] == 'contact' && $conf['EasyCaptcha']['activate_on']['contactform']) 
    9884    { 
    9985      $conf['EasyCaptcha']['template'] = 'contactform'; 
    10086      include(EASYCAPTCHA_PATH . 'include/contactform.inc.php'); 
    10187    } 
    102     else if ( $page['section'] == 'guestbook' && $conf['EasyCaptcha']['activate_on']['guestbook'] ) 
     88    else if ($page['section'] == 'guestbook' && $conf['EasyCaptcha']['activate_on']['guestbook']) 
    10389    { 
    10490      $conf['EasyCaptcha']['template'] = 'guestbook'; 
     
    11298function easycaptcha_plugin_admin_menu($menu) 
    11399{ 
    114   array_push($menu, array( 
     100  $menu[] = array( 
    115101    'NAME' => 'Easy Captcha', 
    116102    'URL' => EASYCAPTCHA_ADMIN, 
    117     )); 
     103    ); 
    118104  return $menu; 
    119105} 
  • extensions/EasyCaptcha/maintain.inc.php

    r24215 r26025  
    22defined('PHPWG_ROOT_PATH') or die('Hacking attempt!'); 
    33 
    4 defined('EASYCAPTCHA_ID') or define('EASYCAPTCHA_ID', basename(dirname(__FILE__))); 
    5 include_once(PHPWG_PLUGINS_PATH . EASYCAPTCHA_ID . '/include/install.inc.php'); 
     4class EasyCaptcha_maintain extends PluginMaintain 
     5{ 
     6  private $installed = false; 
    67 
    7 function plugin_install() 
    8 { 
    9   easycaptcha_install(); 
    10   define('easycaptcha_installed', true); 
    11 } 
     8  function install($plugin_version, &$errors=array()) 
     9  { 
     10    global $conf; 
    1211 
    13 function plugin_activate() 
    14 { 
    15   if (!defined('easycaptcha_installed')) 
     12    if (empty($conf['EasyCaptcha'])) 
     13    { 
     14      $default_config = array( 
     15        'activate_on' => array( 
     16          'picture'     => true, 
     17          'category'    => true, 
     18          'register'    => true, 
     19          'contactform' => true, 
     20          'guestbook'   => true, 
     21          ), 
     22        'comments_action' => 'reject', 
     23        'challenge' => 'random', 
     24        'drag' => array( 
     25          'theme' => 'icons', 
     26          'size'  => 50, 
     27          'nb'    => 5, 
     28          'bg1'   => '#F7F7F7', 
     29          'bg2'   => '#E5E5E5', 
     30          'obj'   => '#FFFFFF', 
     31          'sel'   => '#C8FF96', 
     32          'bd1'   => '#DDDDDD', 
     33          'bd2'   => '#555555', 
     34          'txt'   => '#222222', 
     35          ), 
     36        'tictac' => array( 
     37          'size'  => 128, 
     38          'bg1'   => '#F7F7F7', 
     39          'bg2'   => '#E5E5E5', 
     40          'bd'    => '#DDDDDD', 
     41          'obj'   => '#00B4F7', 
     42          'sel'   => '#F7B400', 
     43          ), 
     44        'lastmod' => time(), 
     45        ); 
     46 
     47      $conf['EasyCaptcha'] = serialize($default_config); 
     48      conf_update_param('EasyCaptcha', $conf['EasyCaptcha']); 
     49    } 
     50    else 
     51    { 
     52      $old_conf = is_string($conf['EasyCaptcha']) ? unserialize($conf['EasyCaptcha']) : $conf['EasyCaptcha']; 
     53 
     54      if (empty($old_conf['lastmod'])) 
     55      { 
     56        $old_conf['lastmod'] = time(); 
     57      } 
     58 
     59      $conf['EasyCaptcha'] = serialize($old_conf); 
     60      conf_update_param('EasyCaptcha', $conf['EasyCaptcha']); 
     61    } 
     62 
     63    $this->installed = true; 
     64  } 
     65 
     66  function activate($plugin_version, &$errors=array()) 
    1667  { 
    17     easycaptcha_install(); 
     68    if (!$this->installed) 
     69    { 
     70      $this->install($plugin_version, $errors); 
     71    } 
     72  } 
     73 
     74  function deactivate() 
     75  { 
     76  } 
     77 
     78  function uninstall() 
     79  { 
     80    conf_delete_param('EasyCaptcha'); 
    1881  } 
    1982} 
    20  
    21 function plugin_uninstall() 
    22 { 
    23   pwg_query('DELETE FROM '.CONFIG_TABLE.' WHERE param="EasyCaptcha" LIMIT 1'); 
    24 } 
  • extensions/EasyCaptcha/template/admin.tpl

    r24234 r26025  
    1 {combine_css path=$EASYCAPTCHA_PATH|@cat:"template/style.css"} 
    2  
    3 {combine_css path="themes/default/js/plugins/chosen.css"} 
     1{combine_css path=$EASYCAPTCHA_PATH|cat:'template/style.css'} 
     2 
     3{combine_css path='themes/default/js/plugins/chosen.css'} 
    44{combine_script id='jquery.chosen' load='footer' path='themes/default/js/plugins/chosen.jquery.min.js'} 
    55 
     
    88 
    99{assign var="spectrum_language" value=$EASYCAPTCHA_PATH|cat:'template/bgrins-spectrum/i18n/jquery.spectrum-'|cat:$lang_info.code|cat:'.js'} 
    10 {if 'PHPWG_ROOT_PATH'|@constant|@cat:$spectrum_language|file_exists} 
     10{if 'PHPWG_ROOT_PATH'|constant|cat:$spectrum_language|file_exists} 
    1111{combine_script id='jquery.spectrum.'|cat:$lang_info.code load='footer' require='jquery.spectrum' path=$spectrum_language} 
    1212{/if} 
    1313 
    1414 
    15 {footer_script}{literal} 
     15{footer_script} 
    1616// multiselect 
    1717$("select").css({ 
    18     "width":"700px" 
     18    width: 300 
    1919}).chosen({ 
    2020    disable_search:true, 
     21    placeholder_text_multiple: '{'Nowhere'|translate}' 
    2122}); 
    2223 
     
    3334$('.preview-tictac').on('change', function() { 
    3435    var inputs = ['size','bg1','bg2','bd','obj','sel'], 
    35         url = '{/literal}{$EASYCAPTCHA_PATH}{literal}' + 'tictac/gen_admin.php?t='+ new Date().getTime(); 
     36        url = '{$EASYCAPTCHA_PATH}' + 'tictac/gen_admin.php?t='+ new Date().getTime(); 
    3637 
    3738    for (var i=0; i<inputs.length; i++) { 
     
    4445 
    4546// Drag & drop preview 
    46 {/literal} 
    47 var themes = {ldelim} 
     47var themes = { 
    4848{foreach from=$THEMES key=theme item=params} 
    4949  '{$theme}': '{$EASYCAPTCHA_PATH}drag/{$theme}/{$params.image}', 
    5050{/foreach} 
    5151}; 
    52 {literal} 
    5352 
    5453$('.preview-drag').on('change', function() { 
     
    5958 
    6059    for (var i=0; i<inputs.length; i++) { 
    61         search = '{\\$EASYCAPTCHA_CONF\\.'+ inputs[i] +'}'; 
     60        search = '{ldelim}\\$EASYCAPTCHA.drag\\.'+ inputs[i] +'}'; 
    6261        replace = $('input[name="drag['+ inputs[i] +']"]').val(); 
    6362        style = style.replace(new RegExp(search, 'g'), replace); 
     
    6766        y = parseInt($('input[name="drag[nb]"]').val()); 
    6867 
    69     search = '{dat_equation}', 
     68    search = '{ldelim}math equation=\'15+(x+5)*y\' x=$EASYCAPTCHA.drag.size y=$EASYCAPTCHA.drag.nb}', 
    7069    replace = 15+(x+5)*y; 
    71     style = style.replace(new RegExp(search, 'g'), replace); 
     70    style = style.replace(search, replace); 
    7271 
    7372    $('#drag_style').text(style); 
     
    107106    $(this).nextAll('.preview').slideDown(); 
    108107}); 
    109 {/literal}{/footer_script} 
     108{/footer_script} 
    110109 
    111110 
     
    233232        <a class="buttonLike">{'Preview'|translate}</a> 
    234233        <div class="preview"> 
    235           {include file=$EASYCAPTCHA_ABS_PATH|cat:'template/common.inc.tpl' EASYCAPTCHA_CHALLENGE='drag' EASYCAPTCHA_CONF=$easycaptcha.drag} 
     234          {$easycaptcha.challenge = 'drag'} 
     235          {include file=$EASYCAPTCHA_ABS_PATH|cat:'template/common.inc.tpl' EASYCAPTCHA=$easycaptcha} 
    236236          {$smarty.capture.easycaptcha} 
    237237        </div> 
     
    251251    [<a href="https://www.iconfinder.com/iconsets/ie_Bright" class="externalLink">#4</a>] 
    252252  | Libraries 
    253     [<a href="http://bgrins.github.io/spectrum"class="externalLink">Spectrum.js</a>] 
    254     [<a href="http://threedubmedia.com"class="externalLink">jQuery.events</a>] 
     253    [<a href="http://bgrins.github.io/spectrum" class="externalLink">Spectrum.js</a>] 
     254    [<a href="http://threedubmedia.com" class="externalLink">jQuery.events</a>] 
    255255</div> 
    256256 
    257257 
    258258{* <!-- weird thing to update bunch of CSS --> *} 
    259 {html_head}{literal} 
     259{html_head} 
    260260<style id="drag_style"></style> 
    261261<script type="text/template" id="drag_style_src"> 
    262 #easycaptcha, #easycaptcha_noscript { 
    263   background: {$EASYCAPTCHA_CONF.bg1}; 
    264   background: -webkit-linear-gradient(top, {$EASYCAPTCHA_CONF.bg1} 0%, {$EASYCAPTCHA_CONF.bg2} 100%); 
    265   background: -moz-linear-gradient(top, {$EASYCAPTCHA_CONF.bg1} 0%, {$EASYCAPTCHA_CONF.bg2} 100%); 
    266   background: -ms-linear-gradient(top, {$EASYCAPTCHA_CONF.bg1} 0%, {$EASYCAPTCHA_CONF.bg2} 100%); 
    267   background: -o-linear-gradient(top, {$EASYCAPTCHA_CONF.bg1} 0%, {$EASYCAPTCHA_CONF.bg2} 100%); 
    268   background: linear-gradient(to bottom, {$EASYCAPTCHA_CONF.bg1} 0%, {$EASYCAPTCHA_CONF.bg2} 100%); 
    269   color:{$EASYCAPTCHA_CONF.txt}; 
    270 } 
    271 #easycaptcha .drag_item { 
    272   width:{$EASYCAPTCHA_CONF.size}px; 
    273   height:{$EASYCAPTCHA_CONF.size}px; 
    274   border:1px solid {$EASYCAPTCHA_CONF.bd1}; 
    275   background:{$EASYCAPTCHA_CONF.obj}; 
    276 } 
    277 #easycaptcha .drag_item img { 
    278   width:{$EASYCAPTCHA_CONF.size}px; 
    279   height:{$EASYCAPTCHA_CONF.size}px; 
    280 } 
    281 #easycaptcha .drop_zone { 
    282   width:{$EASYCAPTCHA_CONF.size}px; 
    283   height:{$EASYCAPTCHA_CONF.size}px; 
    284   margin-left:{dat_equation}px; 
    285   line-height:{$EASYCAPTCHA_CONF.size}px; 
    286   background: {$EASYCAPTCHA_CONF.bg1}; 
    287   background: -webkit-linear-gradient(bottom, {$EASYCAPTCHA_CONF.bg1} 0%, {$EASYCAPTCHA_CONF.bg2} 100%); 
    288   background: -moz-linear-gradient(bottom, {$EASYCAPTCHA_CONF.bg1} 0%, {$EASYCAPTCHA_CONF.bg2} 100%); 
    289   background: -ms-linear-gradient(bottom, {$EASYCAPTCHA_CONF.bg1} 0%, {$EASYCAPTCHA_CONF.bg2} 100%); 
    290   background: -o-linear-gradient(bottom, {$EASYCAPTCHA_CONF.bg1} 0%, {$EASYCAPTCHA_CONF.bg2} 100%); 
    291   background: linear-gradient(to top, {$EASYCAPTCHA_CONF.bg1} 0%, {$EASYCAPTCHA_CONF.bg2} 100%); 
    292   border:1px dotted {$EASYCAPTCHA_CONF.bd2}; 
    293   color:{$EASYCAPTCHA_CONF.txt}; 
    294 } 
    295 #easycaptcha .drop_zone.active { 
    296   background:{$EASYCAPTCHA_CONF.sel}; 
    297 } 
    298 #easycaptcha .drop_zone.valid { 
    299   background:{$EASYCAPTCHA_CONF.sel}; 
    300   box-shadow:0 0 0 2px {$EASYCAPTCHA_CONF.sel}; 
    301 } 
     262{$DRAG_CSS} 
    302263</script> 
    303 {/literal}{/html_head} 
     264{/html_head} 
  • extensions/EasyCaptcha/template/comment.tpl

    r24234 r26025  
    22 
    33{* <!-- DRAG & DROP --> *} 
    4 {if $EASYCAPTCHA_CHALLENGE == 'drag'} 
    5 <p><label>{'To verify you are a human, please place the <b>%s</b> in the most right box bellow.'|translate|sprintf:$EASYCAPTCHA_CONF.text}</label></p> 
     4{if $EASYCAPTCHA.challenge == 'drag'} 
     5<p><label>{'To verify you are a human, please place the <b>%s</b> in the most right box bellow.'|translate:$EASYCAPTCHA.drag.text}</label></p> 
    66 
    77{* <!-- TIC TAC TOE --> *} 
    8 {else if $EASYCAPTCHA_CHALLENGE == 'tictac'} 
     8{else if $EASYCAPTCHA.challenge == 'tictac'} 
    99<p><label>{'You are player X, click on the right case to complete the line.'|translate}</label></p> 
    1010 
  • extensions/EasyCaptcha/template/common.inc.tpl

    r24234 r26025  
    11{* <!-- DRAG & DROP --> *} 
    2 {if $EASYCAPTCHA_CHALLENGE == 'drag'} 
     2{if $EASYCAPTCHA.challenge == 'drag'} 
    33{combine_script id='jquery.event.drag' load='footer' require='jquery' path=$EASYCAPTCHA_PATH|cat:'template/jquery.events/jquery.event.drag-2.2.js'} 
    44{combine_script id='jquery.event.drop' load='footer' require='jquery' path=$EASYCAPTCHA_PATH|cat:'template/jquery.events/jquery.event.drop-2.2.js'} 
    55 
    66{combine_script id='easycaptcha.drag' load='footer' require='jquery.event.drag,jquery.event.drop' path=$EASYCAPTCHA_PATH|cat:'template/drag.js'} 
    7  
    8 {html_style} 
    9 #easycaptcha, #easycaptcha_noscript {ldelim} 
    10   display:inline-block; 
    11   position:relative; 
    12   padding:10px; 
    13   border-radius:8px; 
    14   background: {$EASYCAPTCHA_CONF.bg1}; 
    15   background: -webkit-linear-gradient(top, {$EASYCAPTCHA_CONF.bg1} 0%, {$EASYCAPTCHA_CONF.bg2} 100%); 
    16   background: -moz-linear-gradient(top, {$EASYCAPTCHA_CONF.bg1} 0%, {$EASYCAPTCHA_CONF.bg2} 100%); 
    17   background: -ms-linear-gradient(top, {$EASYCAPTCHA_CONF.bg1} 0%, {$EASYCAPTCHA_CONF.bg2} 100%); 
    18   background: -o-linear-gradient(top, {$EASYCAPTCHA_CONF.bg1} 0%, {$EASYCAPTCHA_CONF.bg2} 100%); 
    19   background: linear-gradient(to bottom, {$EASYCAPTCHA_CONF.bg1} 0%, {$EASYCAPTCHA_CONF.bg2} 100%); 
    20   color:{$EASYCAPTCHA_CONF.txt}; 
    21 } 
    22 #easycaptcha .drag_item {ldelim} 
    23   position:absolute; 
    24   top:15px; 
    25   width:{$EASYCAPTCHA_CONF.size}px; 
    26   height:{$EASYCAPTCHA_CONF.size}px; 
    27   border-radius:5px; 
    28   border:1px solid {$EASYCAPTCHA_CONF.bd1}; 
    29   background:{$EASYCAPTCHA_CONF.obj}; 
    30   z-index:10; 
    31   cursor:move; 
    32 } 
    33 #easycaptcha .drag_item.active {ldelim} 
    34   z-index:100; 
    35   opacity:0.75; 
    36 } 
    37 #easycaptcha .drag_item img {ldelim} 
    38   width:{$EASYCAPTCHA_CONF.size}px; 
    39   height:{$EASYCAPTCHA_CONF.size}px; 
    40   border-radius:5px; 
    41 } 
    42 #easycaptcha .drop_zone {ldelim} 
    43   -moz-box-sizing:borderbox; 
    44   box-sizing:borderbox; 
    45   padding:5px; 
    46   width:{$EASYCAPTCHA_CONF.size}px; 
    47   height:{$EASYCAPTCHA_CONF.size}px; 
    48   margin-left:{math equation='15+(x+5)*y' x=$EASYCAPTCHA_CONF.size y=$EASYCAPTCHA_CONF.nb}px; 
    49   line-height:{$EASYCAPTCHA_CONF.size}px; 
    50   background: {$EASYCAPTCHA_CONF.bg1}; 
    51   background: -webkit-linear-gradient(bottom, {$EASYCAPTCHA_CONF.bg1} 0%, {$EASYCAPTCHA_CONF.bg2} 100%); 
    52   background: -moz-linear-gradient(bottom, {$EASYCAPTCHA_CONF.bg1} 0%, {$EASYCAPTCHA_CONF.bg2} 100%); 
    53   background: -ms-linear-gradient(bottom, {$EASYCAPTCHA_CONF.bg1} 0%, {$EASYCAPTCHA_CONF.bg2} 100%); 
    54   background: -o-linear-gradient(bottom, {$EASYCAPTCHA_CONF.bg1} 0%, {$EASYCAPTCHA_CONF.bg2} 100%); 
    55   background: linear-gradient(to top, {$EASYCAPTCHA_CONF.bg1} 0%, {$EASYCAPTCHA_CONF.bg2} 100%); 
    56   border:1px dotted {$EASYCAPTCHA_CONF.bd2}; 
    57   border-radius:5px; 
    58   text-align:center; 
    59   text-transform:uppercase; 
    60   color:{$EASYCAPTCHA_CONF.txt}; 
    61 } 
    62 #easycaptcha .drop_zone.active {ldelim} 
    63   background:{$EASYCAPTCHA_CONF.sel}; 
    64 } 
    65 #easycaptcha .drop_zone.valid {ldelim} 
    66   background:{$EASYCAPTCHA_CONF.sel}; 
    67   box-shadow:0 0 0 2px {$EASYCAPTCHA_CONF.sel}; 
    68 } 
    69 {/html_style} 
     7{combine_css id='easycaptcha.drag' path=$EASYCAPTCHA_PATH|cat:'template/drag.css' template=true version=$EASYCAPTCHA.lastmod} 
    708 
    719{capture name=easycaptcha} 
     
    7614<div id="easycaptcha" style="display:none;"> 
    7715{counter start=0 assign=i} 
    78 {foreach from=$EASYCAPTCHA_CONF.selection item=image} 
    79   <div class="drag_item" style="left:{math equation='10+(x+5)*y' x=$EASYCAPTCHA_CONF.size y=$i}px;" data-id="{$image}"> 
    80     <img src="{$ROOT_URL}{$EASYCAPTCHA_PATH}drag/get.php?{$EASYCAPTCHA_CONF.theme}&amp;{$image}"> 
     16{foreach from=$EASYCAPTCHA.drag.selection item=image} 
     17  <div class="drag_item" style="left:{math equation='10+(x+5)*y' x=$EASYCAPTCHA.drag.size y=$i}px;" data-id="{$image}"> 
     18    <img src="{$ROOT_URL}{$EASYCAPTCHA_PATH}drag/get.php?{$EASYCAPTCHA.drag.theme}&amp;{$image}"> 
    8119  </div> 
    8220  {counter} 
     
    8725{* <!-- fields are not type "hidden" for LiveValidation in GuestBook and ContactForm --> *} 
    8826<input type="text" name="easycaptcha" value="" style="display:none;"> 
    89 <input type="text" name="easycaptcha_key" value="{$EASYCAPTCHA_CONF.key}" style="display:none;"> 
     27<input type="text" name="easycaptcha_key" value="{$EASYCAPTCHA.key}" style="display:none;"> 
    9028{/capture} 
    9129 
    9230 
    9331{* <!-- TIC TAC TOE --> *} 
    94 {else if $EASYCAPTCHA_CHALLENGE == 'tictac'} 
    95 {html_style} 
    96 #easycaptcha table {ldelim} 
    97   width:{$EASYCAPTCHA_CONF.size}px; 
    98   height:{$EASYCAPTCHA_CONF.size}px; 
    99   border-collapse:collapse; 
    100   display:inline-block; 
    101   margin:0; 
    102   background:url('{$ROOT_URL}{$EASYCAPTCHA_PATH}tictac/gen.php?t={$smarty.now}') no-repeat; 
    103 } 
    104 #easycaptcha td {ldelim} 
    105   border:none; 
    106   padding:0; 
    107 } 
    108 #easycaptcha label {ldelim} 
    109   display:block; 
    110   width:{math equation="floor(x/3)" x=$EASYCAPTCHA_CONF.size}px; 
    111   height:{math equation="floor(x/3)" x=$EASYCAPTCHA_CONF.size}px; 
    112   cursor:url('{$ROOT_URL}{$EASYCAPTCHA_PATH}tictac/gen.php?cross=96') 16 16, pointer; 
    113 } 
    114 #easycaptcha input {ldelim} 
    115   display:none; 
    116 } 
    117 #easycaptcha label.selected {ldelim} 
    118   background:url('{$ROOT_URL}{$EASYCAPTCHA_PATH}tictac/gen.php?cross={$EASYCAPTCHA_CONF.size}') no-repeat; 
    119 } 
    120 {/html_style} 
     32{else if $EASYCAPTCHA.challenge == 'tictac'} 
     33{combine_css id='easycaptcha.tictac' path=$EASYCAPTCHA_PATH|cat:'template/tictac.css' template=true version=$EASYCAPTCHA.lastmod} 
    12134 
    122 {footer_script require='jquery'}{literal} 
     35{footer_script require='jquery'} 
    12336(function($){ 
    12437$('#easycaptcha input').on('change', function() { 
     
    12740}); 
    12841}(jQuery)); 
    129 {/literal}{/footer_script} 
     42{/footer_script} 
    13043 
    13144{capture name=easycaptcha} 
     
    15063</div> 
    15164 
    152 <input type="text" name="easycaptcha_key" value="{$EASYCAPTCHA_CONF.key}" style="display:none;"> 
     65<input type="text" name="easycaptcha_key" value="{$EASYCAPTCHA.key}" style="display:none;"> 
    15366{/capture} 
    15467 
  • extensions/EasyCaptcha/template/contactform.tpl

    r24234 r26025  
    44 
    55  {* <!-- DRAG & DROP --> *} 
    6   {if $EASYCAPTCHA_CHALLENGE == 'drag'} 
    7   <td class="title">{'To verify you are a human, please place the <b>%s</b> in the most right box bellow.'|translate|sprintf:$EASYCAPTCHA_CONF.text}</td> 
     6  {if $EASYCAPTCHA.challenge == 'drag'} 
     7  <td class="title">{'To verify you are a human, please place the <b>%s</b> in the most right box bellow.'|translate:$EASYCAPTCHA.drag.text}</td> 
    88 
    99  {footer_script} 
     
    1313 
    1414  {* <!-- TIC TAC TOE --> *} 
    15   {else if $EASYCAPTCHA_CHALLENGE == 'tictac'} 
     15  {else if $EASYCAPTCHA..challenge == 'tictac'} 
    1616  <td class="title">{'You are player X, click on the right case to complete the line.'|translate}</td> 
    1717 
  • extensions/EasyCaptcha/template/drag.js

    r24215 r26025  
    3939      }); 
    4040  }) 
    41   .drag('end', function(e, dd) { 
     41  .drag('end', function() { 
    4242      $(this).removeClass('active'); 
    4343  }); 
    4444 
    4545$easycaptcha.find('.drop_zone') 
    46   .drop('start', function(e, dd) { 
     46  .drop('start', function() { 
    4747      $(this).addClass('active'); 
    4848  }) 
  • extensions/EasyCaptcha/template/guestbook.tpl

    r24234 r26025  
    33 
    44  {* <!-- DRAG & DROP --> *} 
    5   {if $EASYCAPTCHA_CHALLENGE == 'drag'} 
    6   <td colspan=2><label>{'To verify you are a human, please place the <b>%s</b> in the most right box bellow.'|translate|sprintf:$EASYCAPTCHA_CONF.text}</label></td> 
     5  {if $EASYCAPTCHA.challenge == 'drag'} 
     6  <td colspan=2><label>{'To verify you are a human, please place the <b>%s</b> in the most right box bellow.'|translate:$EASYCAPTCHA.drag.text}</label></td> 
    77 
    88  {footer_script} 
     
    1212 
    1313  {* <!-- TIC TAC TOE --> *} 
    14   {else if $EASYCAPTCHA_CHALLENGE == 'tictac'} 
     14  {else if $EASYCAPTCHA.challenge == 'tictac'} 
    1515  <td colspan=2><label>{'You are player X, click on the right case to complete the line.'|translate}</label></td> 
    1616 
  • extensions/EasyCaptcha/template/register.tpl

    r24234 r26025  
    44 
    55  {* <!-- DRAG & DROP --> *} 
    6   {if $EASYCAPTCHA_CHALLENGE == 'drag'} 
    7   <span class="property"><label>{'To verify you are a human, please place the <b>%s</b> in the most right box bellow.'|translate|sprintf:$EASYCAPTCHA_CONF.text}</label></span> 
     6  {if $EASYCAPTCHA.challenge == 'drag'} 
     7  <span class="property"><label>{'To verify you are a human, please place the <b>%s</b> in the most right box bellow.'|translate:$EASYCAPTCHA.drag.text}</label></span> 
    88 
    99  {* <!-- TIC TAC TOE --> *} 
    10   {else if $EASYCAPTCHA_CHALLENGE == 'tictac'} 
     10  {else if $EASYCAPTCHA.challenge == 'tictac'} 
    1111  <span class="property"><label>{'You are player X, click on the right case to complete the line.'|translate}</label></span> 
    1212 
  • extensions/EasyCaptcha/template/style.css

    r24215 r26025  
    4040.my-warnings { 
    4141  background-image:none; 
     42  display:inline-block; 
    4243  min-height:0; 
    43   padding:0 0 0 5px; 
     44  padding:5px 5px 0 5px; 
    4445  margin:0 5px 15px 5px; 
    4546  font-weight:normal; 
Note: See TracChangeset for help on using the changeset viewer.