65 lines
1.6 KiB
PHP
65 lines
1.6 KiB
PHP
<?php
|
|
|
|
/**
|
|
* WikiPageView
|
|
*
|
|
* @package Panacea
|
|
* @subpackage Views
|
|
* @author Tommy Montgomery
|
|
* @since 2008-10-18
|
|
*/
|
|
|
|
/** Bootstraps the NowhereConcave framework */
|
|
require_once 'NowhereConcave/bootstrap.php';
|
|
|
|
/**
|
|
* View for wiki pages
|
|
*
|
|
* @package Panacea
|
|
* @subpackage Views
|
|
* @author Tommy Montgomery
|
|
* @since 2008-10-18
|
|
*/
|
|
class WikiPageView extends PanaceaWikiView {
|
|
|
|
/**
|
|
* Creates a new {@link WikiPageView}
|
|
*
|
|
* @author Tommy Montgomery
|
|
* @since 2008-10-18
|
|
* @uses addView()
|
|
*
|
|
* @param WikiPageObject $page The wiki page to display
|
|
* @param string $action The action to take
|
|
* @param int $priority The priority of the view
|
|
* @param string $pageName The name of the page
|
|
*/
|
|
public function __construct(WikiPageObject $page = null, $action = null, $pageName = '', $priority = 0) {
|
|
parent::__construct($page, $action, $priority);
|
|
|
|
$this->addView(new WikiPageMenuView($page, $action, 1));
|
|
|
|
switch ($this->action) {
|
|
case 'new':
|
|
$this->addView(new WikiPageNewView($pageName, 2));
|
|
break;
|
|
case 'edit':
|
|
$this->addView(new WikiPageEditView($this->page, $this->action, 2));
|
|
break;
|
|
case 'history':
|
|
$this->addView(new WikiPageHistoryView($this->page, $this->action, 2));
|
|
break;
|
|
case 'stats':
|
|
$this->addView(new WikiPageStatsView($this->page, $this->action, 2));
|
|
break;
|
|
default:
|
|
$this->addView(new WikiPageContentView($this->page, $this->action, 2));
|
|
break;
|
|
}
|
|
|
|
$this->addView(new WikiPageMenuView($this->page, $this->action, 3));
|
|
}
|
|
|
|
}
|
|
|
|
?>
|