From 82d1fce1124a497dc1b78cf88dbc29e2eb1f6ae5 Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Sun, 10 Jul 2011 20:27:11 +0000 Subject: administrators can now see the list of pages that have to be approved --- .../Application/Controllers/GenericController.php | 2 +- .../Application/Controllers/SpecialController.php | 38 ++++++++++++++++++---- h-source/Application/Include/languages.php | 2 ++ h-source/Application/Models/HardwareModel.php | 7 ++++ h-source/Application/Views/My/panel.php | 1 + .../Application/Views/Special/pages_deleted.php | 4 +-- h-source/Application/Views/if_page_deleted.php | 10 +++++- h-source/Application/Views/top_left.php | 5 +-- h-source/Config/Route.php | 1 + 9 files changed, 58 insertions(+), 12 deletions(-) (limited to 'h-source') diff --git a/h-source/Application/Controllers/GenericController.php b/h-source/Application/Controllers/GenericController.php index 949f3ae..c80f6d0 100644 --- a/h-source/Application/Controllers/GenericController.php +++ b/h-source/Application/Controllers/GenericController.php @@ -501,7 +501,7 @@ class GenericController extends BaseController $this->append($data); - session_start(); + @session_start(); if ( isset($_SESSION['notebook_inserted']) and strcmp($this->controller,'notebooks') === 0 ) { $viewFilesList = 'suggest_dialog,dialog,page,if_page_deleted,moderator_dialog'; diff --git a/h-source/Application/Controllers/SpecialController.php b/h-source/Application/Controllers/SpecialController.php index 1f13b69..6f17c2c 100644 --- a/h-source/Application/Controllers/SpecialController.php +++ b/h-source/Application/Controllers/SpecialController.php @@ -120,15 +120,23 @@ class SpecialController extends BaseController $this->last($lang = 'en','adminactions'); } - public function deleted($lang = 'en') + protected function pagelist($lang = 'en', $type) { - $this->shift(1); - - $this->s['registered']->check('admin'); - + switch($type) + { + case 'deleted': + $whereArray = array('-deleted'=>'yes','approved'=>'yes'); + $data['titleString'] = 'hidden device pages'; + break; + case 'notapproved': + $whereArray = array('approved'=>'no'); + $data['titleString'] = 'Device pages that have to be approved'; + break; + } + $this->helper('Pages','special/'.$this->action.'/'.$this->lang,'page'); - $this->m['HardwareModel']->clear()->select()->where(array('-deleted'=>'yes'))->orderBy('id_hard desc'); + $this->m['HardwareModel']->clear()->select()->where($whereArray)->orderBy('id_hard desc'); $recordNumber = $this->m['HardwareModel']->rowNumber(); $page = $this->viewArgs['page']; @@ -144,4 +152,22 @@ class SpecialController extends BaseController $this->right(); } + public function deleted($lang = 'en') + { + $this->shift(1); + + $this->s['registered']->check('admin'); + + $this->pagelist($lang,'deleted'); + } + + public function notapproved($lang = 'en') + { + $this->shift(1); + + $this->s['registered']->check('admin'); + + $this->pagelist($lang,'notapproved'); + } + } \ No newline at end of file diff --git a/h-source/Application/Include/languages.php b/h-source/Application/Include/languages.php index 812be64..2dd8d1c 100644 --- a/h-source/Application/Include/languages.php +++ b/h-source/Application/Include/languages.php @@ -240,6 +240,8 @@ class Lang /*0202*/"List of hidden device pages" => "Lista di pagine nascoste di dispositivi", /*0203*/"approve the device page" => "approva la pagina del dispositivo", /*0204*/"This device page has not been approved yet" => "La pagina del dispositivo non รจ ancora stata approvata", + /*0205*/"Device pages that have to be approved" => "Pagine di dispositivi da approvare", + /*0206*/"The device page has to be approved by an administrator of the website" => "La pagina del dispositivo deve essere approvata da un amministratore del sito" ), 'es' => array ( diff --git a/h-source/Application/Models/HardwareModel.php b/h-source/Application/Models/HardwareModel.php index 11aea59..d19cfbd 100644 --- a/h-source/Application/Models/HardwareModel.php +++ b/h-source/Application/Models/HardwareModel.php @@ -81,6 +81,13 @@ class HardwareModel extends Model_Map { $this->values['deleted'] = 'no'; } } + else if (isset($this->values['deleted'])) + { + if (strcmp($this->values['deleted'],'no') === 0) + { + $this->values['approved'] = 'yes'; + } + } return parent::update($id); } diff --git a/h-source/Application/Views/My/panel.php b/h-source/Application/Views/My/panel.php index 9c6424a..0f50f36 100644 --- a/h-source/Application/Views/My/panel.php +++ b/h-source/Application/Views/My/panel.php @@ -38,6 +38,7 @@ diff --git a/h-source/Application/Views/Special/pages_deleted.php b/h-source/Application/Views/Special/pages_deleted.php index d960d26..f0e69d5 100644 --- a/h-source/Application/Views/Special/pages_deleted.php +++ b/h-source/Application/Views/Special/pages_deleted.php @@ -23,11 +23,11 @@
- ">Home » "> » + ">Home » "> »
- +
diff --git a/h-source/Application/Views/if_page_deleted.php b/h-source/Application/Views/if_page_deleted.php index 1e2ab2d..e60eb78 100644 --- a/h-source/Application/Views/if_page_deleted.php +++ b/h-source/Application/Views/if_page_deleted.php @@ -20,7 +20,7 @@ // along with h-source. If not, see . ?> - +
@@ -47,5 +47,13 @@
+ + + +
+
+ +
+
\ No newline at end of file diff --git a/h-source/Application/Views/top_left.php b/h-source/Application/Views/top_left.php index 148a863..73e8f80 100644 --- a/h-source/Application/Views/top_left.php +++ b/h-source/Application/Views/top_left.php @@ -39,7 +39,7 @@ - "> + "> @@ -89,10 +89,11 @@
+ - + action,'catalogue') === 0) { ?> diff --git a/h-source/Config/Route.php b/h-source/Config/Route.php index a03e718..5362ae0 100644 --- a/h-source/Config/Route.php +++ b/h-source/Config/Route.php @@ -163,6 +163,7 @@ class Route 'special,modactions', 'special,adminactions', 'special,deleted', + 'special,notapproved', 'wiki,insert', 'wiki,update', 'wiki,page', -- cgit v1.2.3