diff options
-rw-r--r-- | h-source/Application/Controllers/HistoryController.php | 50 | ||||
-rw-r--r-- | h-source/Application/Controllers/WikiController.php | 80 | ||||
-rw-r--r-- | h-source/Application/Include/hardware.php | 3 | ||||
-rw-r--r-- | h-source/Application/Include/languages.php | 2 | ||||
-rw-r--r-- | h-source/Application/Include/myFunctions.php | 1 | ||||
-rw-r--r-- | h-source/Application/Models/WikiModel.php | 4 | ||||
-rw-r--r-- | h-source/Application/Views/Videocards/catalogue.php | 2 | ||||
-rw-r--r-- | h-source/Application/Views/Videocards/page.php | 2 | ||||
-rw-r--r-- | h-source/Application/Views/Wiki/climb.php | 44 | ||||
-rw-r--r-- | h-source/Application/Views/Wiki/differences.php | 57 | ||||
-rw-r--r-- | h-source/Application/Views/Wiki/history.php | 86 | ||||
-rw-r--r-- | h-source/Application/Views/Wiki/page.php | 34 | ||||
-rw-r--r-- | h-source/Application/Views/Wiki/talk.php | 170 | ||||
-rw-r--r-- | h-source/Config/Route.php | 2 |
14 files changed, 300 insertions, 237 deletions
diff --git a/h-source/Application/Controllers/HistoryController.php b/h-source/Application/Controllers/HistoryController.php index 2154a0e..13d3b3a 100644 --- a/h-source/Application/Controllers/HistoryController.php +++ b/h-source/Application/Controllers/HistoryController.php @@ -104,7 +104,26 @@ class HistoryController extends BaseController 'error_string' => 'Error: the wiki page is already un-blocked', ), - + + 'pagehide' => array( + + 'action' => 'pagehide', + 'check_status' => 'no', + 'to_status' => 'yes', + 'exec_string' => 'The wiki page has been hidden. Just reload the page', + 'error_string' => 'Error: the wiki page is already hidden', + + ), + + 'pageshow' => array( + + 'action' => 'pageshow', + 'check_status' => 'yes', + 'to_status' => 'no', + 'exec_string' => 'The wiki page is no more hidden. Just reload the page', + 'error_string' => 'Error: the wiki page is already visible', + + ), ); protected $types = array( @@ -164,6 +183,7 @@ class HistoryController extends BaseController ), + //page blocked or not 'page' => array( 'clean_type' => 'page', @@ -174,6 +194,18 @@ class HistoryController extends BaseController 'group' => 'admin', ), + + //page deleted or not + 'page_del' => array( + + 'clean_type' => 'page_del', + 'model_name' => 'WikiModel', + 'id_name' => 'id_wiki', + 'field_name' => 'deleted', + 'actions' => array('pagehide','pageshow'), + 'group' => 'admin', + + ), ); public function __construct($model, $controller, $queryString) @@ -224,6 +256,16 @@ class HistoryController extends BaseController { $this->generic($lang, $token, 'pageunblock'); } + + public function pagehide($lang = 'en', $token = '') + { + $this->generic($lang, $token, 'pagehide'); + } + + public function pageshow($lang = 'en', $token = '') + { + $this->generic($lang, $token, 'pageshow'); + } protected function generic($lang = 'en', $token = '', $action = 'hide') { @@ -333,6 +375,10 @@ class HistoryController extends BaseController $data['object'] = 'wiki 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'; + break; case 'issue': $data['object'] = 'issue'; $data['box_class'] = 'details_of_actions_inner_user'; @@ -354,6 +400,8 @@ class HistoryController extends BaseController 'close' => 'closed', 'pageblock' => 'blocked', 'pageunblock' => 'un-blocked', + 'pagehide' => 'hidden', + 'pageshow' => 'restored', ); $this->append($data); diff --git a/h-source/Application/Controllers/WikiController.php b/h-source/Application/Controllers/WikiController.php index 65a615a..cc0c922 100644 --- a/h-source/Application/Controllers/WikiController.php +++ b/h-source/Application/Controllers/WikiController.php @@ -102,39 +102,34 @@ 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..'); + + if ($this->m['WikiModel']->isDeleted($clean['id_wiki'])) $this->redirect('wiki/page/'.$this->lang,2,'this page has been deleted..'); $deleted = $this->m['WikiModel']->select("wiki.deleted")->where(array("id_wiki"=>$clean['id_wiki']))->limit(1)->toList('wiki.deleted')->send(); - if (strcmp($deleted[0],'no') === 0) + $data['tree_name'] = $title; + + if (isset($_POST['updateAction'])) { - $data['tree_name'] = $title; + //carry out the update database action + $this->m['WikiModel']->updateTable('update'); - if (isset($_POST['updateAction'])) - { - //carry out the update database action - $this->m['WikiModel']->updateTable('update'); + $this->viewRedirect($this->m['WikiModel']->lastTitleClean); + } - $this->viewRedirect($this->m['WikiModel']->lastTitleClean); - } - - $data['notice'] = $this->m['WikiModel']->notice; - - $data['id_wiki'] = $clean['id_wiki']; - $data['submitName'] = "updateAction"; + $data['notice'] = $this->m['WikiModel']->notice; - $data['values'] = $this->m['WikiModel']->getFormValues('update','sanitizeHtml'); - $data['hiddenInput'] = "<input type='hidden' name='id_wiki' value='".$clean['id_wiki']."'>\n"; - - $this->append($data); + $data['id_wiki'] = $clean['id_wiki']; + $data['submitName'] = "updateAction"; - $this->load('form'); - $this->load('bottom_left'); - $this->right(); - } - else - { - $this->redirect($this->controller.'/page/'.$this->lang,2,'deleted..'); - } + $data['values'] = $this->m['WikiModel']->getFormValues('update','sanitizeHtml'); + $data['hiddenInput'] = "<input type='hidden' name='id_wiki' value='".$clean['id_wiki']."'>\n"; + + $this->append($data); + + $this->load('form'); + $this->load('bottom_left'); + $this->right(); } else { @@ -162,7 +157,7 @@ class WikiController extends BaseController $data['title'] = 'main page - '.Website::$generalName; $clean['title_clean'] = sanitizeAll($title_clean); - $data['isDeleted'] = 'no'; + $data['isDeleted'] = false; $data['isBlocked'] = false; if (isset($title_clean)) @@ -174,7 +169,7 @@ class WikiController extends BaseController $data['table'] = $res; $data['tree_name'] = $res[0]['wiki']['title']; $data['title'] = $res[0]['wiki']['title'] . ' - ' . Website::$generalName; - $data['isDeleted'] = $res[0]['wiki']['deleted']; + $data['isDeleted'] = $this->m['WikiModel']->isDeleted($res[0]['wiki']['id_wiki']);; $data['isBlocked'] = $this->m['WikiModel']->isBlocked($res[0]['wiki']['id_wiki']); if ( count($res) < 2 ) @@ -233,6 +228,7 @@ class WikiController extends BaseController $data['id'] = $clean['id']; $data['tree_name'] = $this->m['WikiModel']->getTheModelName($clean['id']); $data['isBlocked'] = $this->m['WikiModel']->isBlocked($clean['id']); + $data['isDeleted'] = $this->m['WikiModel']->isDeleted($clean['id']); $data['title'] = 'history - '.Website::$generalName; @@ -288,7 +284,7 @@ class WikiController extends BaseController $data['tree'] = null; $data['tree'] = null; $data['title'] = 'revision - '.Website::$generalName; - $data['isDeleted'] = 'no'; + $data['isDeleted'] = false; if (count($data['table']) > 0) { @@ -394,9 +390,8 @@ class WikiController extends BaseController if ($clean['id_wiki'] !== 0) { - $deleted = $this->m['WikiModel']->select("wiki.deleted")->where(array("id_wiki"=>$clean['id_wiki']))->limit(1)->toList('wiki.deleted')->send(); - - $data['isDeleted'] = $deleted[0]; + + $data['isDeleted'] = $this->m['WikiModel']->isDeleted($clean['id_wiki']); $data['id_rev'] = $clean['id_rev']; $data['id_wiki'] = $clean['id_wiki']; @@ -412,21 +407,16 @@ 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..'); + + if ($this->m['WikiModel']->isDeleted($clean['id_wiki'])) $this->redirect('wiki/page/'.$this->lang,2,'this page has been deleted..'); if (isset($_POST['confirmAction'])) { - if (strcmp($deleted[0],'no') === 0) - { - $this->m['WikiModel']->makeCurrent($clean['id_rev']); - - $this->viewRedirect($this->m['WikiModel']->lastTitleClean); - - $data['notice'] = $this->m['WikiModel']->notice; - } - else - { - $this->redirect($this->controller.'/page/'.$this->lang,2,'deleted..'); - } + $this->m['WikiModel']->makeCurrent($clean['id_rev']); + + $this->viewRedirect($this->m['WikiModel']->lastTitleClean); + + $data['notice'] = $this->m['WikiModel']->notice; } $this->append($data); @@ -453,6 +443,8 @@ class WikiController extends BaseController $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['isDeleted'] = $this->m['WikiModel']->isDeleted($clean['id_wiki']); + $data['tree'] = $this->getSpecPageLink() . " » " . $this->getViewLink($data['tree_name'])." » ".gtext('Talk'); if (isset($_POST['insertAction'])) @@ -462,6 +454,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..'); + + if ($this->m['WikiModel']->isDeleted($clean['id_wiki'])) $this->redirect('wiki/page/'.$this->lang,2,'this page has been deleted..'); $this->m['WikitalkModel']->values['created_by'] = $this->s['registered']->status['id_user']; $this->m['WikitalkModel']->values['id_wiki'] = $clean['id_wiki']; diff --git a/h-source/Application/Include/hardware.php b/h-source/Application/Include/hardware.php index 42cce0b..f10993b 100644 --- a/h-source/Application/Include/hardware.php +++ b/h-source/Application/Include/hardware.php @@ -249,7 +249,8 @@ class Videocard extends Hardware "ATI" => "ATI", "NVIDIA" => "NVIDIA", "Intel" => "Intel", - "SiS" => "SiS", + "Silicon Integrated Systems Corp" => "Silicon-Integrated-Systems-Corp", + "VIA Technologies, Inc" => "VIA-Technologies-Inc", ); public static $videoSelect = array( diff --git a/h-source/Application/Include/languages.php b/h-source/Application/Include/languages.php index 0a8a728..6a9d9ec 100644 --- a/h-source/Application/Include/languages.php +++ b/h-source/Application/Include/languages.php @@ -190,7 +190,7 @@ class Lang "I want to make this revision the current revision" => "Voglio che questa revisione diventi quella corrente", "Confirm" => "Conferma", "Make this revision the current revision of the page" => "Rendi questa revisione la revisione corrente della pagina", - "This wiki page has been hidden" => "Questa pagina della wiki è stata nascosta", + "This wiki page has been deleted" => "Questa pagina della wiki è stata cancellata", "Talk" => "Discussione", "Talk page of the wiki page" => "Pagina di discussione della pagina della wiki", "a page with the same title already exists" => "esiste già una pagina con questo titolo", diff --git a/h-source/Application/Include/myFunctions.php b/h-source/Application/Include/myFunctions.php index d2b54e7..d731062 100644 --- a/h-source/Application/Include/myFunctions.php +++ b/h-source/Application/Include/myFunctions.php @@ -444,6 +444,7 @@ function betterVendor($string) "iMicro-Electronics" => "iMicro Electronics", "Active-Pixel" => "Active Pixel", "Microdia-Ltd" => "Microdia Ltd", + "Silicon-Integrated-Systems-Corp" => "Silicon Integrated Systems Corp", ); return (array_key_exists($string,$names)) ? $names[$string] : $string; diff --git a/h-source/Application/Models/WikiModel.php b/h-source/Application/Models/WikiModel.php index 6cdc632..2ee7505 100644 --- a/h-source/Application/Models/WikiModel.php +++ b/h-source/Application/Models/WikiModel.php @@ -267,9 +267,9 @@ class WikiModel extends Model_Map { $res = $this->select('wiki.deleted')->where(array('id_wiki'=>$clean['id']))->send(); if ( count($res) > 0 ) { - return $res[0]['wiki']['deleted']; + return strcmp($res[0]['wiki']['deleted'],'no') === 0 ? false : true; } - return 'no'; + return false; } public function isBlocked($id) diff --git a/h-source/Application/Views/Videocards/catalogue.php b/h-source/Application/Views/Videocards/catalogue.php index ff9b7fd..3f77e15 100644 --- a/h-source/Application/Views/Videocards/catalogue.php +++ b/h-source/Application/Views/Videocards/catalogue.php @@ -50,7 +50,7 @@ <div class="notebook_vendor"> <div class="inner_label"><?php echo gtext("vendor");?>:</div> - <div class="inner_value"><?php echo $item['hardware']['vendor'];?></div> + <div class="inner_value"><?php echo betterVendor($item['hardware']['vendor']);?></div> </div> <div class="notebook_vendor"> diff --git a/h-source/Application/Views/Videocards/page.php b/h-source/Application/Views/Videocards/page.php index 68612ad..a9a9b3d 100644 --- a/h-source/Application/Views/Videocards/page.php +++ b/h-source/Application/Views/Videocards/page.php @@ -45,7 +45,7 @@ <div class="notebook_vendor"> <div class="inner_label"><?php echo gtext("vendor");?>:</div> - <div class="inner_value"><b><?php echo $item[$tableName]['vendor'];?></b></div> + <div class="inner_value"><b><?php echo betterVendor($item[$tableName]['vendor']);?></b></div> </div> <div class="notebook_vendor"> diff --git a/h-source/Application/Views/Wiki/climb.php b/h-source/Application/Views/Wiki/climb.php index bd502d1..c648e7f 100644 --- a/h-source/Application/Views/Wiki/climb.php +++ b/h-source/Application/Views/Wiki/climb.php @@ -21,30 +21,32 @@ ?> <div id="left"> - <div class="position_tree_box"> - <a href="<?php echo $this->baseUrl."/home/index/$lang";?>">Home</a> » <?php echo $tree;?> - </div> - - <div class="notebook_view_title"> - <?php echo gtext('Make this revision the current revision of the page'); ?> <b><?php echo $tree_name;?></b> - </div> - - <div class="notebook_insert_link"> - <a title="Back to the history of the page <?php echo $tree_name;?>" href="<?php echo $this->baseUrl."/".$this->controller."/history/$lang/".$id_wiki.$this->viewStatus;?>"><img class="top_left_images" src="<?php echo $this->baseUrl;?>/Public/Img/back-60.png"></a> - </div> + <?php if (!$isDeleted) { ?> - <div class="wiki_external_box"> + <div class="position_tree_box"> + <a href="<?php echo $this->baseUrl."/home/index/$lang";?>">Home</a> » <?php echo $tree;?> + </div> - <?php echo $notice;?> + <div class="notebook_view_title"> + <?php echo gtext('Make this revision the current revision of the page'); ?> <b><?php echo $tree_name;?></b> + </div> - <div class="climb_form_ext_box"> + <div class="notebook_insert_link"> + <a title="Back to the history of the page <?php echo $tree_name;?>" href="<?php echo $this->baseUrl."/".$this->controller."/history/$lang/".$id_wiki.$this->viewStatus;?>"><img class="top_left_images" src="<?php echo $this->baseUrl;?>/Public/Img/back-60.png"></a> + </div> - <?php if (strcmp($isDeleted,'no') === 0 ) { ?> - <form action="<?php echo $this->currPage."/$lang/$id_rev"; ?>" method="POST"> - <?php echo gtext('I want to make this revision the current revision');?>: <input type="submit" name="confirmAction" value="<?php echo gtext('Confirm');?>"> - </form> - <?php } ?> + <div class="wiki_external_box"> - </div> + <?php echo $notice;?> - </div>
\ No newline at end of file + <div class="climb_form_ext_box"> + + <form action="<?php echo $this->currPage."/$lang/$id_rev"; ?>" method="POST"> + <?php echo gtext('I want to make this revision the current revision');?>: <input type="submit" name="confirmAction" value="<?php echo gtext('Confirm');?>"> + </form> + + </div> + + </div> + + <?php } ?>
\ No newline at end of file diff --git a/h-source/Application/Views/Wiki/differences.php b/h-source/Application/Views/Wiki/differences.php index 1709cbf..ee7a795 100644 --- a/h-source/Application/Views/Wiki/differences.php +++ b/h-source/Application/Views/Wiki/differences.php @@ -21,41 +21,44 @@ ?> <div id="left"> - - <div class="position_tree_box"> - <a href="<?php echo $this->baseUrl."/home/index/$lang";?>">Home</a> » <?php echo $tree;?> - </div> - - <?php if ($showDiff === true) { ?> - <div class="notebook_view_title"> - Differences between the revision of <b><?php echo smartDate($update_new);?></b>, created by <b><?php echo getLinkToUser($u->getUser($created_by));?></b>, and the revision of <b><?php echo smartDate($update_old);?></b> - </div> - <?php } ?> - - <div class="notebook_insert_link"> - <a title="Back to the history of the page <?php echo $tree_name;?>" href="<?php echo $this->baseUrl."/".$this->controller."/history/$lang/".$id_wiki.$this->viewStatus;?>"><img class="top_left_images" src="<?php echo $this->baseUrl;?>/Public/Img/back-60.png"></a> - </div> + + <?php if (!$isDeleted) { ?> - <div class="wiki_external_box"> + <div class="position_tree_box"> + <a href="<?php echo $this->baseUrl."/home/index/$lang";?>">Home</a> » <?php echo $tree;?> + </div> - <div class="diff_color_notice"> - <b>Notice</b>: the text in <del>red</del> has been deleted from the previous revision, the text in <ins>green</ins> has been added in this revision and the text in <span class="gray_text_notice">gray</span> has not been changed. + <?php if ($showDiff === true) { ?> + <div class="notebook_view_title"> + Differences between the revision of <b><?php echo smartDate($update_new);?></b>, created by <b><?php echo getLinkToUser($u->getUser($created_by));?></b>, and the revision of <b><?php echo smartDate($update_old);?></b> </div> + <?php } ?> - <?php foreach ($diffArray as $label => $text) { ?> + <div class="notebook_insert_link"> + <a title="Back to the history of the page <?php echo $tree_name;?>" href="<?php echo $this->baseUrl."/".$this->controller."/history/$lang/".$id_wiki.$this->viewStatus;?>"><img class="top_left_images" src="<?php echo $this->baseUrl;?>/Public/Img/back-60.png"></a> + </div> - <div class="diff_ext_box"> + <div class="wiki_external_box"> - <div class="diff_item_label"> - <?php echo gtext("differences in the entry");?>: <b><?php echo $label;?></b> + <div class="diff_color_notice"> + <b>Notice</b>: the text in <del>red</del> has been deleted from the previous revision, the text in <ins>green</ins> has been added in this revision and the text in <span class="gray_text_notice">gray</span> has not been changed. </div> - <div class="diff_item_text"> - <?php echo in_array($label,$fieldsWithBreaks) ? nl2br($text) : $text;?> - </div> + <?php foreach ($diffArray as $label => $text) { ?> - </div> + <div class="diff_ext_box"> - <?php } ?> + <div class="diff_item_label"> + <?php echo gtext("differences in the entry");?>: <b><?php echo $label;?></b> + </div> + + <div class="diff_item_text"> + <?php echo in_array($label,$fieldsWithBreaks) ? nl2br($text) : $text;?> + </div> + + </div> - </div> + <?php } ?> + + </div> + <?php } ?> diff --git a/h-source/Application/Views/Wiki/history.php b/h-source/Application/Views/Wiki/history.php index ec394f4..b2e2ab5 100644 --- a/h-source/Application/Views/Wiki/history.php +++ b/h-source/Application/Views/Wiki/history.php @@ -22,49 +22,53 @@ <div id="left"> - <div class="position_tree_box"> - <a href="<?php echo $this->baseUrl."/home/index/$lang";?>">Home</a> » <a href="<?php echo $this->baseUrl."/wiki/page/$lang";?>">Wiki</a> » <a href="<?php echo $this->baseUrl."/wiki/page/$lang/".encodeUrl($tree_name);?>"><?php echo $tree_name;?></a> » <?php echo gtext('History');?> - </div> - - <div class="notebook_view_title"> - <?php echo gtext('History of the wiki page'); ?> <b><?php echo $tree_name;?></b> - </div> - - <div class="notebook_insert_link"> - <a title="Back to the page <?php echo $tree_name;?>" href="<?php echo $this->baseUrl."/".$this->controller."/page/$lang/".encodeUrl($tree_name);?>"><img class="top_left_images" src="<?php echo $this->baseUrl;?>/Public/Img/back-60.png"></a> - </div> + <?php if (!$isDeleted) { ?> - <div class="wiki_external_box"> - - <ul class="page_history"> - - <?php if ($this->viewArgs['page'] === 1) { ?> - <?php foreach ($rev1 as $rev) { ?> - <li class="page_history_current_item"><b><?php echo gtext("Current revision");?>:</b> <?php echo smartDate($rev['wiki']['update_date']);?> by <?php echo $u->getLinkToUserFromId($rev['wiki']['created_by']);?> (<a href="<?php echo $this->baseUrl."/".$this->controller."/differences/$lang/$id/0".$this->viewStatus;?>">diff</a>)</li> - <?php } ?> - <?php } ?> - - <?php foreach ($rev2 as $rev) { ?> - <li class="page_history_item"> - - <a href="<?php echo $this->baseUrl."/".$this->controller."/revision/$lang/".$rev['wiki_revisions']['id_rev'].$this->viewStatus;?>"><?php echo smartDate($rev['wiki_revisions']['update_date']);?></a> by <?php echo $u->getLinkToUserFromId($rev['wiki_revisions']['created_by']);?> - - <?php if (strcmp($rev['wiki_revisions']['id_rev'],$firstRev) !== 0) {?> - (<a href="<?php echo $this->baseUrl."/".$this->controller."/differences/$lang/$id/".$rev['wiki_revisions']['id_rev'].$this->viewStatus;?>">diff</a>) + <div class="position_tree_box"> + <a href="<?php echo $this->baseUrl."/home/index/$lang";?>">Home</a> » <a href="<?php echo $this->baseUrl."/wiki/page/$lang";?>">Wiki</a> » <a href="<?php echo $this->baseUrl."/wiki/page/$lang/".encodeUrl($tree_name);?>"><?php echo $tree_name;?></a> » <?php echo gtext('History');?> + </div> + + <div class="notebook_view_title"> + <?php echo gtext('History of the wiki page'); ?> <b><?php echo $tree_name;?></b> + </div> + + <div class="notebook_insert_link"> + <a title="Back to the page <?php echo $tree_name;?>" href="<?php echo $this->baseUrl."/".$this->controller."/page/$lang/".encodeUrl($tree_name);?>"><img class="top_left_images" src="<?php echo $this->baseUrl;?>/Public/Img/back-60.png"></a> + </div> + + <div class="wiki_external_box"> + + <ul class="page_history"> + + <?php if ($this->viewArgs['page'] === 1) { ?> + <?php foreach ($rev1 as $rev) { ?> + <li class="page_history_current_item"><b><?php echo gtext("Current revision");?>:</b> <?php echo smartDate($rev['wiki']['update_date']);?> by <?php echo $u->getLinkToUserFromId($rev['wiki']['created_by']);?> (<a href="<?php echo $this->baseUrl."/".$this->controller."/differences/$lang/$id/0".$this->viewStatus;?>">diff</a>)</li> + <?php } ?> <?php } ?> - - <?php if ($islogged === 'yes' and !$isBlocked) { ?> - (<a href="<?php echo $this->baseUrl.'/'.$this->controller.'/climb/'.$lang.'/'.$rev['wiki_revisions']['id_rev'].$this->viewStatus;?>"><?php echo gtext('Make current'); ?></a>) + + <?php foreach ($rev2 as $rev) { ?> + <li class="page_history_item"> + + <a href="<?php echo $this->baseUrl."/".$this->controller."/revision/$lang/".$rev['wiki_revisions']['id_rev'].$this->viewStatus;?>"><?php echo smartDate($rev['wiki_revisions']['update_date']);?></a> by <?php echo $u->getLinkToUserFromId($rev['wiki_revisions']['created_by']);?> + + <?php if (strcmp($rev['wiki_revisions']['id_rev'],$firstRev) !== 0) {?> + (<a href="<?php echo $this->baseUrl."/".$this->controller."/differences/$lang/$id/".$rev['wiki_revisions']['id_rev'].$this->viewStatus;?>">diff</a>) + <?php } ?> + + <?php if ($islogged === 'yes' and !$isBlocked) { ?> + (<a href="<?php echo $this->baseUrl.'/'.$this->controller.'/climb/'.$lang.'/'.$rev['wiki_revisions']['id_rev'].$this->viewStatus;?>"><?php echo gtext('Make current'); ?></a>) + <?php } ?> + + </li> <?php } ?> - - </li> - <?php } ?> - - </ul> + + </ul> + + </div> + + <div class="history_page_list"> + <?php echo gtext("page list");?>: <?php echo $pageList;?> + </div> - </div> - - <div class="history_page_list"> - <?php echo gtext("page list");?>: <?php echo $pageList;?> - </div> + <?php } ?> diff --git a/h-source/Application/Views/Wiki/page.php b/h-source/Application/Views/Wiki/page.php index d386704..1580d67 100644 --- a/h-source/Application/Views/Wiki/page.php +++ b/h-source/Application/Views/Wiki/page.php @@ -57,16 +57,18 @@ <div class="view_page_back_button"> <a title="Insert a new wiki page" href="<?php echo $this->baseUrl."/".$this->controller."/insert/$lang";?>"><img class="top_left_images" src="<?php echo $this->baseUrl;?>/Public/Img/new-60.png"></a> </div> - - <div class="view_page_history_button"> - <a title="talk page" href="<?php echo $this->baseUrl."/".$this->controller."/talk/$lang/$id_wiki";?>"><img class="top_left_note_image" src="<?php echo $this->baseUrl;?>/Public/Img/talk-60.png"></a> - </div> - <div class="view_page_history_button"> - <a title="history page" href="<?php echo $this->baseUrl."/".$this->controller."/history/$lang/$id_wiki";?>"><img class="top_left_note_image" src="<?php echo $this->baseUrl;?>/Public/Img/history-60.png"></a> - </div> + <?php if (!$isDeleted) { ?> + <div class="view_page_history_button"> + <a title="talk page" href="<?php echo $this->baseUrl."/".$this->controller."/talk/$lang/$id_wiki";?>"><img class="top_left_note_image" src="<?php echo $this->baseUrl;?>/Public/Img/talk-60.png"></a> + </div> + + <div class="view_page_history_button"> + <a title="history page" href="<?php echo $this->baseUrl."/".$this->controller."/history/$lang/$id_wiki";?>"><img class="top_left_note_image" src="<?php echo $this->baseUrl;?>/Public/Img/history-60.png"></a> + </div> + <?php } ?> - <?php if (strcmp($isDeleted,'no') === 0 and !$isBlocked) { ?> + <?php if (!$isDeleted and !$isBlocked) { ?> <div class="view_page_update_button"> <form action="<?php echo $this->baseUrl."/".$this->controller."/update/$lang";?>" method="POST"> <input title="edit page" class="update_submit_class" type="image" src="<?php echo $this->baseUrl;?>/Public/Img/edit-60.png" value="xedit"> @@ -76,10 +78,12 @@ <?php } ?> </div> - <div class="talk_numb_ext_wiki"> - <a href="<?php echo $this->baseUrl."/".$this->controller."/talk/$lang/$id_wiki";?>">talk messages: <?php echo $talk_number;?></a> - </div> - + <?php if (!$isDeleted) { ?> + <div class="talk_numb_ext_wiki"> + <a href="<?php echo $this->baseUrl."/".$this->controller."/talk/$lang/$id_wiki";?>">talk messages: <?php echo $talk_number;?></a> + </div> + <?php } ?> + <?php } else if ( strcmp($this->action,'revision') === 0 ) { ?> <div class="position_tree_box"> @@ -98,15 +102,15 @@ <div class="wiki_external_box"> - <?php if ( strcmp($isDeleted,'yes') === 0 ) { ?> + <?php if ( $isDeleted ) { ?> <div class="revision_alert"> - <?php echo gtext('This wiki page has been hidden'); ?> + <?php echo gtext('This wiki page has been deleted'); ?> </div> <?php } ?> - <?php if ( strcmp($isDeleted,'no') === 0) { ?> + <?php if (!$isDeleted) { ?> <!--if revision--> <?php if (strcmp($this->action,'revision') === 0) { ?> diff --git a/h-source/Application/Views/Wiki/talk.php b/h-source/Application/Views/Wiki/talk.php index 724b273..3e26527 100644 --- a/h-source/Application/Views/Wiki/talk.php +++ b/h-source/Application/Views/Wiki/talk.php @@ -44,126 +44,130 @@ <a title="Back to the page <?php echo $tree_name;?>" href="<?php echo $this->baseUrl."/".$this->controller."/page/$lang/".encodeUrl($tree_name);?>"><img class="top_left_images" src="<?php echo $this->baseUrl;?>/Public/Img/back-60.png"></a> </div> - <?php if (!$isBlocked) { ?> - - <div class="wiki_external_box"> + <?php if (!$isDeleted) { ?> + <?php if (!$isBlocked) { ?> - <?php foreach ($table as $message) { ?> + <div class="wiki_external_box"> - <?php if (strcmp($message['wiki_talk']['deleted'],'no') === 0) { ?> + <?php foreach ($table as $message) { ?> - <a name="wiki-talk-<?php echo $message['wiki_talk']['id_talk'];?>"></a> - <div class="talk_message_item"> + <?php if (strcmp($message['wiki_talk']['deleted'],'no') === 0) { ?> - <div class="talk_message_item_title_date"> - <?php if ($ismoderator) { ?> - <a id="<?php echo $message['wiki_talk']['id_talk'];?>" class="hide_wiki_talk hide_general" href="<?php echo $this->baseUrl."/home/index/$lang";?>"><img src="<?php echo $this->baseUrl;?>/Public/Img/Crystal/button_cancel.png">hide</a> - <?php } ?> + <a name="wiki-talk-<?php echo $message['wiki_talk']['id_talk'];?>"></a> + <div class="talk_message_item"> + + <div class="talk_message_item_title_date"> + <?php if ($ismoderator) { ?> + <a id="<?php echo $message['wiki_talk']['id_talk'];?>" class="hide_wiki_talk hide_general" href="<?php echo $this->baseUrl."/home/index/$lang";?>"><img src="<?php echo $this->baseUrl;?>/Public/Img/Crystal/button_cancel.png">hide</a> + <?php } ?> + + <div class="talk_message_item_title"> + <?php echo $message['wiki_talk']['title'];?> + </div> - <div class="talk_message_item_title"> - <?php echo $message['wiki_talk']['title'];?> + <div class="talk_message_item_date"> + by <?php echo getLinkToUser($u->getUser($message['wiki_talk']['created_by']));?>, <?php echo smartDate($message['wiki_talk']['creation_date']);?> + </div> </div> - <div class="talk_message_item_date"> - by <?php echo getLinkToUser($u->getUser($message['wiki_talk']['created_by']));?>, <?php echo smartDate($message['wiki_talk']['creation_date']);?> + <div class="talk_message_item_content"> + <?php echo decodeWikiText($message['wiki_talk']['message']);?> </div> - </div> - <div class="talk_message_item_content"> - <?php echo decodeWikiText($message['wiki_talk']['message']);?> - </div> + <?php if ($ismoderator) { ?> + <!--view details--> + <div class="show_hidden_box_ext"> + <div class="md_type">wiki_talk</div> + <a id="<?php echo $message['wiki_talk']['id_talk'];?>" class="hidden_message_view_details" href="<?php echo $this->baseUrl."/home/index/$lang";?>">view details</a> + <div class="moderation_details_box"></div> + </div> + <?php } ?> - <?php if ($ismoderator) { ?> - <!--view details--> - <div class="show_hidden_box_ext"> - <div class="md_type">wiki_talk</div> - <a id="<?php echo $message['wiki_talk']['id_talk'];?>" class="hidden_message_view_details" href="<?php echo $this->baseUrl."/home/index/$lang";?>">view details</a> - <div class="moderation_details_box"></div> </div> - <?php } ?> - - </div> - - <?php } else { ?> - - <?php if ($ismoderator) { ?> - <a name="wiki-talk-<?php echo $message['wiki_talk']['id_talk'];?>"></a> - <div class="talk_message_item_hidden"> - this message has been deleted - <a id="<?php echo $message['wiki_talk']['id_talk'];?>" class="show_wiki_talk hide_general" href="<?php echo $this->baseUrl."/home/index/$lang";?>"><img src="<?php echo $this->baseUrl;?>/Public/Img/Crystal/button_ok.png">make visible</a> + <?php } else { ?> - <!--view details--> - <div class="show_hidden_box_ext"> - <div class="md_type">wiki_talk</div> - - <a id="<?php echo $message['wiki_talk']['id_talk'];?>" class="hidden_message_view_details" href="<?php echo $this->baseUrl."/home/index/$lang";?>">view details</a> - - <div class="details_of_hidden_message"> - <div class="details_of_hidden_message_inner"> - <div class="talk_message_item_date"> - submitted by <?php echo getLinkToUser($u->getUser($message['wiki_talk']['created_by']));?>, <?php echo smartDate($message['wiki_talk']['creation_date']);?> - </div> - <div class="message_view_description_hidden"> - <?php echo decodeWikiText($message['wiki_talk']['message']);?> + <?php if ($ismoderator) { ?> + <a name="wiki-talk-<?php echo $message['wiki_talk']['id_talk'];?>"></a> + <div class="talk_message_item_hidden"> + this message has been deleted + + <a id="<?php echo $message['wiki_talk']['id_talk'];?>" class="show_wiki_talk hide_general" href="<?php echo $this->baseUrl."/home/index/$lang";?>"><img src="<?php echo $this->baseUrl;?>/Public/Img/Crystal/button_ok.png">make visible</a> + + <!--view details--> + <div class="show_hidden_box_ext"> + <div class="md_type">wiki_talk</div> + + <a id="<?php echo $message['wiki_talk']['id_talk'];?>" class="hidden_message_view_details" href="<?php echo $this->baseUrl."/home/index/$lang";?>">view details</a> + + <div class="details_of_hidden_message"> + <div class="details_of_hidden_message_inner"> + <div class="talk_message_item_date"> + submitted by <?php echo getLinkToUser($u->getUser($message['wiki_talk']['created_by']));?>, <?php echo smartDate($message['wiki_talk']['creation_date']);?> + </div> + <div class="message_view_description_hidden"> + <?php echo decodeWikiText($message['wiki_talk']['message']);?> + </div> </div> + <div class="moderation_details_box"></div> </div> - <div class="moderation_details_box"></div> </div> - </div> - </div> + </div> + <?php } ?> + <?php } ?> <?php } ?> + </div> - <?php } ?> - </div> + <?php if ($islogged === 'yes') { ?> - <?php if ($islogged === 'yes') { ?> + <div class="talk_form_external_box"> + <div class="talk_login_notice"> + <a name="form">Add a message</a> + </div> - <div class="talk_form_external_box"> - <div class="talk_login_notice"> - <a name="form">Add a message</a> - </div> + <?php echo $notice;?> - <?php echo $notice;?> + <div class="notebooks_insert_form"> + <form action="<?php echo $this->baseUrl."/".$this->controller."/talk/$lang/$id_wiki";?>#form" method="POST"> - <div class="notebooks_insert_form"> - <form action="<?php echo $this->baseUrl."/".$this->controller."/talk/$lang/$id_wiki";?>#form" method="POST"> + <div class="edit_form"> - <div class="edit_form"> + <div class="form_entry"> + <div class="entry_label">Title:</div> + <?php echo Html_Form::input('title',$values['title'],'talk_input_entry');?> + </div> - <div class="form_entry"> - <div class="entry_label">Title:</div> - <?php echo Html_Form::input('title',$values['title'],'talk_input_entry');?> - </div> + <div class="form_entry"> + <div class="entry_label">Message:</div> + <?php echo Html_Form::textarea('message',$values['message'],'talk_textarea_entry','bb_code');?> + </div> + + <input type="submit" name="insertAction" value="Save"> - <div class="form_entry"> - <div class="entry_label">Message:</div> - <?php echo Html_Form::textarea('message',$values['message'],'talk_textarea_entry','bb_code');?> </div> - <input type="submit" name="insertAction" value="Save"> + </form> + </div> + </div> - </div> + <?php } else { ?> - </form> + <div class="talk_login_notice"> + <a name="form"><?php echo gtext("You have to");?> <a href="<?php echo $this->baseUrl."/users/login/$lang?redirect=".$currPos.$queryString;?>">login</a> <?php echo gtext("in order to add a message");?></a> </div> - </div> - <?php } else { ?> + <?php } ?> - <div class="talk_login_notice"> - <a name="form"><?php echo gtext("You have to");?> <a href="<?php echo $this->baseUrl."/users/login/$lang?redirect=".$currPos.$queryString;?>">login</a> <?php echo gtext("in order to add a message");?></a> + <?php } else { ?> + <!--is blocked--> + <div class="wiki_external_box"> + <?php echo gtext('This wiki page has been blocked'); ?> </div> - <?php } ?> - - <?php } else { ?> - <div class="wiki_external_box"> - <?php echo gtext('This wiki page has been blocked'); ?> - </div> + <!--close deleted--> <?php } ?> </div>
\ No newline at end of file diff --git a/h-source/Config/Route.php b/h-source/Config/Route.php index 31a5238..5d65567 100644 --- a/h-source/Config/Route.php +++ b/h-source/Config/Route.php @@ -108,6 +108,8 @@ class Route 'history,pageblock', 'history,pageunblock', 'history,viewall', + 'history,pagehide', + 'history,pageshow', 'threegcards,catalogue', 'threegcards,view', 'threegcards,history', |