r100746 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100745‎ | r100746 | r100747 >
Date:21:33, 25 October 2011
Author:reedy
Status:ok
Tags:
Comment:
REL1_18 MFT r97815, r98069, r98210, r98212, 98298
Modified paths:
  • /branches/REL1_18/phase3 (modified) (history)
  • /branches/REL1_18/phase3/includes (modified) (history)
  • /branches/REL1_18/phase3/includes/SkinTemplate.php (modified) (history)
  • /branches/REL1_18/phase3/includes/Title.php (modified) (history)
  • /branches/REL1_18/phase3/includes/specials (modified) (history)
  • /branches/REL1_18/phase3/includes/specials/SpecialBlock.php (modified) (history)
  • /branches/REL1_18/phase3/skins/common/shared.css (modified) (history)

Diff [purge]

Index: branches/REL1_18/phase3/skins/common/shared.css
@@ -792,6 +792,20 @@
793793 right: 10px;
794794 background-position: 0% 100%;
795795 }
 796+/* Table Sorting */
 797+table.sortable th.headerSort {
 798+ background-image: url(images/sort_both.gif);
 799+ cursor: pointer;
 800+ background-repeat: no-repeat;
 801+ background-position: center right;
 802+ padding-right: 21px;
 803+}
 804+table.sortable th.headerSortUp {
 805+ background-image: url(images/sort_up.gif);
 806+}
 807+table.sortable th.headerSortDown {
 808+ background-image: url(images/sort_down.gif);
 809+}
796810
797811 /* LTR content in RTL layout */
798812 .ltr {
Index: branches/REL1_18/phase3/includes/Title.php
@@ -3881,7 +3881,7 @@
38823882 return $this->mDbkeyform == '';
38833883 case NS_MEDIAWIKI:
38843884 // known system message
3885 - return $this->getDefaultMessageText() !== false;
 3885+ return $this->hasSourceText() !== false;
38863886 default:
38873887 return false;
38883888 }
@@ -3911,8 +3911,13 @@
39123912
39133913 if ( $this->mNamespace == NS_MEDIAWIKI ) {
39143914 // If the page doesn't exist but is a known system message, default
3915 - // message content will be displayed, same for language subpages
3916 - return $this->getDefaultMessageText() !== false;
 3915+ // message content will be displayed, same for language subpages-
 3916+ // Use always content language to avoid loading hundreds of languages
 3917+ // to get the link color.
 3918+ global $wgContLang;
 3919+ list( $name, $lang ) = MessageCache::singleton()->figureMessage( $wgContLang->lcfirst( $this->getText() ) );
 3920+ $message = wfMessage( $name )->inLanguage( $wgContLang )->useDatabase( false );
 3921+ return $message->exists();
39173922 }
39183923
39193924 return false;
Property changes on: branches/REL1_18/phase3/includes/Title.php
___________________________________________________________________
Modified: svn:mergeinfo
39203925 Merged /trunk/phase3/includes/Title.php:r97815,98069
Index: branches/REL1_18/phase3/includes/SkinTemplate.php
@@ -1540,6 +1540,134 @@
15411541 return $personal_tools;
15421542 }
15431543
 1544+ function getSidebar( $options = array() ) {
 1545+ // Force the rendering of the following portals
 1546+ $sidebar = $this->data['sidebar'];
 1547+ if ( !isset( $sidebar['SEARCH'] ) ) {
 1548+ $sidebar['SEARCH'] = true;
 1549+ }
 1550+ if ( !isset( $sidebar['TOOLBOX'] ) ) {
 1551+ $sidebar['TOOLBOX'] = true;
 1552+ }
 1553+ if ( !isset( $sidebar['LANGUAGES'] ) ) {
 1554+ $sidebar['LANGUAGES'] = true;
 1555+ }
 1556+
 1557+ if ( !isset( $options['search'] ) || $options['search'] !== true ) {
 1558+ unset( $sidebar['SEARCH'] );
 1559+ }
 1560+ if ( isset( $options['toolbox'] ) && $options['toolbox'] === false ) {
 1561+ unset( $sidebar['TOOLBOX'] );
 1562+ }
 1563+ if ( isset( $options['languages'] ) && $options['languages'] === false ) {
 1564+ unset( $sidebar['LANGUAGES'] );
 1565+ }
 1566+
 1567+ $boxes = array();
 1568+ foreach ( $sidebar as $boxName => $content ) {
 1569+ if ( $content === false ) {
 1570+ continue;
 1571+ }
 1572+ switch ( $boxName ) {
 1573+ case 'SEARCH':
 1574+ // Search is a special case, skins should custom implement this
 1575+ $boxes[$boxName] = array(
 1576+ 'id' => "p-search",
 1577+ 'header' => wfMessage( 'search' )->text(),
 1578+ 'generated' => false,
 1579+ 'content' => true,
 1580+ );
 1581+ break;
 1582+ case 'TOOLBOX':
 1583+ $msgObj = wfMessage( 'toolbox' );
 1584+ $boxes[$boxName] = array(
 1585+ 'id' => "p-tb",
 1586+ 'header' => $msgObj->exists() ? $msgObj->text() : 'toolbox',
 1587+ 'generated' => false,
 1588+ 'content' => $this->getToolbox(),
 1589+ );
 1590+ break;
 1591+ case 'LANGUAGES':
 1592+ if ( $this->data['language_urls'] ) {
 1593+ $msgObj = wfMessage( 'otherlanguages' );
 1594+ $boxes[$boxName] = array(
 1595+ 'id' => "p-lang",
 1596+ 'header' => $msgObj->exists() ? $msgObj->text() : 'otherlanguages',
 1597+ 'generated' => false,
 1598+ 'content' => $this->data['language_urls'],
 1599+ );
 1600+ }
 1601+ break;
 1602+ default:
 1603+ $msgObj = wfMessage( $boxName );
 1604+ $boxes[$boxName] = array(
 1605+ 'id' => "p-$boxName",
 1606+ 'header' => $msgObj->exists() ? $msgObj->text() : $boxName,
 1607+ 'generated' => true,
 1608+ 'content' => $content,
 1609+ );
 1610+ break;
 1611+ }
 1612+ }
 1613+
 1614+ // HACK: Compatibility with extensions still using SkinTemplateToolboxEnd
 1615+ $hookContents = null;
 1616+ if ( isset( $boxes['TOOLBOX'] ) ) {
 1617+ ob_start();
 1618+ // We pass an extra 'true' at the end so extensions using BaseTemplateToolbox
 1619+ // can abort and avoid outputting double toolbox links
 1620+ wfRunHooks( 'SkinTemplateToolboxEnd', array( &$this, true ) );
 1621+ $hookContents = ob_get_contents();
 1622+ ob_end_clean();
 1623+ if ( !trim( $hookContents ) ) {
 1624+ $hookContents = null;
 1625+ }
 1626+ }
 1627+ // END hack
 1628+
 1629+ if ( isset( $options['htmlOnly'] ) && $options['htmlOnly'] === true ) {
 1630+ foreach ( $boxes as $boxName => $box ) {
 1631+ if ( is_array( $box['content'] ) ) {
 1632+ $content = "<ul>";
 1633+ foreach ( $box['content'] as $key => $val ) {
 1634+ $content .= "\n " . $this->makeListItem( $key, $val );
 1635+ }
 1636+ // HACK, shove the toolbox end onto the toolbox if we're rendering itself
 1637+ if ( $hookContents ) {
 1638+ $content .= "\n $hookContents";
 1639+ }
 1640+ // END hack
 1641+ $content .= "\n</ul>\n";
 1642+ $boxes[$boxName]['content'] = $content;
 1643+ }
 1644+ }
 1645+ } else {
 1646+ if ( $hookContents ) {
 1647+ $boxes['TOOLBOXEND'] = array(
 1648+ 'id' => "p-toolboxend",
 1649+ 'header' => $boxes['TOOLBOX']['header'],
 1650+ 'generated' => false,
 1651+ 'content' => "<ul>{$hookContents}</ul>",
 1652+ );
 1653+ // HACK: Make sure that TOOLBOXEND is sorted next to TOOLBOX
 1654+ $boxes2 = array();
 1655+ foreach ( $boxes as $key => $box ) {
 1656+ if ( $key === 'TOOLBOXEND' ) {
 1657+ continue;
 1658+ }
 1659+ $boxes2[$key] = $box;
 1660+ if ( $key === 'TOOLBOX' ) {
 1661+ $boxes2['TOOLBOXEND'] = $boxes['TOOLBOXEND'];
 1662+ }
 1663+ }
 1664+ $boxes = $boxes2;
 1665+ // END hack
 1666+ }
 1667+ }
 1668+
 1669+ return $boxes;
 1670+ }
 1671+
15441672 /**
15451673 * Makes a link, usually used by makeListItem to generate a link for an item
15461674 * in a list used in navigation lists, portlets, portals, sidebars, etc...
Index: branches/REL1_18/phase3/includes/specials/SpecialBlock.php
@@ -640,7 +640,7 @@
641641 if( !$status ) {
642642 # Show form unless the user is already aware of this...
643643 if( !$data['Confirm'] || ( array_key_exists( 'PreviousTarget', $data )
644 - && $data['PreviousTarget'] !== $block->getTarget() ) )
 644+ && $data['PreviousTarget'] !== $target ) )
645645 {
646646 return array( array( 'ipb_already_blocked', $block->getTarget() ) );
647647 # Otherwise, try to update the block...
Property changes on: branches/REL1_18/phase3/includes/specials/SpecialBlock.php
___________________________________________________________________
Modified: svn:mergeinfo
648648 Merged /trunk/phase3/includes/specials/SpecialBlock.php:r98298
Property changes on: branches/REL1_18/phase3/includes/specials
___________________________________________________________________
Modified: svn:mergeinfo
649649 Merged /trunk/phase3/includes/specials:r98298
Property changes on: branches/REL1_18/phase3/includes
___________________________________________________________________
Modified: svn:mergeinfo
650650 Merged /trunk/phase3/includes:r97815,98069,98210,98212,98298
Property changes on: branches/REL1_18/phase3
___________________________________________________________________
Modified: svn:mergeinfo
651651 Merged /trunk/phase3:r97815,98069,98210,98212,98298

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r97815Don't load all languages just to check whether message is known....nikerabbit14:04, 22 September 2011
r98069Raise the specificity of the sortable header....hartman17:26, 25 September 2011
r98210Add getSidebar method to BaseTemplate to simplify the sidebar boilerplate.dantman05:31, 27 September 2011
r98212Followup r98210; Add an ugly hack to support old extensions using the SkinTem...dantman07:58, 27 September 2011

Status & tagging log