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

class p403_sxExe extends xIExecutor {
	
	public function main() {
		global $_APP;
		$tips = '';
		if(isset($_POST['do'])) {
			$arrayStr = '';
			$_APP['preview'] = array();
			if(isset($_POST['preview'])) {
				foreach($_POST['preview'] as $ext) {
					$_APP['preview'][] = $ext;
					$arrayStr .= "'".$ext."',";
				}
				if($arrayStr!='') $arrayStr=substr($arrayStr, 0, -1);
			}
			$appInfo = file_get_contents(__ROOT__.'confs/app.i.php');
			$appInfo = preg_replace('/_APP\\[\'preview\'\\].+?\\);/s', "_APP['preview'] = array(".$arrayStr.");", $appInfo);
			file_put_contents(__ROOT__.'confs/app.i.php', $appInfo);
			$tips = '您的设置已经保存';
		}
		include_once(__ROOT__.'admin/ui.p403.php');
	}
	
	public function onError($result) {
		
	}
	
}
