Commit graph

891 commits

Author SHA1 Message Date
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
Daniel Friesen
8569cc6203 Drop the $out params I added before I added context to Skin, as well deprecate some of the $out params in other methods. 2011-05-04 10:43:40 +00:00
Daniel Friesen
37ddf59571 Add proper $out setting to Skin::getCategories which is present in the other similar methods. Replaces r87380. 2011-05-04 01:53:05 +00:00
Chad Horohoe
5c5322b1bb Add hack to shut up fatals when getCategories() is called without an actual OutputPage 2011-05-04 01:43:03 +00:00
Alexandre Emsenhuber
f3e7cac6f9 Removed Skin::$usercss, always false, nothing sets this 2011-05-03 09:43:34 +00:00
Alexandre Emsenhuber
90d6d37204 Typo Typo Typo 2011-05-02 17:39:29 +00:00
Alexandre Emsenhuber
8d0178c60b * Removed Skin::reallyGenerateUserStylesheet() nothing uses it and nothing overrides it
* Corrected Skin::generateUserJs() and Skin::generateUserStylesheet()'s comments: nothing override them anymore, also marked them as deprecated, only usage is action=raw&gen=(css|js)
2011-05-02 17:30:17 +00:00
Alexandre Emsenhuber
04d2417f8f Moved Skin::$mWatchLinkNum to SkinLegacy since it's only used there and made it protected per documentation (nothing else apart SkinLegacy uses it) 2011-05-02 15:32:20 +00:00
Alexandre Emsenhuber
126ceb56d7 Get the revision ID from the OutputPage object instead of making a copy 2011-05-02 15:26:19 +00:00
Siebrand Mazeland
02e44a71b0 Revert r86872: Breaks LiquidThreads page moves with the below failure. Threads are lost and nowhere to be found any more.
[25-Apr-2011 18:12:45] /wiki/Special:MoveThread/Thread:User_talk:Siebrand/test/One_new_message: Exception: MWNamespace::getTalk does not make any sense for given namespace -1
#0 /www/w/includes/Namespace.php(81): MWNamespace::isMethodValidFor(-1, 'MWNamespace::ge...')
#1 /www/w/includes/WatchedItem.php(73): MWNamespace::getTalk(-1)
#2 /www/w/includes/User.php(2304): WatchedItem->addWatch()
#3 /www/w/includes/actions/WatchAction.php(53): User->addWatch(Object(Title))
#4 /www/w/includes/Action.php(376): WatchAction->onView()
#5 /www/w/extensions/LiquidThreads/classes/Thread.php(115): FormlessAction->execute()
#6 /www/w/extensions/LiquidThreads/classes/Thread.php(435): Thread::create(Object(Article), Object(Article), NULL, 1, 'One new message')
#7 /www/w/extensions/LiquidThreads/classes/Thread.php(414): Thread->leaveTrace('move test', Object(Title), Object(Title))
#8 /www/w/extensions/LiquidThreads/pages/SpecialMoveThread.php(107): Thread->moveToPage(Object(Title), 'move test', true)
#9 [internal function]: SpecialMoveThread->trySubmit(Array)
#10 /www/w/includes/HTMLForm.php(279): call_user_func(Array, Array)
#11 /www/w/includes/HTMLForm.php(228): HTMLForm->trySubmit()
#12 /www/w/includes/HTMLForm.php(242): HTMLForm->tryAuthorizedSubmit()
#13 /www/w/extensions/LiquidThreads/pages/ThreadActionPage.php(37): HTMLForm->show()
#14 /www/w/includes/SpecialPageFactory.php(459): ThreadActionPage->execute('Thread:User_tal...')
#15 /www/w/includes/Wiki.php(252): SpecialPageFactory::executePath(Object(Title), Object(RequestContext))
#16 /www/w/includes/Wiki.php(98): MediaWiki->handleSpecialCases()
#17 /www/w/index.php(145): MediaWiki->performRequestForTitle(NULL)
#18 {main}
2011-04-25 18:20:53 +00:00
Happy-melon
70bdc008c4 Implement an interface and abstract class to hold the widely-reused get(Request|User|Title|Lang|Skin|Output) accessors for objects acting as a context source. Article is rather messier because both getTitle() and getUser() are in use for other things, and Article::$mTitle is in extremely wide use both within Article.php and outside. 2011-04-25 17:37:43 +00:00
Alexandre Emsenhuber
0ca36d006e Use wfMsgExt() instead of wfMsgReal() 2011-04-22 21:05:47 +00:00
Happy-melon
2c9cfd7cce Refactor the factory/i18n/list/etc static methods from SpecialPage into their own class; there's no reason we need to be parsing them in every single SpecialPage subclass. Leave all the methods as stubs in SpecialPage.php; if we required PHP 5.3 they could be replaced by a a __callStatic() magic method, but that doesn't work on PHP 5.2.
Also make a few changes to the functions available.  SpecialPageFactory::resolveAlias() now takes an optional subpage and returns array(<name>,<subpage>).  Similarly merge getPage() and getPageByAlias().  There were many examples of (extensions particularly) making dubious assumptions about the presence or absence of subpages or canonical-ness.

I didn't deprecate SpecialPage::getTitleFor() as it's got over six hundred calls.  I'm rather undecided on the best position of getPage()/executePath().  Although the latter needs cleanup anyway.
2011-04-17 11:31:11 +00:00
Happy-melon
626e9fd811 Fix fatal in Standard skin. 2011-04-16 20:22:18 +00:00
Happy-melon
e76c7823c1 Update Skin.php to not call the now-separate Linker methods via $this->foo(). 2011-04-16 20:01:39 +00:00
Roan Kattouw
82bf4764ea For bug 27488: move the startup script, jquery+mediawiki and the mw.config.set() call for configuration variables back to the <head> . Let modules control whether they're loaded in the <head> ('top') or at the bottom of the <body> ('bottom') through the position parameter/property
Also rearranges the loading order a little bit such that only=messages comes before only=scripts, and config comes before everything except startup and jquery+mediawiki
2011-04-07 12:07:25 +00:00
Tim Starling
7bb50c630a The beginnings of HipHop compiled mode support. It works now for parser cache hits.
* Work around HipHop issue 314 (volatile broken) and issue 308 (no compilation detection) by adding some large and ugly compilation detection code to WebStart.php and doMaintenance.php.
* Provide an MW_COMPILED constant which can be used to detect compiled mode throughout the codebase.
* Introduced wfIsHipHop(), which detects either compiled or interpreted mode. Used this to work around unusual eval() return value in eval.php.
* Work around lack of ini_get() in Maintenance.php, by duplicating wfIsHipHop(). 
* In Maintenance::shouldExecute(), accept "include" as an inclusion function name, since all kinds of inclusion give this string in HipHop.
* Introduced new class MWInit, which provides some static functions in the pre-autoloader environment.
* Introduced MWInit::compiledPath(), which provides a relative path for invoking a compiled file, and MWInit::interpretedPath(), which provides an absolute path for interpreting a PHP file. Used these new functions in the appropriate places.
* When we are running compiled code, don't include files which would generate duplicate class, function or constant definitions. Documented the new requirements on the contents of Defines.php and UtfNormalDefines.php.
* In HipHop compiled mode, it's not possible to have executable code in the same file as a class definition. 
  ** Moved MimeMagic initialisation to the constructor.
  ** Moved Namespace.php global variable initialisation to Setup.php.
  ** Moved MemcachedSessions.php initialisation to the caller in GlobalFunctions.php.
  ** Moved Sanitizer.php constants and global variables to static class members. Introduced an accessor function for the attribs regex, as a new place to put code formerly at file level. 
  ** Moved Language.php initialisation of $wgLanguageNames to Language::getLanguageNames(). Removed the global variable, marked "private" since forever.

* In two places: don't use error_log() with type=3 to append to a file, HipHop doesn't support it. Use file_put_contents() with FILE_APPEND instead.
* Work around the terrible breakage of class_exists() by using MWInit::classExists() instead in various places. In WebInstaller::getPageByName(), the class_exists() was marked with a fixme comment already, so I replaced it with an autoloader solution.
2011-04-04 12:59:55 +00:00
Tim Starling
1402a56f2a Fix for r85244: HipHop does not support the static form of method_exists(). 2011-04-04 03:42:34 +00:00
Daniel Friesen
7d0622b0cc Remove a dead patch of Skin code that was migrated completely into SkinLegacy and SkinTemplate already. 2011-04-04 00:42:52 +00:00
Daniel Friesen
ea8bfcd496 Fix use of mUser noted by c15657 on r85250. 2011-04-03 23:38:44 +00:00
Daniel Friesen
b185adf24f Continue with r85240; Move getSkin from User to RequestContext, do it without globals, strip out the non-functional $title related stuff, and update Skin to use a RequestContext. 2011-04-03 12:46:36 +00:00
Daniel Friesen
4d1624f9f5 Followup r85244; Fix a small issue with the case of a variable name. 2011-04-03 12:37:07 +00:00
Daniel Friesen
c817a24081 Drop connetion between Skin and Linker and turn Linker into a staticly usable class. 2011-04-03 11:44:11 +00:00
Alexandre Emsenhuber
b7f8d0f41d * Moved all <link> definitions in OutputPage::getHeadLinks() instead of having them in a *lot* of different functions
* Also moved there generic <meta> and removed OutputPage::addDefaultMeta() with its $called static local variable which was breaking the output when generating multiple pages on the same request (rebuildFileCache.php, dumpHTML.php) since that function could only be executed completely once for all instances, and not once per instance
* Moved default module from OutputPage::output() to its own function and don't call it when executing a body only request, since it's useless in that case
* Call Skin::setMembers() from Skin::initPage() instead of Skin::outputPage()
2011-04-02 18:38:42 +00:00
Happy-melon
1abc3ba112 Follow-up r83336, r83460: abandon hardcoded styles altogether, and instead use a semantic element to pick up appropriate styles which are already in the global stylesheets. This makes it easier to keep track of where we have implemented this browser-specific tweak in case we have to modify it in future. By turning debugging on devs have already volunteered themselves to masses of gratuitous extra text-on-page, a few extra elements won't inconvenience them too much further. 2011-03-26 13:27:50 +00:00
Alexandre Emsenhuber
fc4c38348b * Make Skin::formatDebugHTML() work with $wgDebugTimestamps = true
* Removed escaping of ' since the string is defined with "
2011-03-07 18:21:58 +00:00
Antoine Musso
8a3dcccbda Remove second parameters from wfEmptyMsg() calls
The second parameter was removed in r64178 and is now useless.
There is probably no need to backport this in 1.17.
2011-03-07 17:10:22 +00:00
Antoine Musso
ae7215c4ad Keep monospace as a fallback for HTML debugging
Per CR on r83336. We also keep this as inline style since it is only
needed by developers anyway.
2011-03-07 16:36:35 +00:00
Antoine Musso
a8a47d6a12 Use 'Courier new' for $wgShowDebug HTML output
'Courier new' is rendered with a constant size in both monobook
and vector skins.  monospace is rendered too small under vector
with firefox/Linux.
Thus, this patch makes the font size consistent.
2011-03-05 22:26:09 +00:00
Happy-melon
0ebda6b3e4 Include MediaWiki:Noscript.css in <noscript></noscript> tags in the header, to allow wikis to load styles for users with JS disabled. 2011-03-05 16:01:25 +00:00
Daniel Friesen
bc19677685 Reduce usage of $wgOut inside Skin. 2011-03-03 10:22:46 +00:00
Alexandre Emsenhuber
304ce524eb Per Reedy, fix for r82034: forgot to change a wfGetCacheNotice() call (and also changed a comment) 2011-03-01 08:52:38 +00:00
Sam Reed
d677412428 Improve method documentation
Few bits of fixup
2011-02-19 21:16:47 +00:00
Alexandre Emsenhuber
461ef632c0 Follow-up r82452: need to transform entries sinces some wiki like to use variables or parser functions in the sidebar 2011-02-19 19:15:45 +00:00
Alexandre Emsenhuber
d0483bf747 * Use $this->mTitle instead of $wgTitle
* Put back the wfMsgForContentNoTrans() added in r66835 but reverted in r68707 since wfMsgForContent() is breaking the {{...}} syntax
2011-02-19 13:39:09 +00:00
Sam Reed
8b1bdb6e68 Remove unreachable line in DifferenceEngine
Documentation for ObjectCache.php

Remove unused variables from CompareParsers and PreprocessDump
2011-02-18 01:06:04 +00:00
Happy-melon
eb9cf4b00c Create a user.groups module in ResourceLoader, which bundles a CSS and JS page for each usergroup the user is a member of (MediaWiki:Sysop.js, MediaWiki:Autoconfirmed.css, etc). Groups '*' and 'user' are not included. 2011-02-16 19:54:02 +00:00
Happy-melon
ef6041d750 revert r82283, loads of unrelated changes 2011-02-16 19:51:25 +00:00
Happy-melon
d64cd26a7c Create a user.groups module in ResourceLoader, which bundles a CSS and JS page for each usergroup the user is a member of (MediaWiki:Sysop.js, MediaWiki:Autoconfirmed.css, etc). Groups '*' and 'user' are not included. 2011-02-16 19:49:37 +00:00
Alexandre Emsenhuber
4fe955e32b Moved Skin::makeGlobalVariablesScript() to OutputPage::getJSVars()
* merged <script> and if ( window.mediaWiki ) block with the one of mediaWiki.loader as stated in the doc
* removed dependency of $wgTitle
* the two only calls to this functions are in SemanticForms, but will not affect current version of MediaWiki:
** specials/SF_UploadWindow.php: this file is only used before 1.16
** specials/SF_UploadWindow2.php: the call is part of the else branch of a "method_exists( $wgOut, 'addModules' )" check, which means it's not called since 1.17
2011-02-16 18:25:44 +00:00
Roan Kattouw
e2dc92dcbc Fix fatal in r82258 2011-02-16 17:31:53 +00:00
Roan Kattouw
f5533b0c98 Per Philip Tzou, move wgUserVariant from the set of config variables to the set of pageview-specific variables, because it depends on user settings and such 2011-02-16 17:06:24 +00:00
Alexandre Emsenhuber
b2a0cc74d5 Moved wfGetSiteNotice(), wfGetNamespaceNotice() and wfGetCachedNotice() to Skin call to allow passing the Skin object to the SiteNoticeBefore and SiteNoticeAfter hooks.
I didn't left compatibility functions since there's no other call to these functions in core or extensions.
2011-02-12 21:24:05 +00:00
Raimond Spekking
9fbeca5552 Follow-up r81604: Prefix new classes with 'mw-' per [[Manual:Coding conventions]] 2011-02-09 17:06:41 +00:00
Ilmari Karonen
6eb0ed9207 (bug 23315) Add new body classes to allow easier styling of special pages.
Also eliminate some duplicate code introduced into SpecialPage::headElement() in r61071 by calling Skin::getPageClasses() instead, and use $sk parameter instead of $wgUser->getSkin() to get skin name.
2011-02-06 21:08:48 +00:00
Daniel Friesen
3d220be8d6 Completely remove support for legacy style skins. All legacy skinning options are now part of a SkinLegacy/LegacySkinTemplate pair that inherits from the normal SkinTemplate setup. Also ported our three built in skins to use the new legacy classes. ( ;) if you want to kill legacy skins now, you only have to svn rm 4 files) 2011-02-04 04:18:05 +00:00
Daniel Friesen
8c9a20833e Commit some fixes for comments on r77741 2011-02-03 00:00:58 +00:00
Chad Horohoe
90fdb46ae5 Last $wgArticle junk in Skin(Template). Just pass the article on hand to lastModified(). Nothing outside of here calls it anyway 2011-01-26 17:06:18 +00:00
Chad Horohoe
8ac435b072 Followup r81034, remove the global statements 2011-01-26 16:56:46 +00:00
Chad Horohoe
c1a29795b4 First round of $wgArticle removals 2011-01-26 16:54:58 +00:00