Let old skins take into account $wgUploadNavigationUrl.
[lhc/web/wiklou.git] / includes / Skin.php
index 8c327e4..c26a922 100644 (file)
@@ -290,7 +290,7 @@ class Skin extends Linker {
 
        /**
         * Set the title
-        * @param Title $t The title to use
+        * @param $t Title object to use
         */
        public function setTitle( $t ) {
                $this->mTitle = $t;
@@ -356,7 +356,7 @@ class Skin extends Linker {
         * Make a <script> tag containing global variables
         * @param $skinName string Name of the skin
         * The odd calling convention is for backwards compatibility
-        * @TODO @FIXME Make this not depend on $wgTitle!
+        * @todo FIXME: Make this not depend on $wgTitle!
         */
        static function makeGlobalVariablesScript( $skinName ) {
                if ( is_array( $skinName ) ) {
@@ -1988,6 +1988,25 @@ CSS;
                );
        }
 
+       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();