'xxx'
// 'html_before' => 'yyy'
// 'html_after' => 'zzz'
// )
// ...
// )
//
// RETURNS
// On SUCCESS
// $form_field_support_html STRING
//
// On FAILURE
// array( $error_message STRING )
// -------------------------------------------------------------------------
// =========================================================================
// Convert the input array to JSON/Javascript...
// =========================================================================
$field_groups_obj = json_encode( $field_groups ) ;
// =========================================================================
// Create the output HTML/Javascript...
// =========================================================================
// -------------------------------------------------------------------------
// The Zebra Form HTML is like (eg):-
//
// ...
//
//
//
//
// ...
//
//
//
(optional - default = 0)
//
//
// ...
//
//
//
This field allows
// you to show/hide the "Reload" buttons that
// appear - on LOCALHOST only - above each Ad Swapper
// ad widget's ads. So if your website ISN'T
// running on LOCALHOST, then the setting in this field
// will have NO effect. And if your website IS
// running on localhost, then the "Reload" buttons are
// a debugging tool - for the Ad Swapper plugin
// developers. So; hide them, and forget about
// them.
//
//
// ...
//
// NOTE how the "id" on the checkbox has had a "_1" appended to the
// original Zebra field name.
// -------------------------------------------------------------------------
$out = <<
window.zebra_form_field_groups = {$field_groups_obj} ;
function ferntec_sdm_add_field_groups_to_form() {
var i , j = window.zebra_form_field_groups.length ;
var this_field_group , jQuery_field_obj ;
for ( i=0 ; i 0 ) {
jQuery_field_obj.before( this_field_group['html_before'] ) ;
}
if ( typeof this_field_group['html_after'] === 'string' && this_field_group['html_after'].length > 0 ) {
jQuery_field_obj.after( this_field_group['html_after'] ) ;
}
}
// -----------------------------------------------------------------
}
}
ferntec_sdm_add_field_groups_to_form() ;
EOT;
// =========================================================================
// SUCCESS!
// =========================================================================
return $out ;
// =========================================================================
// That's that!
// =========================================================================
}
// =============================================================================
// That's that!
// =============================================================================