<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link rel="stylesheet" type="text/css" href="{-:*__THEME__-}/admin/css/c.css" />
<link rel="stylesheet" type="text/css" href="{-:*__THEME__-}/admin/css/mf.css" />
</head>
<body>
<form id="formAdd" action="" method="post">
<dl class="abox">
	<dt><strong>{-:@ADD-}{-:@FLINK-}</strong></dt>
	<dd>
		<table class="formTable">
			<tr>
				<td class="inputTitle">{-:@CATEGORY-}</td>
				<td></td>
			</tr>
			<tr>
				<td class="inputArea">
					<select name="flink_category_id">
					{-foreach:$_FCL,$fc-}
						<option value="{-:$fc['flink_category_id']-}">{-:$fc['fc_name']-}</option>
					{-:/foreach-}
					</select>
				</td>
				<td class="inputTip">
					<span class="fc_gry">{-:@FLINK_CATEGORY_TIP-}</span>
				</td>
			</tr>
			<tr>
				<td class="inputTitle">{-:@SITE_NAME-}</td>
				<td></td>
			</tr>
			<tr>
				<td class="inputArea">
					<input class="required i" type="text" value="" name="f_site_name" maxlength="96" size="30">
				</td>
				<td class="inputTip">
					<span class="fc_r">*</span> <span class="fc_gry">{-:@F_SITE_NAME_TIP-}</span>
				</td>
			</tr>
			<tr>
				<td class="inputTitle">{-:@SITE_URL-}</td>
				<td></td>
			</tr>
			<tr>
				<td class="inputArea">
					<input class="required i" type="text" value="http://" name="f_site_url" maxlength="96" size="30">
				</td>
				<td class="inputTip">
					<span class="fc_r">*</span> <span class="fc_gry">{-:@F_SITE_URL_TIP-}</span>
				</td>
			</tr>
			<tr>
				<td class="inputTitle">{-:@WEBMASTER_EMAIL-}</td>
				<td></td>
			</tr>
			<tr>
				<td class="inputArea">
					<input class="i" type="text" value="" name="f_webmaster_email" maxlength="96" size="30">
				</td>
				<td class="inputTip">
					<span class="fc_gry">{-:@F_WEBMASTER_EMAIL_TIP-}</span>
				</td>
			</tr>
			<tr>
				<td class="inputTitle">{-:@SITE_DESCRIPTION-}</td>
				<td></td>
			</tr>
			<tr>
				<td class="inputArea">
					<textarea class="i" name="f_site_description" style="width:360px;height:60px;"></textarea>
				</td>
				<td class="inputTip">
					<span class="fc_gry">{-:@F_SITE_DESCRIPTION_TIP-}</span>
				</td>
			</tr>
			<tr>
				<td class="inputTitle">{-:@SITE_LOGO-}</td>
				<td class=""></td>
			</tr>
			<tr>
				<td colspan="2" class="inputArea">
					<input id="f_site_log" class="i" type="text" value="" name="f_site_logo" maxlength="255" size="50">
					<input id="f_site_log_uploader" to="#f_site_log" preview="#f_site_log_preview" btntext="{-:@UPLOAD-}" typeset='image' class="uploader" type="file"  />
					<img id="f_site_log_preview" src="" />
				</td>
			</tr>
			<tr>
				<td class="inputTitle">{-:@SHOW_TYPE-}</td>
				<td></td>
			</tr>
			<tr>
				<td class="inputArea">
					<label><input type="radio" value="0" name="f_show_type" checked="checked"> {-:@TEXT_LINK-}</label>
					<label><input type="radio" value="1" name="f_show_type"> {-:@LOGO_LINK-}</label>
				</td>
				<td class="inputArea">
					<span class="fc_gry">{-:@F_SHOW_TYPE_TIP-}</span>
				</td>
			</tr>
			<tr>
				<td class="inputTitle">{-:@STATUS-}</td>
				<td></td>
			</tr>
			<tr>
				<td class="inputArea">
					<label><input type="radio" value="0" name="f_status"> {-:@NOT_PASSED-}</label>
					<label><input type="radio" value="1" name="f_status" checked="checked"> {-:@PASSED-}</label>
				</td>
				<td class="inputArea">
					<span class="fc_gry">{-:@F_STATUS_TIP-}</span>
				</td>
			</tr>
			<tr>
				<td class="inputTitle">{-:@DISPLAY_ORDER-}</td>
				<td></td>
			</tr>
			<tr>
				<td class="inputArea">
					<input class="i" type="text" value="50" name="f_display_order" maxlength="20" size="10">
				</td>
				<td class="inputArea">
					<span class="fc_gry">{-:@F_DISPLAY_ORDER_TIP-}</span>
				</td>
			</tr>
		</table>
	</dd>
</dl><!--/.abox-->
<div id="operation">
	<span class="btn_b submit" action="{-url:flink/add_flink_do-}" to="#formAdd">{-:@SUBMIT-}</span>
</div>
</form>
<script type="text/javascript" src="{-:*__PUBLIC__-}/js/jquery.js"></script>
<script type="text/javascript" src="{-:*__PUBLIC__-}/js/uploadify/uploadify.js"></script>
<script type="text/javascript">
{-php:
	$o_upload = M('Option')->get_option('upload');
	$_FS['img'] = '*.'.implode(';*.', explode(',', $o_upload['imgtype']));
	$_FS['file'] = '*.'.implode(';*.', explode(',', $o_upload['filetype']));
	$_FS['all'] = $_FS['img'].';'.$_FS['file'];
-}
$(document).ready(function(){
	$('.uploader').each(function(){
		var btntext = $(this).attr('btntext'),
			to_id = $(this).attr('to'),
			typeset = $(this).attr('typeset'),
			thumb = $(this).attr('thumb'),
			preview_id = $(this).attr('preview'),
			fileTypeDesc, fileTypeExts, uploader;
		if('image' == typeset){
			fileTypeDesc = '{-:@IMAGE-}';
			fileTypeExts = '{-:$_FS['img']-}';
			if('yes' == thumb)
			{
				uploader = '{-url:upload/upload_file?type_set=image&upload_type=flink&thumb=yes-}';
			}
			else
			{
				uploader = '{-url:upload/upload_file?type_set=image&upload_type=flink-}';
			}
		}
		else if('all' == typeset){
			fileTypeDesc = '{-:@FILE-}';
			fileTypeExts = '{-:$_FS['all']-}';
			uploader = '{-url:upload/upload_file?type_set=all&upload_type=flink-}';
		}
		$(this).uploadify({
			'buttonClass' : 'btn_upload',
			'buttonImage' : '',
			'buttonText' : btntext,
			'fileObjName' : 'upload',
			'fileTypeDesc' : fileTypeDesc,
			'fileTypeExts' : fileTypeExts,
			'formData' : {
				'{-php:echo session_name();-}' : '{-php:echo session_id();-}'
			},
			'swf' : '{-:*__PUBLIC__-}/js/uploadify/uploadify.swf',
			'uploader' : uploader,
			'height' : 27,
			'width' : 80,
			'multi' : false,
			'queueID' : 'uwa_id',
			'onInit': function(){
				$("#uwa_id").hide();
			},
			'onUploadSuccess' : function(file, data, response){
				$(to_id).val(data);
				if(preview_id)
				{
					$(preview_id).attr('src', data);
				}
			},
			'onUploadError' : function(file, errorCode, errorMsg, errorString){
				alert(errorString);
			}
		});
	});
});
</script>
<script type="text/javascript" src="{-:*__THEME__-}/admin/js/c.js"></script>
</body>
</html>