Changeset 544665
- Timestamp:
- 05/15/2012 08:35:37 PM (14 years ago)
- Location:
- jazzy-forms/trunk
- Files:
-
- 8 edited
-
back/tpl-diagnostics.php (modified) (2 diffs)
-
core/Log.php (modified) (2 diffs)
-
core/Mail.php (modified) (1 diff)
-
front/ctrl-email.php (modified) (2 diffs)
-
front/ctrl-shortcode.php (modified) (1 diff)
-
front/jazzy-forms.js (modified) (4 diffs)
-
jazzy-forms.php (modified) (4 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
jazzy-forms/trunk/back/tpl-diagnostics.php
r530820 r544665 20 20 Plugins: <?php echo htmlentities(json_encode(get_plugins())); ?> 21 21 22 <form method="post" action="#"> 23 Panic! 24 <input type="submit" name="panic" value="DON'T PRESS THIS!" class="button-primary"> 25 This completely deletes any Jazzy Forms configuration and deactives the plugin, without any confirmation. 26 </form> 27 22 28 <form method="post"> 23 29 Tweaks: … … 28 34 </form> 29 35 </pre> 30 <h2>Panic</h2>31 <form method="post" action="#">32 <input type="submit" name="panic" value="DON'T PRESS THIS!" class="button-primary">33 <p>This completely deletes any Jazzy Forms configuration and deactives the plugin.</p> -
jazzy-forms/trunk/core/Log.php
r530946 r544665 19 19 } 20 20 21 function jzzf_log_level_string($level) { 22 switch($level) { 23 case 10: 24 return 'DEBUG'; 25 case 20: 26 return 'INFO'; 27 case 30: 28 return 'WARNING'; 29 case 40: 30 return 'ERROR'; 31 case 50: 32 return 'CRITICAL'; 33 } 34 return ''; 35 } 36 37 function jzzf_format_output($level, $msg) { 38 $lines = explode("\n", $msg); 39 $output = ''; 40 $first = true; 41 foreach($lines as $line) { 42 if($first) { 43 $first = false; 44 } else { 45 $line = '->' . $line; 46 } 47 $output .= '[' . $level . '|' . date(DATE_ISO8601) . '|' . $_SERVER['REMOTE_ADDR'] . ']' . "$line\n"; 48 } 49 return $output; 50 } 51 21 52 function jzzf_debug($msg) { jzzf_log(10, $msg); } 22 53 function jzzf_info($msg) { jzzf_log(20, $msg); } … … 31 62 return; 32 63 } 33 switch($level) { 34 case 10: $importance = 'DEBUG'; break; 35 case 20: $importance = 'INFO'; break; 36 case 30: $importance = 'WARNING'; break; 37 case 40: $importance = 'ERROR'; break; 38 case 50: $importance = 'CRITICAL'; break; 39 } 40 $output = '[' . $importance . '|' . date(DATE_ISO8601) . '|' . $_SERVER['REMOTE_ADDR'] . ']' . "$msg\n"; 64 $importance = jzzf_log_level_string($level); 65 $output = jzzf_format_output($importance, $msg); 41 66 file_put_contents($file, $output, FILE_APPEND); 42 67 } -
jazzy-forms/trunk/core/Mail.php
r530946 r544665 3 3 function jzzf_send_email($email) { 4 4 $message = $email["message"] . "\r\n\r\n"; 5 $headers = 'From: '. $email["from"] . "\r\n" . 6 "Content-type: text/plain; charset=utf-8"; 5 $headers = 'From: '. $email["from"] . "\r\n"; 6 if($email['cc']) { 7 $headers .= 'Cc: '. $email["cc"] . "\r\n"; 8 } 9 if($email['bcc']) { 10 $headers .= 'Bcc: '. $email["bcc"] . "\r\n"; 11 } 12 $headers .= "Content-type: text/plain; charset=utf-8"; 7 13 if(jzzf_log_enabled()) { 8 14 jzzf_debug("Email headers: $headers"); 9 15 jzzf_debug("Email to: {$email['to']}"); 10 16 jzzf_debug("Email subject: {$email['subject']}"); 11 jzzf_debug("Email message: {$ message}");17 jzzf_debug("Email message: {$email['message']}"); 12 18 } 19 $result = false; 13 20 if(get_option('jzzf_tweak_suppress_email', false)) { 14 21 jzzf_info('Emails are suppressed. Not sending.'); 15 return true;22 $result = strpos($email['to'], "@") !== false; 16 23 } else { 17 24 jzzf_info('Sending email'); 18 returnwp_mail($email["to"], $email["subject"], $message, $headers);25 $result = wp_mail($email["to"], $email["subject"], $message, $headers); 19 26 } 27 jzzf_info('Email return value:' . (int) $result); 28 return $result; 20 29 } -
jazzy-forms/trunk/front/ctrl-email.php
r530946 r544665 2 2 3 3 function jzzf_ctrl_email() { 4 jzzf_info("Processing email request"); 4 5 if(!($form = $_REQUEST['form'])) { 5 6 jzzf_http_error(403, "Invalid form"); … … 9 10 } 10 11 $replaced = jzzf_apply_email_templates($email, $_REQUEST['values']); 11 jzzf_send_email($replaced); 12 if(jzzf_send_email($replaced)) 13 { 14 echo 1; 15 } else { 16 echo 0; 17 } 12 18 } 13 19 -
jazzy-forms/trunk/front/ctrl-shortcode.php
r530820 r544665 121 121 "sending" => $form->email->sending, 122 122 "ok" => $form->email->ok, 123 "fail" => $form-> fail123 "fail" => $form->email->fail 124 124 ); 125 125 } -
jazzy-forms/trunk/front/jazzy-forms.js
r530820 r544665 97 97 set_message(button, graph.form.email.sending); 98 98 var values = {}; 99 for( key in graph.email) {99 for(var key in graph.email) { 100 100 var value = evaluate_formula(graph.email[key]); 101 if(graph.email[key].length == 1 ) {101 if(graph.email[key].length == 1 && graph.types[key] == 'f') { 102 102 values[key] = sanitize_result(value, key); 103 103 } else { … … 112 112 }, 113 113 "error": function() { set_message(button, graph.form.email.fail); }, 114 "success": function() { set_message(button, graph.form.email.ok); } 114 "success": function(data) { 115 if(data == "1") { 116 set_message(button, graph.form.email.ok); 117 } else { 118 set_message(button, graph.form.email.fail); 119 } 120 } 115 121 }); 116 122 } … … 310 316 return Math.round(numarg(0)*decimal)/decimal; 311 317 }, 318 'mround': function() { 319 var multiple = numarg(1); 320 return Math.round(numarg(0)/multiple)*multiple; 321 }, 312 322 'roundup': function() { 313 323 var digits = numarg(1, 0); … … 321 331 var x = numarg(0); 322 332 return (x > 0) ? Math.floor(numarg(0)*decimal)/decimal : Math.ceil(numarg(0)*decimal)/decimal; 333 }, 334 'ln': function() { 335 var x = numarg(0); 336 return Math.log(x); 337 }, 338 'log': function() { 339 var x = numarg(0); 340 var b = numarg(1, 10); 341 return Math.log(x) / Math.log(b); 342 }, 343 'log10': function() { 344 var x = numarg(0); 345 return Math.log(x) / Math.log(10); 346 }, 347 'exp': function() { 348 var x = numarg(0); 349 return Math.exp(x); 350 }, 351 'power': function() { 352 var x = numarg(0); 353 var y = numarg(1); 354 return Math.pow(x, y); 323 355 }, 324 356 'sqrt': function() { -
jazzy-forms/trunk/jazzy-forms.php
r530946 r544665 4 4 Plugin URI: http://www.jazzyforms.com/ 5 5 Description: Online form builder with an emphasis on calculation 6 Version: 0.9. 76 Version: 0.9.8 7 7 Author: Igor Prochazka 8 8 Author URI: http://www.l90r.com/ … … 28 28 */ 29 29 30 define(JZZF_VERSION, 0.090 7);30 define(JZZF_VERSION, 0.0908); 31 31 define(JZZF_OPTION_VERSION, 'jzzf_version'); 32 32 … … 111 111 112 112 function jzzf_sanitize_db() { 113 if(function_exists('is_multisite') && is_multisite()) { 114 jzzf_create_tables(); 115 } 113 116 $current = jzzf_get_version(); 114 117 if($current < JZZF_VERSION) { … … 211 214 add_action('jzzf_form', 'jzzf_form', 2); 212 215 add_action('wp_ajax_jzzf_email', 'jzzf_email'); 213 216 add_action('wp_ajax_nopriv_jzzf_email', 'jzzf_email'); 217 214 218 ?> -
jazzy-forms/trunk/readme.txt
r530946 r544665 5 5 Requires at least: 3.2.1 6 6 Tested up to: 3.3.1 7 Stable tag: 0.9. 77 Stable tag: 0.9.8 8 8 9 9 Jazzy Forms is an online form generator that performs instant calculations. It's ideal for inter-active price calculators and for sending out cost estimates by email. … … 112 112 == Changelog == 113 113 114 = 0.9.8 = 115 * Email fix: complete Cc and Bcc implementation 116 * Email fix: don't fail for numeric values 117 * Email fix: send emails for users that are not logged in (!) 118 * Email fix: respect wp_mail()'s return value 119 * Improve compatibility with WPMU 120 * New functions: MROUND, logarithm and exponential functions 121 114 122 = 0.9.7 = 115 123 * Emergency update (missing file in v0.9.6)
Note: See TracChangeset
for help on using the changeset viewer.