From 4cce66a88b7796abfa7d7acf69073d353559e91a Mon Sep 17 00:00:00 2001 From: Jens Frank Date: Mon, 9 Oct 2006 19:43:20 +0000 Subject: [PATCH] Add "title" to the opensearch link to allow automatic adding of the search engine in Firefox 2 --- RELEASE-NOTES | 1 + includes/Skin.php | 5 +++-- opensearch_desc.php | 7 +++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 198deab6c4..761ebf123b 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 == diff --git a/includes/Skin.php b/includes/Skin.php index 1c92ccdaf1..ffbe27c7dd 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -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); diff --git a/opensearch_desc.php b/opensearch_desc.php index 25649d6b09..59d61eeece 100644 --- a/opensearch_desc.php +++ b/opensearch_desc.php @@ -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; + ?> -- 2.20.1