Page 1 of 1

ENCTYPE for cms_mapi_create_admin_form_start

Posted: Tue Dec 14, 2004 2:48 am
by snorki
in lib/module.functions.php I added ENCTYPE="multipart/form-data" to allow file uploads from within the admin-part of modules

Code: Select all

function cms_mapi_create_admin_form_start($module, $id, $method="post") {

	return "<form name=\"".$id."moduleform\" method=\"$method\" action=\"moduleinterface.php\" ENCTYPE=\"multipart/form-data\"><input type=\"hidden\" name=\"module\" value=\"$module\" />\n";


}
probably,

Code: Select all

function cms_mapi_create_admin_form_start($module, $id, $method="post", $enctype="_whateverTheDefaultEncTypeIsCalled_")
would be nicer, but I don't know what the default ENCTYPE is since I never have to type it. AnywayZ, this works for me.

hop it helps,

snorki

ENCTYPE for cms_mapi_create_admin_form_start

Posted: Tue Dec 14, 2004 2:54 am
by Ted
Very good idea. I just added this to both user_form_start and admin_form_start in svn.

Thanks!