diff options
-rw-r--r-- | application/Router.php | 6 | ||||
-rw-r--r-- | index.php | 12 | ||||
-rw-r--r-- | plugins/readityourself/readityourself.php | 2 | ||||
-rw-r--r-- | plugins/wallabag/wallabag.php | 2 | ||||
-rw-r--r-- | tpl/includes.html | 3 | ||||
-rw-r--r-- | tpl/opensearch.html | 45 |
6 files changed, 65 insertions, 5 deletions
diff --git a/application/Router.php b/application/Router.php index 82b2b858..1e6a3983 100644 --- a/application/Router.php +++ b/application/Router.php | |||
@@ -29,6 +29,8 @@ class Router | |||
29 | 29 | ||
30 | public static $PAGE_IMPORT = 'import'; | 30 | public static $PAGE_IMPORT = 'import'; |
31 | 31 | ||
32 | public static $PAGE_OPENSEARCH = 'opensearch'; | ||
33 | |||
32 | public static $PAGE_LINKLIST = 'linklist'; | 34 | public static $PAGE_LINKLIST = 'linklist'; |
33 | 35 | ||
34 | /** | 36 | /** |
@@ -63,6 +65,10 @@ class Router | |||
63 | return self::$PAGE_TAGCLOUD; | 65 | return self::$PAGE_TAGCLOUD; |
64 | } | 66 | } |
65 | 67 | ||
68 | if (startswith($query, 'do='. self::$PAGE_OPENSEARCH)) { | ||
69 | return self::$PAGE_OPENSEARCH; | ||
70 | } | ||
71 | |||
66 | // At this point, only loggedin pages. | 72 | // At this point, only loggedin pages. |
67 | if (!$loggedIn) { | 73 | if (!$loggedIn) { |
68 | return self::$PAGE_LINKLIST; | 74 | return self::$PAGE_LINKLIST; |
@@ -679,8 +679,8 @@ class pageBuilder | |||
679 | $this->tpl->assign('pagetitle', $GLOBALS['pagetitle']); | 679 | $this->tpl->assign('pagetitle', $GLOBALS['pagetitle']); |
680 | } | 680 | } |
681 | $this->tpl->assign('shaarlititle', empty($GLOBALS['title']) ? 'Shaarli': $GLOBALS['title']); | 681 | $this->tpl->assign('shaarlititle', empty($GLOBALS['title']) ? 'Shaarli': $GLOBALS['title']); |
682 | if (!empty($GLOBALS['plugins']['errors'])) { | 682 | if (!empty($GLOBALS['plugin_errors'])) { |
683 | $this->tpl->assign('plugin_errors', $GLOBALS['plugins']['errors']); | 683 | $this->tpl->assign('plugin_errors', $GLOBALS['plugin_errors']); |
684 | } | 684 | } |
685 | } | 685 | } |
686 | 686 | ||
@@ -1204,6 +1204,14 @@ function renderPage() | |||
1204 | exit; | 1204 | exit; |
1205 | } | 1205 | } |
1206 | 1206 | ||
1207 | // Display openseach plugin (XML) | ||
1208 | if ($targetPage == Router::$PAGE_OPENSEARCH) { | ||
1209 | header('Content-Type: application/xml; charset=utf-8'); | ||
1210 | $PAGE->assign('serverurl', index_url($_SERVER)); | ||
1211 | $PAGE->renderPage('opensearch'); | ||
1212 | exit; | ||
1213 | } | ||
1214 | |||
1207 | // -------- User clicks on a tag in a link: The tag is added to the list of searched tags (searchtags=...) | 1215 | // -------- User clicks on a tag in a link: The tag is added to the list of searched tags (searchtags=...) |
1208 | if (isset($_GET['addtag'])) | 1216 | if (isset($_GET['addtag'])) |
1209 | { | 1217 | { |
diff --git a/plugins/readityourself/readityourself.php b/plugins/readityourself/readityourself.php index 68efc543..1b030bc8 100644 --- a/plugins/readityourself/readityourself.php +++ b/plugins/readityourself/readityourself.php | |||
@@ -14,7 +14,7 @@ if (is_file(PluginManager::$PLUGINS_PATH . '/readityourself/config.php')) { | |||
14 | } | 14 | } |
15 | 15 | ||
16 | if (!isset($GLOBALS['plugins']['READITYOUSELF_URL'])) { | 16 | if (!isset($GLOBALS['plugins']['READITYOUSELF_URL'])) { |
17 | $GLOBALS['plugins']['errors'][] = 'Readityourself plugin error: '. | 17 | $GLOBALS['plugin_errors'][] = 'Readityourself plugin error: '. |
18 | 'Please define "$GLOBALS[\'plugins\'][\'READITYOUSELF_URL\']" '. | 18 | 'Please define "$GLOBALS[\'plugins\'][\'READITYOUSELF_URL\']" '. |
19 | 'in "plugins/readityourself/config.php" or in your Shaarli config.php file.'; | 19 | 'in "plugins/readityourself/config.php" or in your Shaarli config.php file.'; |
20 | } | 20 | } |
diff --git a/plugins/wallabag/wallabag.php b/plugins/wallabag/wallabag.php index 024a3d2b..37969c97 100644 --- a/plugins/wallabag/wallabag.php +++ b/plugins/wallabag/wallabag.php | |||
@@ -10,7 +10,7 @@ if (is_file(PluginManager::$PLUGINS_PATH . '/wallabag/config.php')) { | |||
10 | } | 10 | } |
11 | 11 | ||
12 | if (!isset($GLOBALS['plugins']['WALLABAG_URL'])) { | 12 | if (!isset($GLOBALS['plugins']['WALLABAG_URL'])) { |
13 | $GLOBALS['plugins']['errors'][] = 'Wallabag plugin error: '. | 13 | $GLOBALS['plugin_errors'][] = 'Wallabag plugin error: '. |
14 | 'Please define "$GLOBALS[\'plugins\'][\'WALLABAG_URL\']" '. | 14 | 'Please define "$GLOBALS[\'plugins\'][\'WALLABAG_URL\']" '. |
15 | 'in "plugins/wallabag/config.php" or in your Shaarli config.php file.'; | 15 | 'in "plugins/wallabag/config.php" or in your Shaarli config.php file.'; |
16 | } | 16 | } |
diff --git a/tpl/includes.html b/tpl/includes.html index bdf3a07d..f94ce1be 100644 --- a/tpl/includes.html +++ b/tpl/includes.html | |||
@@ -10,4 +10,5 @@ | |||
10 | {if="is_file('inc/user.css')"}<link type="text/css" rel="stylesheet" href="../inc/user.css" />{/if} | 10 | {if="is_file('inc/user.css')"}<link type="text/css" rel="stylesheet" href="../inc/user.css" />{/if} |
11 | {loop="$plugins_includes.css_files"} | 11 | {loop="$plugins_includes.css_files"} |
12 | <link type="text/css" rel="stylesheet" href="{$value}#"/> | 12 | <link type="text/css" rel="stylesheet" href="{$value}#"/> |
13 | {/loop} \ No newline at end of file | 13 | {/loop} |
14 | <link rel="search" type="application/opensearchdescription+xml" href="?do=opensearch#" title="Shaarli search - {$shaarlititle|htmlspecialchars}"/> \ No newline at end of file | ||
diff --git a/tpl/opensearch.html b/tpl/opensearch.html new file mode 100644 index 00000000..3fcc30b7 --- /dev/null +++ b/tpl/opensearch.html | |||
@@ -0,0 +1,45 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"> | ||
3 | <ShortName>Shaarli search - {$pagetitle}</ShortName> | ||
4 | <Description>Shaarli search - {$pagetitle}</Description> | ||
5 | <Url type="text/html" template="{$serverurl}?searchterm={searchTerms}" /> | ||
6 | <Url type="application/atom+xml" template="{$serverurl}?do=atom&searchterm={searchTerms}"/> | ||
7 | <Url type="application/rss+xml" template="{$serverurl}?do=rss&searchterm={searchTerms}"/> | ||
8 | <InputEncoding>UTF-8</InputEncoding> | ||
9 | <Developer>Shaarli Community - https://github.com/shaarli/Shaarli/</Developer> | ||
10 | <Image width="16" height="16">data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABmJLR0QA/wD/AP+gvaeTAAAHRklE | ||
11 | QVRIx5WWaWxU5xWG3++7986dfYYZb+MN2xiMDRiDFePUiQsNoiwpUNpAmhInJVEqpa0oQUlbJVKq | ||
12 | olaiqpLKUtOKhAJRm1BKRVWctuykpFjAgPcFx/uMl5mxPTOeuXPv3O3rjyiV0lIpfX+dc36c55xf | ||
13 | 70vwP9TZ2fFpSQCwT5u6unX4f0QeNLx27RoMQwfRveTd11T23M+8S9w+Z3NRma1W4Hk6/nEimFpM | ||
14 | Xnun9Xpmz1MPY+feOhBi/fwAAOjq7iJEqmQqCZf5i7NvyNZ/bJPYgAjCiJc2Zmhyw68SM/T1+NlK | ||
15 | uf61BPoH+tHU1PT5ACMjI8RXvACvpZ5NT0+fmrG+2TKqtDLV0BgA2AUfXS3+UtfDX2ixCf73E+oA | ||
16 | rat92CTkv9fRBwEkSaLDt/JZR/v0Q7qjb8dQ5hjSqmYSOCkzBbogL+ij2RN8bik9wK88Al9tH4tG | ||
17 | ow88lvb19yEyPwfGGLq6OungYD9fUlosrqwoQVVVUeOU8qE/mU0ZTq6KNvreNort+5hugkayQUgY | ||
18 | qQld/u6qnVRhkciscOdOkNy5E0RnZ+e/AbwsZxAaHyORZA+prW01CTlnGppOqAcwUnCmlDAkA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w7cTMemtY/cPsw3n | ||
32 | oe2+4mGXpt7VGWPJ6zOn1V2Xfaz5AxgvBzexodmeGWmCbWWTDOGpSZIIqeAe2/IYvnXgWbomUj2T | ||
33 | lNlwUP7bV64lzuRIeoodqDxi1OKRs/e0i08dH/6JPWtk6KKaZd3xj2jAXkY3BvZGK1xrhZvRNktP | ||
34 | fNA0ubQrxyxV4jHpSkWoXJPKYqBetxeRpgsMWwE5b/bxaYxUDSWmzCLbStqQuy02LY4/cWLsqH8i | ||
35 | HYNbyEeJczkJSzH2855DwsXp932F9hXEKQSQ1UHa568iRAa3uFyeNVolMBmeIrzT4cTXm37KMuvA | ||
36 | xb8XXTqiDELRgKg8h/dGWwP9iSDaIzcYJSCbA/uNR3N2sNahV/hbsSA70vEdW66tCOOpj8FRkIgU | ||
37 | Q5ybLUopiTzeTpFWUoTXdR3knwQMzLANOyQX50fWhDktLeAX3UcIA2EEQHPgi6TBsrWzaLGm7emC | ||
38 | H7bY+GPlV6YumiEpDhslxGBgROApz+yyhROzduIEzwngDh48iD3jO0nBRAUUXtHcoq+ZWbI5EWWa | ||
39 | WTieFjoKsaVoN92T88J4vlz+asXqpb+hEcdotbdueZ47vyiqhpA2UoRQwpoLtpNHxR0382jR8RzT | ||
40 | k8xYMyCMMfR33Uc8rxdrA9tpuHPyS7pPOTRPZ1arepa4rUsybiWnnU9a39ZXxdur+XoGAGMdoXLi | ||
41 | M789axnfNxDr8omiDcvF1f3OhPf18efjF/nfz6PGvv6zlrlwWwYBgcBZbKH4WKHODLHEURDxbHDF | ||
42 | QWGePftHUlZWjsy8guYnH2EgwORfZ5cuavEqgGhLnL6+sycvRP1Fbux/fheIn3wCCN4N/qdPMwA4 | ||
43 | 2fYOeoe7kc6kcfCbh8n+r7YwAOjs6QCl9DNx5t7dew+MOf8CcuqqoLxlhwgAAAAASUVORK5CYII= | ||
44 | </Image> | ||
45 | </OpenSearchDescription> | ||