	README document describing HTMLTemplate Toolkit common templates.
	Parallels, Inc., (c) 2009.

	This folder contains common HTML templates could be used to assist 
plug-ins developers with forms and tables compilation. 
Common templates can be devided into several groups:
  - Basic (elemnentary).
  - Primitive.
  - Base (set of primitives and basics).
  - Miscellaneous.

	Each group may contain templates for building 'Edit' forms or to simplify 
compilation of 'View' pages. 

Templates are located in 
	/var/opt/hspc-root/template/HSPC/PluginToolkit/HTMLTemplate directory 
together with this short README file.

    Your custom templates, which you wish to use with HTMLTemplate tool 
you should place to '/var/opt/hspc-root/template/<some_directory>'. 
Then you can use them specifying 'path' in 
	HSPC::PluginToolkit::HTMLTemplate::parse_template(...)
calls. See below for examples.

	Templates allows you to customize them also. The customization may be 
implemented per-reseller, according to Parallels Business Automation - Standard Customization Guide.

List of templates divided by group:
	Basic:
	item_edit_area.tmpl 	- Textarea
	item_edit_check.tmpl	- Checkbox
	item_edit_combo.tmpl	- Combobox 
	item_edit_radio.tmpl	- Radiobutton
	item_edit_text.tmpl		- Input field
	item_view_check.tmpl	- Checkbox (view)
	item_view_text.tmpl		- Text (view)

	Primitives:
	item_edit_cnttype.tmpl	- Contact type control (personal or corporate)
	item_edit_name.tmpl		- Contact person name (First name and Last name)
	item_edit_phone.tmpl	- Phone number (country code, area code, number and extension)
	item_edit_terms.tmpl	- Terms agreement (read-only textarea and checkbox)
	item_edit_date.tmpl		- Date input
	item_view_date.tmpl		- Date view

	Base:
	base_edit_contact.tmpl	- Base contact edit form 
	base_view_contact.tmpl	- Base contact view 
	
	Miscellaneous:
	item_js_disable.tmpl	- Javascript function for form elements dynamic disabling
	table_edit.tmpl			- HTML <table> wrapper for 'edit' forms
	table_view.tmpl			- HTML <table> wrapper for 'view' sheets
	item_view_folder.tmpl	- Titled frame for logical blocks of edit or view elements

	'.tmpl' extension may NOT be ommitted.

	EXAMPLES 

	1. Draw domain contact edit form with additional mandatory field (Birth date)
	==============================================================
	# use parse module and import parse_template function
	use HSPC::PluginToolkit::HTMLTemplate qw|parse_template|;
	# generate base contact form
	my $form = parse_template(
		name => 'base_edit_contact.html',
		data => {
			type => 'Administrative Contact',
			# to collect parameters for several contacts
			form_prefix => 'admin_somedomain_com', 
			is_corporate => 0,
			fname => 'Firstname',
			lname => 'Lastname',
			email => 'somename@somedomain.com',
			address => '1234 Somewhere St.',
			city => 'SomeThingTown',
			state => 'SMTH',
			zip => '12345',
			country => 'SM',
			phone => '1|123|1234567|',
			hide_fax => 1
		}
	);
	
	# add input field for Birth date
	$form .= parse_template(
		name => 'item_edit_text.tmpl',
		data => {
			name => 'admin_somedomain_com_birth_date',
			maxlength => 9,
			size => 10,
			title => 'Birth Date',
			value => '',
			descr => 'e.g. 10.11.1980',
			not_empty => 1,
		}
	);

	# wrap code into <table> tags
	my $html = parse_template(
		name => 'table_edit.tmpl',
		data => {
			value => $form
		}
	);

	# HTML form is ready. return it to caller
	return $html; 
	==================================================================


More information on the HTMLTemplate usage, syntax and customization see
Parallels Business Automation - Standard Plug-in Developers Guide.
