Commit graph

23 commits

Author SHA1 Message Date
Daniel Friesen
39ab3cfc9f Implement Message::isBlank and Message::isDisabled.
And while we're at it... update a random assortment of code using wfEmptyMsg to use the new wfMessage class and our exists/isBlank/isDisabled methods.
2011-01-14 10:51:05 +00:00
Daniel Friesen
2f933fedba Fix bug 14267 by adding support for a MediaWiki:Mainpage-nstab.
Additionally, *cough* *cough*:
* Add a Title::isMainPage helper for the fairly common $title->equals( Title::newMainPage() ); test.
* Update wfMessageFallback to also accept an array of message keys instead of requiring them listed as arguments to the function.
* Move the bulk of wfMessageFallback code into Message.php instead of leaving it in GlobalFunctions.php
* Change the wfMessageFallback implementation so that the Message class handles the fallbacks themselves eliminating any side effects caused by the fact that wfEmptyMsg always used usedb=false, language=userlang when one might actually use a different language or usedb setting in the message object that actually returned the text (this may be considered a wfEmptyMsg regression in 1.18).
* Make blank "" message contents fallback like nonexistant messages do.
* Re use the new tabAction array handling used to support mainpage-nstab in the talk and view tabs instead of making wfEmptyMsg calls directly in SkinTemplate.
2011-01-14 08:32:10 +00:00
Alexandre Emsenhuber
1e22a9dbde Allow OutputPage::parse() to parse in any langauge, modified wfMsgExt() and wfMessage() accordingly 2011-01-05 12:24:39 +00:00
Niklas Laxström
df5e9a91a7 (bug 25273) Message::params() triggers a fatal error.
Patch by hashar.
2010-09-23 19:15:58 +00:00
Chad Horohoe
4a025d936a Skip new object construction if it's going to be the same 2010-09-22 19:19:47 +00:00
Niklas Laxström
9eebeaa3d1 Fix to language handling 2010-09-20 13:24:31 +00:00
Niklas Laxström
ab9595e304 One step forward with the Message class.
wfMessage can be used now. Later the old wfMsg* function will be changed to just wrappers over the new class.
2010-09-02 17:12:56 +00:00
Niklas Laxström
f3511bbc69 Update syntax examples a bit 2010-07-08 09:03:47 +00:00
Niklas Laxström
f33313abdc Fixed a bug in __construct 2010-03-31 10:10:49 +00:00
Niklas Laxström
b4f9c12705 Fix syntax terrors 2010-03-29 19:18:58 +00:00
Max Semenik
3b1a10c0c6 Started tests for Message class, fixed one bug found by them 2010-03-29 14:30:42 +00:00
Niklas Laxström
206632ac47 Message::key() accepts message parameters as varargs. Renamed ::language() to ::inLanguage() 2010-03-29 14:08:23 +00:00
Roan Kattouw
d4cbde99eb Message.php fixes:
* Don't call params() for every param passed to the constructor
* Use self
* Use array_merge() instead of += , the latter behaves contrary to the documentation
* Fix capitalization of toString() calls
* Various style, typo fixes
2010-03-28 19:23:39 +00:00
Niklas Laxström
a92fb166fb Remove options array and move message fetching one level down.
Options is now to value members: format and useDatabase.
fetchMessage() can be overwritten to use other message source
like for example testing purposes.
2010-03-28 15:22:49 +00:00
Chad Horohoe
ecbd13d6e4 Factory functions are static 2010-03-28 14:53:01 +00:00
Alexandre Emsenhuber
77cfdb7bb2 Modified the documentation for better rendering in doxygen 2010-03-25 21:28:27 +00:00
Happy-melon
209fa62c8e Various tweaks and fixes. 2010-03-25 20:52:52 +00:00
Happy-melon
77c882769c Work on Message.php:
* Just one function for adding parameters, not three.  
* Implement an options framework: one extra widget (get-message-not-from-db) already in use in wfMsgNoDB(), others will probably follow, so set up something to keep them clean.
* Lay the groundwork for supporting __tostring() when MW stops supporting PHP < 5.2.0
* Fix various fatal and non-fatal errors
* Make use of r64178 to clean out any dependency on the wfMsg* functions.
2010-03-25 20:34:56 +00:00
Chad Horohoe
9bae2600f1 This is PHP, updating docs to reflect that 2010-03-25 13:10:26 +00:00
Niklas Laxström
e5941506f9 Tidy up the class
Added documentation and examples, fixed a bug with escaped() and better handling for languages.
2010-03-23 15:41:18 +00:00
Jack Phoenix
8f385c5bb0 braces, spacing + comment tweaks 2010-03-22 18:39:53 +00:00
Alexandre Emsenhuber
10a3197429 * Fixed examples (use -> for access to object's methods, not .)
* Formatted comment
* svn:eol-style native
2010-03-22 17:56:04 +00:00
Niklas Laxström
61095ced9f New message class up for discussion and development.
Not ment for use yet. It is just isolated file so it really doesn't need branch either.
2010-03-22 17:05:32 +00:00