<?php
class item_search_form_options extends myQuicty {

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

function set_form_options() {
	$this->form->set_base_link_addr(quicty_base_url().'<!--{$folder_name}-->/item_search/');
	$this->form->set_restart_link_addr(quicty_base_url().'<!--{$folder_name}-->/item_search/');
	$this->form->set_button_status('use_confirm',false);
	
	$this->set_amazon_option_and_condition();
	
	$this->set_defaults();
	$this->set_constants();
	$this->add_rules();
	$this->set_form_filters();
}

function set_amazon_option_and_condition() {
	$this->form->form_element['search_option']->loadArray($this->amazon->search_kind_array);
	$this->form->form_element['sort_option']->loadArray($this->amazon->sort_option_array);
}

function set_defaults() {
	/*
	$defaults = array("field's name"=>$default_value,
					"field's name"=>$default_value);
	$this->form->setDefaults($defaults);
	*/
}

function set_constants() {
	$constants = array("ItemPage"=>'1');
	$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 item_search_form_options
?>