Commit graph

993 commits

Author SHA1 Message Date
Chad Horohoe
6d73b42d59 Remove AjaxAddScript hook
Has been obsolete since the introduction of ResourceLoader and
is unused by any extension in Git.

Change-Id: Ia8ce6a0f1c5d46811897bd75670a3d5ea76caf7d
2014-07-16 18:49:36 -07:00
Ori Livneh
7fb6675a8f Remove ResourceLoaderGetStartupModules hook
Deprecated only since 1.23, but universally reviled, and used only by
MwEmbedSupport, which no longer uses it as of I43af3c87a).

Change-Id: I36c89b273fdb0ec3a76034c7a6d2f48a15d5457f
2014-07-11 13:49:00 -07:00
Tony Thomas
9d54bc2055 Added VERP functionality hook to core
* By default, wiki should keep the envelope sender as $wgPasswordSender
* Requires BounceHandler extension. Added hook to core
* Alters the return path, to bounce-{key}@domain
* The envelope sender is set using the 5th param in mail()

Bug: 46640
Needed By: I9463ae33ae327405725ea9693d45ad61b8ecf798
Change-Id: Ic5c1231611a5c4984ddf81fd716e6f3a3e82fd57
2014-07-11 12:03:49 +00:00
jenkins-bot
d7dd7fbf98 Merge "New 'UserResetAllOptions' hook from the wikiHow codebase." 2014-07-10 21:51:41 +00:00
Jack Phoenix
6cddec7213 New 'UserResetAllOptions' hook from the wikiHow codebase.
Location is a tad bit different now than on the wikiHow codebase and some
arguments have been added, as per code review.

Because sometimes you have things that are stored in the user_properties
database table that should *not* be reset even when the user has requested
to reset all prefs back to the site defaults.

Live example of a thing using this hook (well, its previous iteration) is
wikiHow's WikihowPreferences extension.

Change-Id: I1da936c786adb21e2c1802ef405bb904c9cf4918
2014-07-11 00:39:16 +03:00
jenkins-bot
a79442d6cf Merge "Allow third party code to hook-up MIME type detection" 2014-07-09 17:47:44 +00:00
umherirrender
b98d9efe77 Remove deprecated Skin::makeGlobalVariablesScript
And make OutputPage::getJSVars private per documentation.
Also adjust some comments.

Change-Id: Ia6484654754dd4782dda1d8c1e140cdb7a6f1115
2014-07-08 22:26:47 +00:00
Matthew Flaschen
a838e96837 Profiling: Fix StartProfiler.sample, link in docs/scripts.txt
Note two options in StartProfiler.sample, since only one of them
supports the toolbar

Change-Id: Ie8bd7febf749de8a5d32cbe87ba7733ee135bdc9
2014-07-07 19:05:31 -04:00
rillke
bd7750cee4 Allow third party code to hook-up MIME type detection
Adding 3 hooks to MimeMagic.php

- MimeMagicInit: Add assignments of MIME types -> Media types
  and assignments of MIME types -> File extensions
- MimeMagicImproveFromExtension: Further improve the MIME type detected
  by considering the file extension
- MimeMagicGuessFromContent: Guess the MIME from file content

This is the successor of Icf9eec10bec7c0a7e.

PHP's own module fileinfo module is not capable detecting Chemical
table files. Instead, they are reported as text/plain.

MediaHandlers can be attached by MIME type only. That's why these
changes are required for [[Extension:MolHandler]] to work.

Clean up:
Do not create unused property MimeMagic::mToMime.

Change-Id: I67f3e4e83b47e6df0d9e8371f09a741a8aa77651
2014-07-06 13:38:14 +02:00
Max Semenik
467f4affd1 New hook, AfterParserFetchFileAndTitle
It is needed for PageImages to collect information about galleries, improving results
for Commons mainspace.

Bug: 66510
Change-Id: I3136d648ef2c1841767db0ab33855cd168e3de3e
2014-07-01 17:40:11 -07:00
Kevin Israel
5b40c74620 Combine SpecialPageBeforeFormDisplay set of hooks into one
Hooks with dynamically generated names cannot be documented in the normal
manner, and indeed this set, added in r86482 / 10d93c34cb, was not.

In contrast, every other hook in core has a name that is a fixed string
and thus is easy to grep for, create a manual page title for, and so on.
Conceptually, each hook's name should correspond to one or more locations
at which code can be inserted.

So I changed the code to use hook name "SpecialPageBeforeFormDisplay"
for all FormSpecialPages and added the special page name as a parameter,
which is consistent with existing hook "ActionBeforeFormDisplay".

From extensions in Gerrit, the only use I found was in StopForumSpam,
which is updated to use the new hook in Id474915a. So I chose to break
backward compatibility instead of using a hack to hide the old hooks
from maintenance/findHooks.php.

After three years, the script again reports, "Looks good!"

Change-Id: I7ea6521b47fb034bc367a1d06d477a7654035a5f
2014-06-28 17:33:14 -07:00
umherirrender
82efaa9e61 Do not mention deprecated User::isValidEmailAddr() in hooks.txt
Replaced by Sanitizer::validateEmail()

Change-Id: I7b4ef438dd31a2dbc641bb06bea8e256e0f5dd1f
2014-06-27 19:57:58 +00:00
jenkins-bot
a30854859e Merge "Remove SearchEngineReplacePrefixesComplete hook" 2014-06-24 07:20:18 +00:00
umherirrender
e1219dea55 Do not mention deprecated RawPage in hooks.txt
Replaced by RawAction

Change-Id: Ic7d24ccf41c2571c76da486c6513b2dd325b8fd0
2014-06-23 20:28:47 +02:00
Chad Horohoe
da0070e9d1 Remove SearchEngineReplacePrefixesComplete hook
This hook is poorly thought out. The only extension that uses it
can't possibly think it works how they're expecting.

Change-Id: I853a01afc8e922f22e949321a2f2343d264632a6
2014-06-23 08:48:45 -07:00
Kevin Israel
4bbd1c44d9 Fix some findHooks.php errors
* Correct typo in docs/hooks.txt.
* Add a few directories.

Left unfixed is "Undocumented: Special{$this->getName()}BeforeFormDisplay",
which will be addressed separately.

Change-Id: I4fda8960642c23500bd20e0b89c1d1327456313b
2014-06-20 21:35:51 -04:00
jenkins-bot
cc54e1fa85 Merge "Create PostLoginRedirect Hook for changing the redirect behavior" 2014-06-12 14:24:50 +00:00
Rob Moen
750a98bb56 Create PostLoginRedirect Hook for changing the redirect behavior
Allows for modifying returnTo url, url parameters, and the redirect
type.

New return to condition 'signup' if redirecting after signup
Treated same as 'success', though now explicitly marking as such

Part of making GettingStarted not dependent on CentralAuth

Bug: 65619
Change-Id: I219353d9825918e22d4772611a38d72c4e674e10
2014-06-05 19:31:46 -04:00
Reedy
dcc9d4a3c8 Remove 'SpecialVersionExtensionTypes' hook, deprecated in 1.17.
Change-Id: I98d15e2bbbec2ba754c4754c97a46f32e714398a
2014-06-01 00:14:26 +00:00
jenkins-bot
27f8aa732e Merge "Add SelfLinkBeginHook" 2014-05-28 22:07:37 +00:00
Yuri Astrakhan
cf1d36d56b Added BeforeHttpsRedirect hook allowing extensions to cancel forceHTTPS
For ZERO, we need to be able to avoid forceHTTPS from taking place in
case user logged in while on wifi, and later switched to
zero.wikipedia.org for the carrier who doesn't support HTTPS.
In that case, the extension will need to be able to cancel redirect
and force regular HTTP handling.

Open Question: should this code log off user in case hook returns false?

Bug 65567

Change-Id: If04c83066c5d47b3c04ad7674e3c4e95a4cd464b
2014-05-28 12:46:11 -04:00
cicalese
4202d4a881 Add SelfLinkBeginHook
Called before a link to the current article is displayed to allow the display
of the link to be customized.

Bug: 63592
Change-Id: I343e1b1b08ec841d22a1b22bcb8af43bb65a5a50
2014-05-27 19:54:44 -04:00
jenkins-bot
92f5c2bf38 Merge "Removed double hook explanation AfterFinalPageOutput" 2014-05-25 06:28:53 +00:00
florianschmidtwelzow
179a096210 Removed double hook explanation AfterFinalPageOutput
Bug: 65690
Change-Id: I0990568875db854579974f611e7378bca0b0eaed
2014-05-25 08:23:02 +02:00
Matthew Flaschen
b76fb1329f Document ArticleUndelete change
Change-Id: I157cab408598878e9483b60e656026f0ddbbb0b2
2014-05-20 22:37:19 -04:00
jenkins-bot
5f56facb3d Merge "Update kss style guide wording and README" 2014-05-20 21:14:33 +00:00
jenkins-bot
67ad578c42 Merge "Improve rendering of Living Style Guide sections, examples, and modifiers." 2014-05-20 21:08:18 +00:00
kaldari
97a145f1fb Always render copyright notice in user language
All other footer content is rendered in the user language and the
copyright notice on the edit page is also in the user language.
See EditPage::getCopyrightWarning().

We already do this on WMF wikis through the WikimediaMessages
extension (which sets $forContent to false). The same behaviour has
been requested for 3rd party wikis as well.

Bug: 49116
Change-Id: I1dddfa7771c7063ec319fa441c2e400a374abc92
2014-05-16 17:12:23 -07:00
Bartosz Dziewoński
0da7a40876 Load shared MediaWiki styles when generating the style guide
Among other things it defines styles for .errorbox and friends, which
are showcased in the guide.

Change-Id: I14279400b9aa362d19040e8083032e4e7c1c4ba6
2014-05-16 16:31:34 +02:00
Subramanya Sastry
91de7e350b Minor fix to contenthandler.txt doc.
Change-Id: I45c1a750b2308dc30d609910d802d25a4252a7e5
2014-05-15 12:09:37 -05:00
Alexandre Emsenhuber
7c7dbce0f0 Remove messageTypes.inc and replace it by a hook
The list is now maintained in the translatewiki repo:
https://git.wikimedia.org/blob/translatewiki.git/HEAD/groups%2FMediaWiki%2FMediaWiki.yaml

Change-Id: I4a33b22e425cbc1eeaf8b53870ef7b7947e91b40
2014-05-13 21:45:28 +02:00
Alexandre Emsenhuber
29c34d0cc8 Don't use $this for docuementing hook parameters
It is a reserved keyword, so this only confuses people.

Change-Id: I6553bd93ac6f72be42493a0c3ca59c63d4a97e18
2014-05-11 12:02:21 +02:00
Nemo bis
ccd7758c1e Extend AbortEmailNotification hook to access log type etc.
Bug: 42458
Change-Id: Ifc3935f031c49f9b49ae76c5a8af8334e70ca2b1
2014-05-11 09:39:14 +00:00
Matthew Flaschen
986034ef5f Update kss style guide wording and README
This should explain the conventions of the MediaWiki project.
Wikimedia is a prominent user of MediaWiki, but not the only one.

Other MediaWiki installations do not share all of Wikimedia's
values and mission.  However, it is possible to express common values
that should guide this work in core.

Thus, I retained some of the existing text, as well as adding one other
point, accessibility (which we have discussed but was not mentioned
here).

Change-Id: Iafc8641c9b89138b3e4b7f6e274395279ddad43c
2014-05-11 01:33:25 +02:00
jenkins-bot
aed188f0c0 Merge "Adds the SidebarBeforeOutput hook" 2014-05-10 18:30:25 +00:00
Tpt
0c6c03050c Adds the SidebarBeforeOutput hook
Allows to modify sidebar abstract representation just before its output

Required by change Ib4014253016db1c3d6b624be9ebbdaf452115145

Change-Id: I170e7253825c8dab5cad38e6b0ba59f28572efbf
2014-05-10 17:38:23 +02:00
daniel
48d5e5b3c9 Introduce ContentGetParserOutput hook
This hooks allows extensions to override the normal model-specific
rendering of page content. A typical use would be to provide syntax
highlighting for pages that contain scripts. In that sense,
ContentGetParserOutput is a generalization of the old ShowRawCssJs
hook.

This, together with I76412f9d, is a (hopefully) fixed version of the
reverted Ibfb2cbefea44.

Change-Id: I979e2438689648ba4c959d8083197ef14ce524e8
2014-05-10 14:27:33 +02:00
Shahyar
a6850e52ae Improve rendering of Living Style Guide sections, examples, and modifiers.
Change-Id: I5ca69ff5889239eed2f369917bf7bcbbd751e397
2014-05-10 10:57:33 +02:00
Andrew Garrett
c9100d3616 Add WhatLinksHereProps hook, to allow extensions to annotate WhatLinksHere entries.
Needed by change 110090

Change-Id: I679abfbbdbd56498ec87579b4fe4e49ad486c84c
2014-04-30 21:23:35 -07:00
Matthew Flaschen
eda1642a94 Explain make kss environment variable in README
Change-Id: I9e83187050ed360c57a1c3d4aeba913d69211349
2014-04-21 23:12:24 -04:00
Ori Livneh
e8b46e5e66 Deprecate ResourceLoaderGetStartupModules
In bug 63240, Roan calls it a 'misfeature', which I think is exactly right. It
has been used as a lazy workaround for having to think about load-order,
dependency management, and race conditions.

Bug: 63240
Change-Id: Ic48ad39c6d3d166d6bb8f60dfdd5f95aa7ed16a6
2014-04-20 14:07:54 -07:00
Chad Horohoe
f234aa61f5 Remove 2 unused Special:Search hooks
Nothing is listed on mw.org as using these and nothing in Git uses
them either. Less hooks is a good thing, we've still got 11 here :(

Change-Id: I2dd1dbb269820b192f8d9e9a496a161f4ef851bf
2014-04-18 08:23:38 -07:00
jenkins-bot
b101f05438 Merge "includes/Linker.php: Added hook for "Media:" links" 2014-04-17 19:39:37 +00:00
Bartosz Dziewoński
a931293184 Properly deprecate the SpecialVersionExtensionTypes hook
wfRunHooks() has recently gained a new parameter for this.

Change-Id: If8dd90d03334ca6007f5af5e79c2545886c88b5f
2014-04-15 22:16:41 +02:00
Mwalker
c45d497eda Merge "New hook for readonly editpages" 2014-04-15 18:15:59 +00:00
Derk-Jan Hartman
61c9dcf696 New hook for readonly editpages
EditPage::showReadOnlyForm:initial which is analogous to
EditPage::showEditForm:initial

Bug: 45258
Change-Id: I6885d617e18562acf0331e8db5790b53b489dbc2
2014-04-15 08:46:01 +02:00
Robert Vogel
020fc0b649 includes/Linker.php: Added hook for "Media:" links
The static method 'Linker::makeMediaLinkFile' produced a HTML string
without usage of MediaWiki 'Html' class. It also lacked a hook to allow
modifications of the output HTML.

I altered the implementation and added a hook that provides a signature
and behaviour similar to the existing 'LinkerMakeExternalLink' and
'LinkBegin'/'LinkEnd' hooks. It provides all available context information
and allows modification of single attributes or the output HTML as a
whole. I have updated the 'docs/hooks.txt' file to provide proper
documentation.

Change-Id: I6d7769298a4ca6cbbf807fcebb91fb0d2222f8d8
2014-04-14 14:39:54 +02:00
jenkins-bot
a580d5d60e Merge "ChangesListSpecialPage: Implement two new hooks superseding 4 old ones" 2014-04-14 03:13:53 +00:00
Juliusz Gonera
070ef42720 Fix KSS mediawiki.ui style guide (docs)
Broken after a change in directory structure...

Change-Id: Ibe208302c30483ee9476a176efe8dd88b21d30a5
2014-04-11 14:25:22 -07:00
Bartosz Dziewoński
a4aa71c6cf ChangesListSpecialPage: Implement two new hooks superseding 4 old ones
Old hooks (called by SpecialWatchlist, SpecialRecentChanges and
SpecialRecentChangesLinked) have been deprecated, but I'm not planning
to remove them anytime soon. (They have lots of usages in extensions
as of this writing.)

The new hooks (and their deprecated friends) are:

* ChangesListSpecialPageFilters:
  * Replaces: SpecialRecentChangesFilters and SpecialWatchlistFilters
  * The signature for this one is exactly the same as signatures for
    the other two. We might want to pass something else than $this
    here…

* ChangesListSpecialPageQuery
  * Replaces: SpecialRecentChangesQuery and SpecialWatchlistQuery
  * These hooks have wildly different signatures. The new one is a
    superset of the old ones, in a more reasonable order, with the
    addition of the name of the special page we're doing right now.

Change-Id: I9cceda5d2dcfc53c852c5682c466b48ad8f31202
2014-04-11 22:53:35 +02:00