Add "title" to the opensearch link to allow automatic adding of the search engine...
authorJens Frank <jeluf@users.mediawiki.org>
Mon, 9 Oct 2006 19:43:20 +0000 (19:43 +0000)
committerJens Frank <jeluf@users.mediawiki.org>
Mon, 9 Oct 2006 19:43:20 +0000 (19:43 +0000)
RELEASE-NOTES
includes/Skin.php
opensearch_desc.php

index 198deab..761ebf1 100644 (file)
@@ -282,6 +282,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 4528) Lack of important LaTeX functions stackrel, rightleftharpoon
 * (bug 6721) missing symbols ulcorner, urcorner, llcorner, lrcorner, twoheadrightarrow, twoheadleftarrow
 * (bug 7367) Hyphens sometimes erroneously appended to equations when not converted to PNG
+* Add "title" to the opensearch link to allow automatic adding of the search engine in Firefox 2
 
 == Languages updated ==
 
index 1c92ccd..ffbe27c 100644 (file)
@@ -157,7 +157,7 @@ class Skin extends Linker {
        }
 
        function initPage( &$out ) {
-               global $wgFavicon, $wgScriptPath;
+               global $wgFavicon, $wgScriptPath, $wgSitename, $wgLanguageCode, $wgLanguageNames;
 
                $fname = 'Skin::initPage';
                wfProfileIn( $fname );
@@ -170,7 +170,8 @@ class Skin extends Linker {
                $out->addLink( array( 
                        'rel' => 'search', 
                        'type' => 'application/opensearchdescription+xml',
-                       'href' => "$wgScriptPath/opensearch_desc.php"
+                       'href' => "$wgScriptPath/opensearch_desc.php",
+                       'title' => "$wgSitename ({$wgLanguageNames[$wgLanguageCode]})",
                ));
 
                $this->addMetadataLinks($out);
index 25649d6..59d61ee 100644 (file)
@@ -5,8 +5,10 @@
  */
 
 require_once( dirname(__FILE__) . '/includes/WebStart.php' );
-$shortName = htmlspecialchars( mb_substr( $wgSitename, 0, 16 ) );
-$siteName = htmlspecialchars( $wgSitename );
+require_once( dirname(__FILE__) . '/languages/Names.php' );
+$fullName = "$wgSitename ({$wgLanguageNames[$wgLanguageCode]})";
+$shortName = htmlspecialchars( mb_substr( $fullName, 0, 24 ) );
+$siteName = htmlspecialchars( $fullName );
 
 if ( !preg_match( '/^https?:/', $wgFavicon ) ) {
        $favicon = htmlspecialchars( $wgServer . $wgFavicon );
@@ -35,4 +37,5 @@ echo <<<EOT
 </OpenSearchDescription>
 EOT;
 
+
 ?>