diff options
author | Antonio Gallo <tonicucoz@gmail.com> | 2011-10-25 22:52:38 +0000 |
---|---|---|
committer | Antonio Gallo <tonicucoz@gmail.com> | 2011-10-25 22:52:38 +0000 |
commit | d67f5736dfbec2b769e98dd17f34137b9feec1fc (patch) | |
tree | bfb72d575c958957f3e722de05068b664d4fbe3f | |
parent | 94a0a341180376096f8be03261051ccd4f5fe083 (diff) |
improved wiki (TOC and moderator box)
-rw-r--r-- | h-source/Application/Controllers/HistoryController.php | 1 | ||||
-rw-r--r-- | h-source/Application/Include/wikiFormatting.php | 17 | ||||
-rw-r--r-- | h-source/Application/Views/Wiki/page.php | 112 | ||||
-rw-r--r-- | h-source/Public/Css/main.css | 17 |
4 files changed, 68 insertions, 79 deletions
diff --git a/h-source/Application/Controllers/HistoryController.php b/h-source/Application/Controllers/HistoryController.php index fac65c0..e50b7e1 100644 --- a/h-source/Application/Controllers/HistoryController.php +++ b/h-source/Application/Controllers/HistoryController.php @@ -298,6 +298,7 @@ class HistoryController extends BaseController 'field_name' => 'blocked', 'actions' => array('pageblock','pageunblock'), 'group' => 'admin', + 'types_to_show' => 'page,page_del', ), diff --git a/h-source/Application/Include/wikiFormatting.php b/h-source/Application/Include/wikiFormatting.php index 40b7f34..0bcc932 100644 --- a/h-source/Application/Include/wikiFormatting.php +++ b/h-source/Application/Include/wikiFormatting.php @@ -82,11 +82,11 @@ function decodeWikiText($string) if ($decodeAnotherTime and $decodeCounter<=30) { - return decodeWikiText(Toc::render().Tabs::render().$string); + return decodeWikiText(Tabs::render().$string); } else { - return Toc::render().Tabs::render().$string; + return Tabs::render().$string; } } @@ -180,14 +180,14 @@ function createNode($match,$hnodeTag,$htmlTagBegin,$htmlTagEng) } else { +// $decodeAnotherTime = false; return $htmlTagBegin.$match[2].$htmlTagEng; } } function createToc($match) { - Toc::create(); - return null; + return Toc::render(); } //table of contents @@ -199,7 +199,7 @@ class Toc private static $html = null; - public function create() + public function render() { $c=0; foreach (self::$links as $link) @@ -255,12 +255,7 @@ class Toc $res[] = "</ul></div>"; } self::$links = array(); - self::$html = implode('',$res); - } - - public function render() - { - echo self::$html; + return implode('',$res); } } diff --git a/h-source/Application/Views/Wiki/page.php b/h-source/Application/Views/Wiki/page.php index c0cfa8b..afff4bd 100644 --- a/h-source/Application/Views/Wiki/page.php +++ b/h-source/Application/Views/Wiki/page.php @@ -22,14 +22,55 @@ <div id="left"> - <?php $tableName = strcmp($this->action,'page') === 0 ? 'wiki' : 'wiki_revisions'; ?> + <?php + $tableName = strcmp($this->action,'page') === 0 ? 'wiki' : 'wiki_revisions'; + $displayClass = ($isDeleted) ? 'display_none' : null; + ?> <?php if ( strcmp($this->action,'page') === 0 ) { ?> - + <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/Main-Page";?>">Wiki</a> » <?php echo $tree_name;?> </div> + <!--block the page--> + <?php if ($isadmin) { ?> + <div class="moderator_box_deleted"> + <?php if ($isBlocked) { ?> + <?php echo gtext('This wiki page has been blocked'); ?> + + <a id="<?php echo $id_wiki;?>" class="pageunblock_page block_general" href="<?php echo $this->baseUrl."/home/index/$lang";?>"><img src="<?php echo $this->baseUrl;?>/Public/Img/Crystal/unlock.png"><?php echo gtext('unblock the wiki page'); ?></a> + + <?php } else { ?> + + <a id="<?php echo $id_wiki;?>" class="pageblock_page block_general" href="<?php echo $this->baseUrl."/home/index/$lang";?>"><img src="<?php echo $this->baseUrl;?>/Public/Img/Crystal/lock.png"><?php echo gtext('block the wiki page'); ?></a> + + <?php } ?> + + <?php if ($isDeleted) { ?> + <div class="wiki_hidden_notice"><?php echo gtext('This wiki page has been deleted'); ?></div> + + <a id="<?php echo $id_wiki;?>" class="pageshow_page_del block_general" href="<?php echo $this->baseUrl."/home/index/$lang";?>"><img src="<?php echo $this->baseUrl;?>/Public/Img/Crystal/button_ok.png"><?php echo gtext('restore the wiki page'); ?></a> + + <?php } else { ?> + + <a id="<?php echo $id_wiki;?>" class="pagehide_page_del block_general" href="<?php echo $this->baseUrl."/home/index/$lang";?>"><img src="<?php echo $this->baseUrl;?>/Public/Img/Crystal/button_cancel.png"><?php echo gtext('delete the wiki page'); ?></a> + + <?php } ?> + + <!--view details--> + <div class="show_hidden_box_ext"> + <div class="md_type">page</div> + <?php if ($isDeleted) { ?> + <a class="hidden_message_view_page" href="<?php echo $this->baseUrl."/home/index/$lang";?>"><?php echo gtext("see the page");?></a> | + <?php } ?> + <a id="<?php echo $id_wiki;?>" class="hidden_message_view_details" href="<?php echo $this->baseUrl."/home/index/$lang";?>">view details</a> + <div class="moderation_details_box"></div> + </div> + + </div> + <?php } ?> + <div class="notebook_insert_link"> <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> @@ -77,15 +118,9 @@ <?php } ?> - <div class="wiki_external_box"> - - <?php if ( $isDeleted ) { ?> - - <div class="revision_alert"> - <?php echo gtext('This wiki page has been deleted'); ?> - </div> + <div class="wiki_external_box <?php echo $displayClass;?>"> - <?php } else { ?> + <?php if (!$isDeleted or $isadmin) { ?> <!--if revision--> <?php if (strcmp($this->action,'revision') === 0) { ?> @@ -112,59 +147,8 @@ </div> - <?php if ( strcmp($this->action,'page') === 0 ) { ?> - <!--block the page--> - <?php if ($isadmin) { ?> - <div class="moderator_box"> - <?php if ($isBlocked) { ?> - <?php echo gtext('This wiki page has been blocked'); ?> - - <a id="<?php echo $id_wiki;?>" class="pageunblock_page block_general" href="<?php echo $this->baseUrl."/home/index/$lang";?>"><img src="<?php echo $this->baseUrl;?>/Public/Img/Crystal/unlock.png"><?php echo gtext('unblock the wiki page'); ?></a> - - <?php } else { ?> - - <a id="<?php echo $id_wiki;?>" class="pageblock_page block_general" href="<?php echo $this->baseUrl."/home/index/$lang";?>"><img src="<?php echo $this->baseUrl;?>/Public/Img/Crystal/lock.png"><?php echo gtext('block the wiki page'); ?></a> - - <?php } ?> - - <!--view details--> - <div class="show_hidden_box_ext"> - <div class="md_type">page</div> - <a id="<?php echo $id_wiki;?>" class="hidden_message_view_details" href="<?php echo $this->baseUrl."/home/index/$lang";?>">view details</a> - <div class="moderation_details_box"></div> - </div> - - </div> - <?php } ?> - - <!--delete the page--> - <?php if ($isadmin) { ?> - <div class="moderator_box_deleted"> - <?php if ($isDeleted) { ?> - <?php echo gtext('This wiki page has been deleted'); ?> - - <a id="<?php echo $id_wiki;?>" class="pageshow_page_del block_general" href="<?php echo $this->baseUrl."/home/index/$lang";?>"><img src="<?php echo $this->baseUrl;?>/Public/Img/Crystal/button_ok.png"><?php echo gtext('restore the wiki page'); ?></a> - - <?php } else { ?> - - <a id="<?php echo $id_wiki;?>" class="pagehide_page_del block_general" href="<?php echo $this->baseUrl."/home/index/$lang";?>"><img src="<?php echo $this->baseUrl;?>/Public/Img/Crystal/button_cancel.png"><?php echo gtext('delete the wiki page'); ?></a> - - <?php } ?> - - <!--view details--> - <div class="show_hidden_box_ext"> - <div class="md_type">page_del</div> - <a id="<?php echo $id_wiki;?>" class="hidden_message_view_details" href="<?php echo $this->baseUrl."/home/index/$lang";?>">view details</a> - <div class="details_of_hidden_message"> - <?php foreach ($table as $page) { ?> - <div class="wiki_page_content"> - <?php echo decodeWikiText($page[$tableName]['page'])?> - </div> - <?php } ?> - <div class="moderation_details_box"></div> - </div> - </div> - + <?php if ($isDeleted) { ?> + <div class="revision_alert"> + <?php echo gtext('This wiki page has been deleted'); ?> </div> - <?php } ?> <?php } ?> diff --git a/h-source/Public/Css/main.css b/h-source/Public/Css/main.css index 93f5783..c06058e 100644 --- a/h-source/Public/Css/main.css +++ b/h-source/Public/Css/main.css @@ -493,6 +493,7 @@ a.link_menu margin-bottom:20px; border-bottom:1px solid #d26262; border-top:1px solid #d26262; + clear:both; } /*page list in history*/ @@ -702,6 +703,10 @@ ins -moz-border-radius: 15px; -webkit-border-radius: 15px; } +.tables_of_contents a +{ + font-size:14px; +} .tables_of_contents_title { margin:10px 25px; @@ -1610,8 +1615,8 @@ ins } .moderator_box_deleted { - background:#F0FFFF; - border:1px solid #ADD8E6; + background:#C7DAEF; +/* border:1px solid #ADD8E6; */ } .listTable @@ -2015,13 +2020,17 @@ div#description_tabs_content margin:10px 0; } -.issue_hidden_notice +.issue_hidden_notice, .wiki_hidden_notice { - width:500px; + width:450px; float:left; margin-bottom:10px; color:red; } +.wiki_hidden_notice +{ + color:#000; +} .show_hidden_box_ext { clear:left; |