1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
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>';
|