切换为新的Archive类和ArchiveCategory类

This commit is contained in:
wlx 2012-11-30 15:12:27 +00:00
parent 24541f8ee7
commit a673040e9a
2 changed files with 30 additions and 37 deletions

View File

@ -14,8 +14,7 @@ class Admin_NewsController extends Zend_Controller_Action
}
function indexAction()
{
include_once("news.php");
$News = new news($this->db);
$News = new Archive($this->db);
$sql = "SELECT count(id) as c FROM ".$News->tbl_archives;
$rs = $this->db->query($sql);
@ -31,8 +30,7 @@ class Admin_NewsController extends Zend_Controller_Action
function newslistAction(){
include_once("news.php");
$News = new news($this->db);
$News = new Archive($this->db);
$type = $this->_request->getParam('type');
@ -66,8 +64,8 @@ class Admin_NewsController extends Zend_Controller_Action
Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml');
$this->view->paginator=$paginator;
$category = new Category($this->db);
$this->view->types= $category->GetCategory();
$category = new ArchiveCategory($this->db);
$this->view->types= $category->GetFullCategory();
$this->view->type = $type;
$this->view->deepField = $category->DeepTitle;
}//newslistAction 新闻列表
@ -81,8 +79,7 @@ class Admin_NewsController extends Zend_Controller_Action
$edit = $this->_request->getParam('edit');
include_once("news.php");
$News = new news($this->db);
$News = new Archive($this->db);
if($add)
{
@ -90,8 +87,8 @@ class Admin_NewsController extends Zend_Controller_Action
$this->_helper->viewRenderer('category-add');
$category = new Category($this->db);
$catlogs = $category->GetCategory();
$category = new ArchiveCategory($this->db);
$catlogs = $category->GetFullCategory();
$this->view->categories=$catlogs;
$this->view->deepField = $category->DeepTitle;
@ -166,9 +163,9 @@ class Admin_NewsController extends Zend_Controller_Action
$this->_helper->viewRenderer('category-edit');
$this->view->ptype = $News->ptype;
$category = new Category($this->db);
$category = new ArchiveCategory($this->db);
$this->view->info = $category->GetOne($edit);
$this->view->categories = $category->GetCategory();
$this->view->categories = $category->GetFullCategory();
$this->view->deepField = $category->DeepTitle;
if(!empty($submit))
@ -218,9 +215,9 @@ class Admin_NewsController extends Zend_Controller_Action
else
{
include_once("news.php");
$category = new Category($this->db);
$catlogs = $category->GetCategory();
$category = new ArchiveCategory($this->db);
$catlogs = $category->GetFullCategory();
$this->view->catlogs=$catlogs;
$this->view->deepField = $category->DeepTitle;
}//栏目列表
@ -268,9 +265,8 @@ class Admin_NewsController extends Zend_Controller_Action
//新闻添加页面
function newsaddAction()
{
include_once("news.php");
$category = new Category($this->db);
$catlogs = $category->GetCategory();
$category = new ArchiveCategory($this->db);
$catlogs = $category->GetFullCategory();
$this->view->types=$catlogs;
$this->view->deepField = $category->DeepTitle;
}//newsadd 新闻添加
@ -278,8 +274,8 @@ class Admin_NewsController extends Zend_Controller_Action
//文档编辑
function newseditAction()
{
include_once("news.php");
$News = new news($this->db);
$News = new Archive($this->db);
$id = $this->_request->getParam('id');
@ -312,8 +308,8 @@ class Admin_NewsController extends Zend_Controller_Action
$this->view->keywords = join(",",$News->GetTags($id));
$category = new Category($this->db);
$catlogs = $category->GetCategory();
$category = new ArchiveCategory($this->db);
$catlogs = $category->GetFullCategory();
$this->view->types=$catlogs;
$this->view->deepField = $category->DeepTitle;
}
@ -324,8 +320,8 @@ class Admin_NewsController extends Zend_Controller_Action
$this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNoRender();
include_once("news.php");
$News = new news($this->db);
$News = new Archive($this->db);
$auth = Zend_Auth::getInstance();
if($auth->hasIdentity())
@ -490,8 +486,8 @@ class Admin_NewsController extends Zend_Controller_Action
$id = $this->_request->getParam('id');
include_once("news.php");
$News = new news($this->db);
$News = new Archive($this->db);
$News->DeleteArchives($id);
$this->messenger->addMessage('提示信息:档案删除成功!');

View File

@ -12,9 +12,8 @@ class NewsController extends Zend_Controller_Action
function indexAction()
{
include_once("news.php");
$News = new news($this->db);
$category = new Category($this->db);
$News = new Archive($this->db);
$category = new ArchiveCategory($this->db);
$this->view->types = $category->GetCategory();
$this->view->deepField = $category->DeepTitle;
@ -62,8 +61,7 @@ class NewsController extends Zend_Controller_Action
}
include_once("news.php");
$News = new news($this->db);
$News = new Archive($this->db);
$sql = "SELECT id,code,title FROM ".$News->tbl_categorys." WHERE code='$type' AND is_pub=true ";
$rs = $this->db->query($sql);
@ -79,7 +77,7 @@ class NewsController extends Zend_Controller_Action
$this->view->url = $row['code'];
$this->view->title = $row['title'];
$category = new Category($this->db);
$category = new ArchiveCategory($this->db);
$this->view->types = $category->GetCategory();
$this->view->deepField = $category->DeepTitle;
@ -118,13 +116,12 @@ class NewsController extends Zend_Controller_Action
$this->_forward('error', 'error', null, null);
}
include_once("news.php");
$News = new news($this->db);
$category = new Category($this->db);
$News = new Archive($this->db);
$category = new ArchiveCategory($this->db);
$this->view->types = $category->GetCategory();
$this->view->deepField = $category->DeepTitle;
$time = date("Y-m-d H:i:s",time());
$time = date("Y-m-d",time());
$sql = "SELECT n.*,c.title as typename,c.code,u.realname as author FROM ".$News->tbl_archives." n
left join ".$News->tbl_catalog." ct on ct.aid=n.id