Index: branches/liquidthreads/maintenance/language/messages.inc |
— | — | @@ -266,6 +266,7 @@ |
267 | 267 | 'feed-rss', |
268 | 268 | 'sitenotice', |
269 | 269 | 'anonnotice', |
| 270 | + 'newsectionheaderdefaultlevel', |
270 | 271 | ), |
271 | 272 | 'nstab' => array( |
272 | 273 | 'nstab-main', |
Index: branches/liquidthreads/maintenance/language/messageTypes.inc |
— | — | @@ -79,6 +79,7 @@ |
80 | 80 | 'loginlanguagelinks', |
81 | 81 | 'markaspatrolledlink', |
82 | 82 | 'newarticletextanon', |
| 83 | + 'newsectionheaderdefaultlevel', |
83 | 84 | 'newtalkseperator', |
84 | 85 | 'noarticletextanon', |
85 | 86 | 'number_of_watching_users_RCview', |
Index: branches/liquidthreads/includes/SpecialAllpages.php |
— | — | @@ -101,7 +101,11 @@ |
102 | 102 | $lines = $wgMemc->get( $key ); |
103 | 103 | |
104 | 104 | if( !is_array( $lines ) ) { |
105 | | - $firstTitle = $dbr->selectField( 'page', 'page_title', $where, $fname, array( 'LIMIT' => 1 ) ); |
| 105 | + $options = array( 'LIMIT' => 1 ); |
| 106 | + if ( ! $dbr->implicitOrderby() ) { |
| 107 | + $options['ORDER BY'] = 'page_title'; |
| 108 | + } |
| 109 | + $firstTitle = $dbr->selectField( 'page', 'page_title', $where, $fname, $options ); |
106 | 110 | $lastTitle = $firstTitle; |
107 | 111 | |
108 | 112 | # This array is going to hold the page_titles in order. |
— | — | @@ -293,8 +297,11 @@ |
294 | 298 | } else { |
295 | 299 | # The previous chunk is not complete, need to link to the very first title |
296 | 300 | # available in the database |
297 | | - $reallyFirstPage_title = $dbr->selectField( 'page', 'page_title', array( 'page_namespace' => $namespace ), $fname, array( 'LIMIT' => 1) ); |
298 | | - |
| 301 | + $options = array( 'LIMIT' => 1 ); |
| 302 | + if ( ! $dbr->implicitOrderby() ) { |
| 303 | + $options['ORDER BY'] = 'page_title'; |
| 304 | + } |
| 305 | + $reallyFirstPage_title = $dbr->selectField( 'page', 'page_title', array( 'page_namespace' => $namespace ), $fname, $options ); |
299 | 306 | # Show the previous link if it s not the current requested chunk |
300 | 307 | if( $from != $reallyFirstPage_title ) { |
301 | 308 | $prevTitle = Title::makeTitle( $namespace, $reallyFirstPage_title ); |
Index: branches/liquidthreads/includes/DatabaseOracle.php |
— | — | @@ -128,6 +128,9 @@ |
129 | 129 | function implicitGroupby() { |
130 | 130 | return false; |
131 | 131 | } |
| 132 | + function implicitOrderby() { |
| 133 | + return false; |
| 134 | + } |
132 | 135 | function searchableIPs() { |
133 | 136 | return true; |
134 | 137 | } |
Index: branches/liquidthreads/includes/Xml.php |
— | — | @@ -99,7 +99,7 @@ |
100 | 100 | * @param bool $hidden Include hidden namespaces? [WTF? --RC] |
101 | 101 | * @return string |
102 | 102 | */ |
103 | | - public static function namespaceSelector( $selected = '', $all = null, $hidden = false ) { |
| 103 | + public static function namespaceSelector( $selected = '', $all = null, $hidden = false, $element_name = 'namespace' ) { |
104 | 104 | global $wgContLang; |
105 | 105 | $namespaces = $wgContLang->getFormattedNamespaces(); |
106 | 106 | $options = array(); |
— | — | @@ -114,7 +114,7 @@ |
115 | 115 | $options[] = self::option( $name, $index, $index === $selected ); |
116 | 116 | } |
117 | 117 | |
118 | | - return Xml::openElement( 'select', array( 'id' => 'namespace', 'name' => 'namespace', |
| 118 | + return Xml::openElement( 'select', array( 'id' => 'namespace', 'name' => $element_name, |
119 | 119 | 'class' => 'namespaceselector' ) ) |
120 | 120 | . "\n" |
121 | 121 | . implode( "\n", $options ) |
Index: branches/liquidthreads/includes/Article.php |
— | — | @@ -1181,7 +1181,7 @@ |
1182 | 1182 | |
1183 | 1183 | if( $section == 'new' ) { |
1184 | 1184 | # Inserting a new section |
1185 | | - $subject = $summary ? "== {$summary} ==\n\n" : ''; |
| 1185 | + $subject = $summary ? wfMsgForContent('newsectionheaderdefaultlevel',$summary) . "\n\n" : ''; |
1186 | 1186 | $text = strlen( trim( $oldtext ) ) > 0 |
1187 | 1187 | ? "{$oldtext}\n\n{$subject}{$text}" |
1188 | 1188 | : "{$subject}{$text}"; |
— | — | @@ -1207,7 +1207,7 @@ |
1208 | 1208 | |
1209 | 1209 | # If this is a comment, add the summary as headline |
1210 | 1210 | if ( $comment && $summary != "" ) { |
1211 | | - $text = "== {$summary} ==\n\n".$text; |
| 1211 | + $text = wfMsgForContent('newsectionheaderdefaultlevel',$summary) . "\n\n".$text; |
1212 | 1212 | } |
1213 | 1213 | |
1214 | 1214 | $this->doEdit( $text, $summary, $flags ); |
— | — | @@ -2375,7 +2375,7 @@ |
2376 | 2376 | /** |
2377 | 2377 | * Do standard deferred updates after page edit. |
2378 | 2378 | * Update links tables, site stats, search index and message cache. |
2379 | | - * Every 1000th edit, prune the recent changes table. |
| 2379 | + * Every 100th edit, prune the recent changes table. |
2380 | 2380 | * |
2381 | 2381 | * @private |
2382 | 2382 | * @param $text New text of the article |
Index: branches/liquidthreads/includes/WatchlistEditor.php |
— | — | @@ -411,12 +411,8 @@ |
412 | 412 | if( $redirect ) |
413 | 413 | $link = '<span class="watchlistredir">' . $link . '</span>'; |
414 | 414 | $tools[] = $skin->makeLinkObj( $title->getTalkPage(), wfMsgHtml( 'talkpagelinktext' ) ); |
415 | | - if( $title->exists() ) { |
| 415 | + if( $title->exists() ) |
416 | 416 | $tools[] = $skin->makeKnownLinkObj( $title, wfMsgHtml( 'history_short' ), 'action=history' ); |
417 | | - } |
418 | | - if( $title->getNamespace() == NS_USER ) { |
419 | | - $tools[] = $skin->makeKnownLinkObj( SpecialPage::getTitleFor( 'Contributions' ), wfMsgHtml( 'contributions' ), 'target=' . $title->getPartialUrl() ); |
420 | | - } |
421 | 417 | return '<li>' |
422 | 418 | . Xml::check( 'titles[]', false, array( 'value' => $title->getPrefixedText() ) ) |
423 | 419 | . $link . ' (' . implode( ' | ', $tools ) . ')' . '</li>'; |
Index: branches/liquidthreads/includes/EditPage.php |
— | — | @@ -325,6 +325,8 @@ |
326 | 326 | } |
327 | 327 | |
328 | 328 | $permErrors = $this->mArticle->getTitle()->getUserPermissionsErrors( 'edit', $wgUser); |
| 329 | + if( !$this->mTitle->exists() ) |
| 330 | + $permErrors += $this->mTitle->getUserPermissionsErrors( 'create', $wgUser); |
329 | 331 | |
330 | 332 | # Ignore some permissions errors. |
331 | 333 | $remove = array(); |
— | — | @@ -349,7 +351,7 @@ |
350 | 352 | # array_diff returns elements in $permErrors that are not in $remove. |
351 | 353 | $permErrors = array_diff( $permErrors, $remove ); |
352 | 354 | |
353 | | - if ($permErrors != array()) |
| 355 | + if ( !empty($permErrors) ) |
354 | 356 | { |
355 | 357 | wfDebug( "$fname: User can't edit\n" ); |
356 | 358 | $wgOut->readOnlyPage( $this->getContent(), true, $permErrors ); |
Index: branches/liquidthreads/includes/OutputPage.php |
— | — | @@ -850,7 +850,7 @@ |
851 | 851 | $this->enableClientCache( false ); |
852 | 852 | $this->mRedirect = ''; |
853 | 853 | $this->mBodytext = ''; |
854 | | - $this->addWikitext( $this->formatPermissionsErrorMessage( $errors ) ); |
| 854 | + $this->addWikiText( $this->formatPermissionsErrorMessage( $errors ) ); |
855 | 855 | } |
856 | 856 | |
857 | 857 | /** @deprecated */ |
— | — | @@ -998,6 +998,8 @@ |
999 | 999 | * @todo document |
1000 | 1000 | * @param bool $protected Is the reason the page can't be reached because it's protected? |
1001 | 1001 | * @param mixed $source |
| 1002 | + * @param bool $protected, page is protected? |
| 1003 | + * @param array $reason, array of arrays( msg, args ) |
1002 | 1004 | */ |
1003 | 1005 | public function readOnlyPage( $source = null, $protected = false, $reasons = array() ) { |
1004 | 1006 | global $wgUser, $wgReadOnlyFile, $wgReadOnly, $wgTitle; |
— | — | @@ -1005,8 +1007,8 @@ |
1006 | 1008 | |
1007 | 1009 | $this->setRobotpolicy( 'noindex,nofollow' ); |
1008 | 1010 | $this->setArticleRelated( false ); |
1009 | | - |
1010 | | - if ($reasons != array()) { |
| 1011 | + |
| 1012 | + if ( !empty($reasons) ) { |
1011 | 1013 | $this->setPageTitle( wfMsg( 'viewsource' ) ); |
1012 | 1014 | $this->setSubtitle( wfMsg( 'viewsourcefor', $skin->makeKnownLinkObj( $wgTitle ) ) ); |
1013 | 1015 | |
Index: branches/liquidthreads/includes/api/ApiQueryRevisions.php |
— | — | @@ -236,7 +236,7 @@ |
237 | 237 | $vals['timestamp'] = wfTimestamp(TS_ISO_8601, $row->rev_timestamp); |
238 | 238 | } |
239 | 239 | |
240 | | - if ($this->fld_len && !is_null($row->rev_len)) { |
| 240 | + if ($this->fld_size && !is_null($row->rev_len)) { |
241 | 241 | $vals['size'] = intval($row->rev_len); |
242 | 242 | } |
243 | 243 | |
Index: branches/liquidthreads/includes/DifferenceEngine.php |
— | — | @@ -215,14 +215,14 @@ |
216 | 216 | wfMsg( 'minoreditletter') ) . ' '; |
217 | 217 | } |
218 | 218 | |
219 | | - $oldHeader = "<strong>{$this->mOldtitle}</strong><br />" . |
220 | | - $sk->revUserTools( $this->mOldRev ) . "<br />" . |
221 | | - $oldminor . $sk->revComment( $this->mOldRev, !$diffOnly ) . "<br />" . |
222 | | - $prevlink; |
223 | | - $newHeader = "<strong>{$this->mNewtitle}</strong><br />" . |
224 | | - $sk->revUserTools( $this->mNewRev ) . " $rollback<br />" . |
225 | | - $newminor . $sk->revComment( $this->mNewRev, !$diffOnly ) . "<br />" . |
226 | | - $nextlink . $patrol; |
| 219 | + $oldHeader = '<div id="mw-diff-otitle1"><strong>' . $this->mOldtitle . '</strong></div>' . |
| 220 | + '<div id="mw-diff-otitle2">' . $sk->revUserTools( $this->mOldRev ) . "</div>" . |
| 221 | + '<div id="mw-diff-otitle3">' . $oldminor . $sk->revComment( $this->mOldRev, !$diffOnly ) . "</div>" . |
| 222 | + '<div id="mw-diff-otitle4">' . $prevlink . '</div>'; |
| 223 | + $newHeader = '<div id="mw-diff-ntitle1"><strong>' .$this->mNewtitle . '</strong></div>' . |
| 224 | + '<div id="mw-diff-ntitle2">' . $sk->revUserTools( $this->mNewRev ) . " $rollback</div>" . |
| 225 | + '<div id="mw-diff-ntitle3">' . $newminor . $sk->revComment( $this->mNewRev, !$diffOnly ) . "</div>" . |
| 226 | + '<div id="mw-diff-ntitle4">' . $nextlink . $patrol . '</div>'; |
227 | 227 | |
228 | 228 | $this->showDiff( $oldHeader, $newHeader ); |
229 | 229 | |
— | — | @@ -1869,3 +1869,4 @@ |
1870 | 1870 | } |
1871 | 1871 | |
1872 | 1872 | |
| 1873 | + |
Index: branches/liquidthreads/includes/Title.php |
— | — | @@ -1178,12 +1178,11 @@ |
1179 | 1179 | ( !$this->isTalkPage() && !$user->isAllowed( 'createpage' ) ) ) { |
1180 | 1180 | $errors[] = $user->isAnon() ? array ('nocreatetext') : array ('nocreate-loggedin'); |
1181 | 1181 | } |
1182 | | - } elseif( $action == 'move' && |
1183 | | - !( $this->isMovable() && $user->isAllowed( 'move' ) ) ) { |
| 1182 | + } elseif( $action == 'move' && !( $this->isMovable() && $user->isAllowed( 'move' ) ) ) { |
1184 | 1183 | $errors[] = $user->isAnon() ? array ( 'movenologintext' ) : array ('movenotallowed'); |
1185 | | - } else if ( !$user->isAllowed( $action ) ) { |
| 1184 | + } else if ( !$user->isAllowed( $action ) ) { |
1186 | 1185 | $return = null; |
1187 | | - $groups = array(); |
| 1186 | + $groups = array(); |
1188 | 1187 | global $wgGroupPermissions; |
1189 | 1188 | foreach( $wgGroupPermissions as $key => $value ) { |
1190 | 1189 | if( isset( $value[$action] ) && $value[$action] == true ) { |
— | — | @@ -1191,7 +1190,7 @@ |
1192 | 1191 | $groupPage = User::getGroupPage( $key ); |
1193 | 1192 | if( $groupPage ) { |
1194 | 1193 | $skin = $user->getSkin(); |
1195 | | - $groups[] = $skin->makeLinkObj( $groupPage, $groupName ); |
| 1194 | + $groups[] = '[['.$groupPage->getPrefixedText().'|'.$groupName.']]'; |
1196 | 1195 | } else { |
1197 | 1196 | $groups[] = $groupName; |
1198 | 1197 | } |
Index: branches/liquidthreads/includes/DatabasePostgres.php |
— | — | @@ -102,6 +102,9 @@ |
103 | 103 | function implicitGroupby() { |
104 | 104 | return false; |
105 | 105 | } |
| 106 | + function implicitOrderby() { |
| 107 | + return false; |
| 108 | + } |
106 | 109 | function searchableIPs() { |
107 | 110 | return true; |
108 | 111 | } |
Index: branches/liquidthreads/includes/Database.php |
— | — | @@ -441,6 +441,14 @@ |
442 | 442 | } |
443 | 443 | |
444 | 444 | /** |
| 445 | + * Returns true if this database does an implicit order by when the column has an index |
| 446 | + * For example: SELECT page_title FROM page LIMIT 1 |
| 447 | + */ |
| 448 | + function implicitOrderby() { |
| 449 | + return true; |
| 450 | + } |
| 451 | + |
| 452 | + /** |
445 | 453 | * Returns true if this database can do a native search on IP columns |
446 | 454 | * e.g. this works as expected: .. WHERE rc_ip = '127.42.12.102/32'; |
447 | 455 | */ |
Index: branches/liquidthreads/languages/messages/MessagesEn.php |
— | — | @@ -713,6 +713,7 @@ |
714 | 714 | 'feed-rss' => 'RSS', # only translate this message to other languages if you have to change it |
715 | 715 | 'sitenotice' => '-', # the equivalent to wgSiteNotice; don't translate or duplicate this message to other languages |
716 | 716 | 'anonnotice' => '-', # don't translate or duplicate this message to other languages |
| 717 | +'newsectionheaderdefaultlevel' => '== $1 ==', # don't translate or duplicate this message to other languages |
717 | 718 | |
718 | 719 | # Short words for each namespace, by default used in the 'article' tab in monobook |
719 | 720 | 'nstab-main' => 'Article', |
Index: branches/liquidthreads/RELEASE-NOTES |
— | — | @@ -194,8 +194,9 @@ |
195 | 195 | text for a non-existent page |
196 | 196 | * (bug 11022) Use a more accurate page title for Special:Whatlinkshere and |
197 | 197 | Special:Recentchangeslinked |
198 | | -* Add link to user contributions in normal watchlist edit mode |
199 | | - |
| 198 | +* (bug 9426) Add 'newsectionheaderdefaultlevel' message to allow modification |
| 199 | + of the heading formatting for new sections when section=new argument is supplied |
| 200 | + |
200 | 201 | == Bugfixes since 1.10 == |
201 | 202 | |
202 | 203 | * (bug 9712) Use Arabic comma in date/time formats for Arabic and Farsi |
— | — | @@ -428,8 +429,9 @@ |
429 | 430 | * (bug 8393) <sup> and <sub> need to be preserved (without attributes) for |
430 | 431 | entries in the table of contents |
431 | 432 | * (bug 11114) Fix regression in read-only mode error display during editing |
| 433 | +* Force non-MySQL databases to use an ORDER BY in SpecialAllpages to ensure |
| 434 | + that the first page_title is truly the first page title. |
432 | 435 | |
433 | | - |
434 | 436 | == API changes since 1.10 == |
435 | 437 | |
436 | 438 | Full API documentation is available at http://www.mediawiki.org/wiki/API |
Property changes on: branches/liquidthreads |
___________________________________________________________________ |
Modified: svnmerge-integrated |
437 | 439 | - /trunk/phase3:1-25371 |
438 | 440 | + /trunk/phase3:1-25414 |