Commit graph

217 commits

Author SHA1 Message Date
Aaron Schulz
80ee12ab5c * Fix location of $ip check
* Add User::mailPasswordInternal hook for bug 14630
2008-08-14 00:18:21 +00:00
Leon Weber
5ae0f26b1e Introduced a new hook 'SkinAfterContent' that allows extensions to add text
after the page content and article metadata. Updated all skins and skin
templates to work with that hook.

The hook is added in the newly introduced Skin::hookAfterContent(). It
couldn't be implemented anywhere else as we want to be able using a single hook
in all skins:

Some skins are based on SkinTemplate (e.g. MonoBook), while 
some directly extend the Skin class (like CologneBlue). The Skin based ones
collect their output from several functions from Skin class, while SkinTemplate
prepares an array with all the needed data and passes it to the skins using it.

Thus we had to create said new protected function for running that hook. SkinTemplate
pushes the function's output into the data array. The Skin class based skins
directly use the function's output.
2008-08-08 15:53:49 +00:00
Alexandre Emsenhuber
2070b1dba8 Document UserGetReservedNames hook 2008-08-07 16:12:25 +00:00
Aryeh Gregor
81d611bcac Re-commit turning makeKnownLinkObj(), makeBrokenLinkObj(), makeLinkObj() into link() wrappers. This should mean that all link processing now goes through link(). Per Brion's advice, remove the BrokenLink hook and replace it with LinkBegin and LinkEnd hooks. All parser tests pass except the usual suspects. 2008-08-05 17:05:59 +00:00
Jack Phoenix
30487ba4de adding new hook, MakeGlobalVariablesScript 2008-08-01 22:38:11 +00:00
Daniel Friesen
74370b6703 New hook SkinBuildSidebar to allow extensions to modify the sidebar to do things like adding custom portlets. 2008-08-01 14:40:05 +00:00
Aryeh Gregor
a42e23da22 Revert r38165 for now, breaks CentralAuth and I don't have that installed anywhere to debug. 2008-07-29 14:53:10 +00:00
Aryeh Gregor
c51f8ce69d Merge TitleArray and UserArray into one unified class, ObjectArray. Adding support for a new type of object will now just take a few lines. 2008-07-29 00:51:08 +00:00
Aryeh Gregor
39273d2c67 Recommit r38149, with the fatal error fixed. The EditSectionLinkForOther hook is now removed entirely -- EditSectionLink is run unconditionally instead. This is extremely unlikely to break any extensions. 2008-07-28 23:52:55 +00:00
Brion Vibber
8cce306e05 Revert r38149 for now, causes regressions in API parsing.
Bug 14965 - https://bugzilla.wikimedia.org/show_bug.cgi?id=14965

PHP Catchable fatal error:  Argument 1 passed to Title::equals() must be an instance of Title, null given, called in /usr/local/apache/common-local/php-1.5/includes/Linker.php on line 1323 and defined in /usr/local/apache/common-local/php-1.5/includes/Title.php on line 3003 
$wgTitle isn't available in this sort of background rendering.
2008-07-28 23:00:14 +00:00
Aryeh Gregor
34bf34d923 Linker::doEditSectionLink() and Linker::doEditSectionLinkForOther() and their respective hooks are redundant and confusing. They do exactly the same thing with a slightly different interface. Their hooks are not only redundant but relatively ineffective, because they wrap in brackets and a span *after* the hook returns. This makes them useless for, e.g., changing the section edit link to an image (can't remove brackets), or using any block-level element (wrapped in a span).
Make Linker::doEditSectionLink() public, and change its interface to be like that of editSectionLink().  Use that in Parser (which is the only place that uses the old functions that I can find), and mark the old two functions deprecated.  Add a hook 'DoEditSectionLink' with a new, clean interface, which is run immediately before the return so it can override the whole function.  Advise people in hooks.txt to use the new hook, not the old ones.
2008-07-28 20:33:43 +00:00
Brion Vibber
c9365a6364 Revert r38068 "SpecialMovepageBeforeMove hook from Wikia codebase - allows extensions, such as spamRegex, to interfere with page moving"
This passes a MovePageForm, which seems unwise. It won't apply to the edit API, and generally seems like a weak interface -- an internal UI object is passed instead of specific information, leaving it unstable to future changes.
2008-07-28 05:44:18 +00:00
Brion Vibber
dc57160c0d Revert r38040 "new hook, ConfirmEmailComplete"
This hook is incomplete and won't work as advertised. Will fail to run when the email address is confirmed through other means, such as a password reset; also there's no corresponding hook for when the mail gets *un*confirmed, so would lead to inconsistent state.
2008-07-28 05:31:12 +00:00
Alexandre Emsenhuber
139e98bd87 Avoid using $this, it is a reserved word 2008-07-27 18:43:55 +00:00
Jack Phoenix
dfb8cf2d03 SpecialMovepageBeforeMove hook from Wikia codebase - allows extensions, such as spamRegex, to interfere with page moving 2008-07-26 21:38:51 +00:00
Alexandre Emsenhuber
8577bf2876 rm dupe 2008-07-25 20:43:15 +00:00
Aryeh Gregor
d5ce3414df Copy-paste documentation for copy-pasted hook, too. 2008-07-25 19:14:30 +00:00
Jack Phoenix
21c1147643 new hook, ConfirmEmailComplete 2008-07-25 18:11:43 +00:00
Brion Vibber
ed97e482a6 Revert r37924 "(bug 14883) Create hook AlternateSkinPreferences to alternate skin section in user preferences"
This hook seems pretty unclear to me. What's it meant to accomplish? It passes no data to be customized, and has no code interface for building a sustainable, forward-compatible extension from it.
2008-07-23 07:59:38 +00:00
Ryan Schmidt
2c0d815fa3 * (bug 14883) Create hook AlternateSkinPreferences to alternate skin section in user preferences 2008-07-22 21:28:11 +00:00
Alexandre Emsenhuber
986a95a00c * order aplhabetically
* avoid using $this
2008-07-20 13:55:35 +00:00
Aaron Schulz
9897c06a8b * Highlight flagged user contribs (bug 14814)
* Necessary hooks added
2008-07-17 14:55:30 +00:00
Brion Vibber
0b4930fa7a Revert r37741 for now "Changed getInternalLinkAttributesInternal parameters: now accepts Title object if available, passes to hook. Also reordered some code in makeKnownLinkObj so that said hook can mangle the Title object. Reordering should have no other side-effects."
This seems a bit icky and inconsistent. If it's necessary to pass titles around here, it should be done consistently, with appropriate fixups and refactoring to the old spaghetti code.
2008-07-16 10:15:47 +00:00
David McCabe
97c60dcc56 Changed getInternalLinkAttributesInternal parameters: now accepts Title object if available, passes to hook. Also reordered some code in makeKnownLinkObj so that said hook can mangle the Title object. Reordering should have no other side-effects. 2008-07-16 07:22:21 +00:00
Brion Vibber
5c75f383d8 Revert r37686, 37687 for now:
"Improving extendibility of the sidebar improvements, css adding, and also JS variables."

"* New hooks:"
"** SkinSidebarSpecialBox and SkinSidebarOutputSpecialBox to allow extensions to add new custom boxes to Tim's new Sidebar system"
"** SkinSetupSiteCss to allow extensions to modify and add new stylesheets to load into the page. This one allows for fine positioning and can be very useful for things like an extension providing global css for a wiki farm."
"** SkinGlobalVariables to allow extensions to add new global variables to export to the JS variables in the page."

At least some of these appear to duplicate existing functionality -- extensions already can add new stylesheets and JS variables, and I'm pretty sure can add portals as well.
2008-07-15 21:35:32 +00:00
Brion Vibber
f0bcd97be3 Revert r37669: LinkerLinkAttributes hook doesn't seem to make a lot of sense. The parameters passed can't be modified, and they are escaped for output, making it unsuitable as a general extension hook. 2008-07-15 21:16:32 +00:00
Daniel Friesen
81ffc1f019 Improving extendibility of the sidebar improvements, css adding, and also JS variables.
* New hooks:
** SkinSidebarSpecialBox and SkinSidebarOutputSpecialBox to allow extensions to add new custom boxes to Tim's new Sidebar system
** SkinSetupSiteCss to allow extensions to modify and add new stylesheets to load into the page. This one allows for fine positioning and can be very useful for things like an extension providing global css for a wiki farm.
** SkinGlobalVariables to allow extensions to add new global variables to export to the JS variables in the page.
2008-07-15 11:03:04 +00:00
David McCabe
433fe522ec Added LinkerLinkAttributes hook. 2008-07-14 22:29:53 +00:00
Aryeh Gregor
12b4eba6ef Revert r37299. It's causing some extremely strange behavior that I can't pin down. Try copying the text =={{[[Navbox]]}}== into a page, where [[Template:Navbox]] is copied from enwiki. An exhibit is up at <http://en.wikipedia.org/wiki/User:Simetrical/Tl_test> until this fix goes live. This was reported at <http://en.wikipedia.org/wiki/Wikipedia:Village_pump_(technical)#Problem_with_.7B.7Btl.7D.7D_in_section_headers> by CapitalR; thanks to RockMFR for tracking down the revision that was causing it.
As a general rule, it would be a good idea to first split the functions off into their own file without changing them, and then refactor them in a separate commit.  Otherwise it's very hard to follow what's actually being changed.  (git actually tracks changes to functions when they're moved across files, incidentally, which is quite awesome.)
2008-07-10 19:18:00 +00:00
Aryeh Gregor
680007475f Fixes for r37489:
* Don't pass $data or $flags by reference.  They're never accessed again, so it makes no sense.
* Document in hooks.txt.
The interface for this hook seems very messy.  It seems like it would be much cleaner to expose $data as $url (null if stored locally); and $flags as an array, or something like that.  If the text is gzipped, the text can be extracted from the Revision and re-gzipped if you really want to for some strange reason.
2008-07-10 18:04:32 +00:00
Brion Vibber
bb3faf9d9b Revert r37490, 37493 for now -- 'NotifyOnPageChangeComplete hook added'
The hook seems a bit odd; it triggers on some of the composes, but not all. There's another loop right after this one.
Also, there's no need to pass objects as references here.
2008-07-10 17:02:39 +00:00
Krzysztof Krzyzaniak
bad9cb5008 NotifyOnPageChangeComplete description 2008-07-10 12:23:21 +00:00
Niklas Laxström
60f3e72328 * Move message functions to own file
* Improve documentation
* Reduce code duplication
* Fix the braindamage that wfMsg and friends were doing transform, but in the wrong language
2008-07-08 08:05:54 +00:00
Ryan Schmidt
a070873551 * Add new hook NormalizeMessageKey to allow extensions to change what system message is being shown before any queries are made 2008-07-07 22:37:42 +00:00
Brion Vibber
742973c85b Revert r37078, 37132 "New hook ParserBeforeTranscludeTemplate:
This hook allows for modification of the title and text of a template which is being transcluded.

Use of this hook will allow extensions to create features such as TransWiki for an alternative to ScaryTransclusions."

This hook seems a bit oddly placed to me; the template gets fetched locally, and *then* we give the opportunity to fetch it remotely instead? Just seems to be in the wrong order, and pretty unclear.
2008-07-05 22:45:37 +00:00
Alexandre Emsenhuber
de9c02190c * Added $IP in dirs for OpenSearchUrls hook
* getHooksFromDoc() now returns an unique array
* 80 chars per line in docs/hooks.txt
2008-07-05 11:36:55 +00:00
Daniel Friesen
e339f61471 New hook ParserBeforeTranscludeTemplate:
This hook allows for modification of the title and text of a template which is being transcluded.

Use of this hook will allow extensions to create features such as TransWiki for an alternative to ScaryTransclusions.
2008-07-05 03:36:12 +00:00
Roan Kattouw
0104fa1f0c Rewritten the way the API handles tokens:
* Instead of hardcoding stuff all over the place, use callbacks
* Extensions can now add their own tokens to prop=info or prop=revisions using hooks
2008-07-04 12:07:02 +00:00
Aaron Schulz
58f01b0645 Re-commit fixed r37006 2008-07-04 09:38:12 +00:00
Brion Vibber
bbaa82d5f9 Revert r37006 -- causes fatal errors:
PHP Fatal error:  Using $this when not in object context in Article.php on line 135
2008-07-04 00:04:58 +00:00
Aaron Schulz
8c77d16317 Make redirects work properly with flagging (bug 14714) 2008-07-03 20:37:44 +00:00
Brion Vibber
918ec72c43 Revert the rest of r36804 -- ExtendJSGlobalVars and wfMessageCacheReplace hooks.
ExtendJSGlobalVars is probably ok in function, though I don't really like its name.

wfMessageCacheReplace seems really unclear as to what it's trying to accomplish.
2008-07-02 22:56:15 +00:00
Daniel Kinzler
4ae25d6b4c Add hook to replace logic for generating category links. May be used by CategoryTree one day. 2008-07-02 20:02:51 +00:00
Brion Vibber
da83631150 format fix 2008-07-02 01:05:08 +00:00
Brion Vibber
add8c926ac OpenSearch cleanup; Firefox now sends you to the search page for empty searches instead of the domain root (which may not even be a wiki).
This is done by adding the <moz:SearchForm> extension element with the Special:Search URL.

Removed the 24-character truncation on ShortName... neither Firefox nor IE seems to care about longer names, but both expect the ShortName and <link> title to match, and will think you have a duplicate search provider if they don't match because only one was truncated. (Besides, 24 was longer than the spec's limit of 16 -- why bother limiting at all if not to spec?)

The JSON suggestions are now no longer included in the OpenSearch description if the API is disabled, since the interface won't work.

Generally removed some hardcoded escape-then-stick-vars-in-string-output eww... Extension hooks now have a more general opportunity to alter or replace the OpenSearch URLs by tying into the OpenSearchUrls hook.
2008-07-01 23:31:24 +00:00
Chad Horohoe
8af42e9413 Pass $mediaWiki object to MediawikiPerformAction hook. 2008-07-01 03:56:16 +00:00
Jack Phoenix
599b5a42d0 Two new hooks and one new global function from Wikia codebase 2008-06-30 08:42:09 +00:00
Aryeh Gregor
124d3cce7d Update RELEASE-NOTES and hooks.txt for r36692. Contrary to the commit message, the AbortMove hook seems not to have been changed, so I didn't mention that. 2008-06-27 13:37:47 +00:00
Ryan Schmidt
40ccb73c4d * add new hook LinkerMakeExternalImage to allow extensions to modify the HTML output of external images 2008-06-24 14:32:49 +00:00
Chad Horohoe
13d510bf55 Bit of work to AbortMove hook, in preparation for making the SpamBlacklist work on move logs. 2008-06-24 13:03:16 +00:00