Hi everyone,
I'm developing an extension and I need to override the behavior of a method from the Linker class. More precisely, I need to override 'makeImageLink2' to create custom links for certain images. I searched for a related hook but I could not find anything. Can this be done from an extension?
Thanks in advance,
On Mon, Feb 25, 2008 at 1:06 PM, Yasser González Fernández yglez@uh.cu wrote:
Hi everyone,
I'm developing an extension and I need to override the behavior of a method from the Linker class. More precisely, I need to override 'makeImageLink2' to create custom links for certain images. I searched for a related hook but I could not find anything. Can this be done from an extension?
Since Skin inherits from Linker, it can be done in a custom skin. In general, it can't be done with a hook unless there's a hook available in some appropriate place (the function itself, the caller, a callee, or whatever). Generally if you want a hook added, you can get one dev or another to add it to the code, if it's in a place that people will probably want to use and where there's no other way to reasonably implement the extension without hacks. Once a dev has added it to the trunk code, of course, you can hack it into your local copy (whatever version you have) and not worry about upgrade issues, since it will be there in the next release.
On 2008-02-25 Simetrical Simetrical+wikilist@gmail.com wrote:
Thanks for replying my email.
Since Skin inherits from Linker, it can be done in a custom skin.
Although our site mainly uses the Monobook skin I would like the 'custom links' to be generated regardless the selected skin. We had this implemented through a patch to the Linker class. We needed to re-patch the Mediawiki sources between upgrades and I thought it could be done more cleanly by an extension. So, I think modifying the skin will be almost the same, unless there is a way to include common code to all installed skins through an extension.
Generally if you want a hook added, you can get one dev or another to add it to the code, if it's in a place that people will probably want to use and where there's no other way to reasonably implement the extension without hacks.
Does it will be useful to other people?
Huge thanks again,
On Tue, Feb 26, 2008 at 8:42 AM, Yasser González Fernández yglez@uh.cu wrote:
Generally if you want a hook added, you can get one dev or another to add it to the code, if it's in a place that people will probably want to use and where there's no other way to reasonably implement the extension without hacks.
Does it will be useful to other people?
I've checked in a hook in r31314, which should be in the 1.13 release, so you can copy it to your local copy:
http://svn.wikimedia.org/viewvc/mediawiki?view=rev&revision=31314
Note that it might get changed somehow, or removed entirely, before the release. If it does, I'll try to remember to e-mail you.
On 2008-02-26 Simetrical Simetrical+wikilist@gmail.com wrote:
I've checked in a hook in r31314, which should be in the 1.13 release
Thanks for adding the hook. I'll update my working copy of the repository to get the changes.
Note that it might get changed somehow, or removed entirely, before the release. If it does, I'll try to remember to e-mail you.
OK, that would be great. However, since I keep my Mediawiki installation updated from SVN I should notice if the hook is removed.
Thanks again,
wikitech-l@lists.wikimedia.org