From e33879a0b99307d755099f78fac1f561e1a4d3bc Mon Sep 17 00:00:00 2001 From: tmont Date: Mon, 20 Oct 2008 05:39:54 +0000 Subject: [PATCH] made some panacea-specific wiki objects for ease of configuration, although that may change... but it fixed the wiki links for the moment --- src/bootstrap.php | 8 +++ src/lib/PanaceaWikiPageObject.php | 41 ++++++++++++ src/lib/PanaceaWikiParser.php | 63 +++++++++++++++++++ src/lib/controllers/PanaceaWikiController.php | 2 +- 4 files changed, 113 insertions(+), 1 deletion(-) create mode 100644 src/lib/PanaceaWikiPageObject.php create mode 100644 src/lib/PanaceaWikiParser.php diff --git a/src/bootstrap.php b/src/bootstrap.php index 2eb02c4..ea8ac72 100644 --- a/src/bootstrap.php +++ b/src/bootstrap.php @@ -23,6 +23,12 @@ $path = dirname(__FILE__); $file = ''; switch ($className) { + //lib + case 'PanaceaWikiParser': + case 'PanaceaWikiPageObject': + $file = "$path/lib/$className.php"; + break; + //controllers case 'PanaceaControllerFactory': case 'PanaceaWikiController': @@ -42,6 +48,7 @@ $file = "$path/lib/views/$className.php"; break; + //wiki views case 'WikiPageView': case 'WikiPageEditView': case 'WikiPageHistoryView': @@ -51,6 +58,7 @@ $file = "$path/lib/views/wiki/$className.php"; break; + //system views case 'PanaceaView': case 'PanaceaHomeView': case 'PanaceaMainView': diff --git a/src/lib/PanaceaWikiPageObject.php b/src/lib/PanaceaWikiPageObject.php new file mode 100644 index 0000000..6f1186a --- /dev/null +++ b/src/lib/PanaceaWikiPageObject.php @@ -0,0 +1,41 @@ + \ No newline at end of file diff --git a/src/lib/PanaceaWikiParser.php b/src/lib/PanaceaWikiParser.php new file mode 100644 index 0000000..841e7c4 --- /dev/null +++ b/src/lib/PanaceaWikiParser.php @@ -0,0 +1,63 @@ +Panacea + * + * @package Panacea + * @subpackage Library + * @author Tommy Montgomery + * @since 2008-10-19 + */ + class PanaceaWikiParser extends WikiParser { + + /** + * The singleton instance + * + * @var WikiParser + */ + private static $instance = null; + + /** + * Creates a new {@link PanaceaWikiParser} + * + * @author Tommy Montgomery + * @since 2008-10-19 + * @todo Use configuration object for linkRoot + */ + protected function __construct() { + parent::__construct(); + + $this->linkRoot = '/panacea/src/wiki'; + } + + /** + * Gets the singleton instance + * + * @author Tommy Montgomery + * @since 2008-10-19 + * + * @return PanaceaWikiParser + */ + public static function getInstance() { + if (self::$instance === null) { + self::$instance = new self(); + } + + return self::$instance; + } + + } + +?> \ No newline at end of file diff --git a/src/lib/controllers/PanaceaWikiController.php b/src/lib/controllers/PanaceaWikiController.php index a342624..c6f74d4 100644 --- a/src/lib/controllers/PanaceaWikiController.php +++ b/src/lib/controllers/PanaceaWikiController.php @@ -68,7 +68,7 @@ try { $templateView = new PanaceaTemplateView('Wiki :: ' . $this->page); - $wikiObject = new WikiPageObject(WikiPage::loadByPageName($mysql, $this->page)); + $wikiObject = new PanaceaWikiPageObject(WikiPage::loadByPageName($mysql, $this->page)); $wikiObject->setRevision(WikiHistory::REV_LATEST, $mysql); $templateView->mainView->addView($this->viewFactory->getView($this->page, $wikiObject, $this->action));