1*da96af35SAndreas Gohr<?php 2*da96af35SAndreas Gohr/** 3*da96af35SAndreas Gohr * DokuWiki OpenSearch creator 4*da96af35SAndreas Gohr * 5*da96af35SAndreas Gohr * @license GPL 2 (http://www.gnu.org/licenses/gpl.html) 6*da96af35SAndreas Gohr * @link http://www.opensearch.org/ 7*da96af35SAndreas Gohr * @author Mike Frysinger <vapier@gentoo.org> 8*da96af35SAndreas Gohr * @author Andreas Gohr <andi@splitbrain.org> 9*da96af35SAndreas Gohr */ 10*da96af35SAndreas Gohr 11*da96af35SAndreas Gohrif(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../../').'/'); 12*da96af35SAndreas Gohrif(!defined('NOSESSION')) define('NOSESSION',true); // we do not use a session or authentication here (better caching) 13*da96af35SAndreas Gohrif(!defined('NL')) define('NL',"\n"); 14*da96af35SAndreas Gohrrequire_once(DOKU_INC.'inc/init.php'); 15*da96af35SAndreas Gohr 16*da96af35SAndreas Gohr// try to be clever about the favicon location 17*da96af35SAndreas Gohrif(file_exists(DOKU_INC.'favicon.ico')){ 18*da96af35SAndreas Gohr $ico = DOKU_URL.'favicon.ico'; 19*da96af35SAndreas Gohr}elseif(DOKU_TPL.'images/favicon.ico'){ 20*da96af35SAndreas Gohr $ico = DOKU_URL.'lib/tpl/'.$conf['template'].'/images/favicon.ico'; 21*da96af35SAndreas Gohr}elseif(DOKU_TPL.'favicon.ico'){ 22*da96af35SAndreas Gohr $ico = DOKU_URL.'lib/tpl/'.$conf['template'].'/favicon.ico'; 23*da96af35SAndreas Gohr}else{ 24*da96af35SAndreas Gohr $ico = DOKU_URL.'lib/tpl/default/images/favicon.ico'; 25*da96af35SAndreas Gohr} 26*da96af35SAndreas Gohr 27*da96af35SAndreas Gohr// output 28*da96af35SAndreas Gohrheader('Content-Type: application/opensearchdescription+xml; charset=utf-8'); 29*da96af35SAndreas Gohrecho '<?xml version="1.0"?>'.NL; 30*da96af35SAndreas Gohrecho '<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">'.NL; 31*da96af35SAndreas Gohrecho ' <ShortName>'.htmlspecialchars($conf['title']).'</ShortName>'.NL; 32*da96af35SAndreas Gohrecho ' <Image type="image/x-icon">'.$ico.'</Image>'.NL; 33*da96af35SAndreas Gohrecho ' <Url type="text/html" template="'.DOKU_URL.DOKU_SCRIPT.'?do=search&id={searchTerms}" />'.NL; 34*da96af35SAndreas Gohrecho ' <Url type="application/x-suggestions+json" template="'. 35*da96af35SAndreas Gohr DOKU_URL.'lib/exe/ajax.php?call=suggestions&q={searchTerms}" />'.NL; 36*da96af35SAndreas Gohrecho '</OpenSearchDescription>'.NL; 37*da96af35SAndreas Gohr 38*da96af35SAndreas Gohr//Setup VIM: ex: et ts=4 enc=utf-8 : 39