I needed functionality to have my lists and custom fields as choices in the block. This patch allows custom fields to be created in the admin interface. It supports radio buttons, select fields, and checkboxes.

It would be great if someone could check it out and give me feedback.

Also, please create a mailbuild.js file with the following code (I wasn't sure how to submit a new file in an issue):

jQuery(function() {
	var $ = jQuery; // Scope jQuery as $
	var last = {el: null, len: 0};
	$('#edit-mblists div:first').children('.form-item')
		.each(function() {
			var fields = $('~ .form-field:first', this), 
				len = fields.find(':input').size();
			$(':radio:first', this).bind('click', function() {
				// Dont animate if last el was me
				if (last.el && (last.el == fields))
					return;
				// Slide up last element
				if (last.el && last.len)
					last.el.slideUp();
				// Update last element
				last = {
					el: fields,
					len: len// leave last comma off
				};
				// Animate me
				// Only do animation if has children
				if (last.el && last.len)
					last.el.slideDown('slow');
			});
			fields.hide();
		}).end()
		// Find first radio and click it
		.find('.form-item:first :radio').click();
});
CommentFileSizeAuthor
mailbuild.module.patch8.91 KBChris Gillis

Comments

dragonwize’s picture

Thank you for the patch thekeyper. One of the developers will look into this and post back when we get a chance.

ac’s picture

We need to implement this so we will test and include it in a release shortly if its all good.

benkant’s picture

Hi thekeyper, thanks for the patch. Can you please recreate your patch as per http://drupal.org/patch/create ?

Essentially:

cvs diff -up mailbuild.module > mailbuild.module.patch

Thanks again.