This file is part of the EditImage Mediawiki Extension.
EditImage is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation, either version 3 of the License, or (at
your option) any later version.
Foobar is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with Foobar. If not, see . */
# Alert the user that this is not a valid entry point to MediaWiki if
# they try to access the special pages file directly.
if (!defined('MEDIAWIKI')) {
echo <<getDBKey();
return true;
}
$wgExtensionCredits['specialpage'][] = array(
'name' => 'EditImage',
'version' => '0.1',
'author' => 'Benjamin Mako Hill',
'url' => 'http://www.mediawiki.org/wiki/User:Benjamin_Mako_Hill',
'description' => 'This extension provides a way for Mediawiki users to edit images from the web.'
);
function wfAddActionContentHook( &$content_actions ) {
global $wgRequest, $wgRequest, $wgTitle;
$action = $wgRequest->getText( 'action' );
if ( $wgTitle->getNamespace() == NS_IMAGE ) {
$editimage_page = SpecialPage::getTitleFor( 'EditImage');;
$content_actions['editimage'] = array(
'class' => $action == 'editimage' ? 'selected' : false,
'text' => "Crop Image", // the wfMsg was not working...
'href' => $editimage_page->getLocalURL("image={$wgTitle->getPrefixedURL()}")
);
}
return true;
}
?>