<?php
require_once 'page_classes/_base.class.php';
class page extends page_base {

function dispatch_index() {
	//$this->assign_search_form();
	$this->display_record();
	switch($this->QuictyStatus) {
		case 'INSERT':
			require_once 'includes/add_page/write.class.php';
			$options['Quicty_modules'] = $this->Quicty_modules;
			$options['application_id'] = $this->application['id'];
			$options['application_path'] = $this->application['application_root'];
			$options['folder_id'] = $this->folder['id'];
			$options['folder_name'] = $this->folder['name'];
			$options['page_name'] = $_POST['name'];
			$options['page_title'] = $_POST['title'];
			$options['page_type'] = $_POST['page_type'];
			$options['db_name'] = $this->application['db_name'];
			$options['system'] = $this->application['system'];
			$options['path'] = $this->application['path'];
			$options['host'] = $this->application['host'];
			$options['port'] = $this->application['port'];
			$options['user'] = $this->application['user'];
			$options['password'] = $this->application['password'];
			$options['persistent'] = $this->application['persistent'];
			if($_POST['datasets_name']=='0') {
				$options['data_name'] = $options['page_name'];
			} else {
				$options['data_name'] = $_POST['datasets_name'];
			}
			$add_page = new add_page_write($options);
			$result = $add_page->write();
			$this->page['message'] = $result['message'];
		case 'UPDATE':
		case 'DELETE':
			redirect('/info?id='.$this->application['id']);
			break;
		case 'BROWSE':
			break;
		default:
	}
	//$this->list_records();
	$this->assign('application_id',$this->application['id']);

	$this->add_pathlist('/info?id='.$this->application['id'],'アプリ');
	if($this->folder['id']) {
		$this->add_pathlist('/folder/info?id='.$this->folder['id'],'フォルダ');
	}
	$this->page['name'] = 'ページ';
	$this->add_pathlist('',$this->page['name']);
	$this->assign('page',$this->page);
	return $this->display($this->current_template);
}

} // end of page class
?>