added opensearch description and crime detection (required by german
federal police) git-svn-id: http://yolanda.mister-muffin.de/svn@231 7eef14d0-6ed0-489d-bf55-20463b2d70db
This commit is contained in:
parent
27f59d3d3e
commit
357dcf431e
5 changed files with 83 additions and 35 deletions
BIN
trunk/images/bka.png
Normal file
BIN
trunk/images/bka.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
|
@ -1,32 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<!-- hardcoded urls are BAAAD. perhaps provide this document in perl ? -->
|
||||
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
|
||||
|
||||
<Contact>admin@example.com</Contact>
|
||||
|
||||
<Description>lol description</Description>
|
||||
|
||||
<Image
|
||||
height="16"
|
||||
width="16"
|
||||
type="image/x-icon"
|
||||
>
|
||||
http:/localhost/images/favicon.ico
|
||||
</Image>
|
||||
|
||||
<Query
|
||||
role="example"
|
||||
searchTerms="example"
|
||||
/>
|
||||
|
||||
<ShortName>Yolanda</ShortName>
|
||||
|
||||
<Tags>lol tags</Tags>
|
||||
|
||||
<Url
|
||||
type="text/html"
|
||||
template="http://localhost/search.pl?query={searchTerms}"
|
||||
/>
|
||||
|
||||
</OpenSearchDescription>
|
|
@ -244,6 +244,14 @@ img
|
|||
border-width: 0;
|
||||
}
|
||||
|
||||
img.bka
|
||||
{
|
||||
bottom: 0px;
|
||||
left: 0px;
|
||||
position: fixed;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
img.logo-big
|
||||
{
|
||||
padding-bottom: 0.5em;
|
||||
|
|
64
trunk/xsl/opensearch.xsl
Normal file
64
trunk/xsl/opensearch.xsl
Normal file
|
@ -0,0 +1,64 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<xsl:stylesheet version="1.0"
|
||||
xmlns="http://a9.com/-/spec/opensearch/1.1/"
|
||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://web.resource.org/cc/"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
>
|
||||
|
||||
<xsl:output
|
||||
encoding="utf8"
|
||||
indent="yes"
|
||||
method="xml"
|
||||
media-type="application/xml"
|
||||
omit-xml-declaration="no"
|
||||
/>
|
||||
|
||||
<xsl:variable name="locale">
|
||||
<xsl:choose>
|
||||
<xsl:when test="document(concat('../locale/', //@locale, '.xml'))">
|
||||
<xsl:value-of select="//@locale" />
|
||||
</xsl:when>
|
||||
<xsl:otherwise>en-us</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
|
||||
<xsl:variable name="site_strings" select="document('../site/main.xml')//strings/string" />
|
||||
<xsl:variable name="locale_strings" select="document(concat('../locale/', $locale, '.xml'))//strings/string" />
|
||||
|
||||
<!-- kill xml, opensearch is the same everywhere -->
|
||||
<xsl:template match="/">
|
||||
<OpenSearchDescription>
|
||||
|
||||
<Description>
|
||||
<xsl:value-of select="$site_strings[@id='site_motto']" />
|
||||
</Description>
|
||||
|
||||
<Image
|
||||
height="16"
|
||||
width="16"
|
||||
type="image/x-icon"
|
||||
>
|
||||
<xsl:value-of select="$site_strings[@id='page_root']" />images/favicon.ico
|
||||
</Image>
|
||||
|
||||
<Query
|
||||
role="example"
|
||||
searchTerms="example"
|
||||
/>
|
||||
|
||||
<ShortName>
|
||||
<xsl:value-of select="$site_strings[@id='site_name']" />
|
||||
</ShortName>
|
||||
|
||||
<Url type="text/html">
|
||||
<xsl:attribute name="template">
|
||||
<xsl:value-of select="$site_strings[@id='page_root']" />/search.pl?query={searchTerms}
|
||||
</xsl:attribute>
|
||||
</Url>
|
||||
|
||||
</OpenSearchDescription>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
|
@ -111,9 +111,14 @@
|
|||
<link
|
||||
rel="search"
|
||||
type="application/opensearchdescription+xml"
|
||||
href="/opensearch.xml"
|
||||
title="Yolanda"
|
||||
/>
|
||||
>
|
||||
<xsl:attribute name="href">
|
||||
<xsl:value-of select="$site_strings[@id='page_root']" />?xslt=opensearch
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="title">
|
||||
<xsl:value-of select="$site_strings[@id='site_name']" />
|
||||
</xsl:attribute>
|
||||
</link>
|
||||
|
||||
<title>
|
||||
<xsl:choose>
|
||||
|
@ -143,6 +148,9 @@
|
|||
|
||||
<body>
|
||||
|
||||
<!-- crime detection -->
|
||||
<img class="bka" src="/images/bka.png" />
|
||||
|
||||
<xsl:if test="not(//@embed='true')">
|
||||
<xsl:choose>
|
||||
<xsl:when test="string-length(//@username)=0">
|
||||
|
|
Loading…
Reference in a new issue