source: t29-www/lib/search.php @ 285

Last change on this file since 285 was 274, checked in by sven, 12 years ago

search.php vergessen.

File size: 1.4 KB
Line 
1<?php
2
3class t29Search {
4        static $actions = array(
5                'opensearch-desc' => 'print_opensearch_desc',
6        );
7
8        function page_handler() {
9                if(!isset($_GET['action']))
10                        return;
11                $action = $_GET['action'];
12                if(array_key_exists($action, self::$actions)) {
13                        $method_name = self::$actions[$action];
14                        $this->$method_name();
15                } else {
16                        print "<b>Page action $action unkown!\n";
17                }
18        }
19
20
21        function print_opensearch_desc() {
22                header('Content-Type: application/opensearchdescription+xml');
23                print '<?xml version="1.0"?>'.PHP_EOL;
24                ?>
25                <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" xmlns:moz="http://www.mozilla.org/2006/browser/search/">
26                        <ShortName>technikum29 (de)</ShortName>
27                        <Description>technikum29 (de)</Description>
28                        <Image height="16" width="16" type="image/x-icon">http://www.technikum29.de/favicon.ico</Image>
29                        <Url type="text/html" method="get" template="http://www.technikum29.de/de-v6/suche.php?q={searchTerms}" />
30                        <Url type="application/x-suggestions+json" method="get" template="http://www.technikum29.de/de-v6/suche.php?get=suggestions&amp;q={searchTerms}&amp;format=json" />
31                        <Url type="application/x-suggestions+xml" method="get" template="http://www.technikum29.de/de-v6/suche.php?get=suggestions&amp;q={searchTerms}&amp;format=xml" />
32                        <moz:SearchForm>http://www.technikum29.de/de-v6/suche.php</moz:SearchForm>
33                </OpenSearchDescription>
34                <?php
35                exit;
36        }
37}
Note: See TracBrowser for help on using the repository browser.
© 2008 - 2013 technikum29 • Sven Köppel • Some rights reserved
Powered by Trac
Expect where otherwise noted, content on this site is licensed under a Creative Commons 3.0 License