<!--{template 'head'}-->
<style type="text/css">
#voteitem td.tablerow{text-align:left;}
</style>
<script type="text/javascript">
if(top != window) parent.document.getElementById('menu').contentWindow.show('submenu'+channelid.toString());
setSubject("{$channeltitle}管理");
</script>
<table cellpadding="0" cellspacing="0" border="0" align=center width=100% class="tableborder">
  <tr>
      <td class="tablerow"  colspan=2><b>管理选项：</b>
	<a href="system.php?sys=module&mod={$mod}&channelid={$channelid}&action=manage&pagesize={$pagesize}"><!--{if $action=='manage'}--><font color=red>{$channeltitle}管理</font><!--{else}-->{$channeltitle}管理<!--{/if}--></a> |
	<a href="module.php?mod=movie&channelid={$channelid}&action=add"><!--{if $action=='add'}--><font color=red>{$channeltitle}添加</font><!--{else}-->{$channeltitle}添加<!--{/if}--></a> |
	<a href="system.php?sys=module&mod={$mod}&channelid={$channelid}&action=manage&status=3"><!--{if $action=='modify' && $status==3}--><font color=red>{$channeltitle}审核</font><!--{else}-->{$channeltitle}审核<!--{/if}--></a> |
	<a href="system.php?sys=module&mod={$mod}&channelid={$channelid}&action=manage&recycle=1&pagesize={$pagesize}"><!--{if $_GET['recycle']==1}--><font color=red>{$channeltitle}回收站管理</font><!--{else}-->{$channeltitle}回收站管理<!--{/if}--></a>
	</td>
</tr>
  <tr>
      <td class="tablerow">
		<div class="modify-cate">
			<form name="search-form" id="search-form" class="search-form" action="system.php" onsubmit="$('__submit').disabled=true;return true;">
				<input type="hidden" name="sys" value="module" />
				<input type="hidden" name="channelid" value="{$channelid}" />
				<input type="hidden" name="action" value="manage" />
				<input type="hidden" name="pagesize" value="{$pagesize}" />
				<input onclick="formSubmit('search-form')" name='status' value="0" type='radio' <!--{if $action=='manage'}--> checked<!--{/if}--> id="__status_0"><label for="__status_0">审核通过</label>
				<input onclick="formSubmit('search-form')" name='status' value="3" type='radio' <!--{if $status==3}--> checked<!--{/if}--> id="__status_3"><label for="__status_3">待审{$channeltitle}</label>
				<input onclick="formSubmit('search-form')" name='status' value="2" type='radio' <!--{if $status==2}--> checked<!--{/if}--> id="__status_2"><label for="__status_2">退稿{$channeltitle}</label>
				<input onclick="formSubmit('search-form')" name='status' value="1" type='radio' <!--{if $status==1}--> checked<!--{/if}--> id="__status_1"><label for="__status_1">草稿{$channeltitle}</label>
				<input onclick="formSubmit('search-form')" name='status' value="4" type='radio' <!--{if $status==4}--> checked<!--{/if}--> id="__status_4"><label for="__status_4">回收站</label>
				<input onclick="formSubmit('search-form')" name='is_comend' value="1" type='checkbox'<!--{if intval($_GET['is_comend'])==1}--> checked<!--{/if}--> id="__is_comend"><label for="__is_comend">推荐{$channeltitle}</label>
				<!--{eval $play_status = isset($_GET['param']['play_status']) ? intval($_GET['param']['play_status']) : -1;}-->
				<select name="param[play_status]" onchange="formSubmit('search-form')">
					<option value="-1"<!--{if $play_status == -1}--> selected<!--{/if}-->>不限</option>
					<option value="0"<!--{if $play_status == 0}--> selected<!--{/if}-->>完结</option>
					<option value="1"<!--{if $play_status == 1}--> selected<!--{/if}-->>连载中</option>
					<option value="2"<!--{if $play_status == 2}--> selected<!--{/if}-->>预告片</option>
					<option value="3"<!--{if $play_status == 3}--> selected<!--{/if}-->>不可观看</option>
				</select>				
				<select onchange="formSubmit('search-form')"  name='cid'>
					<option value='0'>选择栏目</option>
					{$strall}
				</select>
				<select onchange="formSubmit('search-form')"  id="__filter" name="filter"><!--{echo makeFilterBox($filters, 'select');}--></select>
			</form>
		</div>
	</td>
      <td align=right class="tablerow">
      </td>
  </tr>
</table>
<script language="javascript">
var id='{$id}';
var autoIndex = 1;
<!--{if $movie_source_type_json}-->
var movie_source_type_json = {$movie_source_type_json};
<!--{else}-->
var movie_source_type_json = {};
<!--{/if}-->
function AddItem()
{
	autoIndex++;
	var option = "<select name='types[]'>{$movie_source_type_option}</select>";
	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[]\" type=\"text\" class='f-text'  size=\"15\" maxlength=\"30\" value=\"第"+autoIndex+"集\">&nbsp;"+option+" <input  class='f-text' name=\"urls[]\" id=\"urls_modify_"+autoIndex+"\" type=\"text\" size=\"40\" maxlength=\"255\" value=\"\"> <input type=\"button\" class=\"f-button\" value=\"上传\" onClick=\"qmeCms.dialogView.iframe('上传视频','system.php?sys=upload&id=urls_modify_"+autoIndex+"&channelid="+channelid+"&file_type=media',{type:'abs'});\"><input class=\"f-button\" type=button onclick=\"SelectBrowse('"+config.url+"admin/images/browse.html?type=media&channelid="+channelid+"&callback=getBrowseSoft','urls_modify_"+autoIndex+"',550,360);\" value=\"浏览\"><input class=\"f-button\" type=\"button\" value=\"删除\" onclick=\"$('down_table').deleteRow(this.parentNode.parentNode.rowIndex)\">";
}
function save( action,id,rows)
{
	var url_name = '';
	var link = '';
	if( action=='edit_movie_url'){
		urls       = encodeURIComponent($("urls_"+id).value) ;
		url_name   = $("url_name_"+id).value;
		link   = "system.php?sys=module&mod="+mod+"&channelid="+channelid+"&action=ajax&action_do="+action+"&urls="+urls+"&id="+id;
	}
	if( action=='deleteurl'){
		if(!makeSure()) return false;
		link = "system.php?sys=module&mod="+mod+"&channelid="+channelid+"&action=ajax&action_do="+action+"&id="+id;
	}
	if(link == '') return alert("error");
	var A = arguments;
	if(A.length == 4){
		A[3].disabled = true;
	}
	AJAX.request( link,
	{
		method		: 'post',
		parameters	: 'url_name=' + encodeURIComponent(url_name),
		onComplete	: function( json){
			var json = evaljson(json);
			if(A.length == 4){
				A[3].disabled = false;
			}
			if( json[0]==1){
				if( action=='editurl'){
					alert( lang[json[1]]);
				}else{
					var myTable = $("down_table");
					myTable.deleteRow( rows);
				}
			}else{
				alert(lang[json[1]]);
			}
		}
	});
}
</script>