<?
class Zone extends Object {


    function constructor($zone) {
        parent::constructor();
        $this->zone = $zone;
    }



    function getDialog() {
        if( !empty($_REQUEST["target"]) && ($this->target = $_REQUEST["target"]) ) { 
            $dialog_name = $this->zone."_dialog_".$this->target;
        } else {
            $dialog_name = $this->zone."_dialog";
        }
        return $dialog_name;
    }



    function getTemplate() {
        return $this->zone."/"._TPL_ZONE_INDEX;
    }



    function run() {
        ### params for object constructor
        $param_list = func_get_args();
        array_unshift($param_list,$this->getDialog());

        $this->dialog = call_user_func_array('func_new',$param_list);

        $this->dialog->zoner = $this->zone.".php";
        
        if(!empty($this->dialog->redirect_url)) {
            exit;
        }
        $this->dialog->setTemplate($this->getTemplate());
        ob_start();
        $this->dialog->action();
        $this->dialog->makeData();
        $this->dialog->display();
        if(!$this->dialog->getSilent()) {
            ob_end_flush();
        }
    }


}
?>