made some panacea-specific wiki objects for ease of configuration, although that may change... but it fixed the wiki links for the moment

This commit is contained in:
tmont 2008-10-20 05:39:54 +00:00
parent dab37a08c0
commit e33879a0b9
4 changed files with 113 additions and 1 deletions

View File

@ -23,6 +23,12 @@
$path = dirname(__FILE__); $path = dirname(__FILE__);
$file = ''; $file = '';
switch ($className) { switch ($className) {
//lib
case 'PanaceaWikiParser':
case 'PanaceaWikiPageObject':
$file = "$path/lib/$className.php";
break;
//controllers //controllers
case 'PanaceaControllerFactory': case 'PanaceaControllerFactory':
case 'PanaceaWikiController': case 'PanaceaWikiController':
@ -42,6 +48,7 @@
$file = "$path/lib/views/$className.php"; $file = "$path/lib/views/$className.php";
break; break;
//wiki views
case 'WikiPageView': case 'WikiPageView':
case 'WikiPageEditView': case 'WikiPageEditView':
case 'WikiPageHistoryView': case 'WikiPageHistoryView':
@ -51,6 +58,7 @@
$file = "$path/lib/views/wiki/$className.php"; $file = "$path/lib/views/wiki/$className.php";
break; break;
//system views
case 'PanaceaView': case 'PanaceaView':
case 'PanaceaHomeView': case 'PanaceaHomeView':
case 'PanaceaMainView': case 'PanaceaMainView':

View File

@ -0,0 +1,41 @@
<?php
/**
* PanaceaWikiPageObject
*
* @package Panacea
* @subpackage Library
* @author Tommy Montgomery
* @since 2008-10-19
*/
/** Bootstraps the NowhereConcave framework */
require_once 'NowhereConcave/bootstrap.php';
/**
* Composite object of {@link WikiPage} and {@link WikiHistory}
*
* @package Panacea
* @subpackage Library
* @author Tommy Montgomery
* @since 2008-10-19
*/
class PanaceaWikiPageObject extends WikiPageObject {
/**
* Creates a new {@link PanaceaWikiPageObject} with the specified
* {@link WikiPage}
*
* @author Tommy Montgomery
* @since 2008-10-19
* @uses PanaceaWikiParser::getInstance()
*
* @param WikiPage $page A wiki page
*/
public function __construct(WikiPage $page) {
parent::__construct($page, PanaceaWikiParser::getInstance());
}
}
?>

View File

@ -0,0 +1,63 @@
<?php
/**
* PanaceaWikiParser
*
* @package Panacea
* @subpackage Library
* @author Tommy Montgomery
* @since 2008-10-19
*/
/** Bootstraps the NowhereConcave framework */
require_once 'NowhereConcave/bootstrap.php';
/**
* Wiki parser for <i>Panacea</i>
*
* @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;
}
}
?>

View File

@ -68,7 +68,7 @@
try { try {
$templateView = new PanaceaTemplateView('Wiki :: ' . $this->page); $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); $wikiObject->setRevision(WikiHistory::REV_LATEST, $mysql);
$templateView->mainView->addView($this->viewFactory->getView($this->page, $wikiObject, $this->action)); $templateView->mainView->addView($this->viewFactory->getView($this->page, $wikiObject, $this->action));