Also fixes old skins to take into account the actual uploadrights of users.
Fixes bug 23563
* Special:Userrights didn't recognize user as changing his/her own rights if user did not capitalize first letter of username.
* (bug 23507) Add styles for printing wikitables
* (bug 19586) Avoid JS errors in mwsuggest when using old browsers such as Opera 8.
+* (bug 23563) Old skins now support $wgUploadNavigationUrl and take into account upload rights.
=== API changes in 1.17 ===
* (bug 22738) Allow filtering by action type on query=logevent
);
}
+ function uploadLink() {
+ global $wgUploadNavigationUrl;
+
+ if( $wgUploadNavigationUrl ) {
+ $title = Title::newFromText( $wgUploadNavigationUrl );
+ }
+ if( !$title ) {
+ $title = SpecialPage::getTitleFor('Upload');
+ }
+
+ return $this->link(
+ $title,
+ wfMsgHtml( 'upload' ),
+ array(),
+ array(),
+ array( 'known', 'noclasses' )
+ );
+ }
+
/* these are used extensively in SkinTemplate, but also some other places */
static function makeMainPageUrl( $urlaction = '' ) {
$title = Title::newMainPage();
. $this->specialLink( 'newpages' )
. $sep . $this->specialLink( 'listfiles' )
. $sep . $this->specialLink( 'statistics' );
- if ( $wgUser->isLoggedIn() && $wgEnableUploads ) {
- $s .= $sep . $this->specialLink( 'upload' );
+ if( UploadBase::isEnabled() && UploadBase::isAllowed( $wgUser ) === true ) {
+ $s .= $sep . $this->uploadLink();
}
global $wgSiteSupportPage;
/* show my preferences link */
$s .= $sep . $this->specialLink( 'preferences' );
/* show upload file link */
- if ( $wgEnableUploads ) {
- $s .= $sep . $this->specialLink( 'upload' );
+ if( UploadBase::isEnabled() && UploadBase::isAllowed( $wgUser ) === true ) {
+ $s .= $sep . $this->uploadLink();
}
+
/* show log out link */
$s .= $sep . $this->specialLink( 'userlogout' );
}
$s .= "\n<br /><hr class='sep' />";
}
- if ( $wgUser->isLoggedIn() && ( $wgEnableUploads || $wgRemoteUploads ) ) {
- $s .= $this->specialLink( 'upload' ) . $sep;
+ if( UploadBase::isEnabled() && UploadBase::isAllowed( $wgUser ) === true ) {
+ $s .= $this->uploadLink() . $sep;
}
+
$s .= $this->specialLink( 'specialpages' );
global $wgSiteSupportPage;