: $nothing;
$f .= $patrolled ? '<span class="unpatrolled">!</span>' : $nothing;
return $f;
-
}
/**
return '<div>'.$blockOut.'</div>' ;
}
+}
- /**
- * Called in a loop over all displayed RC entries
- * Either returns the line, or caches it for later use
- */
- function recentChangesLine( &$rc, $watched = false ) {
- global $wgUser;
- if ( $wgUser->getOption( 'usenewrc' ) )
- $line = $this->recentChangesLineNew ( $rc, $watched ) ;
- else
- $line = $this->recentChangesLineOld ( $rc, $watched ) ;
- return $line ;
- }
+/**
+ * Generate a list of changes using the good old system (no javascript)
+ */
+class OldChangesList extends ChangesList {
/**
* Format a line using the old system (aka without any javascript).
*/
- function recentChangesLineOld( &$rc, $watched = false ) {
+ function recentChangesLine( &$rc, $watched = false ) {
global $wgTitle, $wgLang, $wgContLang, $wgUser, $wgUseRCPatrol,
$wgOnlySysopsCanPatrol, $wgSysopUserBans;
return $s;
}
+
+}
+
+/**
+ * Generate a list of changes using an Enhanced system (use javascript).
+ */
+class EnhancedChangesList extends ChangesList {
/**
* Format a line for enhanced recentchange (aka with javascript and block of lines).
*/
- function recentChangesLineNew( &$baseRC, $watched = false ) {
+ function recentChangesLine( &$baseRC, $watched = false ) {
global $wgTitle, $wgLang, $wgContLang, $wgUser,
$wgUseRCPatrol, $wgOnlySysopsCanPatrol, $wgSysopUserBans;
}
}
+
?>
// Add end of the texts
$wgOut->addHTML( '<div class="rcoptions">' . rcOptionsPanel( $defaults, $nondefaults ) . "\n" );
- $wgOut->addHTML( rcNamespaceForm( $namespace, $invert, $nondefaults) . '</div>');
+ $wgOut->addHTML( rcNamespaceForm( $namespace, $invert, $nondefaults) . '</div>'."\n");
}
// And now for the content
$sk = $wgUser->getSkin();
$wgOut->setSyndicated( true );
- $list =& new ChangesList( $sk );
+
+ if ( $wgUser->getOption('usenewrc') ) {
+ $list =& new EnhancedChangesList( $sk );
+ } else {
+ $list =& new OldChangesList( $sk );
+ }
+
$s = $list->beginRecentChangesList();
$counter = 1;
foreach( $rows as $obj ){
$t = Title::makeTitle( NS_SPECIAL, 'Recentchanges' );
$namespaceselect = HTMLnamespaceselector($namespace, '');
- $submitbutton = '<input type="submit" value="' . wfMsgHtml( 'allpagessubmit' ) . '" />';
+ $submitbutton = '<input type="submit" value="' . wfMsgHtml( 'allpagessubmit' ) . "\" />\n";
$invertbox = "<input type='checkbox' name='invert' value='1' id='nsinvert'" . ( $invert ? ' checked="checked"' : '' ) . ' />';
$out = "<div class='namespacesettings'><form method='get' action='{$wgScript}'>\n";
$out .= "
<div id='nsselect' class='recentchanges'>
<label for='namespace'>" . wfMsgHtml('namespace') . "</label>
- $namespaceselect $submitbutton $invertbox <label for='nsinvert'>" . wfMsgHtml('invert') . "</label>
-</div>";
+ {$namespaceselect}{$submitbutton}{$invertbox} <label for='nsinvert'>" . wfMsgHtml('invert') . "</label>\n</div>";
$out .= '</form></div>';
return $out;
}
wfProfileIn( $fname );
require_once( 'DifferenceEngine.php' );
- $comment = "<p>" . htmlspecialchars( $row->rc_comment ) . "</p>\n";
+ $comment = '<p>' . htmlspecialchars( $row->rc_comment ) . "</p>\n";
if( $row->rc_namespace >= 0 ) {
global $wgContLang;
$wgOut->addHTML( $note."\n" );
- $list =& new ChangesList( $sk );
+ if ( $wgUser->getOption('usenewrc') ) {
+ $list =& new EnhancedChangesList( $sk );
+ } else {
+ $list =& new OldChangesList( $sk );
+ }
$s = $list->beginRecentChangesList();
$count = $dbr->numRows( $res );
/* End bottom header */
$sk = $wgUser->getSkin();
- $list =& new ChangesList( $sk );
+
+ if ( $wgUser->getOption('usenewrc') ) {
+ $list =& new EnhancedChangesList( $sk );
+ } else {
+ $list =& new OldChangesList( $sk );
+ }
+
$s = $list->beginRecentChangesList();
$counter = 1;
while ( $obj = $dbr->fetchObject( $res ) ) {