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:
parent
dab37a08c0
commit
e33879a0b9
@ -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':
|
||||
|
41
src/lib/PanaceaWikiPageObject.php
Normal file
41
src/lib/PanaceaWikiPageObject.php
Normal 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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
63
src/lib/PanaceaWikiParser.php
Normal file
63
src/lib/PanaceaWikiParser.php
Normal 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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user