From 0ffdd23172da152cef31fa6011d0677dcce27128 Mon Sep 17 00:00:00 2001 From: tmont Date: Sun, 19 Oct 2008 04:43:45 +0000 Subject: [PATCH] wiki menu, and created a wiki view base class --- src/bootstrap.php | 3 ++ src/lib/views/PanaceaView.php | 2 + src/lib/views/wiki/PanaceaWikiView.php | 49 ++++++++++++++++++++++ src/lib/views/wiki/WikiPageContentView.php | 37 ++++++++++++++++ src/lib/views/wiki/WikiPageMenuView.php | 46 ++++++++++++++++++++ src/lib/views/wiki/WikiPageView.php | 22 +++++++--- src/media/css/global.css | 13 ++++++ 7 files changed, 166 insertions(+), 6 deletions(-) create mode 100644 src/lib/views/wiki/PanaceaWikiView.php create mode 100644 src/lib/views/wiki/WikiPageContentView.php create mode 100644 src/lib/views/wiki/WikiPageMenuView.php diff --git a/src/bootstrap.php b/src/bootstrap.php index 04bb816..e972335 100644 --- a/src/bootstrap.php +++ b/src/bootstrap.php @@ -32,6 +32,9 @@ break; case 'WikiPageView': + case 'WikiPageMenuView': + case 'WikiPageContentView': + case 'PanaceaWikiView': $file = "$path/lib/views/wiki/$className.php"; break; diff --git a/src/lib/views/PanaceaView.php b/src/lib/views/PanaceaView.php index 98d45d6..d0d943d 100644 --- a/src/lib/views/PanaceaView.php +++ b/src/lib/views/PanaceaView.php @@ -21,6 +21,7 @@ * @since 2008-10-16 * * @property-read string $root The relative root + * @property-read string $wikiPath The path to the wiki directory * @property-read string $mediaPath The path to the media directory * @property-read string $cssPath The path to the CSS directory * @property-read string $jsPath The path to the JavaScript directory @@ -52,6 +53,7 @@ $this->config = array( 'root' => '/panacea/src', + 'wikiPath' => '/panacea/src/wiki', 'mediaPath' => '/panacea/src/media', 'cssPath' => '/panacea/src/media/css', 'jsPath' => '/panacea/src/media/js', diff --git a/src/lib/views/wiki/PanaceaWikiView.php b/src/lib/views/wiki/PanaceaWikiView.php new file mode 100644 index 0000000..6cad220 --- /dev/null +++ b/src/lib/views/wiki/PanaceaWikiView.php @@ -0,0 +1,49 @@ +page = $page; + } + + } + +?> \ No newline at end of file diff --git a/src/lib/views/wiki/WikiPageContentView.php b/src/lib/views/wiki/WikiPageContentView.php new file mode 100644 index 0000000..f84cc79 --- /dev/null +++ b/src/lib/views/wiki/WikiPageContentView.php @@ -0,0 +1,37 @@ +page; + } + + } + +?> \ No newline at end of file diff --git a/src/lib/views/wiki/WikiPageMenuView.php b/src/lib/views/wiki/WikiPageMenuView.php new file mode 100644 index 0000000..6dc0e93 --- /dev/null +++ b/src/lib/views/wiki/WikiPageMenuView.php @@ -0,0 +1,46 @@ + + +
+ +
+
+ \ No newline at end of file diff --git a/src/lib/views/wiki/WikiPageView.php b/src/lib/views/wiki/WikiPageView.php index 528472e..8f45760 100644 --- a/src/lib/views/wiki/WikiPageView.php +++ b/src/lib/views/wiki/WikiPageView.php @@ -20,13 +20,23 @@ * @author Tommy Montgomery * @since 2008-10-18 */ - class WikiPageView extends PanaceaView { - - protected $page; + class WikiPageView extends PanaceaWikiView { + /** + * Creates a new {@link WikiPageView} + * + * @author Tommy Montgomery + * @since 2008-10-18 + * + * @param WikiPageObject $page The wiki page to display + * @param int $priority The priority of the view + */ public function __construct(WikiPageObject $page, $priority = 0) { - parent::__construct($priority); - $this->page = $page; + parent::__construct($page, $priority); + + $this->addView(new WikiPageMenuView($page, 1)); + $this->addView(new WikiPageContentView($page, 2)); + $this->addView(new WikiPageMenuView($page, 3)); } /** @@ -36,7 +46,7 @@ * @since 2008-10-18 */ public function send() { - echo $this->page; + parent::send(); } } diff --git a/src/media/css/global.css b/src/media/css/global.css index 00d6685..404094e 100644 --- a/src/media/css/global.css +++ b/src/media/css/global.css @@ -10,6 +10,11 @@ body { a { text-decoration: none; } +ul.menu { + list-style-type: none; + margin: 0; + padding: 0; +} #wrapper { width: 95%; @@ -129,4 +134,12 @@ a { border-top: 1px solid #000000; border-bottom: 1px solid #000000; background-color: #DDDD77; +} + +.wikimenu { + position: relative; +} +.wikimenu ul li { + float: right; + margin-left: 10px; } \ No newline at end of file