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} |
---|
6 | |
---|
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 | |
---|
36 | function cf_validate() { |
---|
37 | var items = new Array('cf_from_name','cf_from_mail','cf_subject','cf_message'); |
---|
38 | var is_mail = new Array(false,true,false,false); |
---|
39 | var is_needed = new Array( |
---|
40 | {/literal}{if $CF.NEED_NAME}true{else}false{/if}{literal}, |
---|
41 | {/literal}{if $CF.NEED_MAIL}true{else}false{/if}{literal}, |
---|
42 | true,true); |
---|
43 | var messages = new Array( |
---|
44 | '{/literal}{'cf_from_name_error'|@translate|@escape:javascript}{literal}', |
---|
45 | '{/literal}{'cf_mail_format_error'|@translate|@escape:javascript}{literal}', |
---|
46 | '{/literal}{'cf_subject_error'|@translate|@escape:javascript}{literal}', |
---|
47 | '{/literal}{'cf_message_error'|@translate|@escape:javascript}{literal}'); |
---|
48 | var i; |
---|
49 | for (i=0 ; i<items.length ; i++) { |
---|
50 | var item = document.getElementById(items[i]); |
---|
51 | var is_ok = cf_check_content(item, is_mail[i]); |
---|
52 | if (!is_ok && is_needed[i]) { |
---|
53 | alert(messages[i]); |
---|
54 | item.focus(); |
---|
55 | return false; |
---|
56 | } |
---|
57 | } |
---|
58 | return true; |
---|
59 | } |
---|
60 | </script> |
---|
61 | {/literal} |
---|
62 | <div id="autre_content" class="contact-form"> |
---|
63 | <form method="post" action="{$CF.F_ACTION}" class="filter" id="contactform" onsubmit="return cf_validate();"> |
---|
64 | <div class="contact-form-content"> |
---|
65 | <table> |
---|
66 | <tr> |
---|
67 | <td class="contact-form-left">{'cf_from_name'|@translate}</td> |
---|
68 | <td class="contact-form-right"> |
---|
69 | {if $CF.LOGGED} |
---|
70 | <input type="text" name="cf_from_name_label" id="cf_from_name" size="40" value="{$CF.NAME}" disabled="disabled" class="cf-input-disabled"> |
---|
71 | <input type="hidden" name="cf_from_name" value="{$CF.NAME}" /> |
---|
72 | {else} |
---|
73 | <input type="text" name="cf_from_name" id="cf_from_name" size="40" value="{$CF.NAME}" class="cf-input"> |
---|
74 | {/if} |
---|
75 | </td> |
---|
76 | </tr> |
---|
77 | <tr> |
---|
78 | <td class="contact-form-left">{'cf_from_mail'|@translate}</td> |
---|
79 | <td class="contact-form-right"> |
---|
80 | {if $CF.LOGGED and ''!=$CF.EMAIL} |
---|
81 | <input type="text" name="cf_from_mail_label" id="cf_from_mail" size="40" value="{$CF.EMAIL}" disabled="disabled" class="cf-input-disabled"> |
---|
82 | <input type="hidden" name="cf_from_mail" value="{$CF.EMAIL}" /> |
---|
83 | {else} |
---|
84 | <input type="text" name="cf_from_mail" id="cf_from_mail" size="40" value="{$CF.EMAIL}" class="cf-input"></td> |
---|
85 | {/if} |
---|
86 | </td> |
---|
87 | </tr> |
---|
88 | <tr> |
---|
89 | <td class="contact-form-left">{'cf_subject'|@translate}</td> |
---|
90 | <td class="contact-form-right"><input type="text" name="cf_subject" id="cf_subject" size="40" value="{$CF.SUBJECT}" class="cf-input"></td> |
---|
91 | </tr> |
---|
92 | <tr> |
---|
93 | <td class="contact-form-left" id="cf_message_label">{'cf_message'|@translate}</td> |
---|
94 | <td class="contact-form-right"><textarea name="cf_message" id="cf_message" rows="10" cols="40">{$CF.MESSAGE}</textarea></td> |
---|
95 | </tr> |
---|
96 | <tr> |
---|
97 | <td class="contact-form-left"> </td> |
---|
98 | <td class="contact-form-right"><input class="submit" type="submit" value="{'cf_submit'|@translate}"></td> |
---|
99 | </tr> |
---|
100 | </table> |
---|
101 | <input type="hidden" name="cf_key" value="{$CF.KEY}" /> |
---|
102 | <input type="hidden" name="cf_id" value="{$CF.ID}" /> |
---|
103 | </div> |
---|
104 | </form> |
---|
105 | </div> |
---|