refactored history views to use the new Collection object
This commit is contained in:
parent
59bbfccef9
commit
cb39cca4fb
@ -31,11 +31,11 @@
|
||||
* @uses WikiRevisionHistoryView
|
||||
*
|
||||
* @param WikiPageObject $page The wiki page to display
|
||||
* @param array $revisions The revisions to display
|
||||
* @param Collection $revisions The revisions to display
|
||||
* @param string $action The action to take
|
||||
* @param int $priority The priority of the view
|
||||
*/
|
||||
public function __construct(WikiPageObject $page, array $revisions, $action = null, $priority = 0) {
|
||||
public function __construct(WikiPageObject $page, Collection $revisions, $action = null, $priority = 0) {
|
||||
parent::__construct($page, $action, $priority);
|
||||
|
||||
$this->addView(new WikiRevisionHistoryView($revisions, 1));
|
||||
|
@ -23,9 +23,7 @@
|
||||
class WikiRevisionHistoryView extends PanaceaView {
|
||||
|
||||
/**
|
||||
* Array of {@link WikiHistory}s
|
||||
*
|
||||
* @var array
|
||||
* @var WikiHistoryCollection
|
||||
*/
|
||||
protected $revisions;
|
||||
|
||||
@ -35,12 +33,16 @@
|
||||
* @author Tommy Montgomery
|
||||
* @since 2008-10-21
|
||||
*
|
||||
* @param array $revisions The revisions to display
|
||||
* @param Collection $revisions The revisions to display
|
||||
* @param int $priority The priority of the view
|
||||
*/
|
||||
public function __construct(array $revisions, $priority = 0) {
|
||||
public function __construct(Collection $revisions, $priority = 0) {
|
||||
parent::__construct($priority);
|
||||
|
||||
if ($revisions->type !== 'WikiHistory') {
|
||||
throw new InvalidTypeException(1, 'Collection with type "WikiHistory"', $revisions);
|
||||
}
|
||||
|
||||
$this->revisions = $revisions;
|
||||
}
|
||||
|
||||
@ -66,7 +68,7 @@
|
||||
foreach ($this->revisions as $revision => $history) { ?>
|
||||
|
||||
<tr>
|
||||
<td><?php echo $revision; ?></td>
|
||||
<td><?php echo $history->revision; ?></td>
|
||||
<td><?php echo $history->created; ?></td>
|
||||
<td>Not implemented yet</td>
|
||||
<td><?php echo $history->created_user_id; ?></td>
|
||||
|
Loading…
Reference in New Issue
Block a user