wiki menu, and created a wiki view base class
This commit is contained in:
parent
6d01fe82c7
commit
0ffdd23172
@ -32,6 +32,9 @@
|
||||
break;
|
||||
|
||||
case 'WikiPageView':
|
||||
case 'WikiPageMenuView':
|
||||
case 'WikiPageContentView':
|
||||
case 'PanaceaWikiView':
|
||||
$file = "$path/lib/views/wiki/$className.php";
|
||||
break;
|
||||
|
||||
|
@ -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',
|
||||
|
49
src/lib/views/wiki/PanaceaWikiView.php
Normal file
49
src/lib/views/wiki/PanaceaWikiView.php
Normal file
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* WikiPageContentView
|
||||
*
|
||||
* @package Panacea
|
||||
* @subpackage Views
|
||||
* @author Tommy Montgomery
|
||||
* @since 2008-10-18
|
||||
*/
|
||||
|
||||
/** Bootstraps the NowhereConcave framework */
|
||||
require_once 'NowhereConcave/bootstrap.php';
|
||||
|
||||
/**
|
||||
* View for wiki content
|
||||
*
|
||||
* @package Panacea
|
||||
* @subpackage Views
|
||||
* @author Tommy Montgomery
|
||||
* @since 2008-10-18
|
||||
*/
|
||||
class PanaceaWikiView extends PanaceaView {
|
||||
|
||||
/**
|
||||
* The wiki page to display
|
||||
*
|
||||
* @var WikiPageObject
|
||||
*/
|
||||
protected $page;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
37
src/lib/views/wiki/WikiPageContentView.php
Normal file
37
src/lib/views/wiki/WikiPageContentView.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* WikiPageContentView
|
||||
*
|
||||
* @package Panacea
|
||||
* @subpackage Views
|
||||
* @author Tommy Montgomery
|
||||
* @since 2008-10-18
|
||||
*/
|
||||
|
||||
/** Bootstraps the NowhereConcave framework */
|
||||
require_once 'NowhereConcave/bootstrap.php';
|
||||
|
||||
/**
|
||||
* View for wiki content
|
||||
*
|
||||
* @package Panacea
|
||||
* @subpackage Views
|
||||
* @author Tommy Montgomery
|
||||
* @since 2008-10-18
|
||||
*/
|
||||
class WikiPageContentView extends PanaceaWikiView {
|
||||
|
||||
/**
|
||||
* Renders the view
|
||||
*
|
||||
* @author Tommy Montgomery
|
||||
* @since 2008-10-18
|
||||
*/
|
||||
public function send() {
|
||||
echo "\t\t" . $this->page;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
46
src/lib/views/wiki/WikiPageMenuView.php
Normal file
46
src/lib/views/wiki/WikiPageMenuView.php
Normal file
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* WikiPageMenuView
|
||||
*
|
||||
* @package Panacea
|
||||
* @subpackage Views
|
||||
* @author Tommy Montgomery
|
||||
* @since 2008-10-18
|
||||
*/
|
||||
|
||||
/** Bootstraps the NowhereConcave framework */
|
||||
require_once 'NowhereConcave/bootstrap.php';
|
||||
|
||||
/**
|
||||
* View for wiki page menus
|
||||
*
|
||||
* @package Panacea
|
||||
* @subpackage Views
|
||||
* @author Tommy Montgomery
|
||||
* @since 2008-10-18
|
||||
*/
|
||||
class WikiPageMenuView extends PanaceaWikiView {
|
||||
|
||||
/**
|
||||
* Renders the view
|
||||
*
|
||||
* @author Tommy Montgomery
|
||||
* @since 2008-10-18
|
||||
*/
|
||||
public function send() { ?>
|
||||
|
||||
<div class="wikimenu">
|
||||
<ul class="menu">
|
||||
<li><a href="<?php echo $this->wikiPath; ?>/<?php echo $this->page->page->page_name; ?>?stats">Statistics</a></li>
|
||||
<li><a href="<?php echo $this->wikiPath; ?>/<?php echo $this->page->page->page_name; ?>?history">History</a></li>
|
||||
<li><a href="<?php echo $this->wikiPath; ?>/<?php echo $this->page->page->page_name; ?>?source">Source</a></li>
|
||||
<li><a href="<?php echo $this->wikiPath; ?>/<?php echo $this->page->page->page_name; ?>?edit">Edit</a></li>
|
||||
</ul>
|
||||
<div style="clear:right"></div>
|
||||
</div>
|
||||
<?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();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -10,6 +10,11 @@ body {
|
||||
a {
|
||||
text-decoration: none;
|
||||
}
|
||||
ul.menu {
|
||||
list-style-type: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#wrapper {
|
||||
width: 95%;
|
||||
@ -130,3 +135,11 @@ a {
|
||||
border-bottom: 1px solid #000000;
|
||||
background-color: #DDDD77;
|
||||
}
|
||||
|
||||
.wikimenu {
|
||||
position: relative;
|
||||
}
|
||||
.wikimenu ul li {
|
||||
float: right;
|
||||
margin-left: 10px;
|
||||
}
|
Loading…
Reference in New Issue
Block a user