Location: PHPKode > projects > AModules3 > amodules-3.0.1/mini-apps/02-DBver_control/FormApplication.php
<?php
/*
 * Created on 25.03.2006 by *Camper*
 */
class FormApplication extends Form{
	function init(){
		parent::init();
		$this
			->addField('line', 'name', 'Application name')
			->addField('text', 'description', 'Description')->setProperty('cols', 60)
			->addField('line', 'dirname', 'Deploy dirname')->setProperty('size', 80)
			->addField('dropdown', 'svn', 'Do svn add')->setValueList(array('Y'=>'Yes', 'N'=>'No'))
			
			->addSubmit('Save')
			
			->setSource('application')
			->addConditionFromGet('id')
		;
		if($_GET['id']!='')$this->addSubmit('Delete');
	}
	function submitted(){
		if(parent::submitted()){
			if($this->isClicked('Delete')){
				$this->dq->do_delete();
				$this->api->redirect('Application');
			}
			if(!$this->elements['svn']->value)$this->dq->set('svn', 'N');
			$this->update();
			$this->api->redirect('Application');
		}
	}
}
Return current item: AModules3