Plugin Directory

Changeset 1308912


Ignore:
Timestamp:
12/15/2015 09:44:22 AM (10 years ago)
Author:
markusklems
Message:

New feature: you can make first name and last name fields required now, like this: [cloudwok wok_id="YOUR_WOK_ID" show_form="True" show_form_input_name="True" required_firstname="True" required_lastname="True"]

Location:
cloudwok-file-upload/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cloudwok-file-upload/trunk/cloudwok.php

    r1282540 r1308912  
    44Plugin URI: http://www.cloudwok.com
    55Description: CloudWok enables you to let your website visitors upload files directly into a Dropbox, Google Drive, Amazon S3, Box.com, or other cloud storage folder that you own.
    6 Version: 0.4.0
     6Version: 0.4.1
    77Author: CloudWok
    88Author Email: [email protected]
     
    6464            'label_send_firstname_placeholder' => '',
    6565            'label_send_lastname_placeholder' => '',
    66             'prefill_form_fields' => ''
     66            'prefill_form_fields' => '',
     67            'required_firstname' => '',
     68            'required_lastname' => ''
    6769        ), $atts )
    6870    );
     
    130132      }}';
    131133    }
    132     if(array_key_exists('label_send_msg_btn', $atts) || array_key_exists('label_send_msg_placeholder', $atts) || array_key_exists('prefill_form_fields', $atts)) {
     134    if(array_key_exists('label_send_msg_btn', $atts) || array_key_exists('label_send_msg_placeholder', $atts) || array_key_exists('prefill_form_fields', $atts) || array_key_exists('required_firstname', $atts) || array_key_exists('required_lastname', $atts)) {
    133135        $customizeMessages = 'document.querySelector( ".cloudwok-embed .cloudwok-upload-message").addEventListener("DOMNodeInserted", customizeMessages, false);
    134136        function customizeMessages(e) {
     
    152154            $customizeMessages = $customizeMessages . 'document.querySelector(".cloudwok-embed input[name=from_lastname]" ).placeholder = "' . $atts['label_send_lastname_placeholder'] . '";';
    153155        }
     156        if(array_key_exists('required_firstname', $atts) && $atts['required_firstname']  == "True") {
     157            $customizeMessages = $customizeMessages . 'document.querySelector(".cloudwok-embed input[name=from_firstname]" ).required=true;';
     158        }
     159        if(array_key_exists('required_lastname', $atts) && $atts['required_lastname']  == "True") {
     160            $customizeMessages = $customizeMessages . 'document.querySelector(".cloudwok-embed input[name=from_lastname]" ).required=true;';
     161        }
    154162        // fill e-mail, first name, and last name with wp user values
    155     if($wp_user_email) {
    156         $customizeMessages = $customizeMessages . 'document.querySelector(".cloudwok-embed input[name=from]").value = "' . $wp_user_email . '";';
    157     }
    158     if($wp_user_firstname) {
    159         $customizeMessages = $customizeMessages . 'document.querySelector(".cloudwok-embed input[name=from_firstname]").value = "' . $wp_user_firstname . '";';
    160     }
    161     if($wp_user_lastname) {
    162         $customizeMessages = $customizeMessages . 'document.querySelector(".cloudwok-embed input[name=from_lastname]" ).value = "' . $wp_user_lastname . '";';
    163     }
     163        if(array_key_exists('prefill_form_fields', $atts)) {
     164      if($wp_user_email && array_key_exists('show_form_input_email', $atts) &&   $atts['show_form_input_email'] == "True") {
     165        $customizeMessages = $customizeMessages .   'document.querySelector(".cloudwok-embed input[name=from]").value = "' .   $wp_user_email . '";';
     166      }
     167      if($wp_user_firstname && array_key_exists('show_form_input_name', $atts) &&   $atts['show_form_input_name'] == "True") {
     168        $customizeMessages = $customizeMessages .   'document.querySelector(".cloudwok-embed input[name=from_firstname]").value = "'   . $wp_user_firstname . '";';
     169      }
     170      if($wp_user_lastname && array_key_exists('show_form_input_name', $atts) &&   $atts['show_form_input_name'] == "True") {
     171        $customizeMessages = $customizeMessages .   'document.querySelector(".cloudwok-embed input[name=from_lastname]" ).value = "'   . $wp_user_lastname . '";';
     172      }
     173      }
    164174        $customizeMessages = $customizeMessages . '
    165175      }}';
  • cloudwok-file-upload/trunk/readme.txt

    r1282540 r1308912  
    55Requires at least: 3.0.0
    66Tested up to: 4.3.1
    7 Stable tag: 0.4.0
     7Stable tag: 0.4.1
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    9696`[cloudwok wok_id="YOUR_WOK_ID" show_form="True" show_form_input_name="True" show_form_input_email="True" prefill_form_fields="True"]`
    9797
     98Since version 0.4.1 of this plugin, you can make the first name and last name fields required:
     99
     100`[cloudwok wok_id="YOUR_WOK_ID" show_form="True" show_form_input_name="True" required_firstname="True" required_lastname="True"]`
     101
    98102By default, a small "powered by" text-link to www.cloudwok.com is disabled. If you like our plug-in, we would appreciate it if you would enable the link via `[cloudwok wok_id="YOUR_WOK_ID" show_powered_by_link="True"]`. Send me a link to your WordPress site with enabled "powered by" link, and I'd be happy to send you a small coupon code gift back: [email protected]. Thanks!
    99103
     
    114118== Changelog ==
    115119
     120= 0.4.1 =
     121Added ability to make first name / last name fields required: `required_firstname="True"` and `required_lastname="True"`
    116122= 0.4.0 =
    117123Minor change to make feature introduced in 0.3.9 work in all cases.
Note: See TracChangeset for help on using the changeset viewer.