Created
December 1, 2016 02:59
-
-
Save bhwebworks/b64bec11a0b451865edfb6d1953e8a53 to your computer and use it in GitHub Desktop.
Revisions
-
richardW8k revised this gist
Sep 8, 2016 . 1 changed file with 6 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -19,12 +19,12 @@ function all_fields_extra_options( $value, $merge_tag, $options, $field, $raw_va $exclude = preg_match( "/exclude\[(.*?)\]/", $options , $exclude_match ); $exclude_array = explode( ',', rgar( $exclude_match, 1 ) ); $log = "all_fields_extra_options(): {$field->label}({$field->id} - {$field->type}) - "; if ( $include && in_array( $field->id, $include_array ) ) { switch ( $field->type ) { case 'html' : $value = $field->content; break; case 'section' : $value .= sprintf( '<tr bgcolor="#FFFFFF"> @@ -33,7 +33,7 @@ function all_fields_extra_options( $value, $merge_tag, $options, $field, $raw_va <font style="font-family: sans-serif; font-size:12px;">%s</font> </td> </tr> ', $field->description ); break; case 'signature' : $url = GFSignature::get_signature_url( $raw_value ); @@ -42,7 +42,7 @@ function all_fields_extra_options( $value, $merge_tag, $options, $field, $raw_va } GFCommon::log_debug( $log . 'included.' ); } if ( $exclude && in_array( $field->id, $exclude_array ) ) { GFCommon::log_debug( $log . 'excluded.' ); return false; } -
richardW8k revised this gist
Jun 7, 2014 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,8 +6,8 @@ * example: {all_fields:include[6]} * example: {all_fields:include[6],exclude[2,3]} */ add_filter( 'gform_merge_tag_filter', 'all_fields_extra_options', 11, 5 ); function all_fields_extra_options( $value, $merge_tag, $options, $field, $raw_value ) { if ( $merge_tag != 'all_fields' ) { return $value; } -
richardW8k revised this gist
Jun 7, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ /** * to exclude field from notification add 'exclude[ID]' option to {all_fields} tag * 'include[ID]' option includes HTML field / Section Break field description / Signature image in notification * see http://www.gravityhelp.com/documentation/page/Merge_Tags for a list of standard options * example: {all_fields:exclude[2,3]} * example: {all_fields:include[6]} -
richardW8k revised this gist
Jun 7, 2014 . 1 changed file with 6 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -24,11 +24,9 @@ function all_fields_extra_options( $value, $merge_tag, $options, $field ) { if ( $include && in_array( $field['id'], $include_array ) ) { switch ( $field['type'] ) { case 'html' : $value = $field['content']; break; case 'section' : $value .= sprintf( '<tr bgcolor="#FFFFFF"> <td width="20"> </td> <td> @@ -37,10 +35,15 @@ function all_fields_extra_options( $value, $merge_tag, $options, $field ) { </tr> ', $field['description'] ); break; case 'signature' : $url = GFSignature::get_signature_url( $raw_value ); $value = "<img alt='signature' src='{$url}'/>"; break; } GFCommon::log_debug( $log . 'included.' ); } if ( $exclude && in_array( $field['id'], $exclude_array ) ) { GFCommon::log_debug( $log . 'excluded.' ); return false; } return $value; -
richardW8k revised this gist
Jun 7, 2014 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ /** * to exclude field from notification add 'exclude[ID]' option to {all_fields} tag * to include HTML field / Section Break field description in notification add 'include[ID]' option to {all_fields} tag * see http://www.gravityhelp.com/documentation/page/Merge_Tags for a list of standard options * example: {all_fields:exclude[2,3]} * example: {all_fields:include[6]} -
richardW8k revised this gist
Jun 7, 2014 . 1 changed file with 39 additions and 32 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,40 +1,47 @@ /** * to exclude field from notifications add 'exclude[ID]' option to {all_fields} tag * to include HTML field / Section Break field description in notifications add 'include[ID]' option to {all_fields} tag * see http://www.gravityhelp.com/documentation/page/Merge_Tags for a list of standard options * example: {all_fields:exclude[2,3]} * example: {all_fields:include[6]} * example: {all_fields:include[6],exclude[2,3]} */ add_filter( 'gform_merge_tag_filter', 'all_fields_extra_options', 10, 4 ); function all_fields_extra_options( $value, $merge_tag, $options, $field ) { if ( $merge_tag != 'all_fields' ) { return $value; } // usage: {all_fields:include[ID],exclude[ID,ID]} $include = preg_match( "/include\[(.*?)\]/", $options , $include_match ); $include_array = explode( ',', rgar( $include_match, 1 ) ); $exclude = preg_match( "/exclude\[(.*?)\]/", $options , $exclude_match ); $exclude_array = explode( ',', rgar( $exclude_match, 1 ) ); $log = "all_fields_extra_options(): {$field['label']}({$field['id']} - {$field['type']}) - "; if ( $include && in_array( $field['id'], $include_array ) ) { switch ( $field['type'] ) { case 'html' : GFCommon::log_debug( $log . ' included.' ); $value = $field['content']; break; case 'section' : GFCommon::log_debug( $log . ' description included.' ); $value .= sprintf( '<tr bgcolor="#FFFFFF"> <td width="20"> </td> <td> <font style="font-family: sans-serif; font-size:12px;">%s</font> </td> </tr> ', $field['description'] ); break; } } if ( $exclude && in_array( $field['id'], $exclude_array ) ) { GFCommon::log_debug( $log . ' excluded.' ); return false; } return $value; } -
richardW8k renamed this gist
Jan 22, 2014 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
richardvav revised this gist
Oct 16, 2013 . 1 changed file with 7 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -21,7 +21,13 @@ function all_fields_extra_options( $value, $merge_tag, $options, $field ) { GFCommon::log_debug( "all_fields_extra_options(): Field ID: {$field["id"]} (Type: {$field["type"]}) - Field included." ); return $field["content"]; } elseif ( $include_class == true && $field["type"] == "section" ) { $field_value = $value . sprintf( '<tr bgcolor="#FFFFFF"> <td width="20"> </td> <td> <font style="font-family: sans-serif; font-size:12px;">%s</font> </td> </tr> ', $field["description"] ); GFCommon::log_debug( "all_fields_extra_options(): Field ID: {$field["id"]} (Type: {$field["type"]}) - Description included." ); return $field_value; } else { -
richardvav revised this gist
Oct 16, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ /** * to exclude field from notifications give field the CSS Class Name 'gf_exclude' * to include HTML field / Section Break field description in notifications give field the CSS Class Name 'gf_include' * add 'extra_options' option to {all_fields} tag. Example: {all_fields:extra_options} * see http://www.gravityhelp.com/documentation/page/Merge_Tags for a list of standard options */ -
richardvav revised this gist
Oct 16, 2013 . 1 changed file with 7 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -15,13 +15,17 @@ function all_fields_extra_options( $value, $merge_tag, $options, $field ) { $exclude_class = in_array( "gf_exclude", $class_array ); if ( $exclude_class == true ) { GFCommon::log_debug( "all_fields_extra_options(): Field ID: {$field["id"]} (Type: {$field["type"]}) - Field excluded." ); return false; } elseif ( $include_class == true && $field["type"] == "html" ) { GFCommon::log_debug( "all_fields_extra_options(): Field ID: {$field["id"]} (Type: {$field["type"]}) - Field included." ); return $field["content"]; } elseif ( $include_class == true && $field["type"] == "section" ) { $field_value = $value . sprintf( '<tr bgcolor="#FFFFFF"><td width="20"> </td><td><font style="font-family: sans-serif; font-size:12px;">%s</font></td></tr>', $field["description"] ); GFCommon::log_debug( "all_fields_extra_options(): Field ID: {$field["id"]} (Type: {$field["type"]}) - Description included." ); return $field_value; } else { GFCommon::log_debug( "all_fields_extra_options(): Field ID: {$field["id"]} (Type: {$field["type"]}) - Field handled normally." ); return $value; } } -
richardvav revised this gist
Oct 14, 2013 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,7 +10,6 @@ function all_fields_extra_options( $value, $merge_tag, $options, $field ) { $extra_options = in_array( "extra_options", $options_array ); if ( $merge_tag == "all_fields" && $extra_options == true ) { $class_array = explode( " ", $field["cssClass"] ); $include_class = in_array( "gf_include", $class_array ); $exclude_class = in_array( "gf_exclude", $class_array ); -
richardvav revised this gist
Oct 14, 2013 . 1 changed file with 7 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -15,12 +15,16 @@ function all_fields_extra_options( $value, $merge_tag, $options, $field ) { $include_class = in_array( "gf_include", $class_array ); $exclude_class = in_array( "gf_exclude", $class_array ); if ( $exclude_class == true ) { GFCommon::log_debug("all_fields_extra_options(): Field ID: {$field["id"]} (Type: {$field["type"]}) - Field excluded."); return false; } elseif ( $include_class == true && $field["type"] == "html" ) { GFCommon::log_debug("all_fields_extra_options(): Field ID: {$field["id"]} (Type: {$field["type"]}) - Field included."); return $field["content"]; } else { GFCommon::log_debug("all_fields_extra_options(): Field ID: {$field["id"]} (Type: {$field["type"]}) - Field handled normally."); return $value; } } else return $value; -
richardvav revised this gist
Oct 14, 2013 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,8 +6,8 @@ */ add_filter( 'gform_merge_tag_filter', 'all_fields_extra_options', 10, 4 ); function all_fields_extra_options( $value, $merge_tag, $options, $field ) { $options_array = explode( ",", $options ); $extra_options = in_array( "extra_options", $options_array ); if ( $merge_tag == "all_fields" && $extra_options == true ) { -
richardvav revised this gist
Oct 14, 2013 . 1 changed file with 10 additions and 12 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,25 +1,23 @@ /** * to exclude field from notifications give field the CSS Class Name 'gf_exclude' * to include HTML field in notifications give field the CSS Class Name 'gf_include' * add 'extra_options' option to {all_fields} tag. Example: {all_fields:extra_options} * see http://www.gravityhelp.com/documentation/page/Merge_Tags for a list of standard options */ add_filter( 'gform_merge_tag_filter', 'all_fields_extra_options', 10, 4 ); function all_fields_extra_options( $value, $merge_tag, $options, $field ) { $options_array = explode( ",", $options ); $extra_options = in_array( "extra_options", $options_array ); if ( $merge_tag == "all_fields" && $extra_options == true ) { $class_array = explode( " ", $field["cssClass"] ); $include_class = in_array( "gf_include", $class_array ); $exclude_class = in_array( "gf_exclude", $class_array ); if ( $exclude_class == true ) return false; elseif ( $include_class == true && $field["type"] == "html" ) return $field["content"]; else return $value; -
richardvav revised this gist
Oct 13, 2013 . 1 changed file with 17 additions and 15 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,25 +1,27 @@ /** * to include HTML fields or exclude fields from notifications * give field the CSS Class Name 'gf_exclude' and add the 'exclude' option to the {all_fields} tag * give HTML field the CSS Class Name 'gf_include' and add the 'html' option to the {all_fields} tag * merge tag options can be stacked. example: {all_fields:exclude,html} * see http://www.gravityhelp.com/documentation/page/Merge_Tags for a list of standard options */ add_filter( 'gform_merge_tag_filter', 'all_fields_extra_options', 10, 4 ); function all_fields_extra_options( $value, $merge_tag, $options, $field ) { if ( $merge_tag == "all_fields" ) { //break string into array and then return TRUE if string is found in the array $options_array = explode( ",", $options ); $include_html = in_array( "html", $options_array ); $exclude = in_array( "exclude", $options_array ); $class_array = explode( " ", $field["cssClass"] ); $include_class = in_array( "gf_include", $class_array ); $exclude_class = in_array( "gf_exclude", $class_array ); if ( $exclude == true && $exclude_class == true ) return false; elseif ( $include_html == true && $include_class == true && $field["type"] == "html" ) return $field["content"]; else return $value; } else -
richardvav revised this gist
Oct 12, 2013 . 2 changed files with 27 additions and 13 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ //to exclude a field from notifications give it the CSS Class Name 'gf_exclude' and add the 'exclude' option to the {all_fields} tag //to include a HTML field in notifications give it the CSS Class Name 'gf_include' and add the 'html' option to the {all_fields} tag //merge tag options can be stacked. example: {all_fields:exclude,html} //see http://www.gravityhelp.com/documentation/page/Merge_Tags for a list of standard options add_filter( 'gform_merge_tag_filter', 'all_fields_extra_options', 10, 4 ); function all_fields_extra_options( $value, $merge_tag, $options, $field ) { if ( $merge_tag == "all_fields" ) { $options_array = explode( ",", $options ); //breaks options into an array $include_html = in_array( "html", $options_array ); //returns TRUE if 'html' is found in the array $exclude = in_array( "exclude", $options_array ); //returns TRUE if 'exclude' is found in the array $class_array = explode( " ", $field["cssClass"] ); //breaks the fields CSS classes into an array $include_class = in_array( "gf_include", $class_array ); //returns TRUE if 'gf_include' is found in the array $exclude_class = in_array( "gf_exclude", $class_array ); //returns TRUE if 'gf_exclude' is found in the array if ( $exclude == true && $exclude_class == true ) { //if merge tag has 'exclude' option and field has 'gf_exclude' class then don't return the field return false; } elseif ( $include_html == true && $include_class == true && $field["type"] == "html" ) { //if merge tag has 'html' option and field is a HTML field with the 'gf_include' class then return the field content return $field["content"]; } else return $value; } else return $value; } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,13 +0,0 @@ -
richardvav created this gist
Oct 12, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ //to include a HTML field in notifications assign the field the CSS Class Name 'gf_include' and then use the {all_fields:html} merge tag add_filter( 'gform_merge_tag_filter', 'include_html_all_fields', 10, 4 ); function include_html_all_fields( $value, $merge_tag, $options, $field ) { $options_array = explode( ",", $options ); //breaks options into an array $include = in_array( "html", $options_array ); //returns TRUE if 'html' is found in the array $class_array = explode( " ", $field["cssClass"] ); //breaks the fields CSS classes into an array $include_class = in_array( "gf_include", $class_array ); //returns TRUE if 'gf_include' is found in the array if ( $merge_tag == "all_fields" && $include == true && $include_class == true && $field["type"] == "html" ) return $field["content"]; else return $value; }