From a673040e9a2708b943589a4a57ef8e886a458386 Mon Sep 17 00:00:00 2001 From: wlx Date: Fri, 30 Nov 2012 15:12:27 +0000 Subject: [PATCH] =?UTF-8?q?=E5=88=87=E6=8D=A2=E4=B8=BA=E6=96=B0=E7=9A=84Ar?= =?UTF-8?q?chive=E7=B1=BB=E5=92=8CArchiveCategory=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/controllers/NewsController.php | 50 +++++++++---------- .../default/controllers/NewsController.php | 17 +++---- 2 files changed, 30 insertions(+), 37 deletions(-) diff --git a/application/admin/controllers/NewsController.php b/application/admin/controllers/NewsController.php index 83acf329..78f611cd 100644 --- a/application/admin/controllers/NewsController.php +++ b/application/admin/controllers/NewsController.php @@ -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; }//栏目列表 @@ -267,10 +264,9 @@ 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('提示信息:档案删除成功!'); diff --git a/application/default/controllers/NewsController.php b/application/default/controllers/NewsController.php index c63d6ac7..c2ea8100 100644 --- a/application/default/controllers/NewsController.php +++ b/application/default/controllers/NewsController.php @@ -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