<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo SYS_CHARSET ?>">
<title>article list</title>
<link href="<?php echo SYS_ADMIN_STYLE_PATH ?>style/common.css" rel="stylesheet" type="text/css">
<script language="javascript" src="<?php echo SYS_ADMIN_STYLE_PATH ?>js/common.js"></script>
<script language="javascript">
var act = null;
var form_field = 'article_list';

var search_field = '<?php echo $layout['search_field'] ?>';
var order_field = '<?php echo $layout['order_field'] ?>';
var order_type = '<?php echo $layout['order_type'] ?>';

function returnArticleIdValue(tmpValue,tmpTxt)
{
	if(act=="insert")
	{
		window.opener.referencebrowser_setReference(form_field,tmpValue,tmpTxt,1);
	}
	else
	{
		window.opener.setSelectArticle(tmpValue);
		window.close();
	}
}

function init()
{
	
	showElementSelect('search_field',search_field);

	QueryString_Parse();
	act = QueryString("act");
	var field = QueryString("field");
	if(field) form_field = field;
	if(act=="insert") 
	{
		var inputO =  document.getElementsByTagName("input");
		if(inputO.length>0)
		{			
	  	for(i=0; i<inputO.length; i++)
	  	{
	  		if(inputO[i].name.toLowerCase()=="btn_handle")
	  		{
		  		inputO[i].value = "插入";
			}
	  	}
		  
	  }
		
	}
}

</script>
</head>

<body onload="init()">
<table width="100%" height="100%" cellpadding="0" cellspacing="0">
	<tr>
		<td valign="top">
<table class="search_table" cellpadding="0" cellspacing="0">	
	<form name="searchForm" method="post" action="">
	<tr>
		<td class="search_td">
			<span id="search_advanced" style="display:none">
			<select name="search_field" id="search_field" class="input_select" >
			<option value='' >---字段---</option>
			<option value='id' >ID</option>
			<option value='title' >标题</option>
			<option value='intro' >介绍</option>
			<option value='content' >内容</option>
			</select>
            <?php echo $layout['list_type']; echo $layout['list_channel'] ?>
			<input type="text" name="layout_id_show" id="layout_id_show" class="input_text" size="15" value="<?php echo $layout['layout_title'] ?>" onclick="openSelectWin('../mod_template/template_layout_select.php', 'layoutID')" >
			<input type="hidden" name="layout_id" id="layout_id" value="<?php echo $layout['layout_id'] ?>">
			<input type="text" name="username" id="username" class="input_text" size="15" value="<?php echo $layout['username'] ?>" onclick="openSelectWin('../mod_user/user_select.php', 'userName')">
			<input type="hidden" name="uid" id="uid" value="<?php echo $layout['uid'] ?>"><br>
		    </span>
			<input type="text" name="search_keyword" id="search_keyword" class="input_text_search" value="">
			<input type="submit" name="btn_search" class="btn_search" value="go">
			&nbsp;<input type="checkbox" name="chk_switchsearch" id="chk_switchsearch" value="1" onclick="showDisplayHidden('chk_switchsearch','search_advanced')">高级搜索
		</td>
	</tr>	
</form>
</table>
<table class="list_tb" cellpadding="0" cellspacing="0">
<tr class="list_title_tr_bg">
<td width="5%" class="list_title_td">&nbsp;</td>
<td width="40%" class="list_title_td">文章标题</td>
<td width="20%" class="list_title_td">频道分类</td>
<td width="15%" class="list_title_td">文章类型</td>
<td width="10%" class="list_title_td">状态</td>
<td width="10%" class="list_title_td">操作</td>
</tr>
<?php
require_once(EIFR_ROOT . 'admin/mod_channel/class_channel.php');
$num=0; 
foreach($layout['eifr_pages']['list'] as $row):
$num++;
$channel = ComChannel::getChannelById($row['channel_id']);
?>
<tr class="list_sub_tr_bg" onMouseOver="this.className='list_mouseover_tr_bg'" onMouseOut="this.className='list_sub_tr_bg'" >
    <td><?php echo $num ?></td>
    <td><a href="article_view.php?selectid=<?php echo $row['id'] ?>" target="_blank"><?php echo $row['title'] ?></a></td>
    <td><?php echo $channel['title'] ?></td>
    <td><?php echo $lang['article_type_arr'][$row['type']] ?></td>
    <td><?php echo Common::createStatusTxt($row['status']) ?></td>
    <td>
    <input type="button" name="btn_handle" value="选择" onclick="returnArticleIdValue('<?php echo $row['id'] ?>','<?php echo $row['title'] ?>')";>
    </td>
</tr>
<?php endforeach; ?>
</table>               
<div class="pagenext_div"><?php echo $layout['eifr_pages']['page'] ?></div>
		</td>
	</tr>
	<tr>
		<td valign="bottom" height="26">
			<table class="select_window_bottom" width="100%" cellpadding="0" cellspacing="0">
				<tr>
				<td width="300"  id="td_status" class="select_window_bottom_left">&nbsp;</td>
				<td align="right"><a href="javascript:window.opener.clearSelect();window.close()">[---清空---]</a>&nbsp;&nbsp;<a href="javascript:window.close()">[---关闭---]</a>&nbsp;&nbsp;</td>
				</tr>
			</table> 
		</td>
	</tr>
</table>
</body>
</html>
