if ( $moveOverRedirect ) {
$newid = $nt->getArticleID();
+ $newcontent = $newpage->getContent();
# Delete the old redirect. We don't save it to history since
# by definition if we've got here it's rather uninteresting.
# a conflict on the unique namespace+title index...
$dbw->delete( 'page', array( 'page_id' => $newid ), __METHOD__ );
- $newpage->doDeleteUpdates( $newid );
+ $newpage->doDeleteUpdates( $newid, $newcontent );
}
# Save a null revision in the page's history notifying of the move
*/
class EnhancedChangesList extends ChangesList {
-
+ /** @var array Array of array of RCCacheEntry */
protected $rc_cache;
/**
* Add the JavaScript file for enhanced changeslist
- * @return String
+ * @return string
*/
public function beginRecentChangesList() {
$this->rc_cache = array();
/**
* Format a line for enhanced recentchange (aka with javascript and block of lines).
*
- * @param $baseRC RecentChange
- * @param $watched bool
+ * @param RecentChange $baseRC
+ * @param bool $watched
*
* @return string
*/
// Page moves, very old style, not supported anymore
if ( $type == RC_MOVE || $type == RC_MOVE_OVER_REDIRECT ) {
+ $clink = '';
// New unpatrolled pages
} elseif ( $cacheEntry->unpatrolled && $type == RC_NEW ) {
$clink = Linker::linkKnown( $cacheEntry->getTitle() );
/**
* Enhanced RC group
+ * @param RCCacheEntry[] $block
* @return string
*/
protected function recentChangesBlockGroup( $block ) {
# Some catalyst variables...
$namehidden = true;
$allLogs = true;
+ $oldid = '';
foreach ( $block as $rcObj ) {
$oldid = $rcObj->mAttribs['rc_last_oldid'];
if ( $rcObj->mAttribs['rc_type'] == RC_NEW ) {
$sinceLast = 0;
$unvisitedOldid = null;
+ /** @var $rcObj RCCacheEntry */
foreach ( $block as $rcObj ) {
// Same logic as below inside main foreach
if ( $rcObj->watched && $rcObj->mAttribs['rc_timestamp'] >= $rcObj->watched ) {
# Total change link
$r .= ' ';
$logtext = '';
+ /** @var $block0 RecentChange */
+ $block0 = $block[0];
if ( !$allLogs ) {
if ( !ChangesList::userCan( $rcObj, Revision::DELETED_TEXT, $this->getUser() ) ) {
$logtext .= $nchanges[$n];
$logtext .= $nchanges[$n];
} else {
$logtext .= Linker::link(
- $block[0]->getTitle(),
+ $block0->getTitle(),
$nchanges[$n],
array(),
$queryParams + array(
);
if ( $sinceLast > 0 && $sinceLast < $n ) {
$logtext .= $this->message['pipe-separator'] . Linker::link(
- $block[0]->getTitle(),
+ $block0->getTitle(),
$sinceLastVisitMsg[$sinceLast],
array(),
$queryParams + array(
# History
if ( $allLogs ) {
// don't show history link for logs
- } elseif ( $namehidden || !$block[0]->getTitle()->exists() ) {
+ } elseif ( $namehidden || !$block0->getTitle()->exists() ) {
$logtext .= $this->message['pipe-separator'] . $this->message['enhancedrc-history'];
} else {
$params = $queryParams;
$logtext .= $this->message['pipe-separator'] .
Linker::linkKnown(
- $block[0]->getTitle(),
+ $block0->getTitle(),
$this->message['enhancedrc-history'],
array(),
$params
}
$r .= $users;
- $r .= $this->numberofWatchingusers( $block[0]->numberofWatchingusers );
+ $r .= $this->numberofWatchingusers( $block0->numberofWatchingusers );
$r .= '</td></tr>';
# Sub-entries
/**
* Generate HTML for an arrow or placeholder graphic
- * @param string $dir one of '', 'd', 'l', 'r'
- * @param string $alt text
- * @param string $title text
- * @return String: HTML "<img>" tag
+ * @param string $dir One of '', 'd', 'l', 'r'
+ * @param string $alt
+ * @param string $title
+ * @return string HTML "<img>" tag
*/
protected function arrow( $dir, $alt = '', $title = '' ) {
global $wgStylePath;
/**
* Generate HTML for a right- or left-facing arrow,
* depending on language direction.
- * @return String: HTML "<img>" tag
+ * @return string HTML "<img>" tag
*/
protected function sideArrow() {
$dir = $this->getLanguage()->isRTL() ? 'l' : 'r';
/**
* Generate HTML for a down-facing arrow
* depending on language direction.
- * @return String: HTML "<img>" tag
+ * @return string HTML "<img>" tag
*/
protected function downArrow() {
return $this->arrow( 'd', '-', $this->msg( 'rc-enhanced-hide' )->text() );
/**
* Generate HTML for a spacer image
- * @return String: HTML "<img>" tag
+ * @return string HTML "<img>" tag
*/
protected function spacerArrow() {
return $this->arrow( '', codepointToUtf8( 0xa0 ) ); // non-breaking space
/**
* Enhanced RC ungrouped line.
*
- * @param $rcObj RecentChange
- * @return String: a HTML formatted line (generated using $r)
+ * @param RecentChange|RCCacheEntry $rcObj
+ * @return string A HTML formatted line (generated using $r)
*/
protected function recentChangesBlockLine( $rcObj ) {
global $wgRCShowChangedSize;
* @ingroup Database
*/
class DatabaseSqlite extends DatabaseBase {
+ /** @var bool Whether full text is enabled */
private static $fulltextEnabled = null;
- var $mAffectedRows;
- var $mLastResult;
- var $mDatabaseFile;
- var $mName;
+ /** @var string File name for SQLite database file */
+ public $mDatabaseFile;
+
+ /** @var int The number of rows affected as an integer */
+ protected $mAffectedRows;
+
+ /** @var resource */
+ protected $mLastResult;
/**
- * @var PDO
+ * @var string
+ * @todo Seems to serve no purpose. Remove?
*/
+ private $mName;
+
+ /** @var PDO */
protected $mConn;
function __construct( $p = null ) {
if ( $this->requestedHideUser ) {
$fields['Confirm']['type'] = 'check';
unset( $fields['Confirm']['default'] );
- $this->preErrors[] = 'ipb-confirmhideuser';
+ $this->preErrors[] = array( 'ipb-confirmhideuser', 'ipb-confirmaction' );
}
# Or if the user is trying to block themselves
if ( (string)$this->target === $this->getUser()->getName() ) {
$fields['Confirm']['type'] = 'check';
unset( $fields['Confirm']['default'] );
- $this->preErrors[] = 'ipb-blockingself';
+ $this->preErrors[] = array( 'ipb-blockingself', 'ipb-confirmaction' );
}
}
if ( $target === $performer->getName() &&
( $data['PreviousTarget'] !== $target || !$data['Confirm'] )
) {
- return array( 'ipb-blockingself' );
+ return array( 'ipb-blockingself', 'ipb-confirmaction' );
}
} elseif ( $type == Block::TYPE_RANGE ) {
$userId = 0;
# Disallow hiding users with many edits for performance.
return array( 'ipb_hide_invalid' );
} elseif ( !$data['Confirm'] ) {
- return array( 'ipb-confirmhideuser' );
+ return array( 'ipb-confirmhideuser', 'ipb-confirmaction' );
}
}
function getQueryInfo() {
$conds = $this->mConds;
- $conds[] = '(pr_expiry>' . $this->mDb->addQuotes( $this->mDb->timestamp() ) .
- 'OR pr_expiry IS NULL)';
+ $conds[] = 'pr_expiry > ' . $this->mDb->addQuotes( $this->mDb->timestamp() ) .
+ 'OR pr_expiry IS NULL';
$conds[] = 'page_id=pr_page';
$conds[] = 'pr_type=' . $this->mDb->addQuotes( $this->type );
See the [[Special:BlockList|block list]] to review blocks.',
'ipb-blockingself' => 'You are about to block yourself! Are you sure you want to do that?',
'ipb-confirmhideuser' => 'You are about to block a user with "hide user" enabled. This will suppress the user\'s name in all lists and log entries. Are you sure you want to do that?',
+'ipb-confirmaction' => 'If you are sure you really want to do it, please check the "{{int:ipb-confirm}}" field at the bottom.',
'ipb-edit-dropdown' => 'Edit block reasons',
'ipb-unblock-addr' => 'Unblock $1',
'ipb-unblock' => 'Unblock a username or IP address',
'Discussion_Catégorie' => NS_CATEGORY_TALK
);
+$namespaceGenderAliases = array(
+ NS_USER => array( 'male' => 'Utilisateur', 'female' => 'Utilisatrice' ),
+ NS_USER_TALK => array( 'male' => 'Discussion_utilisateur', 'female' => 'Discussion_utilisatrice' ),
+);
+
$specialPageAliases = array(
'Activeusers' => array( 'Utilisateurs_actifs', 'UtilisateursActifs' ),
'Allmessages' => array( 'Messages_système', 'Messages_systeme', 'Messagessystème', 'Messagessysteme' ),
See also:
* {{msg-mw|Ipb-blockingself}}',
+'ipb-confirmaction' => 'Used to inform the user they need to check the "Confirm block" checkbox on [[Special:Block]] ({{mw-msg|ipb-confirm}}) to continue.
+
+See also:
+* {{msg-mw|Ipb-blockingself}}
+* {{msg-mw|Ipb-confirmhideuser}}',
'ipb-edit-dropdown' => 'Shown beneath the user block form on the right side. It is a link to {{msg-mw|Ipbreason-dropdown|notext=1}}.
See also:
'rd_from = pa.page_id',
'rd_namespace = pb.page_namespace',
'rd_title = pb.page_title',
- '(rd_interwiki IS NULL OR rd_interwiki = "")', // bug 40352
+ 'rd_interwiki IS NULL OR rd_interwiki = ' . $dbr->addQuotes( '' ), // bug 40352
'pb.page_is_redirect' => 1,
);
'blockipsuccesstext',
'ipb-blockingself',
'ipb-confirmhideuser',
+ 'ipb-confirmaction',
'ipb-edit-dropdown',
'ipb-unblock-addr',
'ipb-unblock',
),
'mediawiki.special.block' => array(
'scripts' => 'resources/mediawiki.special/mediawiki.special.block.js',
+ 'styles' => 'resources/mediawiki.special/mediawiki.special.block.css',
'dependencies' => array(
'mediawiki.util',
),
--- /dev/null
+/**
+ * Styling for Special:Block
+ */
+
+label[for="mw-input-wpConfirm"] {
+ font-weight: bold;
+}
-<?xml version="1.0" ?><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12"><path d="M4 1.533v9.671l4.752-4.871z" fill="#797979"/></svg>
\ No newline at end of file
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.1"
+ width="12"
+ height="12"
+ id="svg2"
+ inkscape:version="0.48.4 r9939"
+ sodipodi:docname="arrow-collapsed-ltr.svg">
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1041"
+ id="namedview7"
+ showgrid="false"
+ inkscape:zoom="27.812867"
+ inkscape:cx="7.833847"
+ inkscape:cy="7.3054094"
+ inkscape:window-x="0"
+ inkscape:window-y="0"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="svg2" />
+ <defs
+ id="defs4" />
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ transform="matrix(1.0559311,0,0,1.0825058,-404.86649,-609.71107)"
+ id="layer1">
+ <path
+ d="m 387.20944,564.65683 0,8.93354 4.49986,-4.49987 z"
+ id="arrow"
+ style="fill:#797979;fill-opacity:1;stroke:none"
+ inkscape:connector-curvature="0" />
+ </g>
+</svg>
-<?xml version="1.0" ?><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12"><path d="M8 1.533v9.671l-4.752-4.871z" fill="#797979"/></svg>
\ No newline at end of file
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.1"
+ width="12"
+ height="12"
+ id="svg2"
+ inkscape:version="0.48.4 r9939"
+ sodipodi:docname="arrow-collapsed-ltr.svg">
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1041"
+ id="namedview7"
+ showgrid="false"
+ inkscape:zoom="27.812867"
+ inkscape:cx="14.764482"
+ inkscape:cy="6.45175"
+ inkscape:window-x="0"
+ inkscape:window-y="0"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="svg2" />
+ <defs
+ id="defs4" />
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ transform="matrix(-1.0559311,0,0,1.0825058,416.86649,-609.71107)"
+ id="layer1">
+ <path
+ d="m 387.20944,564.65683 0,8.93354 4.49986,-4.49987 z"
+ id="arrow"
+ style="fill:#797979;fill-opacity:1;stroke:none"
+ inkscape:connector-curvature="0" />
+ </g>
+</svg>
-<?xml version="1.0" ?><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12"><path d="M1.165 3.624h9.671l-4.871 4.752z" fill="#797979"/></svg>
\ No newline at end of file
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.1"
+ width="12"
+ height="12"
+ id="svg2"
+ inkscape:version="0.48.4 r9939"
+ sodipodi:docname="arrow-collapsed-rtl.svg">
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1041"
+ id="namedview7"
+ showgrid="false"
+ inkscape:zoom="27.812867"
+ inkscape:cx="9.7488178"
+ inkscape:cy="6.45175"
+ inkscape:window-x="0"
+ inkscape:window-y="0"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="svg2" />
+ <defs
+ id="defs4" />
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ transform="matrix(0,1.0559311,1.0825058,0,-610.0796,-405.24226)"
+ id="layer1">
+ <path
+ d="m 387.20944,564.65683 0,8.93354 4.49986,-4.49987 z"
+ id="arrow"
+ style="fill:#797979;fill-opacity:1;stroke:none"
+ inkscape:connector-curvature="0" />
+ </g>
+</svg>
$this->user->setPassword( $this->password );
$this->user->setEmail( $this->email );
$this->user->setRealName( $this->realname );
- // remove all groups, replace with any groups specified
- foreach ( $this->user->getGroups() as $group ) {
- $this->user->removeGroup( $group );
+
+ // Adjust groups by adding any missing ones and removing any extras
+ $currentGroups = $this->user->getGroups();
+ foreach ( array_diff( $this->groups, $currentGroups ) as $group ) {
+ $this->user->addGroup( $group );
}
- if ( count( $this->groups ) ) {
- foreach ( $this->groups as $group ) {
- $this->user->addGroup( $group );
- }
+ foreach ( array_diff( $currentGroups, $this->groups ) as $group ) {
+ $this->user->removeGroup( $group );
}
$this->user->saveSettings();
}