42 if (
$wgRequest->getVal(
'ctype' ) ==
'application/xml' ) {
44 $ctype =
'application/xml';
46 $ctype =
'application/opensearchdescription+xml';
50 $response->header(
"Content-type: $ctype" );
54 $expiryTime = 600; # 10 minutes
55 $response->header(
'Expires: ' . gmdate(
'D, d M Y H:i:s', time() + $expiryTime ) .
' GMT' );
56 $response->header(
'Cache-control: max-age=600' );
58 print
'<?xml version="1.0"?>';
59 print Xml::openElement(
'OpenSearchDescription',
61 'xmlns' =>
'http://a9.com/-/spec/opensearch/1.1/',
62 'xmlns:moz' =>
'http://www.mozilla.org/2006/browser/search/' ] );
74 $fullName =
wfMessage(
'opensearch-desc' )->inContentLanguage()->text();
75 print Xml::element(
'ShortName',
null, $fullName );
76 print Xml::element(
'Description',
null, $fullName );
80 print Xml::element(
'Image',
84 'type' =>
'image/x-icon' ],
94 'type' =>
'text/html',
96 'template' => $searchPage->getCanonicalURL(
'search={searchTerms}' ) ];
107 'template' => $template,
114 Hooks::runner()->onOpenSearchUrls( $urls );
116 foreach ( $urls as $attribs ) {
117 print Xml::element(
'Url', $attribs );
124 print Xml::element(
'moz:SearchForm',
null,
125 $searchPage->getCanonicalURL() );
127 print
'</OpenSearchDescription>';
static getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name If you don't need a full Title object,...