From 51138d1c41d9be15d64d42bd25a46758d360ae4e Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Fri, 11 Feb 2011 00:55:42 +0000 Subject: improved actions history --- .../Application/Controllers/LastController.php | 65 ++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 h-source/Application/Controllers/LastController.php (limited to 'h-source/Application/Controllers') diff --git a/h-source/Application/Controllers/LastController.php b/h-source/Application/Controllers/LastController.php new file mode 100644 index 0000000..0791ccb --- /dev/null +++ b/h-source/Application/Controllers/LastController.php @@ -0,0 +1,65 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + +class LastController extends BaseController +{ + + public function __construct($model, $controller, $queryString) + { + parent::__construct($model, $controller, $queryString); + + $this->model('HistoryModel'); + + $data['title'] = 'last - '.Website::$generalName; + $this->append($data); + + $this->setArgKeys(array('page:forceNat'=>1)); + } + + public function modifications($lang = 'en') + { + $this->shift(1); + + $whereClauseArray = array( + 'gr' => 'registered', + 'type' => 'wiki', + ); + + $this->helper('Pages','last/modifications/'.$this->lang,'page'); + + $this->m['HistoryModel']->clear()->select()->where($whereClauseArray)->orderBy('id_history desc'); + + $recordNumber = $this->m['HistoryModel']->rowNumber(); + $page = $this->viewArgs['page']; + + $this->m['HistoryModel']->limit = $this->h['Pages']->getLimit($page,$recordNumber,30); + + $data['table'] = $this->m['HistoryModel']->send(); + + $data['pageList'] = $this->h['Pages']->render($page-5,11); + + $this->append($data); + $this->load('modifications'); + $this->right(); + } + +} \ No newline at end of file -- cgit v1.2.3