Commit 57d8e04c authored by Kevin Stover's avatar Kevin Stover Committed by GitHub

Release 3.0.27 (#2397)

* Reverting optimisation changes in favor of a traditional loop. Performance increases in 3.0.25 render the optimisations unnecessary. Closes #2366. (#2372)

* Update email setting reference for better error reporting (#2362)

* update email setting reference for error reporting. Closes #2361.

* Reverting optimisation changes in favor of a traditional loop. Performance increases in 3.0.25 render the optimisations unnecessary. Closes #2366. (#2372)

* Adjusting the invalid email error message.

* Adding logic for fancy emails: Kevin Stover <kevin@wpninjas.com>. Closes #2361.

* Ninja Forms implementation of the WP List Table should only appear on Ninja Forms plugin menus. Closes #2376. (#2378)

* Updating to version 3.0.26. See Changelog for details.

* use uasort to maintain key associations. Closes #2383. (#2384)

* Fixing a malformed radio trigger.

* Using timestamp for key update upon label change. Closes #2387. (#2388)

* Add field sort filter for All Fields merge tag. (#2390)

* add all_fields sorting for add-ons. Closes #2385.

* update fields_by_key parameter.

* set the field ID for the fields merge tag.

* skip the submit button in the all fields table.

* Add password setting type (#2309)

* move reply_to to primary settings. Closes #2290. (#2291)

* Update admin-menu-settings.html.php

* Add initial header advert for Layout & Styles (#2396)

* Added some styling and structure for a new header ad.

* Adding affiliate ID, NF_Layouts() check, Translated banner ad, updated banner ad text, now disables with the "disable admin notices" setting.

* Updating header ad text.

* Updating to version 3.0.27. See Changelog for details.
parent efc615c5
......@@ -3,8 +3,9 @@
Tags: form, forms, contact form, custom form, form builder, form creator, form manager, form creation, contact forms, custom forms, forms builder, forms creator, forms manager, forms creation, form administration,
Requires at least: 4.5
Tested up to: 4.7.1
Stable tag: 3.0.26
Tested up to: 4.7.2
Stable tag: 3.0.27
License: GPLv2 or later
With a simple drag and drop interface you can create contact forms, email subscription forms, order forms, payment forms, and any other type of form for your WordPress site.
......
......@@ -2140,6 +2140,8 @@ WP Color Picker (Iris) Styles
margin-left: 0; }
#nf-builder {
padding: 80px 20px 10px; }
#nf-builder .nf-cta-bubble {
display: none !important; }
#nf-main {
padding: 20px 0 80px; }
#nf-drawer {
......@@ -2194,6 +2196,33 @@ WP Color Picker (Iris) Styles
opacity: 1.0;
filter: alpha(opacity=100);
transition: all 1.0s ease; }
#nf-app-admin-header .nf-cta-bubble {
background: #1EA9EA;
border: 1px solid #1EA9EA;
border-radius: 6px;
color: #fff;
display: block;
float: left;
font-size: 14px;
margin: 6px 0 0 20px;
padding: 5px 10px;
position: relative;
text-decoration: none;
width: 360px; }
#nf-app-admin-header .nf-cta-bubble::after {
display: block;
content: "";
width: 0;
height: 0;
border-top: 10px solid transparent;
border-bottom: 10px solid transparent;
border-right: 10px solid #1EA9EA;
position: absolute;
left: -10px;
top: 13px; }
#nf-app-admin-header .nf-cta-bubble:hover {
background: #fff;
color: #1EA9EA; }
.scrollWrap {
overflow: hidden;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -40,7 +40,7 @@ define( [], function() {
// Update our field model with the new setting value.
dataModel.set( name, value, { settingModel: settingModel } );
nfRadio.channel( 'setting-' + name, 'after:updateSetting', dataModel, settingModel );
nfRadio.channel( 'setting-' + name ).trigger( 'after:updateSetting', dataModel, settingModel );
// Register our setting change with our change tracker
var after = value;
......
......@@ -34,7 +34,8 @@ define( [], function() {
newFieldKey: function( model ) {
var d = new Date();
var n = d.valueOf();
var key = this.keyExists( model.get( 'type' ) + '_' + n );
var key = this.slugify( model.get( 'type' ) + '_' + n );
model.set( 'key', key, { silent: true } );
if( 'undefined' == model.get( 'manual_key' ) ) {
......@@ -55,7 +56,9 @@ define( [], function() {
*
*/
delete model.changed.label;
var key = this.keyExists( model.get( 'label' ) );
var d = new Date();
var n = d.valueOf();
var key = this.slugify( model.get( 'label' ) + '_' + n );
model.set( 'key', key );
}
},
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
......@@ -87,6 +87,36 @@ All styles used for displaying table content
-webkit-transition: all 1.0s ease;
transition: all 1.0s ease;
}
.nf-cta-bubble {
background: $cta_color;
border: 1px solid $cta_color;
border-radius: 6px;
color: #fff;
display: block;
float: left;
font-size: 14px;
margin: 6px 0 0 20px;
padding: 5px 10px;
position: relative;
text-decoration: none;
width: 360px;
&::after {
display: block;
content: "";
width: 0;
height: 0;
border-top: 10px solid transparent;
border-bottom: 10px solid transparent;
border-right: 10px solid $cta_color;
position: absolute;
left: -10px;
top: 13px;
}
&:hover {
background: #fff;
color: $cta-color;
}
}
}
.scrollWrap{
......
......@@ -276,6 +276,9 @@
// }
#nf-builder {
padding: 80px 20px 10px;
.nf-cta-bubble {
display: none !important;
}
}
#nf-main {
padding: 20px 0 80px;
......
......@@ -265,7 +265,8 @@ class Ninja_Forms {
// Plugin version
if ( ! defined( 'NF_PLUGIN_VERSION' ) )
define( 'NF_PLUGIN_VERSION', '3.0.26' );
define( 'NF_PLUGIN_VERSION', '3.0.27' );
// Plugin Folder Path
if ( ! defined( 'NF_PLUGIN_DIR' ) )
......
......@@ -79,6 +79,7 @@ class NF_AJAX_Controllers_Submission extends NF_Abstracts_Controller
{
// Init Field Merge Tags.
$field_merge_tags = Ninja_Forms()->merge_tags[ 'fields' ];
$field_merge_tags->set_form_id( $this->_form_id );
// Init Calc Merge Tags.
$calcs_merge_tags = Ninja_Forms()->merge_tags[ 'calcs' ];
......
......@@ -308,7 +308,7 @@ final class NF_Database_Models_Submission
* TODO: This is probably not the most effecient way to handle this. It should be re-thought.
*/
if ( ! has_filter( 'ninja_forms_get_fields_sorted' ) ) {
usort( $fields, array( 'NF_Database_Models_Submission', 'sort_fields' ) );
uasort( $fields, array( 'NF_Database_Models_Submission', 'sort_fields' ) );
}
$hidden_field_types = apply_filters( 'nf_sub_hidden_field_types', array() );
......@@ -326,7 +326,7 @@ final class NF_Database_Models_Submission
foreach ($fields as $field_id => $field) {
if (!is_int($field_id)) continue;
if (!is_int($field_id)) continue;
if( in_array( $field->get_setting( 'type' ), $hidden_field_types ) ) continue;
if ( $field->get_setting( 'admin_label' ) ) {
......
......@@ -6,6 +6,7 @@
final class NF_MergeTags_Fields extends NF_Abstracts_MergeTags
{
protected $id = 'fields';
protected $form_id;
public function __construct()
{
......@@ -22,10 +23,11 @@ final class NF_MergeTags_Fields extends NF_Abstracts_MergeTags
public function all_fields()
{
$return = '<table>';
$hidden_field_types = array( 'html' );
ksort( $this->merge_tags[ 'all_fields' ][ 'fields' ] );
foreach( $this->merge_tags[ 'all_fields' ][ 'fields' ] as $field ){
$hidden_field_types = array( 'html', 'submit' );
foreach( $this->get_fields_sorted() as $field ){
if( ! isset( $field[ 'type' ] ) ) continue;
if( in_array( $field[ 'type' ], array_values( $hidden_field_types ) ) ) continue;
$field[ 'value' ] = apply_filters( 'ninja_forms_merge_tag_value_' . $field[ 'type' ], $field[ 'value' ], $field );
......@@ -38,10 +40,13 @@ final class NF_MergeTags_Fields extends NF_Abstracts_MergeTags
return $return;
}
// TODO: Is this being used?
public function all_field_plain()
{
$return = '';
foreach( $this->merge_tags[ 'all_fields' ][ 'fields' ] as $field ){
foreach( $this->get_fields_sorted() as $field ){
$field[ 'value' ] = apply_filters( 'ninja_forms_merge_tag_value_' . $field[ 'type' ], $field[ 'value' ], $field );
if( is_array( $field[ 'value' ] ) ) $field[ 'value' ] = implode( ', ', $field[ 'value' ] );
......@@ -56,10 +61,10 @@ final class NF_MergeTags_Fields extends NF_Abstracts_MergeTags
$hidden_field_types = apply_filters( 'nf_sub_hidden_field_types', array() );
if( in_array( $field[ 'type' ], $hidden_field_types ) ) return;
$callback = 'field_' . $field[ 'id' ];
$field_id = $field[ 'id' ];
$callback = 'field_' . $field_id;
$order = absint( $field[ 'order' ] );
$this->merge_tags[ 'all_fields' ][ 'fields' ][ $order ] = $field;
$this->merge_tags[ 'all_fields' ][ 'fields' ][ $field_id ] = $field;
if( is_array( $field[ 'value' ] ) ) $field[ 'value' ] = implode( ',', $field[ 'value' ] );
......@@ -68,13 +73,20 @@ final class NF_MergeTags_Fields extends NF_Abstracts_MergeTags
$this->add( $callback, $field['id'], '{field:' . $field['id'] . '}', $value );
if( isset( $field[ 'key' ] ) ) {
$callback = 'field_' . $field['key'];
$this->add( $callback, $field['key'], '{field:' . $field['key'] . '}', $value );
}
$field_key = $field[ 'key' ];
// Add Field Key Callback
$callback = 'field_' . $field_key;
$this->add( $callback, $field_key, '{field:' . $field_key . '}', $value );
$callback = 'field_' . $field[ 'key' ] . '_calc';
$calc_value = apply_filters( 'ninja_forms_merge_tag_calc_value_' . $field[ 'type' ], $field['value'], $field );
$this->add( $callback, $field['key'], '{field:' . $field['key'] . ':calc}', $calc_value );
// Add Field by Key for All Fields
$this->merge_tags[ 'all_fields_by_key' ][ 'fields' ][ $field_key ] = $field;
// Add Field Calc Callabck
$callback = 'field_' . $field_key . '_calc';
$calc_value = apply_filters( 'ninja_forms_merge_tag_calc_value_' . $field[ 'type' ], $field['value'], $field );
$this->add( $callback, $field_key, '{field:' . $field_key . ':calc}', $calc_value );
}
}
public function add( $callback, $id, $tag, $value )
......@@ -87,4 +99,33 @@ final class NF_MergeTags_Fields extends NF_Abstracts_MergeTags
);
}
public function set_form_id( $form_id )
{
$this->form_id = $form_id;
}
private function get_fields_sorted()
{
$fields = $this->merge_tags[ 'all_fields' ][ 'fields' ];
// Filterable Sorting for Add-ons (ie Layout and Multi-Part ).
if ( has_filter( 'ninja_forms_get_fields_sorted' ) ) {
$fields_by_key = $this->merge_tags[ 'all_fields_by_key' ][ 'fields' ];
$fields = apply_filters( 'ninja_forms_get_fields_sorted', array(), $fields, $fields_by_key, $this->form_id );
} else {
// Default Sorting by Field Order.
uasort( $fields, array( $this, 'sort_fields' ) );
}
return $fields;
}
public static function sort_fields( $a, $b )
{
if ( $a[ 'order' ] == $b[ 'order' ] ) {
return 0;
}
return ( $a[ 'order' ] < $b[ 'order' ] ) ? -1 : 1;
}
} // END CLASS NF_MergeTags_Fields
......@@ -3,7 +3,29 @@
<div id="nf-builder" class="grey"></div>
<script id="tmpl-nf-builder" type="text/template">
<div id="nf-app-admin-header"><div id="nf-logo"></div><a href="admin.php?page=ninja-forms" class="fa fa-times"></a></div>
<div id="nf-app-admin-header">
<div id="nf-logo"></div>
<?php
/*
* TODO: Make this much more dynamic.
*/
$nf_settings = get_option( 'ninja_forms_settings' );
$disable_admin_notices = ( isset ( $nf_settings[ 'disable_admin_notices' ] ) ) ? $nf_settings[ 'disable_admin_notices' ] : false;
if( ! function_exists( 'NF_Layouts' ) && ! $disable_admin_notices ) {
$u_id = get_option( 'nf_aff', false );
if ( !$u_id ) $u_id = apply_filters( 'ninja_forms_affiliate_id', false );
$link = 'https://ninjaforms.com/extensions/layout-styles/?utm_medium=plugin&utm_source=plugin-builder&utm_campaign=Ninja+Forms+Builder&utm_content=Layout+and+Styles';
if ( $u_id ) {
$link = 'http://www.shareasale.com/r.cfm?u=' . $u_id . '&b=812237&m=63061&afftrack=&urllink=' . $link;
}
?>
<a href="<?php echo $link; ?>" target="_blank" class="nf-cta-bubble"><?php printf( __( "Create multi-column form layouts with Layout & Styles...%slearn more now!%s", 'ninja-forms' ), '<span>', '</span>' ); ?></a>
<?php
}
?>
<a href="admin.php?page=ninja-forms" class="fa fa-times"></a></div>
<div id="nf-overlay"></div>
<div id="nf-header"></div>
<div id="nf-main" class="nf-app-main"></div>
......
......@@ -56,6 +56,9 @@
case 'textbox' :
echo "<input type='text' class='code widefat' name='{$setting['id']}' id='{$setting['id']}' value='{$setting['value']}'>";
break;
case 'password' :
echo "<input type='password' class='code widefat' name='{$setting['id']}' id='{$setting['id']}' value='{$setting['value']}'>";
break;
case 'checkbox' :
$checked = ( $setting[ 'value' ] ) ? 'checked' : '';
echo "<input type='hidden' name='{$setting['id']}' value='0'>";
......
......@@ -3,7 +3,7 @@
Plugin Name: Ninja Forms
Plugin URI: http://ninjaforms.com/
Description: Ninja Forms is a webform builder with unparalleled ease of use and features.
Version: 3.0.26
Version: 3.0.27
Author: The WP Ninjas
Author URI: http://ninjaforms.com
Text Domain: ninja-forms
......@@ -51,7 +51,7 @@ if( get_option( 'ninja_forms_load_deprecated', FALSE ) && ! ( isset( $_POST[ 'nf
/**
* @since 3.0
*/
const VERSION = '3.0.26';
const VERSION = '3.0.27';
/**
* @var Ninja_Forms
......
......@@ -2,8 +2,8 @@
Contributors: wpninjasllc, kstover, jameslaws, kbjohnson90, klhall1987, wpnzach, aman086, daveshine, mordauk, bftrick, helgatheviking
Tags: form, forms, contact form, custom form, form builder, form creator, form manager, form creation, contact forms, custom forms, forms builder, forms creator, forms manager, forms creation, form administration,
Requires at least: 4.5
Tested up to: 4.7.1
Stable tag: 3.0.26
Tested up to: 4.7.2
Stable tag: 3.0.27
License: GPLv2 or later
Drag and drop fields in an intuitive UI to create create contact forms, email subscription forms, order forms, payment forms, send emails and more!
......@@ -102,6 +102,21 @@ For help and video tutorials, please visit our website: [Ninja Forms Documentati
== Upgrade Notice ==
= 3.0.27 (2 February 2017) =
*Bugs:*
* Field data should populate properly in all submission exports.
== Changelog ==
= 3.0.27 (2 February 2017) =
*Bugs:*
* Field data should populate properly in all submission exports.
= 3.0.26 (30 January 2017) =
*Bugs:*
......@@ -110,8 +125,6 @@ For help and video tutorials, please visit our website: [Ninja Forms Documentati
* Email errors upon form submission should be clearer.
* Fixed a compatibility bug with other plugins that use the WP List Table.
== Changelog ==
= 3.0.26 (30 January 2017) =
*Bugs:*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment