aboutsummaryrefslogtreecommitdiff
path: root/mod/opensearch/views/default
diff options
context:
space:
mode:
authorSem <sembrestels@riseup.net>2013-11-09 16:15:20 +0100
committerSem <sembrestels@riseup.net>2013-11-09 16:15:20 +0100
commit293fe873dcbedf45571807b722ce859e00a5a3a5 (patch)
tree4ce7adf3dbeed0a4ac2fbefd55f8844f504db499 /mod/opensearch/views/default
parentba0d506ade08ae46ba665474a8b9c81e838f2eee (diff)
parent853cb44b625cbe0e1cae3dff197d54645a1291a1 (diff)
downloadelgg-293fe873dcbedf45571807b722ce859e00a5a3a5.tar.gz
elgg-293fe873dcbedf45571807b722ce859e00a5a3a5.tar.bz2
Add 'mod/opensearch/' from commit '853cb44b625cbe0e1cae3dff197d54645a1291a1'
git-subtree-dir: mod/opensearch git-subtree-mainline: ba0d506ade08ae46ba665474a8b9c81e838f2eee git-subtree-split: 853cb44b625cbe0e1cae3dff197d54645a1291a1
Diffstat (limited to 'mod/opensearch/views/default')
-rw-r--r--mod/opensearch/views/default/opensearch/includes.php10
-rw-r--r--mod/opensearch/views/default/plugins/opensearch/settings.php97
2 files changed, 107 insertions, 0 deletions
diff --git a/mod/opensearch/views/default/opensearch/includes.php b/mod/opensearch/views/default/opensearch/includes.php
new file mode 100644
index 000000000..6aceb45c2
--- /dev/null
+++ b/mod/opensearch/views/default/opensearch/includes.php
@@ -0,0 +1,10 @@
+<?php
+/**
+ * OpenSearch head include
+ */
+
+$url = elgg_normalize_url('opensearch/osd.xml');
+$title = elgg_get_site_entity()->name;
+?>
+
+<link rel="search" type="application/opensearchdescription+xml" href="<?php echo $url; ?>" title="<?php echo $title; ?>" />
diff --git a/mod/opensearch/views/default/plugins/opensearch/settings.php b/mod/opensearch/views/default/plugins/opensearch/settings.php
new file mode 100644
index 000000000..23ba19538
--- /dev/null
+++ b/mod/opensearch/views/default/plugins/opensearch/settings.php
@@ -0,0 +1,97 @@
+<?php
+/**
+ * Opensearch plugin settings
+ */
+
+// set default value
+if (!isset($vars['entity']->shortname)) {
+ $vars['entity']->shortname = elgg_get_site_entity()->name;
+}
+if (!isset($vars['entity']->desc)) {
+ $vars['entity']->desc = elgg_echo('opensearch:engine', array(elgg_get_site_entity()->name));
+}
+if (!isset($vars['entity']->longname)) {
+ $vars['entity']->longname = elgg_get_site_entity()->description;
+}
+if (!isset($vars['entity']->icon)) {
+ $vars['entity']->icon = '_graphics/favicon.ico';
+}
+if (!isset($vars['entity']->tags)) {
+ $vars['entity']->tags = '';
+}
+if (!isset($vars['entity']->lang)) {
+ $vars['entity']->lang = 'en-us';
+}
+if (!isset($vars['entity']->query)) {
+ $vars['entity']->query = '';
+}
+
+echo '<div>';
+echo '<label>'.elgg_echo('opensearh:settings:shortname').'</label> ';
+echo elgg_echo('opensearh:settings:shortname:description');
+echo ' ';
+echo elgg_view('input/text', array(
+ 'name' => 'params[shortname]',
+ 'value' => $vars['entity']->shortname,
+));
+echo '</div>';
+
+echo '<div>';
+echo '<label>'.elgg_echo('opensearh:settings:desc').'</label> ';
+echo elgg_echo('opensearh:settings:desc:description');
+echo ' ';
+echo elgg_view('input/text', array(
+ 'name' => 'params[desc]',
+ 'value' => $vars['entity']->desc,
+));
+echo '</div>';
+
+echo '<div>';
+echo '<label>'.elgg_echo('opensearh:settings:longname').'</label> ';
+echo elgg_echo('opensearh:settings:longname:description');
+echo ' ';
+echo elgg_view('input/text', array(
+ 'name' => 'params[longname]',
+ 'value' => $vars['entity']->longname,
+));
+echo '</div>';
+
+echo '<div>';
+echo '<label>'.elgg_echo('opensearh:settings:icon').'</label> ';
+echo elgg_echo('opensearh:settings:icon:description');
+echo ' ';
+echo elgg_view('input/text', array(
+ 'name' => 'params[icon]',
+ 'value' => $vars['entity']->icon,
+));
+echo '</div>';
+
+echo '<div>';
+echo '<label>'.elgg_echo('opensearh:settings:tags').'</label> ';
+echo elgg_echo('opensearh:settings:tags:description');
+echo ' ';
+echo elgg_view('input/text', array(
+ 'name' => 'params[tags]',
+ 'value' => $vars['entity']->tags,
+));
+echo '</div>';
+
+echo '<div>';
+echo '<label>'.elgg_echo('opensearh:settings:lang').'</label> ';
+echo elgg_echo('opensearh:settings:lang:description');
+echo ' ';
+echo elgg_view('input/text', array(
+ 'name' => 'params[lang]',
+ 'value' => $vars['entity']->lang,
+));
+echo '</div>';
+
+echo '<div>';
+echo '<label>'.elgg_echo('opensearh:settings:query').'</label> ';
+echo elgg_echo('opensearh:settings:query:description');
+echo ' ';
+echo elgg_view('input/text', array(
+ 'name' => 'params[query]',
+ 'value' => $vars['entity']->query,
+));
+echo '</div>';