<!--{template 'download/head'}-->
<script language="javascript">
var autoIndex = 1;
function AddItem()
{
	autoIndex++;
	var index = $('urlsitem').rowIndex;
	var _tr   = $('down_table').insertRow( index);
	var a     = _tr.insertCell(0);
      		a.className = "tablerowl";
		a.innerHTML = "下载地址";
	var b = _tr.insertCell(1);
      		b.className = "tablerow";
		b.innerHTML = "<input name=\"url_name[]\" class='f-text'  type=\"text\" size=\"15\" maxlength=\"30\" value=\"下载地址"+index+"\">&nbsp;<input class='f-text' name=\"urls[]\" id=\"urls_"+autoIndex+"\" type=\"text\" size=\"40\" maxlength=\"255\" value=\"\">&nbsp;<input class='f-button' type=\"button\" value=\"删除\" onclick=\"$('down_table').deleteRow(this.parentNode.parentNode.rowIndex)\">&nbsp;<input class='f-button' type=\"button\" value=\"上传\" onClick=\"qmeCms.dialogView.iframe('上传文件','module.php?mod=download&action=upload&id=urls_"+autoIndex+"&channelid={$channelid}&file_type=file&javascript=getBrowseSoft&keepName=1',{type:'abs'});\">&nbsp;<input class='f-button' type=button onclick=\"SelectBrowse('{$_SET[webpath]}admin/images/browse.html?type=file&channelid={$channelid}&callback=getBrowseSoft','urls_"+autoIndex+"',550,360);\" value=\"浏览\">";
}
</script>
<script language=javascript>
function doCheck()
{
	var cidval = document.myform.cid.value ;
	var cidArray = new Array();
	cidArray = cidval.split("-");
	if(parseInt(cidArray[1])==1){
		alert('指定的栏目不允许添加！只允许在其子栏目中添加。');
		ShowTabs(0);
		return false;
	}
	if(document.myform.subject.value==""){
		alert("请输入标题！");
		ShowTabs(0);
		return false;
	}
	if(document.myform.size.value=="" || parseInt(document.myform.size.value) == 0){
		alert("请输入大小！");
		ShowTabs(0);
		return false;
	}
	if(document.myform.urls.value==""){
		alert("请输入地址！");
		ShowTabs(1);
		return false;
	}
	qmeCms.dialogView.form('操作提示','', {width:400})
	$('submit').disabled = true;
}
</script>
<table width="100%" align="center" cellspacing="0" cellpadding="0" class="tableborder">
   <tr>
     <td>
    	<form name=myform method="post" action="system.php?sys=module&mod={$mod}&channelid={$channelid}&action={$action}" onsubmit="return doCheck();" target="post_iframe">
        <table width='100%'  border='0' align='center' cellpadding='0' cellspacing='0'>
          <tr align='center'>
		 <td id='TabTitle0' class='title6' onclick='ShowTabs(0)'>基本属性</td>
          <td id='TabTitle1' class='title5' onclick='ShowTabs(1)'>下载地址</td>
		   <td id='TabTitle2' class='title5' onclick='ShowTabs(2)'>下载属性</td>
            <!--{if $show_money}--><td id='TabTitle3' class='title5' onclick='ShowTabs(3)'>收费选项</td><!--{/if}-->
			<td id='TabTitle4' class='title5' onclick='ShowTabs(4)'>扩展选项</td>
			<!--{if $show_related}--><td id='TabTitle5' class='title5' onclick='ShowTabs(5)'>相关内容</td><!--{/if}-->
            <td>&nbsp;</td>
          </tr>
        </table>
        <table width="100%" align="center"  cellspacing="1" cellpadding="0" class="tableborder border" id="down_table">
          <tbody id='Tabs0'>
            <tr>
              <td class="tablerowl" width=10%><font color=red>{lang cid}</font></td>
              <td class="tablerow">
				  <div class="modify-cate">
					<select name=cid id="cid"  stye="margin-right:12px;"><option value='0-1'>选择{$channeltitle}所属栏目</option>
						{$strall}
					</select>
					<a href="###" title="展开方式" onclick="return qmeCms.category.show()"><img src='images/stack.gif' style="border:0" /></a>
				</div>
			</td>
            </tr>
            <tr>
              <td class="tablerowl"><font color=red>{lang title}</font></td>
              <td class="tablerow">
				<!--{eval MakeSelectDownload("subject_pre", $_output[subject_pre], 1);}--> 
				<input type=text class="f-text"  name="subject" size="60" />
					<input type=text class="f-text"	name='subject_color' onchange="this.style.backgroundColor=this.value" id='subject_color' value="{$_output['subject_color']}" size="7" />
					<input type="button" onclick="return getColor(this, 'subject_color');" value="选择颜色" />
				</td>
            </tr>
			<tr>
				<td class="tablerowl">{$channeltitle}过滤</td>
				<td class="tablerow">
					<div class="modify-cate">
						<!--{echo makeFilterBox($_output['filter']);}-->
					</div>
				</td>
			</tr>
            <tr>
              <td class="tablerowl">{lang plugin}</td>
              <td class="tablerow"><table width="100%" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td class="tablerow" width=120 style="padding-left:0;"><!--{eval MakeSelectDownload("plugin");}--></td>
                    <td class="tablerowl" width=100>{lang language}</td>
                    <td class="tablerow" width=120 ><!--{eval MakeSelectDownload("language");}--></td>
                    <td class="tablerowl" align=center width=100><font color=red>{lang size}</font></td>
                    <td class="tablerow"><input type=text class="f-text" id="soft-size" name="size" size="10" value="0">KB</td>
                  </tr>
                </table></td>
            </tr>
            <tr>
              <td class="tablerowl">{lang softtype}</td>
              <td class="tablerow"><table width="100%" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td class="tablerow" width=120 style="padding-left:0;"><!--{eval MakeSelectDownload("softtype");}--> </td>
                    <td class="tablerowl" width=100>{lang use_type}</td>
                    <td class="tablerow"><!--{eval MakeSelectDownload("use_type");}--></td>
                  </tr>
                </table></td>
            </tr>
            <tr>
              <td class="tablerowl">{lang systems}</td>
              <td class="tablerow">
			  <!--{eval makeDownCheckBox('systems')}-->
			</td>
            </tr>

            <tr>
              <td class="tablerowl">{lang pic}</td>
              <td class="tablerow"><input size=50 name="thumb" type=text id='thumb' class="f-text" />
						<input type=button  class='f-button'  onclick="qmeCms.dialogView.iframe('上传图片','system.php?sys=upload&id=thumb&channelid={$channelid}&thumb=1',{type:'abs'});" value="上传图片" />
						<input type=button  class='f-button'  onclick="SelectBrowse('{$_SET[webpath]}admin/images/browse.html?type=image&channelid={$channelid}','thumb',550,360);" value="浏览服务器" />
				</td>
            </tr>
            <tr>
              <td class="tablerowl"><font color=red>{lang content}</font></td>
              <td  class="tablerow"><textarea  name="content" id=content style="display:none"></textarea>
				<iframe height="300" frameborder="0" width="100%" scrolling="no" src="../images/fck/editor/fckeditor.html?InstanceName=content&amp;Toolbar=Standard&channelid={$channelid}" id="FCKeditor1___Frame" name="FCKeditor1___Frame" style="border: 0pt none ; margin: 0pt; padding: 0pt; background-color: transparent; background-image: none; width: 100%; height: 300px;"></iframe>
              </td>
            </tr>
          </tbody>
		  <tbody id='Tabs2' style="display:none">
            <tr>
              <td class="tablerowl" width="60">关键词汇</td>
              <td class="tablerow">
				<table width="100%" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td class="tablerow" width=40% style="padding-left:0;"><input type=text class="f-text" name=keyword id=keyword value='' size=35 ></td>
                    <td class="tablerow">多个关键词用<font color=green>|</font>隔开</td>
                  </tr>
                </table></td>
            </tr>
  	   <tr>
		<td class="tablerowl">{$channeltitle}性质</td>
		<td class="tablerow">
			<div class="modify-cate">
				<select name='is_comend' id='is_comend' style="margin-right:15px;">
					<option value="0"<!--{if $_output[is_comend]==0}--> selected<!--{/if}-->>{$channeltitle}推荐等级</option>
					<option value="1"<!--{if $_output[is_comend]==1}--> selected<!--{/if}-->>☆</option>
					<option value="2"<!--{if $_output[is_comend]==2}--> selected<!--{/if}-->>☆☆</option>
					<option value="3"<!--{if $_output[is_comend]==3}--> selected<!--{/if}-->>☆☆☆</option>
					<option value="4"<!--{if $_output[is_comend]==4}--> selected<!--{/if}-->>☆☆☆☆</option>
					<option value="5"<!--{if $_output[is_comend]==5}--> selected<!--{/if}-->>☆☆☆☆☆</option>
				</select>
				<input name='nocoment' type='checkbox' id='nocoment' value='1'<!--{if $article[nocoment]==1}--> checked<!--{/if}-->><label for="nocoment">禁止评论</label>
				评分等级
				<select name='stars' id='stars'>
					<option value='5'>5</option>
					<option value='4'>4</option>
					<option value='3' selected>3</option>
					<option value='2'>2</option>
					<option value='1'>1</option>
				</select>
			</div>
		</td>
  		</tr>
            <tr>
              <td class="tablerowl">{lang author}</td>
              <td class="tablerow">
		<table width="100%" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td class="tablerow" width=40% style="padding-left:0;"><input type=text class="f-text"  name="author" size="20" id="author"></td>
                    <td class="tablerow" width=60% colspan=2></td>
                  </tr>
                </table></td>
            </tr>
            <tr>
              <td class="tablerowl">来源</td>
              <td class="tablerow">
				<table width="100%" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td class="tablerow" width=40% style="padding-left:0;"><input type=text class="f-text"  name="source" size="60" id="source"></td>
                    <td class="tablerow" width=60% colspan=2></td>
                  </tr>
                </table></td>
            </tr>

			<!--{if $_SET['modify_views']}-->
	    <tr>
		<td class="tablerowl">初始下载</td>
		<td class="tablerow">
		今日：<input name='dview' type=text class="f-text"  id='dview' value="<!--{eval echo isset($download[dview])?$download[dview]:20;}-->" size='10' maxlength=8 style='text-align:center'>
		本周：<input name='wview' type=text class="f-text"  id='wview' value="<!--{eval echo isset($download[wview])?$download[wview]:100;}-->" size='10' maxlength=8 style='text-align:center'>
		本月：<input name='mview' type=text class="f-text"  id='mview' value="<!--{eval echo isset($download[mview])?$download[mview]:500;}-->" size='10' maxlength=8 style='text-align:center'>
		总共：<input name='views' type=text class="f-text"  id='views' value="<!--{eval echo isset($download[views])?$download[views]:1000;}-->" size='10' maxlength=8 style='text-align:center'>
		</td>
  	   </tr>
	   <!--{/if}-->
  	   <tr>
		<td class="tablerowl">{$channeltitle}状态</td>
		<td class="tablerow">
			<div class="modify-cate">
				<input name='status' type='radio'  value='1' id='status_1'><label for="status_1">草稿</label>
				<input name='status' type='radio'  value='2' id='status_2'><label for="status_2">未通过审核</label>
				<input name='status' type='radio'  value='3' id="status_3"><label for="status_3">待审核</label>
				<input name='status' type='radio'  value='0' id="status_0" checked><label for="status_0">通过审核</label>
			</div>
		</td>
  	   </tr>
   <tr>
	<td class=tablerowl align=center>自定义文件名</td>
	<td class=tablerow>
		<p style="padding-top:6px;">
			<input type=text class="f-text" name="filename" id="filename" size=40 maxlength="64" value="" /> <input type="checkbox" name="auto_filename" id="auto_filename" value="1" <!--{if $_SET['auto_filename']}--> checked<!--{/if}--> /><label for="auto_filename">自动生成</label>
		</p>
		<p style="padding:6px 0;color:blue"> 自定义生成静态文件名，只能由英文字母，数字，和-_组成, 不包含文件扩展名 </p>
	</td>
  </tr> 	   
  	   <tr>
		<td class=tablerowl align=center>使用模板</td>
		<td class=tablerow><input type=text name=showphp size=40 class="f-text" id="showphp" value=""> <input type="button"  class='f-button'  onclick="SelectBrowse('images/browse.html?type=read&amp;channelid=-1&amp;callback=getDir','showphp',550,360);" value="选择模版"/>  为空则使用系统默认模板</td>
  	   </tr>
		  </tbody>
          <tbody id='Tabs1' style="display:none">
            <tr>
              <td class="tablerowl" width=10%> 
	      </td>
              <td class="tablerow">
				<input class='f-button' type="button" value="下载地址添加"  <!--{if $addtype == 1}-->disabled<!--{/if}-->  onClick="AddItem();">
			</td>
            </tr>
	   <!--{if $addtype == 1}-->
	 <!--镜像模式-->
            <tr>
                   <td class="tablerowl"><font color=red>下载地址</font></td>
                   <td class="tablerow"><input name="urls" type=text class="f-text"  id="urls" size="60" maxlength="255" /> <input  class='f-button' type="button" value="上传" id="up" onClick="qmeCms.dialogView.iframe('上传文件','module.php?mod=download&action=upload&channelid={$channelid}&file_type=file&javascript=getBrowseSoft&keepName=1&id='+urls,{type:'abs'});"><input  class='f-button'  type=button onclick="SelectBrowse('{$_SET[webpath]}admin/images/browse.html?type=file&channelid={$channelid}&callback=getBrowseSoft','urls',550,360);" value="浏览"></td>
            </tr>
            <tr>
                 <td class="tablerowl"><font color=red>可选服务器</font></td>
                 <td class="tablerow">
					<!--{if $serverlist }-->
						<!--{loop $serverlist $list}-->
							<input id="serverid_{$list[id]}" checked type='checkbox' name='serverid[]' value='{$list[id]}' /> <label for="serverid_{$list[id]}">{$list[name]}</label>
						<!--{/loop}-->
					<!--{else}-->
						<span style="margin-left:10px;color:red;">还没有添加服务器，<a href="module.php?mod=download&action=server&action_do=add&channelid={$channelid}">到这里添加</a></span>
					<!--{/if}-->
				</td>
            </tr>
	  <!--{else}-->
	 <!--普通模式-->
            <tr>
                <td class="tablerowl"><font color=red>下载地址</font></td>
                <td class="tablerow">
					<input name="url_name[]" type=text class="f-text"  id="url_name" size="15" maxlength="30" value="下载地址1">
					<input name="urls[]" type=text class="f-text"  id="urls" size="40" maxlength="255" value="">
					<input type="button" value="上传" class='f-button'    id="up" onClick="qmeCms.dialogView.iframe('上传文件','module.php?mod=download&action=upload&channelid={$channelid}&file_type=file&javascript=getBrowseSoft&keepName=1&id=urls',{type:'abs'});"><input  class='f-button'  type=button onclick="SelectBrowse('{$_SET[webpath]}admin/images/browse.html?type=file&channelid={$channelid}&callback=getBrowseSoft','urls',550,360);" value="浏览">
				</td>
            </tr>
	 <!--{/if}-->
            <tr id="urlsitem">
              <td class="tablerow" colspan="2"> </td>
            </tr>
          </tbody>

	<!--{if $show_money}-->
	<tbody id='Tabs3' style='display:none'>
	<!--{template 'element/money'}-->
	</tbody>
	<!--{/if}-->
    <tbody id='Tabs4' style='display:none'>
		<!--{template 'element/extend'}-->
  </tbody>
<!--{if $show_related}-->
<tbody id='Tabs5' style='display:none'>
   <!--{template 'element/related'}-->
</tbody>
<!--{/if}-->
	  <tbody>
          <tr>
            <td width="100%" align="center" colspan=2 id="submitrow"  class="tablerowl">
		<input type="hidden" name="type"  value="{$addtype}">
		<input type="hidden" name="myFormAc" value="update">
		<input type="submit" id="submit"  value="   保存   " class="f-button"  class='f-button' >
              &nbsp;
              <input class="f-button"  class='f-button'   type="button" value="   返回   " OnClick="location.href='system.php?sys=module&mod=download&channelid={$channelid}&action=manage'">
            </td>
          </tr>
         </tbody>
        </table>
     </form>
   </td>
  </tr>
</table>
<script type="text/javascript">
new qmeCms.Calendar("totime");
</script>
<!--{template 'foot'}-->