<?php /* Smarty version 2.6.19, created on 2008-09-23 14:48:50
         compiled from feed/addfeed.phtml */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'truncateex', 'feed/addfeed.phtml', 248, false),array('modifier', 'date_format', 'feed/addfeed.phtml', 250, false),)), $this); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>OOPHP博客管理系统</title>
	<link rel="stylesheet" type="text/css" media="screen" href="<?php echo $this->_tpl_vars['baseUrl']; ?>
/public/styles/layout.css" />
	<link rel="stylesheet" rev="stylesheet" type="text/css" media="screen, projection" href="<?php echo $this->_tpl_vars['baseUrl']; ?>
/public/styles/pagenav.css" />
<script language="javascript" type="text/javascript">

function selectAll(thisObject,formId){
	var thisForm=document.getElementById(formId);
	if(thisObject.checked==true){
		var objectNum=thisForm.elements.length;
		for(var i=0;i<objectNum;i++){
			//alert("ddd");
			thisForm.elements[i].checked=true;
		}
	}
	else{
		var objectNum=thisForm.elements.length;
		for(var i=0;i<objectNum;i++){
			thisForm.elements[i].checked=false;
		}
	}
}

function reverseSelect(id){
	
	var thisForm=document.getElementById(id);
	var objectNum=thisForm.elements.length;
	objectNum=objectNum-2;
	for(var i=0;i<objectNum;i++){
		//alert(thisForm.elements[i].checked);
		if(thisForm.elements[i].checked==true){
			thisForm.elements[i].checked=false;
		}
		else{
			thisForm.elements[i].checked=true;
		}

	}
}

function checkShouldDelItems(formId){
	var thisForm=document.getElementById(formId);
	var objectNum=thisForm.elements.length;
	objectNum=objectNum-3;
	var flag=0;
	for(var i=0;i<objectNum;i++){
		if(thisForm.elements[i].checked==true){
			flag++;
			break;
		}
	}

	if(flag==0){
		showMsg("您没有选择要生成Feed的条目，请返回！");
		return false;
	}
	else{
		if(confirm("确定要您选中的条目导入Feed文章吗？")){
			return true;
		}
		else{
			return false;	
		}
	}	
}

function shouldDelItem(){
	if(confirm("確定要刪除嗎??")){
		return true;	
	}	
	else{
		return false;	
	}
}









function CreateEl(t,c,i){
		var x=document.createElement(t);
		x.className=c;
		x.id=i;
		x.style.display="block";
		return(x);
}



function getViewportInfo() {     
     var w = (window.innerWidth) ? window.innerWidth : (document.documentElement && document.documentElement.clientWidth) ? document.documentElement.clientWidth : document.body.offsetWidth;     
	 var h = (window.innerHeight) ? window.innerHeight : (document.documentElement && document.documentElement.clientHeight) ? document.documentElement.clientHeight : document.body.offsetHeight;     
	 return {w:w,h:h}; 
}; 

function setOpacity(el){
		el.style.filter="alpha(opacity:70)";
		el.style.KHTMLOpacity="0.70";
		el.style.MozOpacity="0.70";
		el.style.opacity="0.70";
}


function showBack(){
		if(document.documentElement.scrollTop){
				var scrollpositionLeft=document.documentElement.scrollLeft;
				var scrollpositionTop=document.documentElement.scrollTop;
		}
		else{
				var scrollpositionLeft=document.body.scrollLeft;
				var scrollpositionTop=document.body.scrollTop;				
		}
		var thisToumingDiv=CreateEl("div","","thisToumingDiv");
		var oWin=getViewportInfo();
		thisToumingDiv.style.position="absolute";
		thisToumingDiv.style.width="100%";
		thisToumingDiv.style.height=document.body.scrollHeight+"px";
		thisToumingDiv.style.left="0px";
		thisToumingDiv.style.top="0px";		
		thisToumingDiv.style.backgroundColor='#999999';
        setOpacity(thisToumingDiv);
		
		document.getElementsByTagName("body")[0].appendChild(thisToumingDiv);

}

function shutBack(){
		document.getElementsByTagName("body")[0].removeChild(document.getElementById("thisToumingDiv"));
}

function showMsg(thismsg){
		var oWin=getViewportInfo();
		if(document.documentElement.scrollTop){
				var scrollpositionLeft=document.documentElement.scrollLeft;
				var scrollpositionTop=document.documentElement.scrollTop;
		}
		else{
				var scrollpositionLeft=document.body.scrollLeft;
				var scrollpositionTop=document.body.scrollTop;				
		}
		showBack();
		var thisTishiKuang=CreateEl("div","","thisTishiKuang");
		thisTishiKuang.style.position="absolute";
		thisTishiKuang.style.width="350px";
		thisTishiKuang.style.height="70px";
		thisTishiKuang.style.backgroundColor='#fff';
		

		thisTishiKuang.style.left=(oWin.w/2-175+scrollpositionLeft)+"px";
		thisTishiKuang.style.top=(oWin.h/2-35+scrollpositionTop)+"px";		
		
		thisTishiKuang.style.textAlign='center';
		thisTishiKuang.style.paddingTop='30px';
		thisTishiKuang.style.border='1px solid #CCC';
		
		document.getElementsByTagName("body")[0].appendChild(thisTishiKuang);
		
		thisTishiKuang.innerHTML='<div align=center>'+thismsg+'</div><br /><div align=center><a onclick=shutMsg()>关闭</a></div>';
}

function shutMsg(){
		if(document.getElementById("thisTishiKuang")||document.getElementById("thisToumingDiv")){
				document.getElementsByTagName("body")[0].removeChild(document.getElementById("thisTishiKuang"));
				document.getElementsByTagName("body")[0].removeChild(document.getElementById("thisToumingDiv"));
		}
}

function alterMsg(msg){
		document.getElementById("thisTishiKuang").innerHTML='<div align=center>'+msg+'</div><br /><div align=center><a onclick=shutMsg()>关闭</a></div>';
}



function selectAll(thisObject,formId){
	var thisForm=document.getElementById(formId);
	if(thisObject.checked==true){
		var objectNum=thisForm.elements.length;
		for(var i=0;i<objectNum;i++){
			//alert("ddd");
			thisForm.elements[i].checked=true;
		}
	}
	else{
		var objectNum=thisForm.elements.length;
		for(var i=0;i<objectNum;i++){
			thisForm.elements[i].checked=false;
		}
	}
}

function reverseSelect(id){
	
	var thisForm=document.getElementById(id);
	var objectNum=thisForm.elements.length;
	objectNum=objectNum-2;
	for(var i=0;i<objectNum;i++){
		//alert(thisForm.elements[i].checked);
		if(thisForm.elements[i].checked==true){
			thisForm.elements[i].checked=false;
		}
		else{
			thisForm.elements[i].checked=true;
		}

	}
}





</script>

</head>

<body>
<div id="navbar">
    <p><!-- <span><select name=""><option value="0">后台首页</option></select></span> -->你的位置: <a href="main.html" title="">后台首页</a> &gt; 生成Feed文章</p>
</div>
<div class="table-div">
   <form name="formDisplay" method="post"  id="formDisplay" action="<?php echo $this->_tpl_vars['baseUrl']; ?>
/admin/feed/addfeed/"> 
	<table >
	<thead>
	  <tr align="center">
	    <th class="title" colspan="6">生成Feed文章</th>
	  </tr>
	</thead>	
	<tbody>
      <tr>
	    <th >&nbsp;</th>
		<th >列表号</th>
		<th >Feed网站标题</th>
		<th >Feed网站地址</th>
		<th >增加时间</th>
	  </tr>
	 
<?php unset($this->_sections['FeedList']);
$this->_sections['FeedList']['name'] = 'FeedList';
$this->_sections['FeedList']['loop'] = is_array($_loop=$this->_tpl_vars['arrFeed']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['FeedList']['show'] = true;
$this->_sections['FeedList']['max'] = $this->_sections['FeedList']['loop'];
$this->_sections['FeedList']['step'] = 1;
$this->_sections['FeedList']['start'] = $this->_sections['FeedList']['step'] > 0 ? 0 : $this->_sections['FeedList']['loop']-1;
if ($this->_sections['FeedList']['show']) {
    $this->_sections['FeedList']['total'] = $this->_sections['FeedList']['loop'];
    if ($this->_sections['FeedList']['total'] == 0)
        $this->_sections['FeedList']['show'] = false;
} else
    $this->_sections['FeedList']['total'] = 0;
if ($this->_sections['FeedList']['show']):

            for ($this->_sections['FeedList']['index'] = $this->_sections['FeedList']['start'], $this->_sections['FeedList']['iteration'] = 1;
                 $this->_sections['FeedList']['iteration'] <= $this->_sections['FeedList']['total'];
                 $this->_sections['FeedList']['index'] += $this->_sections['FeedList']['step'], $this->_sections['FeedList']['iteration']++):
$this->_sections['FeedList']['rownum'] = $this->_sections['FeedList']['iteration'];
$this->_sections['FeedList']['index_prev'] = $this->_sections['FeedList']['index'] - $this->_sections['FeedList']['step'];
$this->_sections['FeedList']['index_next'] = $this->_sections['FeedList']['index'] + $this->_sections['FeedList']['step'];
$this->_sections['FeedList']['first']      = ($this->_sections['FeedList']['iteration'] == 1);
$this->_sections['FeedList']['last']       = ($this->_sections['FeedList']['iteration'] == $this->_sections['FeedList']['total']);
?>
  <tr>
	    <th><input type="checkbox" name="url[]" value="<?php echo $this->_tpl_vars['arrFeed'][$this->_sections['FeedList']['index']]['url']; ?>
"/></th>
		<td><?php echo $this->_tpl_vars['arrFeed'][$this->_sections['FeedList']['index']]['id']; ?>
</td>
		<td><?php echo ((is_array($_tmp=$this->_tpl_vars['arrFeed'][$this->_sections['FeedList']['index']]['title'])) ? $this->_run_mod_handler('truncateex', true, $_tmp, 15, '..', true) : smarty_modifier_truncateex($_tmp, 15, '..', true)); ?>
</td>
		<td><?php echo $this->_tpl_vars['arrFeed'][$this->_sections['FeedList']['index']]['url']; ?>
</td>
		<td><?php echo ((is_array($_tmp=$this->_tpl_vars['arrFeed'][$this->_sections['FeedList']['index']]['addtime'])) ? $this->_run_mod_handler('date_format', true, $_tmp, "%Y-%m-%d") : smarty_modifier_date_format($_tmp, "%Y-%m-%d")); ?>
</td>
		</tr>
  
  
 <?php endfor; else: ?>
  <tr>
	    <td colspan="7" >对不起.没有查找到数据!</td>
</tr>
 
 <?php endif; ?>
	  
	   <td colspan="7" >
	 <div align="center"><input onClick="selectAll(this,'formDisplay');"
			type="checkbox" /> 全选 <input
			onClick="reverseSelect('formDisplay');return false;" type="submit"
			value="反选" /> <input
			onClick="return checkShouldDelItems('formDisplay');" type="submit"
			value="抓取Feed文章" /></div>
			 </td>
	</tbody>	
    </table>
 </form>
	<div id="pages"><?php echo $this->_tpl_vars['pageInfo']; ?>
</div>
	<div style="clear:both;"></div>
</div>
</body>
</html>