aboutsummaryrefslogtreecommitdiff
path: root/h-source/Application/Controllers/HistoryController.php
diff options
context:
space:
mode:
authorAntonio Gallo <tonicucoz@gmail.com>2011-06-05 11:09:40 +0000
committerAntonio Gallo <tonicucoz@gmail.com>2011-06-05 11:09:40 +0000
commit9a5338f565e600e618cc4546abbf18d30d942b3a (patch)
treee5eca4149e71ce3a204de2070cf78a9f9e0bfd6a /h-source/Application/Controllers/HistoryController.php
parent310356e1c7777c0e421af7c744a44827c4869a5e (diff)
improved the way deleted devices are managed
Diffstat (limited to 'h-source/Application/Controllers/HistoryController.php')
-rw-r--r--h-source/Application/Controllers/HistoryController.php71
1 files changed, 61 insertions, 10 deletions
diff --git a/h-source/Application/Controllers/HistoryController.php b/h-source/Application/Controllers/HistoryController.php
index e44ce79..71055fc 100644
--- a/h-source/Application/Controllers/HistoryController.php
+++ b/h-source/Application/Controllers/HistoryController.php
@@ -31,6 +31,7 @@ class HistoryController extends BaseController
'wiki_talk' => 'wiki talk',
'page' => 'wiki page',
'page_del' => 'wiki page',
+ 'device' => 'device page',
);
public static $actionTable = array(
@@ -44,6 +45,8 @@ class HistoryController extends BaseController
'pageunblock' => 'unblock',
'pagehide' => 'hide',
'pageshow' => 'show',
+ 'devicehide' => 'hide',
+ 'deviceshow' => 'show',
);
protected $strings = array(
@@ -147,6 +150,26 @@ class HistoryController extends BaseController
'error_string' => 'Error: the wiki page is already visible',
),
+
+ 'devicehide' => array(
+
+ 'action' => 'devicehide',
+ 'check_status' => 'no',
+ 'to_status' => 'yes',
+ 'exec_string' => 'The device page has been hidden. Just reload the page',
+ 'error_string' => 'Error: the device page is already hidden',
+
+ ),
+
+ 'deviceshow' => array(
+
+ 'action' => 'deviceshow',
+ 'check_status' => 'yes',
+ 'to_status' => 'no',
+ 'exec_string' => 'The device page is no more hidden. Just reload the page',
+ 'error_string' => 'Error: the device page is already visible',
+
+ ),
);
protected $types = array(
@@ -229,6 +252,18 @@ class HistoryController extends BaseController
'group' => 'admin',
),
+
+ //page blocked or not
+ 'device' => array(
+
+ 'clean_type' => 'device',
+ 'model_name' => 'HardwareModel',
+ 'id_name' => 'id_hard',
+ 'field_name' => '-deleted',
+ 'actions' => array('devicehide','deviceshow'),
+ 'group' => 'moderator',
+
+ ),
);
public function __construct($model, $controller, $queryString)
@@ -289,6 +324,16 @@ class HistoryController extends BaseController
{
$this->generic($lang, $token, 'pageshow');
}
+
+ public function devicehide($lang = 'en', $token = '')
+ {
+ $this->generic($lang, $token, 'devicehide');
+ }
+
+ public function deviceshow($lang = 'en', $token = '')
+ {
+ $this->generic($lang, $token, 'deviceshow');
+ }
protected function generic($lang = 'en', $token = '', $action = 'hide')
{
@@ -401,6 +446,10 @@ class HistoryController extends BaseController
$data['object'] = 'wiki page';
$data['box_class'] = 'details_of_actions_inner_user';
break;
+ case 'device':
+ $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';
@@ -418,16 +467,18 @@ class HistoryController extends BaseController
$data['res'] = $this->m['HistoryModel']->select()->where(array('id'=>$clean['id'],'type'=>$clean['type'],'gr'=>$clean['group']))->send();
$data['md_action'] = array(
- 'hide' => 'hidden',
- 'show' => 'restored',
- 'block' => 'blocked',
- 'unblock' => 'un-blocked',
- 'open' => 'opened again',
- 'close' => 'closed',
- 'pageblock' => 'blocked',
- 'pageunblock' => 'un-blocked',
- 'pagehide' => 'hidden',
- 'pageshow' => 'restored',
+ 'hide' => 'hidden',
+ 'show' => 'restored',
+ 'block' => 'blocked',
+ 'unblock' => 'un-blocked',
+ 'open' => 'opened again',
+ 'close' => 'closed',
+ 'pageblock' => 'blocked',
+ 'pageunblock' => 'un-blocked',
+ 'pagehide' => 'hidden',
+ 'pageshow' => 'restored',
+ 'devicehide' => 'hidden',
+ 'deviceshow' => 'restored',
);
$this->append($data);