<?php
if (!defined('USING_SYSTEM')) exit;

class p104_sxExe extends xIExecutor {
	
	public function main() {
		global $_APP;
		$tips = '';
		if(isset($_POST['siteKeywordsTxt'])) {
			$appInfo = file_get_contents(__ROOT__.'confs/app.i.php');
			$appInfo = preg_replace('/_APP\\[\'seo\'\\].+?\\);/s', "_APP['seo'] = array(
'keywords' => '".$_POST['siteKeywordsTxt']."',
'description' => '".$_POST['siteDescriptionTxt']."'
);", $appInfo);
			file_put_contents(__ROOT__.'confs/app.i.php', $appInfo);
			$tips = '您的设置已经成功被保存';
			// --- 更新 ---
			$_APP['seo']['keywords'] = $_POST['siteKeywordsTxt'];
			$_APP['seo']['description'] = $_POST['siteDescriptionTxt'];
		}
		include_once(__ROOT__.'admin/ui.p104.php');
	}
	
	public function onError($result) {
		
	}
	
}
