增加了数据作者管理的非iframe视图

This commit is contained in:
Li Jianxuan 2012-05-31 03:28:05 +00:00
parent 77d114725d
commit 574baab0b2
4 changed files with 133 additions and 24 deletions

View File

@ -2289,8 +2289,16 @@ class Admin_DataController extends Zend_Controller_Action
if($ac == "edit")
{
$this->_helper->layout->disableLayout();
$this->_helper->viewRenderer('author-edit');
$window = $this->_getParam('window');
if($window == "iframe")
{
$this->_helper->layout->disableLayout();
$this->_helper->viewRenderer('author-edit-iframe');
}else{
$this->_helper->viewRenderer('author-edit');
}
$uuid = $this->_getParam('uuid');

View File

@ -0,0 +1,101 @@
<!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>作者管理</title>
<link rel="stylesheet" type="text/css" media="screen" href="/css/default.css" />
<script src='/static/js/jquery-1.7.2.min.js' type="text/javascript"></script>
<script type="text/javascript" src="/js/jquery.colorbox-min.js"></script>
<link href="/css/author.css" media="screen" rel="stylesheet" type="text/css"/>
<link href="/static/js/uploadify/uploadify.css" media="screen" rel="stylesheet" type="text/css" />
<link href="/css/colorbox.css" media="screen" rel="stylesheet" type="text/css" />
<style>
#loading{margin:0px;border:none;height:50px;width:98%;background:url(/static/img/colorbox-images/loading.gif) center center no-repeat;display:none;position:absolute;left:0px;top:0px;overflow:hidden;background:#ccc;}
</style>
</head>
<body>
<!-- 页面内容 -->
<div id="warpper">
<div id="loading" class="info info-box"></div>
<div id="datalist">
<ul>
<?php
if(isset($this->authors))
{
foreach($this->authors as $v)
{
?>
<li id="author_<?php echo $v['id'] ;?>">
<p><?php echo $v['realname']; ?> [ <?php echo $v['username']; ?> ]</p>
<p><span id="status_<?php echo $v['id'] ;?>"><?php if($v['status']==1) {echo "已认证";} if($v['status']==0) {echo "已申请";} if($v['status']==-1) {echo "已拒绝";} ?></span> |
<a href="javascript:;" onclick="remove(<?php echo $v['id'] ;?>)">移除该作者</a>
<span id="statusChange_<?php echo $v['id'] ;?>"><?php if($v['status']<1) {?> <a href="javascript:;" onclick="update(<?php echo $v['id'] ;?>)">认证该用户</a> <?php }?></span>
</p>
</li>
<?php } } ?>
</ul></div>
</div>
<!-- //页面内容 -->
<script>
function update(id){
$.ajax({
'type':"POST",
'url':'/admin/data/author/',
'data':'ac=update&id='+id,
'success':function(data){
if (data!=null)
{
if(typeof(data.error)!='undefined')
{Alert(data.error);return false;}
if(data.msg!=null)
{Alert(data.msg);}
if(typeof(data.updated)!='undefined')
{$('#status_'+data.updated).html('已认证');$('#statusChange_'+data.updated).html('');}
}else{
Alert('处理中出现错误');
}
},
'timeout': 30000
});
}
function remove(id){
if(confirm('确实要删除吗?')==false)
{return false;}
$.ajax({
type:"POST",
url:'/admin/data/author',
data:'ac=del&id='+id,
success:function(data){
if (data!=null)
{
if(typeof(data.error)!='undefined')
{Alert(data.error);return false;}
if(typeof(data.deleted)!='undefined')
{$('#author_'+data.deleted).fadeOut("slow",function(){$(this).remove();});}
}else{
Alert('处理中出现错误');
}
},
'timeout': 30000
});
}
$('#loading').css("opacity","0.2");
$('#loading').ajaxComplete(function() {
$(this).css('display','none');
});
$('#loading').ajaxSend(function() {
$(this).css('display','block');
});
$("#loading").ajaxError(function() {
$(this).css('display','none');
Alert('请求超时或服务器开小差了,请刷新页面后重试');
});
function Alert(html){
$.colorbox({'innerWidth':'50%','html':'<h4>'+html+'</h4>'});
}
</script>
</body>
</html>

View File

@ -1,22 +1,25 @@
<!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>作者管理</title>
<link rel="stylesheet" type="text/css" media="screen" href="/css/default.css" />
<script src='/static/js/jquery-1.7.2.min.js' type="text/javascript"></script>
<script type="text/javascript" src="/js/jquery.colorbox-min.js"></script>
<link href="/css/author.css" media="screen" rel="stylesheet" type="text/css"/>
<link href="/static/js/uploadify/uploadify.css" media="screen" rel="stylesheet" type="text/css" />
<link href="/css/colorbox.css" media="screen" rel="stylesheet" type="text/css" />
<style>
#loading{margin:0px;border:none;height:50px;width:98%;background:url(/static/img/colorbox-images/loading.gif) center center no-repeat;display:none;position:absolute;left:0px;top:0px;overflow:hidden;background:#ccc;}
</style>
</head>
<body>
<?php
$this->headTitle($this->config->title->site);
$this->headTitle($this->config->title->author);
$this->headTitle()->setSeparator(' - ');
$this->headScript()->appendFile('/js/jquery-1.7.min.js');
$this->headLink()->appendStylesheet('/css/admin.css');
$this->headScript()->appendFile('/js/jquery.colorbox-min.js');
$this->headLink()->appendStylesheet('/css/author.css');
$this->headLink()->appendStylesheet('/css/colorbox.css');
$this->breadcrumb('<a href="/">首页</a>');
$this->breadcrumb('<a href="/admin/data">数据管理</a>');
$this->breadcrumb('数据作者管理');
$this->breadcrumb()->setSeparator(' > ');
?>
<!-- 左侧导航 -->
<div id="leftPanel">
<?= $this->partial('data/left.phtml'); ?>
</div>
<!-- //左侧导航 -->
<!-- 页面内容 -->
<div id="warpper">
<div id="rightPanel">
<div id="loading" class="info info-box"></div>
<div id="datalist">
<ul>
@ -95,7 +98,4 @@ $("#loading").ajaxError(function() {
function Alert(html){
$.colorbox({'innerWidth':'50%','html':'<h4>'+html+'</h4>'});
}
</script>
</body>
</html>
</script>

View File

@ -39,7 +39,7 @@ $this->breadcrumb()->setSeparator(' > ');
<p><a href="/data/<?php echo $item['uuid'];?>" target="_blank"><?php echo $item['title'];?></a> </p>
<p>
<?php if ($item['c']) : ?>
作者数量 <span id="sumAuthor_<?php echo $item['id'];?>"><?php echo $item['c']; ?></span> | <a href="/admin/data/author/ac/edit/uuid/<?php echo $item['uuid']; ?>" class="iframe">作者管理</a> |
作者数量 <span id="sumAuthor_<?php echo $item['id'];?>"><?php echo $item['c']; ?></span> | <a href="/admin/data/author/ac/edit/uuid/<?php echo $item['uuid']; ?>/window/iframe" class="iframe">作者管理</a> |
<?php endif; ?>
<span id="addauthor_<?php echo $item['id'];?>"><a href="javascript:;" onclick="AddAuthor(<?php echo $item['id']; ?>,'<?php echo $item['uuid']; ?>')">添加作者</a></span>
</p>