Update of /cvsroot/phpwiki/phpwiki/lib/plugin
In directory usw-pr-cvs1:/tmp/cvs-serv21917/lib/plugin
Modified Files:
RecentChanges.php
Log Message:
Change plugin arg syntax from 'rss=1' to 'format=rss'.
Index: RecentChanges.php
===================================================================
RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/RecentChanges.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** RecentChanges.php 2001/12/07 22:15:43 1.2
--- RecentChanges.php 2001/12/07 22:28:21 1.3
***************
*** 16,20 ****
'show_all' => false,
'limit' => false,
! 'rss' => false);
}
--- 16,20 ----
'show_all' => false,
'limit' => false,
! 'format' => false);
}
***************
*** 35,39 ****
$changes = $dbi->mostRecent($params);
! if ($rss && $request->getArg('action') == 'browse') {
header("Content-Type: application/xml; charset=" . RSS_ENCODING);
--- 35,45 ----
$changes = $dbi->mostRecent($params);
! if ($request->getArg('action') != 'browse')
! $format = false; // default -> HTML
! switch ($format) {
! case 'rss':
! if (!$args['limit'])
! $args['limit'] = 15;
!
header("Content-Type: application/xml; charset=" . RSS_ENCODING);
***************
*** 43,49 ****
echo $xml;
ExitWiki();
! }
! else {
return $this->__format_as_html($changes, $title, $args);
}
}
--- 49,56 ----
echo $xml;
ExitWiki();
! break;
! default:
return $this->__format_as_html($changes, $title, $args);
+ break;
}
}
***************
*** 150,157 ****
$limit = $args['limit'];
! if (! $limit)
! $limit = 15;
!
! while ($limit-- > 0 && $rev = $changes->next()) {
$page = $rev->getPage();
--- 157,161 ----
$limit = $args['limit'];
! while ($rev = $changes->next()) {
$page = $rev->getPage();
***************
*** 186,189 ****
--- 190,196 ----
$uri = WikiURL($pagename, array('version' => $rev->getVersion()), 'absurl');
$rss->addItem($item, $uri);
+
+ if ($limit && --$limit <= 0)
+ break;
}
|