From e29f02659a5328a52042fb43bd3baad321ee3e91 Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Thu, 23 Jun 2011 19:45:28 +0000 Subject: administrators can now approve device page submitted by anonymous users --- .../Application/Controllers/HistoryController.php | 52 ++++++++++++++++++---- 1 file changed, 44 insertions(+), 8 deletions(-) (limited to 'h-source/Application/Controllers/HistoryController.php') diff --git a/h-source/Application/Controllers/HistoryController.php b/h-source/Application/Controllers/HistoryController.php index ead0886..a92f906 100644 --- a/h-source/Application/Controllers/HistoryController.php +++ b/h-source/Application/Controllers/HistoryController.php @@ -24,14 +24,15 @@ class HistoryController extends BaseController { public static $typeTable = array( - 'message' => 'message', - 'talk' => 'talk', - 'user' => 'user', - 'issue' => 'issue', - 'wiki_talk' => 'wiki talk', - 'page' => 'wiki page', - 'page_del' => 'wiki page', - 'device' => 'device page', + 'message' => 'message', + 'talk' => 'talk', + 'user' => 'user', + 'issue' => 'issue', + 'wiki_talk' => 'wiki talk', + 'page' => 'wiki page', + 'page_del' => 'wiki page', + 'device' => 'device page', + 'device_app' => 'device page', ); public static $actionTable = array( @@ -47,6 +48,7 @@ class HistoryController extends BaseController 'pageshow' => 'show', 'devicehide' => 'hide', 'deviceshow' => 'show', + 'deviceapprove' => 'approve', ); protected $strings = array( @@ -170,6 +172,17 @@ class HistoryController extends BaseController 'error_string' => 'Error: the device page is already visible', ), + + 'deviceapprove' => array( + + 'action' => 'deviceapprove', + 'check_status' => 'no', + 'to_status' => 'yes', + 'exec_string' => 'The device page has been approved. Just reload the page', + 'error_string' => 'Error: the device page is already approved', + + ), + ); protected $types = array( @@ -264,6 +277,19 @@ class HistoryController extends BaseController 'group' => 'admin', ), + + //page blocked or not + 'device_app' => array( + + 'clean_type' => 'device_app', + 'model_name' => 'HardwareModel', + 'id_name' => 'id_hard', + 'field_name' => 'approved', + 'actions' => array('deviceapprove'), + 'group' => 'admin', + + ), + ); public function __construct($model, $controller, $queryString) @@ -334,6 +360,11 @@ class HistoryController extends BaseController { $this->generic($lang, $token, 'deviceshow'); } + + public function deviceapprove($lang = 'en', $token = '') + { + $this->generic($lang, $token, 'deviceapprove'); + } protected function generic($lang = 'en', $token = '', $action = 'hide') { @@ -450,6 +481,10 @@ class HistoryController extends BaseController $data['object'] = 'device page'; $data['box_class'] = 'details_of_actions_inner_user'; break; + case 'device_app': + $data['object'] = 'device page'; + $data['box_class'] = 'details_of_actions_inner_user'; + break; case 'page_del': $data['object'] = 'wiki page'; $data['box_class'] = 'details_of_actions_inner_user'; @@ -479,6 +514,7 @@ class HistoryController extends BaseController 'pageshow' => 'restored', 'devicehide' => 'hidden', 'deviceshow' => 'restored', + 'deviceapprove' => 'approved', ); $this->append($data); -- cgit v1.2.3