aboutsummaryrefslogtreecommitdiff
path: root/h-source/Application/Controllers/HistoryController.php
diff options
context:
space:
mode:
authorAntonio Gallo <tonicucoz@gmail.com>2011-02-15 17:06:09 +0000
committerAntonio Gallo <tonicucoz@gmail.com>2011-02-15 17:06:09 +0000
commit4a27b517fc52dde60e5c1837860e4785317490a6 (patch)
tree73b91c5d212f1bb67eb83fea9694cf8d1a360846 /h-source/Application/Controllers/HistoryController.php
parentd85570c9946aef61d8d935d9f50169215338d665 (diff)
improved wiki
Diffstat (limited to 'h-source/Application/Controllers/HistoryController.php')
-rw-r--r--h-source/Application/Controllers/HistoryController.php59
1 files changed, 56 insertions, 3 deletions
diff --git a/h-source/Application/Controllers/HistoryController.php b/h-source/Application/Controllers/HistoryController.php
index cc4b3d0..2154a0e 100644
--- a/h-source/Application/Controllers/HistoryController.php
+++ b/h-source/Application/Controllers/HistoryController.php
@@ -84,6 +84,26 @@ class HistoryController extends BaseController
'error_string' => 'Error: the issue is already closed',
),
+
+ 'pageblock' => array(
+
+ 'action' => 'pageblock',
+ 'check_status' => 'no',
+ 'to_status' => 'yes',
+ 'exec_string' => 'The wiki page has been blocked. Just reload the page',
+ 'error_string' => 'Error: the wiki page is already blocked',
+
+ ),
+
+ 'pageunblock' => array(
+
+ 'action' => 'pageunblock',
+ 'check_status' => 'yes',
+ 'to_status' => 'no',
+ 'exec_string' => 'The wiki page is no more blocked. Just reload the page',
+ 'error_string' => 'Error: the wiki page is already un-blocked',
+
+ ),
);
@@ -143,7 +163,17 @@ class HistoryController extends BaseController
'group' => 'moderator',
),
-
+
+ 'page' => array(
+
+ 'clean_type' => 'page',
+ 'model_name' => 'WikiModel',
+ 'id_name' => 'id_wiki',
+ 'field_name' => 'blocked',
+ 'actions' => array('pageblock','pageunblock'),
+ 'group' => 'admin',
+
+ ),
);
public function __construct($model, $controller, $queryString)
@@ -184,6 +214,16 @@ class HistoryController extends BaseController
{
$this->generic($lang, $token, 'close');
}
+
+ public function pageblock($lang = 'en', $token = '')
+ {
+ $this->generic($lang, $token, 'pageblock');
+ }
+
+ public function pageunblock($lang = 'en', $token = '')
+ {
+ $this->generic($lang, $token, 'pageunblock');
+ }
protected function generic($lang = 'en', $token = '', $action = 'hide')
{
@@ -232,7 +272,7 @@ class HistoryController extends BaseController
{
//hide the message
$model->values = array($clean['field_name'] => $this->strings[$action]['to_status']);
- $model->update($clean['id']);
+ $model->pUpdate($clean['id']);
if ($model->queryResult)
{
@@ -289,6 +329,10 @@ class HistoryController extends BaseController
$data['object'] = 'user';
$data['box_class'] = 'details_of_actions_inner_user';
break;
+ case 'page':
+ $data['object'] = 'wiki page';
+ $data['box_class'] = 'details_of_actions_inner_user';
+ break;
case 'issue':
$data['object'] = 'issue';
$data['box_class'] = 'details_of_actions_inner_user';
@@ -301,7 +345,16 @@ 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');
+ $data['md_action'] = array(
+ 'hide' => 'hidden',
+ 'show' => 'restored',
+ 'block' => 'blocked',
+ 'unblock' => 'un-blocked',
+ 'open' => 'opened again',
+ 'close' => 'closed',
+ 'pageblock' => 'blocked',
+ 'pageunblock' => 'un-blocked',
+ );
$this->append($data);
$this->load('viewall');