From 3e63edf93ce77bae2891d1d0e5552768453e8404 Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Wed, 8 Jun 2011 18:21:25 +0000 Subject: changed last controller to special controller --- .../Application/Controllers/LastController.php | 122 --------------------- .../Application/Controllers/SpecialController.php | 122 +++++++++++++++++++++ h-source/Application/Views/Last/modactions.php | 74 ------------- h-source/Application/Views/Last/modifications.php | 45 -------- h-source/Application/Views/My/panel.php | 4 +- h-source/Application/Views/Special/modactions.php | 74 +++++++++++++ .../Application/Views/Special/modifications.php | 45 ++++++++ h-source/Application/Views/right.php | 2 +- h-source/Config/Route.php | 6 +- 9 files changed, 247 insertions(+), 247 deletions(-) delete mode 100644 h-source/Application/Controllers/LastController.php create mode 100644 h-source/Application/Controllers/SpecialController.php delete mode 100644 h-source/Application/Views/Last/modactions.php delete mode 100644 h-source/Application/Views/Last/modifications.php create mode 100644 h-source/Application/Views/Special/modactions.php create mode 100644 h-source/Application/Views/Special/modifications.php diff --git a/h-source/Application/Controllers/LastController.php b/h-source/Application/Controllers/LastController.php deleted file mode 100644 index 2050ea7..0000000 --- a/h-source/Application/Controllers/LastController.php +++ /dev/null @@ -1,122 +0,0 @@ -. - -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'] = gtext('last modifications').' - '.Website::$generalName; - $this->append($data); - - $this->setArgKeys(array('page:forceNat'=>1)); - } - - protected function last($lang = 'en',$action = 'modifications') - { - switch ($action) - { - case 'modifications': - $data['title'] = 'last modifications - '.Website::$generalName; - - $whereClauseArray = array( - 'gr' => 'registered', - 'type' => 'hardware', - ); - - $viewFile = 'modifications'; - - break; - case 'modactions': - $data['title'] = 'last moderations - '.Website::$generalName; - $data['viewTitle'] = 'List of actions carried out by moderators'; - $data['user_status'] = 'MODERATOR'; - - $whereClauseArray = array( - 'gr' => 'moderator', - ); - - $viewFile = 'modactions'; - - break; - case 'adminactions': - $data['title'] = 'last admin actions - '.Website::$generalName; - $data['viewTitle'] = 'List of actions carried out by administrators'; - $data['user_status'] = 'ADMINISTRATOR'; - - $whereClauseArray = array( - 'gr' => 'admin', - ); - - $viewFile = 'modactions'; - - break; - } - - $this->helper('Pages','last/'.$this->action.'/'.$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($viewFile); - $this->right(); - } - - public function modifications($lang = 'en') - { - $this->shift(1); - - $this->last($lang = 'en','modifications'); - } - - public function modactions($lang = 'en') - { - $this->shift(1); - - $this->s['registered']->check('moderator'); - - $this->last($lang = 'en','modactions'); - } - - public function adminactions($lang = 'en') - { - $this->shift(1); - - $this->s['registered']->check('admin'); - - $this->last($lang = 'en','adminactions'); - } - -} \ No newline at end of file diff --git a/h-source/Application/Controllers/SpecialController.php b/h-source/Application/Controllers/SpecialController.php new file mode 100644 index 0000000..86ac9b9 --- /dev/null +++ b/h-source/Application/Controllers/SpecialController.php @@ -0,0 +1,122 @@ +. + +if (!defined('EG')) die('Direct access not allowed!'); + +class SpecialController extends BaseController +{ + + public function __construct($model, $controller, $queryString) + { + parent::__construct($model, $controller, $queryString); + + $this->model('HistoryModel'); + + $data['title'] = gtext('last modifications').' - '.Website::$generalName; + $this->append($data); + + $this->setArgKeys(array('page:forceNat'=>1)); + } + + protected function last($lang = 'en',$action = 'modifications') + { + switch ($action) + { + case 'modifications': + $data['title'] = 'last modifications - '.Website::$generalName; + + $whereClauseArray = array( + 'gr' => 'registered', + 'type' => 'hardware', + ); + + $viewFile = 'modifications'; + + break; + case 'modactions': + $data['title'] = 'last moderations - '.Website::$generalName; + $data['viewTitle'] = 'List of actions carried out by moderators'; + $data['user_status'] = 'MODERATOR'; + + $whereClauseArray = array( + 'gr' => 'moderator', + ); + + $viewFile = 'modactions'; + + break; + case 'adminactions': + $data['title'] = 'last admin actions - '.Website::$generalName; + $data['viewTitle'] = 'List of actions carried out by administrators'; + $data['user_status'] = 'ADMINISTRATOR'; + + $whereClauseArray = array( + 'gr' => 'admin', + ); + + $viewFile = 'modactions'; + + break; + } + + $this->helper('Pages','last/'.$this->action.'/'.$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($viewFile); + $this->right(); + } + + public function modifications($lang = 'en') + { + $this->shift(1); + + $this->last($lang = 'en','modifications'); + } + + public function modactions($lang = 'en') + { + $this->shift(1); + + $this->s['registered']->check('moderator'); + + $this->last($lang = 'en','modactions'); + } + + public function adminactions($lang = 'en') + { + $this->shift(1); + + $this->s['registered']->check('admin'); + + $this->last($lang = 'en','adminactions'); + } + +} \ No newline at end of file diff --git a/h-source/Application/Views/Last/modactions.php b/h-source/Application/Views/Last/modactions.php deleted file mode 100644 index fe50223..0000000 --- a/h-source/Application/Views/Last/modactions.php +++ /dev/null @@ -1,74 +0,0 @@ - - -. -?> - -
- -
- ">Home » ">panel » moderators' actions -
- -
- -
- - - - - - - - - - - - - - - - - - - - - - -
ACTION IDACTIONTYPEOBJECT IDDATEMOTIVATION
- - - getUser($row['history']['created_by']);?> - - - - - - - - - - -
- -
- : -
- -
diff --git a/h-source/Application/Views/Last/modifications.php b/h-source/Application/Views/Last/modifications.php deleted file mode 100644 index 1caca34..0000000 --- a/h-source/Application/Views/Last/modifications.php +++ /dev/null @@ -1,45 +0,0 @@ - - -. -?> - -
- -
- ">Home » -
- -
- -
- -
- -
- -
- : -
- -
diff --git a/h-source/Application/Views/My/panel.php b/h-source/Application/Views/My/panel.php index 7ca706e..d23d0bd 100644 --- a/h-source/Application/Views/My/panel.php +++ b/h-source/Application/Views/My/panel.php @@ -36,7 +36,7 @@
@@ -45,7 +45,7 @@
diff --git a/h-source/Application/Views/Special/modactions.php b/h-source/Application/Views/Special/modactions.php new file mode 100644 index 0000000..fe50223 --- /dev/null +++ b/h-source/Application/Views/Special/modactions.php @@ -0,0 +1,74 @@ + + +. +?> + +
+ +
+ ">Home » ">panel » moderators' actions +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + +
ACTION IDACTIONTYPEOBJECT IDDATEMOTIVATION
+ + + getUser($row['history']['created_by']);?> + + + + + + + + + + +
+ +
+ : +
+ +
diff --git a/h-source/Application/Views/Special/modifications.php b/h-source/Application/Views/Special/modifications.php new file mode 100644 index 0000000..1caca34 --- /dev/null +++ b/h-source/Application/Views/Special/modifications.php @@ -0,0 +1,45 @@ + + +. +?> + +
+ +
+ ">Home » +
+ +
+ +
+ +
+ +
+ +
+ : +
+ +
diff --git a/h-source/Application/Views/right.php b/h-source/Application/Views/right.php index 60b5f31..31829e0 100644 --- a/h-source/Application/Views/right.php +++ b/h-source/Application/Views/right.php @@ -118,7 +118,7 @@
- "> + ">
diff --git a/h-source/Config/Route.php b/h-source/Config/Route.php index 7725ec5..858af0a 100644 --- a/h-source/Config/Route.php +++ b/h-source/Config/Route.php @@ -158,9 +158,9 @@ class Route 'webcams,differences', 'webcams,climb', 'webcams,talk', - 'last,modifications', - 'last,modactions', - 'last,adminactions', + 'special,modifications', + 'special,modactions', + 'special,adminactions', 'wiki,insert', 'wiki,update', 'wiki,page', -- cgit v1.2.3