<?php
/*
 * content/page/setting/Save.class.php
 * 
 * CopyRight(C) 2010 Shopformer Development Team. All Right Reserved
 * URL: http://sourceforge.jp/projects/shopformer/
 * 
 * 
 * Mail: m_nakashima@users.sourceforge.jp
 * Auther: Masanori Nakashima
 * Last Update: 2010-06-18
 */
require_once( dirname(dirname(dirname(dirname(__FILE__))))
	.DIRECTORY_SEPARATOR.'system'
	.DIRECTORY_SEPARATOR.'login'
	.DIRECTORY_SEPARATOR.'ModuleBase.class.php');
require_once( dirname(dirname(dirname(__FILE__)))
	.DIRECTORY_SEPARATOR.'DaoPage.class.php');
class content_page_setting_Save extends system_login_ModuleBase {
	function content_page_setting_Save() {
	}
	function execute( & $request ) {
		$fileUri			= strtolower(trim(stripslashes($_GET['uri'])));
		if( strlen(trim($fileUri)) == 0 ) {
			$request->addError('ファイルURIを指定してください');
		}
		
		if( !$request->isError() ) {
			$pageObject		= new content_DaoPage($fileUri);
			$pageObject->load( $request );
			$pageObject->title			= $request->getParam('title','post');
			$pageObject->charset		= $request->getParam('charset','post');
			$pageObject->template		= $request->getParam('template','post');
			$pageObject->description	= $request->getParam('description','post');
			$pageObject->keyword		= $request->getParam('keyword','post');
			$pageObject->modules		= trim($request->getParam('modules','post'));
			$pageObject->save($request);
			$request->setAttribute('content.page.pageObject',$pageObject );
		}
	}
}
?>