<?php
(!defined('M_COM') || !defined('M_ADMIN')) && exit('No Permission');
if(!submitcheck('bmtagadd') && !submitcheck('bmtagsdetail') && !submitcheck('bmtagcode')){
	$htmlarr = array(
	'0' => lang('nodeal'),
	'clearhtml' => lang('clearhtml'),
	'disablehtml' => lang('disablehtml'),
	'safehtml' => lang('safehtml'),
	);
	trbasic(lang('usource'),'mtagnew[setting][tname]',isset($mtag['setting']['tname']) ? $mtag['setting']['tname'] : '','text',lang('agusource'));
	trbasic(lang('deal_html_code'),'mtagnew[setting][dealhtml]',makeoption($htmlarr,empty($mtag['setting']['dealhtml']) ? '0' : $mtag['setting']['dealhtml']),'select');
	trbasic(lang('filter_badword'),'mtagnew[setting][badword]',empty($mtag['setting']['badword']) ? '0' : $mtag['setting']['badword'],'radio');
	trbasic(lang('deal_wordlink'),'mtagnew[setting][wordlink]',empty($mtag['setting']['wordlink']) ? '0' : $mtag['setting']['wordlink'],'radio');
	trbasic(lang('multitext_newline'),'mtagnew[setting][nl2br]',empty($mtag['setting']['nl2br']) ? '0' : $mtag['setting']['nl2br'],'radio');
	trbasic(lang('add_randstr'),'mtagnew[setting][randstr]',empty($mtag['setting']['randstr']) ? '0' : $mtag['setting']['randstr'],'radio');
	tabfooter();
	tabheader(lang('ptnaviset'));
	trbasic(lang('nav_simple'),'mtagnew[setting][simple]',empty($mtag['setting']['simple']) ? '0' : $mtag['setting']['simple'],'radio');
	trbasic(lang('nav_length'),'mtagnew[setting][length]',isset($mtag['setting']['length']) ? $mtag['setting']['length'] : '');
	tabfooter();
}else{
	$mtagnew['setting']['length'] = $mtagnew['setting']['length'] ? $mtagnew['setting']['length'] : '10';
	$mtagnew['setting']['tname'] = trim($mtagnew['setting']['tname']);
	if(empty($mtagnew['setting']['tname']) || !preg_match("/^[a-zA-Z_\$][a-zA-Z0-9_\[\]]*$/",$mtagnew['setting']['tname'])){
		if(!submitcheck('bmtagcode')){
			amessage('sourceillegal',M_REFERER); 
		}else $errormsg = lang('sourceillegal');//生成代码出错的提示信息
	}

}
?>
