Plugin Directory

Changeset 544665


Ignore:
Timestamp:
05/15/2012 08:35:37 PM (14 years ago)
Author:
jazzigor
Message:

Updating trunk to v0.9.8

Location:
jazzy-forms/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • jazzy-forms/trunk/back/tpl-diagnostics.php

    r530820 r544665  
    2020Plugins: <?php echo htmlentities(json_encode(get_plugins())); ?>
    2121
     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                   
    2228<form method="post">
    2329Tweaks:
     
    2834</form>
    2935</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  
    1919}
    2020
     21function 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
     37function 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
    2152function jzzf_debug($msg) { jzzf_log(10, $msg); }
    2253function jzzf_info($msg) { jzzf_log(20, $msg); }
     
    3162            return;
    3263        }
    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);
    4166        file_put_contents($file, $output, FILE_APPEND);
    4267    }
  • jazzy-forms/trunk/core/Mail.php

    r530946 r544665  
    33function jzzf_send_email($email) {
    44    $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";
    713    if(jzzf_log_enabled()) {
    814        jzzf_debug("Email headers: $headers");
    915        jzzf_debug("Email to: {$email['to']}");
    1016        jzzf_debug("Email subject: {$email['subject']}");
    11         jzzf_debug("Email message: {$message}");
     17        jzzf_debug("Email message: {$email['message']}");
    1218    }
     19    $result = false;
    1320    if(get_option('jzzf_tweak_suppress_email', false)) {
    1421        jzzf_info('Emails are suppressed. Not sending.');
    15         return true;
     22        $result = strpos($email['to'], "@") !== false;
    1623    } else {
    1724        jzzf_info('Sending email');
    18         return wp_mail($email["to"], $email["subject"], $message, $headers);
     25        $result = wp_mail($email["to"], $email["subject"], $message, $headers);
    1926    }
     27    jzzf_info('Email return value:' . (int) $result);
     28    return $result;
    2029}
  • jazzy-forms/trunk/front/ctrl-email.php

    r530946 r544665  
    22
    33function jzzf_ctrl_email() {
     4    jzzf_info("Processing email request");
    45    if(!($form = $_REQUEST['form'])) {
    56        jzzf_http_error(403, "Invalid form");
     
    910    }
    1011    $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    }
    1218}
    1319
  • jazzy-forms/trunk/front/ctrl-shortcode.php

    r530820 r544665  
    121121            "sending" => $form->email->sending,
    122122            "ok" => $form->email->ok,
    123             "fail" => $form->fail
     123            "fail" => $form->email->fail
    124124        );
    125125    }
  • jazzy-forms/trunk/front/jazzy-forms.js

    r530820 r544665  
    9797        set_message(button, graph.form.email.sending);
    9898        var values = {};
    99         for(key in graph.email) {
     99        for(var key in graph.email) {
    100100            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') {
    102102                values[key] = sanitize_result(value, key);
    103103            } else {
     
    112112            },
    113113            "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            }
    115121        });
    116122    }
     
    310316            return Math.round(numarg(0)*decimal)/decimal;
    311317        },
     318        'mround': function() {
     319            var multiple = numarg(1);
     320            return Math.round(numarg(0)/multiple)*multiple;
     321        },
    312322        'roundup': function() {
    313323            var digits = numarg(1, 0);
     
    321331            var x = numarg(0);
    322332            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);
    323355        },
    324356        'sqrt': function() {
  • jazzy-forms/trunk/jazzy-forms.php

    r530946 r544665  
    44Plugin URI: http://www.jazzyforms.com/
    55Description: Online form builder with an emphasis on calculation
    6 Version: 0.9.7
     6Version: 0.9.8
    77Author: Igor Prochazka
    88Author URI: http://www.l90r.com/
     
    2828*/
    2929
    30 define(JZZF_VERSION, 0.0907);
     30define(JZZF_VERSION, 0.0908);
    3131define(JZZF_OPTION_VERSION, 'jzzf_version');
    3232
     
    111111
    112112function jzzf_sanitize_db() {
     113    if(function_exists('is_multisite') && is_multisite()) {
     114        jzzf_create_tables();
     115    }
    113116    $current = jzzf_get_version();
    114117    if($current < JZZF_VERSION) {
     
    211214add_action('jzzf_form', 'jzzf_form', 2);
    212215add_action('wp_ajax_jzzf_email', 'jzzf_email');
    213  
     216add_action('wp_ajax_nopriv_jzzf_email', 'jzzf_email');
     217
    214218?>
  • jazzy-forms/trunk/readme.txt

    r530946 r544665  
    55Requires at least: 3.2.1
    66Tested up to: 3.3.1
    7 Stable tag: 0.9.7
     7Stable tag: 0.9.8
    88
    99Jazzy 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.
     
    112112== Changelog ==
    113113
     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
    114122= 0.9.7 =
    115123* Emergency update (missing file in v0.9.6)
Note: See TracChangeset for help on using the changeset viewer.