Commit graph

866 commits

Author SHA1 Message Date
Victor Vasiliev
d636fac2d8 Allow extensions to add pages with non-wikitext display by adding two new
hooks (generalizing the code already used for CSS/JS pages).
2011-08-11 17:21:31 +00:00
Alexandre Emsenhuber
73085da1b1 Made code more readable by moving the check about user being last editor when an edit conflicts occurs near related checks; also removed some variables that were used only once 2011-08-06 20:39:15 +00:00
Chad Horohoe
4beb6b59f4 Self-revert r91453: not a well thought out addition to the EditPage::showEditForm:initial hook 2011-08-04 21:04:59 +00:00
Sam Reed
183d2dab37 Back out r93533, r93531, r93530
Breaks unit tests as below, not going to be able to fix them before I disappear for the evening, so might aswell leave trunk clean

ArticleTablesTest testbug14404

Error:
ArticleTablesTest::testbug14404
Undefined offset: 0

/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/includes/ArticleTablesTest.php:31
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/MediaWikiTestCase.php:60
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/MediaWikiPHPUnitCommand.php:20
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/phpunit.php:60

ParserTests testParserTest #552 - testParserTest with data set #551

Failure:
ParserTests::testParserTest with data set #551 ('RAW magic word', '{{RAW:QUERTY}}', '<p><a href="/index.php?title=Template:QUERTY&amp;action=edit&amp;redlink=1" class="new" title="Template:QUERTY (page does not exist)">Template:QUERTY</a>
</p>', '', '')
RAW magic word
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-<p><a href="/index.php?title=Template:QUERTY&amp;action=edit&amp;redlink=1" class="new" title="Template:QUERTY (page does not exist)">Template:QUERTY</a>
+<p><a href="/index.php?title=Template:RAW:QUERTY&amp;action=edit&amp;redlink=1" class="new" title="Template:RAW:QUERTY (page does not exist)">Template:RAW:QUERTY</a>
 </p>

/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/includes/parser/NewParserTest.php:545
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/MediaWikiTestCase.php:60
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/MediaWikiPHPUnitCommand.php:20
/home/ci/cruisecontrol-bin-2.8.3/projects/mw/source/tests/phpunit/phpunit.php:60
2011-07-30 15:56:54 +00:00
Sam Reed
dc9d39887e Merge iwtransclusion branch into trunk 2011-07-30 15:30:01 +00:00
Alexandre Emsenhuber
ba84011526 * Changed OutputPage::$mIsArticle flag to be false by default. A lot of actions don't change that flag when they should, since about only action=view should have it to true.
* Put OutputPage::$mIsArticleRelated declaration just below $mIsArticle's one since they are related
* Made DifferenceEngine consistent with action=view, i.e. setting that flag to true when displaying any version of the page, current or not
* Made Skin::getCopyright() always use history_copyright when displaying an old version, regardless to the diff parameter
* Changed some checks from namespace != NS_SPECIAL && action=view to isArticle() so that they don't get executed when e.g. throwing an Exception (or similar things)
2011-07-27 13:14:28 +00:00
Brion Vibber
51d0ffeb17 Revert non-functional parts of r82343 -- 'select' parameter that's never actually been exported or used, and was always being forced to true before being discarded anyway. 2011-07-20 23:51:52 +00:00
Alexandre Emsenhuber
9e7167bbca * Use wfMessage() instead of OutputPage::addWikiMsgArray() with the third parameter
* In EditPage.php: call Linker methods statically
2011-07-16 19:19:01 +00:00
Alexandre Emsenhuber
db6f6bd21c * In EditPage.php: don't add the separator if getCancelLink() returns an empty string
* In TalkHere extension: override getCancelLink() instead of having mangleEditForm() hack
2011-07-12 15:38:07 +00:00
Robin Pepermans
7c624542f0 (bug 6100; follow-up to r91315) Being bold and removing $wgBetterDirectionality (and dependent wfUILang) in core, as most or all work is finished.
Also:
* Introduce classes mw-float-end, mw-float-start so we don't have to use inline css depending on wfUILang()/$wgLang (see HistoryPage and SpecialFileDuplicateSearch)
* Add direction mark to protection log
* Remove specialpageattributes as it is obsoleted by this commit (also fixes bug 28572)
* Add two direction marks in wfSpecialList, which makes ltr links on rtl wiki (and vice versa) display nicely as well (only on those special pages however)
* Revert r91340 partially: use mw-content-ltr/rtl class anyway in shared.css. Both ways have their [dis]advantages...
* Set the direction of input fields by default to the content language direction (except buttons etc.) in shared.css
2011-07-06 02:26:06 +00:00
Chad Horohoe
be876831c5 (bug 5800) Added $formCallback as a parameter to the hook EditPage::showEditForm:initial 2011-07-05 12:48:46 +00:00
Alexandre Emsenhuber
8635d5cb65 Changed calls to Linker::tooltipAndAccesskeyAttribs() to be static and fixed casing in method's name 2011-07-04 08:28:27 +00:00
Robin Pepermans
d761eab349 Make parser->getFunctionLang be dependent on title->getPageLanguage() instead of $wgContLang, i.e. the page content language instead of the wiki content language. This sets the right language on page view + edit for all pages, instead of only edit preview on MediaWiki namespace pages (as in EditPage.php). 2011-06-26 22:58:27 +00:00
Brian Wolff
4621f21e15 (bug 8556) When using $wgRawHtml, don't show scary session_failure/possible attack
warning when you try to edit categories.

Categories automatically go to preview on open, but there's no edit token
on the initial open of the edit window, which causes big warning over nothing.
2011-06-26 02:40:00 +00:00
Robin Pepermans
6f791165b7 Directionality improvements as part of bug 6100 (under $wgBetterDirectionality):
* Add CSS that should fix all LTR/LTR text on both LTR/RTL wikis, for the editsection link, TOC, and lists (ul/ol).
* Add a class mw-content-ltr/rtl for that.
* Change the divs on CategoryPage so it works wit that CSS.
This is the last relatively major issue for bug 6100.
2011-06-24 23:01:49 +00:00
Platonides
690af6341e Remove unused global $wgContLang 2011-06-22 21:36:42 +00:00
Matěj Grabovský
c8c3159a85 Follow-up r90371, per comment by ^demon
Escape wikitext in username before passing it to certain messages; also remove <nowiki>s in those as they're superfluous.
2011-06-20 19:45:35 +00:00
Robin Pepermans
5eccd533aa Fix double setTargetLanguage of r90337 2011-06-18 15:08:05 +00:00
Robin Pepermans
ca6fcb7e3f Address comment by Platonides on r90320:
* undefined variable $list in CategoryPage.php
* move code in ParserOptions to a new member of Title class, which falls back to $wgContLang
2011-06-18 14:49:01 +00:00
Platonides
44396ab47b Follow up r90320. The purpose of wfProfileIn/Out is to profile
the contents of the function. So it shall be the last instruction.
2011-06-18 14:01:12 +00:00
Robin Pepermans
0288575c25 Follow-up to r90265: directionality improvements as part of bug 6100 (under $wgBetterDirectionality):
* Use ParserOptions()->getTargetLanguage() for setting the page language/direction
* Set headings on categories in user language/direction
* Only set language/direction when viewing a page (or editing but only preview and textarea)
2011-06-17 21:48:43 +00:00
Sam Reed
bdf84cb20e Swap else if for elseif
Trimming trailing whitespace also

Doing in 3 commits, so hopefully reviewable in CR...
2011-06-17 16:03:52 +00:00
Krinkle
2d03eedf8a WatchAction requires token (BREAKING CHANGE)
* (bug 27655) Require token for watching/unwatching pages
* Previously done for API (bug 29070) in r88522
* As with markpatrolled, the tokens are not compatible and made that way on purpose. The API requires the POST method and uses a universal token per-session. Since the front-end is all GET based (also per convention like in markpatrolled and rollback) they are stronger salted (title / action specific)
* ajax.watch used the API already and was switched in r88554.
* The actual watching/unwatching code was moved from WatchAction->onView to WatchAction::doWatch. This was done to allow the API to do the action without needing to generate a token like the front-end needs (or having to duplicate code). It is now similar to RecentChange::markPatrolled (in that it  also a "central" function that does not care about tokens, it's called after the token-handling)
* JavaScript / Gadgets that utilize action=watch in their scripts:
** Effects should be minimal as they should be using the API (see r88522 and wikitech-l)
** If they use index.php and scrap the link from the page, they can continue to do so.

* There are links to the watch action all over the place. I've tried to catch most of them, but there may be some I miss. Migration in most cases is just a matter of adding an array item to the $query for:
 'token' => WatchAction::getWatchToken( $title, $user [, $action] )
or changing:
 Action::factory( 'watch', $article )->execute();
to:
 WatchAction::doWatch( $title, $user );

While replacing the usages in some cases an instance of Article() no longer had to be created, in others $wgUser had to be retrieved from global (which was implied before but needs to be given directly now)

Other notes:
* Article->unwatch() and Article->watch(), which were deprecated as of 1.18 and are no longer used in core, may be broken in scenarios where the Request does not have a 'token' but is making a call to $article->watch()
* Some extensions need to be fixed, I'm currently running a grep search and will fix them a.s.a.p 


[1] http://www.mediawiki.org/wiki/ResourceLoader/Default_modules?mw.user#tokens
2011-06-06 00:09:03 +00:00
Sam Reed
aa9bc3ba41 Adding method documentation
Add a couple of explicit variable definitions

Add some braces

Add one false; to return under case self::AS_NO_CREATE_PERMISSION:
2011-06-05 14:46:55 +00:00
Sam Reed
0d47a2ae90 More parameter documentation!! 2011-05-28 14:52:55 +00:00
Sam Reed
912b95a104 More documentation tweaks/additions 2011-05-26 20:26:51 +00:00
Sam Reed
ebef5e723b More documentation tweaks/additions 2011-05-26 19:52:56 +00:00
Sam Reed
e514478ba5 Fix function level comments that start with /* not /** 2011-05-21 19:35:16 +00:00
Roan Kattouw
ce7434f708 (bug 29036) For cascade-protected pages, the mw-textarea-cprotected class is added to the textarea on the edit form. Patch by Erwin Dokter 2011-05-19 19:48:50 +00:00
Siebrand Mazeland
75c6696aa8 Use consistent notation for "@todo FIXME". Should update http://svn.wikimedia.org/doc/todo.html nicely. 2011-05-17 22:03:20 +00:00
Benjamin Lees
25a779ce49 (bug 28287) The "your changes" box for edit conflicts is now read-only. Patch by MZMcBride. 2011-05-14 22:57:55 +00:00
Alexandre Emsenhuber
23eb73a30a Fix for r86041: when the user wants to unwatch the article, really unwatch it ;) 2011-05-12 20:39:41 +00:00
Sam Reed
f985524076 More versions added to @deprecated tags
Couple of inbound calls fixed up

Some ancient code removed as it's been marked deprecated
2011-05-06 21:50:18 +00:00
Leo Koppelkamm
2dfc1bd9ed Followup to r86603 per Bug 28681 : Create public array mw.toolbar.buttons. User scripts can modify it, until it's written to the DOM on doc.ready 2011-04-26 10:08:46 +00:00
Roan Kattouw
cfb6c7ceea (bug 21180) Move the old toolbar below the summary input to match the new toolbar 2011-04-25 11:35:40 +00:00
Mark A. Hershberger
07753d2796 Remove hints since $this->isNew was not possible anywhere else. 2011-04-25 03:20:17 +00:00
Mark A. Hershberger
32f659d05f * Fixes Bug #27860 - Minor edit after clicking 'new section' tab
Patch from Jan Paul Posma of which he writes:

    This patch hides the minor edit checkbox when editing a new page or new
    section, and makes sure it cannot be enabled by injecting the form value in
    HTML.

* Add Jan Paul Posma to CREDITs re Reedy's earlier comments.
* Add note about isNew to other possible places that it can be used.
2011-04-23 18:58:03 +00:00
Happy-melon
545d854a39 Documentation and type hinting. 2011-04-23 13:55:27 +00:00
Leo Koppelkamm
92d5213ece Move edit.js stuff to mediawiki.action.edit.js, and remove wikibits dependency. Wrap publicly accessible functions inside mw.toolbar & provide legacy shortcuts to those. Make the traditional toolbar use $.fn.textSelection, to reduce code duplication. This fixes Bug 27116, Bug 15705, Bug 11011 2011-04-21 08:19:24 +00:00
Alexandre Emsenhuber
4207ab0c63 * (bug 28511) Use [] syntax instead of {} for string offset access 2011-04-17 07:59:58 +00:00
Happy-melon
8779f4b55f r86001, now with less scariness :P I took out the delete action and did purge instead, which is a much more self-contained action-with-a-form. Also implement a few changes suggested by Brion on IRC last night. 2011-04-14 10:38:29 +00:00
Happy-melon
bc4a096805 Revert r86001: Brion says it's too scary :D will recommit in pieces 2011-04-13 23:36:27 +00:00
Happy-melon
6dc8136d12 New infrastructure for actions, as discussed on wikitech-l. Fairly huge commit.
* Actions come in two flavours: the show-a-form-then-do-something-with-the-result (delete, protect, edit, etc) and the just-do-something (watch, rollback, patrol, etc).  Create abstract base classes Action and FormlessAction to support these two cases.  HTMLForm is an integral part of the form-based structure.
* Look mum, no globals!  :D  Fully context-based.
* Implement watch/unwatch, credits and delete actions in the new system as proof-of-concept.  This also gives the delete frontend a much-needed overhaul.
* Stub out the newly-deprecated functions from Article.php.  This already reduces its linecount by about 15%, and there are plenty more actions still to do.
* Centralising actions like this is going to render a lot of hooks type-incompatible.  There's simply nowhere you can put the ArticleConfirmDelete hook, for instance, where it can be passed an OutputPage as the second parameter.  On the other hand, we can implement new hooks like ActionModifyFormFields and ActionBeforeFormDisplay, which can do much prettier stuff to the forms, like adding extra fields the 'right' way.  Update LiquidThreads to use these new hooks where appropriate.
2011-04-13 23:04:07 +00:00
Aaron Schulz
837d39dec7 * Removed getSelectOptions, which did nothing other than send FOR UPDATE on some slave queries to barely used features
* Removed only Core use of forUpdate(); same issue
2011-04-13 00:50:44 +00:00
Happy-melon
c1e9e08e15 Follow-up r85020 per CR - use strict comparison 2011-03-30 18:06:05 +00:00
Happy-melon
f577792eb7 (bug 18937) avoid broken wikimarkup (four apostrophes together) in MediaWiki:Confirmrecreate when there is no deletion reason, by using a separate message. 2011-03-30 17:04:03 +00:00
Sam Reed
593f98ff2e More member variable documentation 2011-02-24 17:04:49 +00:00
Roan Kattouw
6cc435d68a Revert r74387: it may not fix the IE8 jumping bug in all cases, but it definitely fixes it in most cases. Reverting a partial fix for not being perfect, then never coming up with a full fix is not acceptable. 2011-02-19 19:21:52 +00:00
Mark A. Hershberger
ef74c0a178 Followup bug #27447 and r82308 and r82328 with patch supplied by
Carsten Nielsen to take care of the warning and supply some
documentation.  Also fixed up language in the comments.
2011-02-17 18:41:44 +00:00
Niklas Laxström
b1896720e1 Rv part of r82308 that causes warnings 2011-02-17 10:12:05 +00:00