<?php 
include("_dirinfo.php");
include_once (PATH_TO_ROOT."init.php");

include (PATH_TO_ROOT."webuserspool/UsersPoolinit.php");
include (PATH_TO_ROOT."_class/class.Extjs_form.php");


$form = new MakeForm($tabId);
$form->setMainTable('_Emails',DB_WARPIT_USERSPOOL)
	->setTitle('Options')
	//->addConfig('frame','true')
	->addConfig('padding','10')
	->addConfig('autoScroll','true')
	//->labelAlign('top')

	;
$form->treeInsert = $_POST['tree'];
	unset($_POST['tree']);	
$form->treeRefreshId = $_POST['parId'];
	
if($_POST['node_id'])
	$form->id = $_POST['node_id'];
else //we used this form for creating a new email...we "pass" all the parameters about node creating!
{
	
	$form->treeRefreshId = $_POST['parId'];
	$form->baseParams .= ",insertTree : true";
	foreach ($_POST as  $key => $addData) {
		$form->baseParams .= ",$key : $addData";
	}
		
}
	
$form->addField('idLab','Name','textfield');
$form->addField('id_account','Account','numberfield');
$form->addField('subject','Subject','textfield')->width(400);
$form->addField('mail_from','Sender email','textfield');
$form->addField('mail_from_label','Sender name','textfield');


$form->addSaveCancel('Save','Cancel',"$form");

echo $form->createForm();
	


echo "mainTabPanel.add($form).show();";

?>