* @var Skin
*/
public $skin;
+
protected $watchlist = false;
+
+ protected $message = array();
/**
* Changeslist contructor
* Some users might want to use an enhanced list format, for instance
*
* @param $user User to fetch the list class for
- * @return ChangesList derivative
+ * @return ChangesList|EnhancedChangesList|OldChangesList derivative
*/
public static function newFromUser( $user ) {
global $wgRequest;
* unpatrolled edit. By default in English it will contain "N", "m", "b",
* "!" respectively, plus it will have an appropriate title and class.
*
- * @param $key String: 'newpage', 'unpatrolled', 'minor', or 'bot'
+ * @param $flag String: 'newpage', 'unpatrolled', 'minor', or 'bot'
* @return String: Raw HTML
*/
public static function flag( $flag ) {
* Show formatted char difference
* @param $old Integer: bytes
* @param $new Integer: bytes
- * @returns String
+ * @return String
*/
public static function showCharacterDifference( $old, $new ) {
global $wgRCChangedSizeThreshold, $wgLang, $wgMiserMode;
* Format a line for enhanced recentchange (aka with javascript and block of lines).
*
* @param $baseRC RecentChange
+ * @param $watched bool
+ *
+ * @return string
*/
public function recentChangesLine( &$baseRC, $watched = false ) {
global $wgLang, $wgUser;
/**
* If enhanced RC is in use, this function takes the previously cached
* RC lines, arranges them, and outputs the HTML
+ *
+ * @return string
*/
protected function recentChangesBlock() {
if( count ( $this->rc_cache ) == 0 ) {
class ApiImportReporter extends ImportReporter {
private $mResultArr = array();
+ /**
+ * @param $title Title
+ * @param $origTitle Title
+ * @param $revisionCount int
+ * @param $successCount int
+ * @param $pageInfo
+ * @return void
+ */
function reportPage( $title, $origTitle, $revisionCount, $successCount, $pageInfo ) {
// Add a result entry
$r = array();
return self::listPages( $dbr, $conds );
}
+ /**
+ * @param $dbr DatabaseBase
+ * @param $condition
+ * @return bool|ResultWrapper
+ */
protected static function listPages( $dbr, $condition ) {
return $dbr->resultObject(
$dbr->select(
$targetQuery = array( 'oldid' => $rev->getId() );
}
// Add show/hide deletion links if available
- $del .= $this->revDeleteLink( $rev );
+ $del = $this->revDeleteLink( $rev );
return
'<div id="mw-diff-' . $prefix . 'title1"><strong>' .
$sk->link(
// Add feed links
$wlToken = $wgUser->getOption( 'watchlisttoken' );
- if (!$wlToken) {
+ if ( !$wlToken ) {
$wlToken = sha1( mt_rand() . microtime( true ) );
$wgUser->setOption( 'watchlisttoken', $wlToken );
$wgUser->saveSettings();
);
$wgOut->setSubtitle( $sub );
- if( ( $mode = SpecialEditWatchlist::getMode( $wgRequest, $par ) ) !== false ) {
+ $mode = SpecialEditWatchlist::getMode( $wgRequest, $par );
+ if( $mode !== false ) {
# TODO: localise?
switch( $mode ){
case SpecialEditWatchlist::EDIT_CLEAR:
}
$uid = $wgUser->getId();
- if( ($wgEnotifWatchlist || $wgShowUpdatedMarker) && $wgRequest->getVal( 'reset' ) &&
+ if( ( $wgEnotifWatchlist || $wgShowUpdatedMarker ) && $wgRequest->getVal( 'reset' ) &&
$wgRequest->wasPosted() )
{
$wgUser->clearAllNotifications( $uid );
$days = $defaults['days']; # default cutoff for shortlisters
}
} else {
- $days = floatval($days);
+ $days = floatval( $days );
}
// Dump everything here
if ( $usePage || $rollbacker ) {
$tables[] = 'page';
$join_conds['page'] = array('LEFT JOIN','rc_cur_id=page_id');
- if ($rollbacker) {
+ if ( $rollbacker ) {
$fields[] = 'page_latest';
}
}
} elseif( $days > 0 ) {
$wlInfo = wfMsgExt( 'wlnote', 'parseinline',
$wgLang->formatNum( $numRows ),
- $wgLang->formatNum( round($days*24) )
+ $wgLang->formatNum( round( $days * 24 ) )
) . '<br />';
}
$updated = false;
}
- if ($wgRCShowWatchingUsers && $wgUser->getOption( 'shownumberswatching' )) {
+ if ( $wgRCShowWatchingUsers && $wgUser->getOption( 'shownumberswatching' ) ) {
$rc->numberofWatchingusers = $dbr->selectField( 'watchlist',
'COUNT(*)',
array(
$sk = $wgUser->getSkin();
$title = Title::newFromText( $wgContLang->specialPage( $page ) );
- $options['days'] = ($h / 24.0);
+ $options['days'] = ( $h / 24.0 );
return $sk->linkKnown(
$title,
$sk = $wgUser->getSkin();
$title = Title::newFromText( $wgContLang->specialPage( $page ) );
$options['days'] = $d;
- $message = ($d ? $wgLang->formatNum( $d ) : wfMsgHtml( 'watchlistall2' ) );
+ $message = ( $d ? $wgLang->formatNum( $d ) : wfMsgHtml( 'watchlistall2' ) );
return $sk->linkKnown(
$title,
/**
* Returns html
+ *
+ * @return string
*/
protected static function cutoffLinks( $days, $page = 'Watchlist', $options = array() ) {
global $wgLang;
*/
public function __construct() {
parent::__construct();
- global $wgDBname;
$this->mDescription = "Creates a sitemap for the site";
$this->addOption( 'fspath', 'The file system path to save to, e.g. /tmp/sitemap; defaults to current directory', false, true );
$this->addOption( 'urlpath', 'The URL path corresponding to --fspath, prepended to filenames in the index; defaults to an empty string', false, true );
/**
* Load the language file.
*
- * @param $code The language code.
+ * @param $code string The language code.
*/
protected function loadFile( $code ) {
if ( isset( $this->mRawMessages[$code] ) &&