From d67f5736dfbec2b769e98dd17f34137b9feec1fc Mon Sep 17 00:00:00 2001 From: Antonio Gallo Date: Tue, 25 Oct 2011 22:52:38 +0000 Subject: improved wiki (TOC and moderator box) --- .../Application/Controllers/HistoryController.php | 1 + h-source/Application/Include/wikiFormatting.php | 17 ++-- h-source/Application/Views/Wiki/page.php | 112 +++++++++------------ 3 files changed, 55 insertions(+), 75 deletions(-) (limited to 'h-source/Application') 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[] = ""; } 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 @@
- action,'page') === 0 ? 'wiki' : 'wiki_revisions'; ?> + action,'page') === 0 ? 'wiki' : 'wiki_revisions'; + $displayClass = ($isDeleted) ? 'display_none' : null; + ?> action,'page') === 0 ) { ?> - +
">Home » ">Wiki »
+ + +
+ + + + "> + + + + "> + + + + +
+ + "> + + + + "> + + + + +
+
page
+ + "> | + + ">view details +
+
+ +
+ +