From 4a27b517fc52dde60e5c1837860e4785317490a6 Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Tue, 15 Feb 2011 17:06:09 +0000 Subject: improved wiki --- .../Application/Controllers/BaseController.php | 6 + .../Application/Controllers/HistoryController.php | 59 +++++++- .../Application/Controllers/LastController.php | 2 +- .../Application/Controllers/WikiController.php | 76 +++++++++- h-source/Application/Include/languages.php | 13 +- h-source/Application/Include/myFunctions.php | 7 + h-source/Application/Models/IssuesModel.php | 4 + h-source/Application/Models/MessagesModel.php | 5 + h-source/Application/Models/TalkModel.php | 5 + h-source/Application/Models/UsersModel.php | 5 + h-source/Application/Models/WikiModel.php | 38 ++++- h-source/Application/Models/WikitalkModel.php | 5 + h-source/Application/Views/Last/modifications.php | 2 +- h-source/Application/Views/Wiki/form.php | 10 +- h-source/Application/Views/Wiki/history.php | 2 +- h-source/Application/Views/Wiki/modifications.php | 45 ++++++ h-source/Application/Views/Wiki/page.php | 36 ++++- h-source/Application/Views/Wiki/pages.php | 45 ++++++ h-source/Application/Views/Wiki/talk.php | 163 +++++++++++---------- h-source/Application/Views/header.php | 1 + h-source/Application/Views/right.php | 9 ++ h-source/Config/Route.php | 4 + h-source/Public/Css/main.css | 6 + h-source/Public/Img/Crystal/lock.png | Bin 0 -> 3604 bytes h-source/Public/Img/Crystal/unlock.png | Bin 0 -> 3995 bytes h-source/tables.sql | 5 +- 26 files changed, 453 insertions(+), 100 deletions(-) create mode 100644 h-source/Application/Views/Wiki/modifications.php create mode 100644 h-source/Application/Views/Wiki/pages.php create mode 100755 h-source/Public/Img/Crystal/lock.png create mode 100755 h-source/Public/Img/Crystal/unlock.png diff --git a/h-source/Application/Controllers/BaseController.php b/h-source/Application/Controllers/BaseController.php index 29d0642..5340954 100644 --- a/h-source/Application/Controllers/BaseController.php +++ b/h-source/Application/Controllers/BaseController.php @@ -25,6 +25,7 @@ class BaseController extends Controller protected $lang; protected $ismoderator = false; + protected $isadmin = false; protected $querySanitized = true; protected $token = 'token'; @@ -59,6 +60,7 @@ class BaseController extends Controller $data['islogged'] = 'no'; $data['token'] = 'token'; $data['ismoderator'] = false; + $data['isadmin'] = false; if ($this->s['registered']->status['status'] === 'logged') { @@ -66,8 +68,12 @@ class BaseController extends Controller $data['islogged'] = 'yes'; $data['token'] = $this->s['registered']->status['token']; $this->token = $data['token']; + $data['ismoderator'] = in_array('moderator',$this->s['registered']->status['groups']) ? true : false; $this->ismoderator = $data['ismoderator']; + + $data['isadmin'] = in_array('admin',$this->s['registered']->status['groups']) ? true : false; + $this->isadmin = $data['isadmin']; } $data['lang'] = 'en'; 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'); diff --git a/h-source/Application/Controllers/LastController.php b/h-source/Application/Controllers/LastController.php index c357c1a..6fe66a2 100644 --- a/h-source/Application/Controllers/LastController.php +++ b/h-source/Application/Controllers/LastController.php @@ -29,7 +29,7 @@ class LastController extends BaseController $this->model('HistoryModel'); - $data['title'] = 'last - '.Website::$generalName; + $data['title'] = gtext('last modifications').' - '.Website::$generalName; $this->append($data); $this->setArgKeys(array('page:forceNat'=>1)); diff --git a/h-source/Application/Controllers/WikiController.php b/h-source/Application/Controllers/WikiController.php index 1c4c154..65a615a 100644 --- a/h-source/Application/Controllers/WikiController.php +++ b/h-source/Application/Controllers/WikiController.php @@ -100,6 +100,8 @@ class WikiController extends BaseController { if ($this->m['UsersModel']->isBlocked($this->s['registered']->status['id_user'])) $this->redirect('my/home/'.$this->lang,2,'your account has been blocked..'); + + if ($this->m['WikiModel']->isBlocked($clean['id_wiki'])) $this->redirect('wiki/page/'.$this->lang,2,'this page has been blocked..'); $deleted = $this->m['WikiModel']->select("wiki.deleted")->where(array("id_wiki"=>$clean['id_wiki']))->limit(1)->toList('wiki.deleted')->send(); @@ -161,7 +163,8 @@ class WikiController extends BaseController $clean['title_clean'] = sanitizeAll($title_clean); $data['isDeleted'] = 'no'; - + $data['isBlocked'] = false; + if (isset($title_clean)) { $res = $this->m['WikiModel']->select()->where(array('title_clean'=>$clean['title_clean']))->orderBy('id_wiki desc')->limit(1)->send(); @@ -172,6 +175,7 @@ class WikiController extends BaseController $data['tree_name'] = $res[0]['wiki']['title']; $data['title'] = $res[0]['wiki']['title'] . ' - ' . Website::$generalName; $data['isDeleted'] = $res[0]['wiki']['deleted']; + $data['isBlocked'] = $this->m['WikiModel']->isBlocked($res[0]['wiki']['id_wiki']); if ( count($res) < 2 ) { @@ -205,11 +209,14 @@ class WikiController extends BaseController { $this->redirect('wiki/page/'.$this->lang.'/Main-Page'); } + + $data['md_javascript'] = "moderator_dialog(\"pageblock\",\"page\");moderator_dialog(\"pageunblock\",\"page\");"; $this->append($data); $this->load($viewFile); $this->load('bottom_left'); + $this->load('moderator_dialog'); $this->right(); } @@ -225,6 +232,7 @@ class WikiController extends BaseController $clean['id'] = (int)$id; $data['id'] = $clean['id']; $data['tree_name'] = $this->m['WikiModel']->getTheModelName($clean['id']); + $data['isBlocked'] = $this->m['WikiModel']->isBlocked($clean['id']); $data['title'] = 'history - '.Website::$generalName; @@ -285,6 +293,7 @@ class WikiController extends BaseController if (count($data['table']) > 0) { $data['id_wiki'] = (int)$data['table'][0]['wiki_revisions']['id_wiki']; + $data['isDeleted'] = $this->m['WikiModel']->isDeleted($data['id_wiki']); $data['tree_name'] = $this->m['WikiModel']->getTheModelName($data['id_wiki']); $data['tree'] = $this->getSpecPageLink() . " » " . $this->getViewLink($data['tree_name'])." » " . $this->getHistoryLink($data['id_wiki']) . " » ".gtext('Revision'); @@ -400,8 +409,9 @@ class WikiController extends BaseController if ($this->s['registered']->status['status'] === 'logged') { - if ($this->m['UsersModel']->isBlocked($this->s['registered']->status['id_user'])) $this->redirect('my/home/'.$this->lang,2,'your account has been blocked..'); + + if ($this->m['WikiModel']->isBlocked($clean['id_wiki'])) $this->redirect('wiki/page/'.$this->lang,2,'this page has been blocked..'); if (isset($_POST['confirmAction'])) { @@ -442,6 +452,7 @@ class WikiController extends BaseController $clean['id_wiki'] = (int)$id_wiki; $data['id_wiki'] = $clean['id_wiki']; $data['tree_name'] = $this->m['WikiModel']->getTheModelName($clean['id_wiki']); + $data['isBlocked'] = $this->m['WikiModel']->isBlocked($clean['id_wiki']); $data['tree'] = $this->getSpecPageLink() . " » " . $this->getViewLink($data['tree_name'])." » ".gtext('Talk'); if (isset($_POST['insertAction'])) @@ -449,6 +460,8 @@ class WikiController extends BaseController if ($this->s['registered']->status['status'] === 'logged') { if ($this->m['UsersModel']->isBlocked($this->s['registered']->status['id_user'])) $this->redirect('my/home/'.$this->lang,2,'your account has been blocked..'); + + if ($this->m['WikiModel']->isBlocked($clean['id_wiki'])) $this->redirect('wiki/page/'.$this->lang,2,'this page has been blocked..'); $this->m['WikitalkModel']->values['created_by'] = $this->s['registered']->status['id_user']; $this->m['WikitalkModel']->values['id_wiki'] = $clean['id_wiki']; @@ -476,7 +489,64 @@ class WikiController extends BaseController $this->load('talk'); $this->load('moderator_dialog'); $this->right(); -// $this->loadViewAll('talk,moderator_dialog'); + } + + public function pages($lang = 'en') + { + $data['title'] = gtext('list of pages').' - '.Website::$generalName; + + $this->setArgKeys(array('page:forceNat'=>1)); + + $this->shift(1); + + $this->helper('Pages','wiki/pages/'.$this->lang,'page'); + + $this->m['WikiModel']->clear()->select()->where(array('-deleted'=>'no'))->orderBy('id_wiki desc'); + + $recordNumber = $this->m['WikiModel']->rowNumber(); + $page = $this->viewArgs['page']; + + $this->m['WikiModel']->limit = $this->h['Pages']->getLimit($page,$recordNumber,30); + + $data['table'] = $this->m['WikiModel']->send(); + + $data['pageList'] = $this->h['Pages']->render($page-7,15); + + $this->append($data); + $this->load('pages'); + $this->right(); + } + + //print all the modifications to the wiki + public function modifications($lang = 'en') + { + $data['title'] = gtext('last modifications').' - '.Website::$generalName; + + $this->setArgKeys(array('page:forceNat'=>1)); + + $this->shift(1); + + $whereClauseArray = array( + 'gr' => 'registered', + 'type' => 'wiki', + ); + + $this->helper('Pages','wiki/modifications/'.$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-7,15); + + $this->append($data); + $this->load('modifications'); + $this->right(); } protected function getViewLink($ne_name) diff --git a/h-source/Application/Include/languages.php b/h-source/Application/Include/languages.php index 692c214..0a8a728 100644 --- a/h-source/Application/Include/languages.php +++ b/h-source/Application/Include/languages.php @@ -175,8 +175,8 @@ class Lang "at" => "alle ore", "last modifications" => "ultime modifiche", "watch all modifications" => "guarda tutte le modifiche", - "title" => "titolo", - "text of the wiki page" => "testo della pagina", + "the title" => "il titolo", + "the text of the wiki page" => "il testo della pagina", "the wiki page has not been found" => "la pagina della wiki non è stata trovata", "Page not-found" => "Pagina non trovata", "Insert" => "Inserisci", @@ -198,6 +198,13 @@ class Lang "the page text is too length" => "il testo della pagina è troppo lungo", "History of the wiki page" => "History della pagina della wiki", "Would you like to insert it?" => "Vuoi inserirla?", + "Wiki modifications" => "Modifiche alla Wiki", + "List of the wiki modifications carried out by users" => "Lista delle modifiche apportate alla Wiki dagli utenti", + "list of pages" => "lista delle pagine", + "List of wiki pages" => "Lista delle pagine della wiki", + "This wiki page has been blocked" => "Questa pagina della wiki è stata bloccata", + "unblock the wiki page" => "sblocca la pagina", + "block the wiki page" => "blocca la pagina", ), 'es' => array ( @@ -499,7 +506,7 @@ class Go $urls = getUrlsFromIdHard($clean['idHard']); return $urls['urlView']; } - + } class MyStrings diff --git a/h-source/Application/Include/myFunctions.php b/h-source/Application/Include/myFunctions.php index 8299157..d2b54e7 100644 --- a/h-source/Application/Include/myFunctions.php +++ b/h-source/Application/Include/myFunctions.php @@ -195,6 +195,8 @@ function decodeWikiText($string) $string = preg_replace('/(\[hr\])/', '
',$string); + $string = preg_replace_callback('/(\[\[)(.*?)\|(.*?)(\]\])/', 'linkToInternalPageWithText' ,$string); + $string = preg_replace_callback('/(\[\[)(.*?)(\]\])/', 'linkToInternalPage' ,$string); $string = preg_replace_callback('/(\[a\])(.*?)(\[\/a\])/', 'linkTo',$string); @@ -276,6 +278,11 @@ function linkToInternalPage($match) return "".$match[2].""; } +function linkToInternalPageWithText($match) +{ + return "".$match[3].""; +} + function linkToWithText($match) { if (checkUrl($match[2])) diff --git a/h-source/Application/Models/IssuesModel.php b/h-source/Application/Models/IssuesModel.php index 4593bea..eec86be 100644 --- a/h-source/Application/Models/IssuesModel.php +++ b/h-source/Application/Models/IssuesModel.php @@ -99,4 +99,8 @@ class IssuesModel extends Model_Tree { parent::__construct(); } + public function pUpdate($id) + { + return parent::update($id); + } } \ No newline at end of file diff --git a/h-source/Application/Models/MessagesModel.php b/h-source/Application/Models/MessagesModel.php index 2417739..989facc 100644 --- a/h-source/Application/Models/MessagesModel.php +++ b/h-source/Application/Models/MessagesModel.php @@ -45,6 +45,11 @@ class MessagesModel extends Model_Tree { parent::__construct(); } + public function pUpdate($id) + { + return parent::update($id); + } + public $formStruct = array( 'entries' => array( 'deleted' => array('type'=>'Select','options'=>'no,yes'), diff --git a/h-source/Application/Models/TalkModel.php b/h-source/Application/Models/TalkModel.php index e29e073..b98a5a4 100644 --- a/h-source/Application/Models/TalkModel.php +++ b/h-source/Application/Models/TalkModel.php @@ -43,6 +43,11 @@ class TalkModel extends Model_Tree { parent::__construct(); } + public function pUpdate($id) + { + return parent::update($id); + } + public function insert() { if (parent::insert()) diff --git a/h-source/Application/Models/UsersModel.php b/h-source/Application/Models/UsersModel.php index fe72ce7..d4ef745 100755 --- a/h-source/Application/Models/UsersModel.php +++ b/h-source/Application/Models/UsersModel.php @@ -59,6 +59,11 @@ class UsersModel extends Model_Map $this->deleteNotRegistered(); } + public function pUpdate($id) + { + return parent::update($id); + } + public function deleteNotRegistered() { $limit = time() - Account::$confirmTime; diff --git a/h-source/Application/Models/WikiModel.php b/h-source/Application/Models/WikiModel.php index 0a00bfb..6cdc632 100644 --- a/h-source/Application/Models/WikiModel.php +++ b/h-source/Application/Models/WikiModel.php @@ -37,7 +37,9 @@ class WikiModel extends Model_Map { 'username' => 'regusers', 'id_user' => 'regusers', 'has_confirmed' => 'regusers', - 'deleted' => 'regusers' + 'deleted' => 'regusers', + '-deleted' => 'wiki', + '-blocked' => 'wiki', ); $this->printAssError = "no"; @@ -70,6 +72,11 @@ class WikiModel extends Model_Map { parent::__construct(); } + public function pUpdate($id) + { + return parent::update($id); + } + public function insert() { $this->values['created_by'] = (int)$this->id_user; @@ -254,6 +261,35 @@ class WikiModel extends Model_Map { return false; } + public function isDeleted($id) + { + $clean['id'] = (int)$id; + $res = $this->select('wiki.deleted')->where(array('id_wiki'=>$clean['id']))->send(); + if ( count($res) > 0 ) + { + return $res[0]['wiki']['deleted']; + } + return 'no'; + } + + public function isBlocked($id) + { + $clean['id'] = (int)$id; + $res = $this->select('blocked')->where(array('id_wiki'=>$clean['id']))->send(); + if ( count($res) > 0 ) + { + return strcmp($res[0]['wiki']['blocked'],'no') === 0 ? false : true; + } + return false; + } + + public function toWikiPage($id) + { + $clean['id'] = (int)$id; + $title = $this->getTheModelName($clean['id']); + return "http://".DOMAIN_NAME."/wiki/page/".Lang::$current."/".encodeUrl($title); + } + public function getDiffArray($oldArray, $newArray) { return getDiffArray($this->diffFields, $oldArray, $newArray); diff --git a/h-source/Application/Models/WikitalkModel.php b/h-source/Application/Models/WikitalkModel.php index 608fbae..3bff3d3 100644 --- a/h-source/Application/Models/WikitalkModel.php +++ b/h-source/Application/Models/WikitalkModel.php @@ -37,6 +37,11 @@ class WikitalkModel extends Model_Tree parent::__construct(); } + public function pUpdate($id) + { + return parent::update($id); + } + public $formStruct = array( 'entries' => array( 'title' => array(), diff --git a/h-source/Application/Views/Last/modifications.php b/h-source/Application/Views/Last/modifications.php index 8683615..1caca34 100644 --- a/h-source/Application/Views/Last/modifications.php +++ b/h-source/Application/Views/Last/modifications.php @@ -33,7 +33,7 @@
diff --git a/h-source/Application/Views/Wiki/form.php b/h-source/Application/Views/Wiki/form.php index 0a448dd..b3f7578 100644 --- a/h-source/Application/Views/Wiki/form.php +++ b/h-source/Application/Views/Wiki/form.php @@ -35,7 +35,7 @@ action,'insert') === 0 ) { ?>
- ">Home » ">Wiki » + ">Home » ">Wiki »
@@ -43,13 +43,13 @@
action,'update') === 0 ) { ?>
- ">Home » ">Wiki » "> » + ">Home » ">Wiki » "> »
@@ -76,12 +76,12 @@
- +
- +
diff --git a/h-source/Application/Views/Wiki/history.php b/h-source/Application/Views/Wiki/history.php index 5e5c041..ec394f4 100644 --- a/h-source/Application/Views/Wiki/history.php +++ b/h-source/Application/Views/Wiki/history.php @@ -53,7 +53,7 @@ (controller."/differences/$lang/$id/".$rev['wiki_revisions']['id_rev'].$this->viewStatus;?>">diff) - + () diff --git a/h-source/Application/Views/Wiki/modifications.php b/h-source/Application/Views/Wiki/modifications.php new file mode 100644 index 0000000..71e50c9 --- /dev/null +++ b/h-source/Application/Views/Wiki/modifications.php @@ -0,0 +1,45 @@ + + +. +?> + +
+ +
+ ">Home » ">Wiki » +
+ +
+ +
+ +
+ +
+ +
+ : +
+ +
diff --git a/h-source/Application/Views/Wiki/page.php b/h-source/Application/Views/Wiki/page.php index c690771..d386704 100644 --- a/h-source/Application/Views/Wiki/page.php +++ b/h-source/Application/Views/Wiki/page.php @@ -29,8 +29,35 @@
">Home » ">Wiki »
- + + +
+ + + + "> + + + + "> + + + + +
+
page
+ ">view details +
+
+ +
+ + - +
controller."/update/$lang";?>" method="POST"> @@ -79,7 +106,7 @@ - + action,'revision') === 0) { ?> @@ -91,6 +118,9 @@
+ + +
diff --git a/h-source/Application/Views/Wiki/pages.php b/h-source/Application/Views/Wiki/pages.php new file mode 100644 index 0000000..f944f36 --- /dev/null +++ b/h-source/Application/Views/Wiki/pages.php @@ -0,0 +1,45 @@ + + +. +?> + +
+ +
+ ">Home » ">Wiki » +
+ +
+ +
+ +
+
    + +
  • + +
+
+ +
+ : +
+ +
diff --git a/h-source/Application/Views/Wiki/talk.php b/h-source/Application/Views/Wiki/talk.php index 9835f04..724b273 100644 --- a/h-source/Application/Views/Wiki/talk.php +++ b/h-source/Application/Views/Wiki/talk.php @@ -43,120 +43,127 @@ + + -
+
- + - + - -
+ +
-
- - ">hide - - -
- +
+ + ">hide + + +
+ +
+ +
+ by getUser($message['wiki_talk']['created_by']));?>, +
-
- by getUser($message['wiki_talk']['created_by']));?>, +
+
-
-
- -
+ + +
+
wiki_talk
+ ">view details +
+
+ - - -
-
wiki_talk
- ">view details -
- - -
- - - - - -
- this message has been deleted - - ">make visible - -
-
wiki_talk
+ - ">view details - -
-
-
- submitted by getUser($message['wiki_talk']['created_by']));?>, -
-
- + + +
+ this message has been deleted + + ">make visible + + +
+
wiki_talk
+ + ">view details + +
+
+
+ submitted by getUser($message['wiki_talk']['created_by']));?>, +
+
+ +
+
-
-
-
+
+ + +
- -
+ - +
+ -
- + - +
+ controller."/talk/$lang/$id_wiki";?>#form" method="POST"> -
- controller."/talk/$lang/$id_wiki";?>#form" method="POST"> +
-
+
+ + +
-
- - -
+
+ + +
+ + -
- -
- + +
+
-
+ - + -
- + - \ No newline at end of file diff --git a/h-source/Application/Views/header.php b/h-source/Application/Views/header.php index 625ebae..e86006b 100644 --- a/h-source/Application/Views/header.php +++ b/h-source/Application/Views/header.php @@ -23,6 +23,7 @@ 'inserted','update'=>'updated'); $currPos = $querySanitized ? $this->controller."/".$this->action : 'home/index'; ?> diff --git a/h-source/Application/Views/right.php b/h-source/Application/Views/right.php index 3bde69e..89f3d85 100644 --- a/h-source/Application/Views/right.php +++ b/h-source/Application/Views/right.php @@ -90,6 +90,15 @@ ">
+ controller,'wiki') === 0 ) { ?> +
+ +
+ + controller,'wiki') !== 0 ) { ?>
diff --git a/h-source/Config/Route.php b/h-source/Config/Route.php index 7aaf55b..31a5238 100644 --- a/h-source/Config/Route.php +++ b/h-source/Config/Route.php @@ -105,6 +105,8 @@ class Route 'history,unblock', 'history,open', 'history,close', + 'history,pageblock', + 'history,pageunblock', 'history,viewall', 'threegcards,catalogue', 'threegcards,view', @@ -143,6 +145,8 @@ class Route 'wiki,differences', 'wiki,climb', 'wiki,talk', + 'wiki,modifications', + 'wiki,pages', ); //it can be 'yes' or 'no' diff --git a/h-source/Public/Css/main.css b/h-source/Public/Css/main.css index abdeb0a..dfe6882 100644 --- a/h-source/Public/Css/main.css +++ b/h-source/Public/Css/main.css @@ -1684,4 +1684,10 @@ td.text_item_date float:left; text-align:left; margin-left:10px; +} +.blocked_notice +{ + float:right; + font:normal 12px/1 sans-serif; + color:#000; } \ No newline at end of file diff --git a/h-source/Public/Img/Crystal/lock.png b/h-source/Public/Img/Crystal/lock.png new file mode 100755 index 0000000..d1d0706 Binary files /dev/null and b/h-source/Public/Img/Crystal/lock.png differ diff --git a/h-source/Public/Img/Crystal/unlock.png b/h-source/Public/Img/Crystal/unlock.png new file mode 100755 index 0000000..13b1090 Binary files /dev/null and b/h-source/Public/Img/Crystal/unlock.png differ diff --git a/h-source/tables.sql b/h-source/tables.sql index c59cf23..b22e0be 100644 --- a/h-source/tables.sql +++ b/h-source/tables.sql @@ -224,7 +224,7 @@ create table history ( created_by int not null, creation_date timestamp default CURRENT_TIMESTAMP, type char(10) not null, - action char(10) not null, + action char(15) not null, id INT UNSIGNED NOT NULL, message text CHARACTER SET utf8 not null, gr char(15) not null @@ -233,6 +233,8 @@ create table history ( insert into reggroups (name) values ('moderator'); +insert into reggroups (name) values ('admin'); + create table wiki ( id_wiki INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, created_by int not null, @@ -242,6 +244,7 @@ create table wiki ( title_clean varchar(100) CHARACTER SET utf8 not null, page text CHARACTER SET utf8 not null, deleted char(3) not null default 'no', + blocked CHAR(3) NOT NULL default 'no', is_main char(3) not null default 'no' )engine=innodb; -- cgit v1.2.3