<?php
+/* Copyright (c) 2008 Benjamin Mako Hill <mako@atdot.cc>
+ 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 <http://www.gnu.org/licenses/>. */
# Alert the user that this is not a valid entry point to MediaWiki if
# they try to access the special pages file directly.
$wgExtensionMessagesFiles['EditImage'] = $dir . 'EditImage.i18n.php';
$wgSpecialPages['EditImage'] = 'EditImage';
# $wgHooks['LanguageGetSpecialPageAliases'][] = 'EditImageLocalizedPageName';
+$wgHooks['SkinTemplateContentActions'][] = 'wfAddactionContentHook';
+#$wgHooks['UnknownAction'][] = 'wfAddactActionHook';
function myExtensionLocalizedPageName(&$specialPageArray, $code) {
# The localized title of the special page is among the messages of the extension:
'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;
+}
?>