<?php
class skin_form_options extends myQuicty {

function __construct($page) {
	parent::__construct();
	$this->page = $page;
	$this->form = $this->page->form;
}

function set_form_options() {
	$this->form->set_base_link_addr(quicty_base_url().'/skin/');
	$this->form->set_restart_link_addr(quicty_base_url().'/skin/');
	$this->form->set_button_status('use_confirm',false);
	$this->form->set_button_label('insert','تر¹¹');
	$this->set_defaults();
	$this->set_constants();
	$this->add_rules();
	$this->set_form_filters();
}

function set_defaults() {
	if($this->page->layout AND $this->page->color) {
		$defaults = array(
					"layout"=>$this->page->layout,
					"color"=>$this->page->color
					);
		$this->form->setDefaults($defaults);
		//var_check($this->form);
	}
}

function set_constants() {
	/*
	$constants = array("field's name"=>$constant_value,
					"field's name"=>$constant_value);
	$this->form->setConstants($constants);
	*/
}

//function sample_rule($value) { if($value==true) return true; else return false; }

function add_rules() {
	/*
	$this->form->registerRule('sample_rule','callback','sample_rule',$this);
	$this->form->addRule("field's name",'Error Message','sample_rule',NULL,'server');
	*/
}


//function sample_filter($value) { return $value; }

function set_form_filters() {
	$this->form->applyFilter('_ALL_','trim');
	//$this->form->applyFilter("field's name",array($this,'sample_filter'));
}

} // end of class skin_form_options
?>