分平台移除栏目管理功能

This commit is contained in:
wlx 2014-06-11 03:27:55 +00:00
parent a254e495ca
commit 6571f575c4
2 changed files with 0 additions and 182 deletions

View File

@ -85,186 +85,6 @@ class Admin_NewsController extends Zend_Controller_Action
$this->view->deepField = $category->DeepTitle;
}//newslistAction 新闻列表
function catlogAction()
{
$add = $this->_request->getParam('add');
$submit = $this->_request->getParam('submit');
$delete = $this->_request->getParam('delete');
$edit = $this->_request->getParam('edit');
$News = new Archive($this->db);
if($add)
{
$this->view->ptype = $News->ptype;
$this->_helper->viewRenderer('category-add');
$category = new ArchiveCategory($this->db);
$catlogs = $category->GetFullCategory();
$this->view->categories=$catlogs;
$this->view->deepField = $category->DeepTitle;
if(empty($submit)){
//$this->_helper->viewRenderer('category-add');
}else{
$data = array();
$data['title'] = $this->_request->getParam('ctitle');
$data['code'] = $this->_request->getParam('code');
$data['fid'] = $this->_request->getParam('fid');
$data['ptype'] = $this->_request->getParam('ptype');
$data['is_pub'] = 1;
$this->view->info = $data;
if(empty($data['title']))
{
$this->view->error = "请输入标题";
return true;
}
if(empty($data['code']))
{
$this->view->error = "请输入栏目连接如http://westdc.westgis.ac.cn/news/notice则只需要输入notice";
return true;
}
if(!preg_match("/^[a-z]+$/",$data['code']))
{
$this->view->error = "url格式不正确仅允许26个小写字母";
return true;
}
$LftRgt = $category->Insert($data['fid']);
$data['tid'] = $data['fid'];
$data['lft'] = $LftRgt['left'];
$data['rgt'] = $LftRgt['right'];
unset($data['fid']);
if($this->db->insert($category->CategoryTable,$data))
{
$this->view->msg = '提示信息:栏目添加成功!';
$this->view->jump_url = '/admin/news/catlog';
return true;
}else{
$this->view->error = "添加失败,请重试";
return true;
}
}
}//栏目添加
if($delete>0)
{
$sql = "delete from ".$News->tbl_categorys." where id='$delete'";
if($this->db->exec($sql)>0)
{
$this->messenger->addMessage('提示信息:栏目删除成功!');
$this->_redirect('/admin/news/catlog');
}
}//栏目删除
if($edit>0)
{
$submit = $this->_getParam('submit');
$this->_helper->viewRenderer('category-edit');
$this->view->ptype = $News->ptype;
$category = new ArchiveCategory($this->db);
$this->view->info = $category->GetOne($edit);
$this->view->categories = $category->GetFullCategory();
$this->view->deepField = $category->DeepTitle;
if(!empty($submit))
{
$data = array();
$data['title'] = $this->_request->getParam('ctitle');
$data['code'] = $this->_request->getParam('code');
$data['fid'] = $this->_request->getParam('fid');
$data['ptype'] = $this->_request->getParam('ptype');
$data['is_pub'] = $this->_request->getParam('is_pub');
$this->view->info = $data;
if(empty($data['title']))
{
$this->view->error = "请输入标题";
return true;
}
if(empty($data['code']))
{
$this->view->error = "请输入栏目连接如http://westdc.westgis.ac.cn/news/notice则只需要输入notice";
return true;
}
if(!preg_match("/^[a-z]+$/",$data['code']))
{
$this->view->error = "url格式不正确仅允许26个小写字母";
return true;
}
$LftRgt = $category->Insert($data['fid']);
$data['tid'] = $data['fid'];
$data['lft'] = $LftRgt['left'];
$data['rgt'] = $LftRgt['right'];
unset($data['fid']);
if($this->db->update($News->tbl_categorys,$data,"id=$edit"))
{
$this->view->msg = '提示信息:栏目添加成功!';
$this->view->jump_url = '/admin/news/catlog';
return true;
}else{
$this->view->error = "添加失败,请重试";
return true;
}
}
}//栏目编辑
else
{
$category = new ArchiveCategory($this->db);
$News = new Archive($this->db);
$catlogs = $category->GetFullCategory();
$ptype = $News->ptype;
foreach($catlogs as $k=>$v)
{
$url_parts = array(
"ptype"=>$v['ptype'],
"type_code"=>$v['code']
);
$catlogs[$k]['url'] = $News->makeCategoryUrl($url_parts);
foreach($ptype as $kk=>$vv)
{
if($catlogs[$k]['ptype'] == $vv)
{
$catlogs[$k]['ptype'] = $kk;
}
}
}
$this->view->catlogs=$catlogs;
$this->view->deepField = $category->DeepTitle;
}//栏目列表
}//栏目管理
function getSubCategory($fid)
{

View File

@ -1,8 +1,6 @@
<ul class="nav nav-pills nav-stacked well">
<span class="label"><h4>新闻中心</h4></span>
<li><a href="/admin/news">新闻中心首页</a></li>
<li><a href="/admin/news/catlog">栏目管理</a></li>
<li><a href="/admin/news/catlog/add/1">栏目添加</a></li>
<li><a href="/admin/news/newslist">新闻管理</a></li>
<li><a href="/admin/news/newsadd">新闻发布</a></li>
</ul>