Ignore:
Timestamp:
04/04/11 14:51:28 (9 years ago)
Author:
plg
Message:

compatibility with Piwigo 2.2 (remove "adviser", get_comment_post_key()
replaced by get_ephemeral_key(), known_script replaced by combine_script
and use of combine_css)

textarea is no more "resizable" (useless and break CSS rules)

Location:
extensions/ContactForm
Files:
1 deleted
12 edited

Legend:

Unmodified
Added
Removed
  • extensions/ContactForm/admin/themes/cf_config.tab.tpl

    r8689 r10035  
    1 {html_head} 
    2   {known_script id="jquery.ui" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.core.packed.js"} 
    3   {known_script id="jquery.ui.tabs" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.tabs.packed.js"} 
    4 {/html_head} 
     1{combine_script id="jquery.ui.tabs"} 
    52 
    63<div class="titrePage"> 
     
    7168<p><input class="submit" type="submit" value="{'cf_validate'|@translate}" name="submit"></p> 
    7269</form> 
    73 {literal} 
    74 <script type="text/javascript"> 
     70{footer_script}{literal} 
    7571$(document).ready(function() { 
    7672    $(".infos").fadeOut(800).fadeIn(1200).fadeOut(400).fadeIn(800).fadeOut(400); 
    7773    $(".errors").fadeOut(200).fadeIn(200).fadeOut(300).fadeIn(300).fadeOut(400).fadeIn(400);  
    7874  }); 
    79 </script> 
    80 {/literal} 
     75{/literal}{/footer_script} 
  • extensions/ContactForm/admin/themes/cf_emails.tab.tpl

    r8689 r10035  
    1 {html_head} 
    2   {known_script id="jquery.ui" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.core.packed.js"} 
    3   {known_script id="jquery.ui.tabs" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.tabs.packed.js"} 
    4 {/html_head} 
     1{combine_script id="jquery.ui.tabs"} 
    52 
    63<div class="titrePage"> 
     
    4340<p><input class="submit" type="submit" value="{'cf_validate'|@translate}" name="submit"></p> 
    4441</form> 
    45 {literal} 
    46 <script type="text/javascript"> 
     42{footer_script}{literal} 
    4743$(document).ready(function() { 
    4844    $(".infos").fadeOut(800).fadeIn(1200).fadeOut(400).fadeIn(800).fadeOut(400); 
    4945    $(".errors").fadeOut(200).fadeIn(200).fadeOut(300).fadeIn(300).fadeOut(400).fadeIn(400);  
    5046  }); 
    51 </script> 
    52 {/literal} 
     47{/literal}{/footer_script} 
    5348{$CF_DEBUG} 
  • extensions/ContactForm/classes/cf_plugin.class.php

    r9070 r10035  
    187187        'cf_messages' => realpath(cf_get_template('cf_messages.tpl')), 
    188188      )); 
    189     $template->block_html_head( '', 
    190               '<link rel="stylesheet" type="text/css" '. 
    191               'href="' . CF_INCLUDE . 'contactform.css' . '">', 
    192               $smarty, $repeat); 
    193     $template->block_html_head( '', 
    194               '<script type="text/javascript" '. 
    195               'src="' . CF_INCLUDE . 'contactform.js' . '">'. 
    196               '</script>', 
    197               $smarty, $repeat); 
     189     
    198190    $cf = array( 
    199191        'TITLE'     => 'contact_form_title', 
     
    207199        'SUBJECT'   => $infos['cf_subject'], 
    208200        'MESSAGE'   => $infos['cf_message'], 
    209         'KEY'       => get_comment_post_key($infos['cf_id']), 
     201        'KEY'       => get_ephemeral_key(2, $infos['cf_id']), 
    210202      ); 
    211203    if (!empty($infos['errors'])) { 
     
    463455      $id = trim( stripslashes($_POST['cf_id'])); 
    464456    } 
    465      
    466     $key = explode( ':', $key ); 
    467     if ( count($key)!=2 
    468           or $key[0]>time()-2 // page must have been retrieved more than 2 sec ago 
    469           or $key[0]<time()-3600 // 60 minutes expiration 
    470           or hash_hmac( 
    471                 'md5', $key[0].':'.$id, $conf['secret_key'] 
    472               ) != $key[1] 
    473         ) 
    474     { 
     457 
     458    if (!verify_ephemeral_key($key, $id)) { 
    475459      return false; 
    476460    } 
  • extensions/ContactForm/include/cf_functions.inc.php

    r8910 r10035  
    5353  I.user_id =  U.'.$conf['user_fields']['id'].' and 
    5454  I.status in (\'webmaster\',  \'admin\') and 
    55   I.adviser = \'false\' and 
    5655  '.$conf['user_fields']['email'].' is not null and 
    5756  I.user_id <> '.$user['id'].' 
     
    8887  I.user_id =  U.'.$conf['user_fields']['id'].' and 
    8988  I.status in (\'webmaster\',  \'admin\') and 
    90   I.adviser = \'false\' and 
    9189  '.$conf['user_fields']['email'].' is not null  
    9290order by 
  • extensions/ContactForm/include/contactform.css

    r8479 r10035  
    4343} 
    4444 
    45 /* jQuery ui resizable */ 
    46 .ui-resizable { position: relative; } 
    47 .ui-wrapper { border: 0; } 
    48 .ui-wrapper input, .ui-wrapper textarea { border: 0; } 
    49  
    50 /* Global handle styles */ 
    51 .ui-resizable-handle { position: absolute; display: none; font-size: 0.1px; } 
    52 .ui-resizable .ui-resizable-handle { display: block; } 
    53 body .ui-resizable-disabled .ui-resizable-handle { display: none; } /* use 'body' to make it more specific (css order) */ 
    54 body .ui-resizable-autohide .ui-resizable-handle { display: none; } /* use 'body' to make it more specific (css order) */ 
    55 .ui-resizable-n { 
    56     cursor: n-resize; 
    57     height: 6px; 
    58     width: 100%; 
    59     top: 0px; 
    60     left: 0px; 
    61     background: transparent url('../images/resizable-n.gif') no-repeat scroll center top; 
    62 } 
    63 .ui-resizable-s { cursor: s-resize; height: 6px; width: 100%; bottom: 0px; left: 0px; background: transparent url(../../../admin/themes/roma/images/resizable-s.gif) no-repeat scroll center top; } 
    64 .ui-resizable-e { cursor: e-resize; width: 6px; right: 0px; top: 0px; height: 100%; background: transparent url(../../../admin/themes/roma/images/resizable-e.gif) no-repeat scroll right center; } 
    65 .ui-resizable-w { cursor: w-resize; width: 6px; left: 0px; top: 0px; height: 100%; background: transparent url(../../../admin/themes/roma/images/resizable-w.gif) no-repeat scroll right center; } 
    66 .ui-resizable-se { cursor: se-resize; width: 9px; height: 9px; right: 0px; bottom: 0px; background: transparent url(../../../admin/themes/roma/images/resizable-se.gif); } 
    67 .ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: 0px; bottom: 0px; background: transparent url(../../../admin/themes/roma/images/resizable-sw.gif); } 
    68 .ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: 0px; top: 0px; background: transparent url(../../../admin/themes/roma/images/resizable-nw.gif); } 
    69 .ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: 0px; top: 0px; background: transparent url(../../../admin/themes/roma/images/resizable-ne.gif); } 
     45#cf_message {width:400px;height:200px;} 
  • extensions/ContactForm/themes/cf_button.tpl

    r8479 r10035  
    1 {html_head} 
    2   {known_script id="jquery.ui" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.core.packed.js"} 
    3 {/html_head} 
    4  
    51<div class="cf-button"> 
    62<input type="button" value="{'cf_hide'|@translate}" onclick="hide('cf_messages');"> 
    73</div> 
    8 {literal} 
    9 <script type="text/javascript"> 
     4 
     5{footer_script require="jquery"}{literal} 
    106function hide(id) { 
    117  var element = document.getElementById(id); 
     
    1511  } 
    1612} 
    17 </script> 
    18 {/literal} 
     13{/literal}{/footer_script} 
  • extensions/ContactForm/themes/cf_form.tpl

    r8479 r10035  
    1 {html_head} 
    2   {known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js"} 
    3   {known_script id="jquery.ui" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.core.packed.js"} 
    4   {known_script id="jquery.ui.resizable" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.resizable.packed.js"} 
    5 {/html_head} 
     1{combine_css path="plugins/ContactForm/include/contactform.css"} 
     2{combine_script id="ContactForm" load="async" path="plugins/ContactForm/include/contactform.js"} 
    63 
    7 {literal} 
    8 <script type="text/javascript"> 
    9 jQuery().ready(function(){ 
    10     // Resize possible for textarea 
    11     jQuery("#cf_message").resizable({ 
    12         handles: "all", 
    13         animate: true, 
    14         animateDuration: "slow", 
    15         animateEasing: "swing", 
    16         preventDefault: true, 
    17         preserveCursor: true, 
    18         autoHide: true, 
    19         ghost: true 
    20       }); 
    21   }); 
    22 jQuery().ready(function(){ 
    23   // Resize possible for textarea 
    24   jQuery(".cf-input").resizable({ 
    25         handles: "e", 
    26         animate: true, 
    27         animateDuration: "slow", 
    28         animateEasing: "swing", 
    29         preventDefault: true, 
    30         preserveCursor: true, 
    31         autoHide: true, 
    32         ghost: true 
    33       }); 
    34   }); 
    35  
     4{footer_script}{literal} 
    365function cf_validate() { 
    376  var items = new Array('cf_from_name','cf_from_mail','cf_subject','cf_message'); 
     
    5827  return true; 
    5928} 
    60 </script> 
    61 {/literal} 
     29{/literal}{/footer_script} 
     30 
    6231<div id="autre_content" class="contact-form"> 
    6332  <form  method="post" action="{$CF.F_ACTION}" class="filter" id="contactform" onsubmit="return cf_validate();"> 
  • extensions/ContactForm/themes/simple-black/cf_form.tpl

    r8479 r10035  
    1 {html_head} 
    2   <!-- {known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js"} --> 
    3   {known_script id="jquery.ui" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.core.packed.js"} 
    4   {known_script id="jquery.ui.resizable" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.resizable.packed.js"} 
    5 {/html_head} 
     1{combine_css path="plugins/ContactForm/include/contactform.css"} 
     2{combine_script id="ContactForm" load="async" path="plugins/ContactForm/include/contactform.js"} 
    63 
    7 {literal} 
    8 <script type="text/javascript"> 
     4{footer_script}{literal} 
    95jQuery().ready(function(){ 
    106    // Resize possible for textarea 
     
    5854  return true; 
    5955} 
    60 </script> 
    61 {/literal} 
     56{/literal}{/footer_script} 
     57 
    6258<div id="subcontent" class="contact-form"> 
    6359  <form  method="post" action="{$CF.F_ACTION}" class="filter" id="contactform" onsubmit="return cf_validate();"> 
  • extensions/ContactForm/themes/simple-sunset/cf_form.tpl

    r8479 r10035  
    1 {html_head} 
    2   <!-- {known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js"} --> 
    3   {known_script id="jquery.ui" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.core.packed.js"} 
    4   {known_script id="jquery.ui.resizable" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.resizable.packed.js"} 
    5 {/html_head} 
     1{combine_css path="plugins/ContactForm/include/contactform.css"} 
     2{combine_script id="ContactForm" load="async" path="plugins/ContactForm/include/contactform.js"} 
    63 
    7 {literal} 
    8 <script type="text/javascript"> 
     4{footer_script}{literal} 
    95jQuery().ready(function(){ 
    106    // Resize possible for textarea 
     
    5854  return true; 
    5955} 
    60 </script> 
    61 {/literal} 
     56{/literal}{/footer_script} 
     57 
    6258<div id="subcontent" class="contact-form"> 
    6359  <form  method="post" action="{$CF.F_ACTION}" class="filter" id="contactform" onsubmit="return cf_validate();"> 
  • extensions/ContactForm/themes/simple-white/cf_form.tpl

    r8479 r10035  
    1 {html_head} 
    2   <!-- {known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js"} --> 
    3   {known_script id="jquery.ui" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.core.packed.js"} 
    4   {known_script id="jquery.ui.resizable" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.resizable.packed.js"} 
    5 {/html_head} 
     1{combine_css path="plugins/ContactForm/include/contactform.css"} 
     2{combine_script id="ContactForm" load="async" path="plugins/ContactForm/include/contactform.js"} 
    63 
    7 {literal} 
    8 <script type="text/javascript"> 
     4{footer_script}{literal} 
    95jQuery().ready(function(){ 
    106    // Resize possible for textarea 
     
    5854  return true; 
    5955} 
    60 </script> 
    61 {/literal} 
     56{/literal}{/footer_script} 
     57 
    6258<div id="subcontent" class="contact-form"> 
    6359  <form  method="post" action="{$CF.F_ACTION}" class="filter" id="contactform" onsubmit="return cf_validate();"> 
  • extensions/ContactForm/themes/simple/cf_form.tpl

    r8479 r10035  
    1 {html_head} 
    2   <!-- {known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js"} --> 
    3   {known_script id="jquery.ui" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.core.packed.js"} 
    4   {known_script id="jquery.ui.resizable" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.resizable.packed.js"} 
    5 {/html_head} 
     1{combine_css path="plugins/ContactForm/include/contactform.css"} 
     2{combine_script id="ContactForm" load="async" path="plugins/ContactForm/include/contactform.js"} 
    63 
    7 {literal} 
    8 <script type="text/javascript"> 
     4{footer_script}{literal} 
    95jQuery().ready(function(){ 
    106    // Resize possible for textarea 
     
    5854  return true; 
    5955} 
    60 </script> 
    61 {/literal} 
     56{/literal}{/footer_script} 
     57 
    6258<div id="subcontent" class="contact-form"> 
    6359  <form  method="post" action="{$CF.F_ACTION}" class="filter" id="contactform" onsubmit="return cf_validate();"> 
  • extensions/ContactForm/themes/stripped/cf_form.tpl

    r8478 r10035  
    1 {html_head} 
    2   <!-- {known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js"} --> 
    3   {known_script id="jquery.ui" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.core.packed.js"} 
    4   {known_script id="jquery.ui.resizable" src=$ROOT_URL|@cat:"themes/default/js/ui/packed/ui.resizable.packed.js"} 
    5 {/html_head} 
     1{combine_css path="plugins/ContactForm/include/contactform.css"} 
     2{combine_script id="ContactForm" load="async" path="plugins/ContactForm/include/contactform.js"} 
    63 
    7 {literal} 
    8 <script type="text/javascript"> 
     4{footer_script}{literal} 
    95jQuery().ready(function(){ 
    106    // Resize possible for textarea 
     
    5854  return true; 
    5955} 
    60 </script> 
    61 {/literal} 
     56{/literal}{/footer_script} 
     57 
    6258<div id="subcontent" class="contact-form"> 
    6359  <form  method="post" action="{$CF.F_ACTION}" class="filter" id="contactform" onsubmit="return cf_validate();"> 
Note: See TracChangeset for help on using the changeset viewer.