blob: 512a4a6765276d8cdfb5fd88d68b8c152eeb199d (
plain)
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
|
<form id="external">
<div class="section">
<h2><?php p($l->t('External sites'));?></h2>
<p>
<em><?php p($l->t('Please note that some browsers will block displaying of sites via http if you are running https.')); ?></em>
<br>
<em><?php p($l->t('Furthermore please note that many sites these days disallow iframing due to security reasons.')); ?></em>
<br>
<em><?php p($l->t('We highly recommend to test the configured sites below properly.')); ?></em>
</p>
<ul class="external_sites">
<?php
$sites = \OCA\External\External::getSites();
for($i = 0; $i < sizeof($sites); $i++) {
print_unescaped('<li>
<input type="text" class="site_name" name="site_name[]" value="'.OCP\Util::sanitizeHTML($sites[$i][0]).'" placeholder="'.$l->t('Name').'" />
<input type="text" class="site_url" name="site_url[]" value="'.OCP\Util::sanitizeHTML($sites[$i][1]).'" placeholder="'.$l->t('URL').'" />
<select class="site_icon" name="site_icon[]">');
$nf = true;
foreach($_['images'] as $image) {
if (basename($image) == $sites[$i][2]) {
print_unescaped('<option value="'.basename($image).'" selected>'.basename($image).'</option>');
$nf = false;
} else {
print_unescaped('<option value="'.basename($image).'">'.basename($image).'</option>');
}
}
if($nf) {
print_unescaped('<option value="" selected>'.$l->t('Select an icon').'</option>');
} else {
print_unescaped('<option value="">'.$l->t('Select an icon').'</option>');
}
print_unescaped('</select>
<img class="svg action delete_button" src="'.OCP\image_path("", "actions/delete.svg") .'" title="'.$l->t("Remove site").'" />
</li>');
}
if(sizeof($sites) === 0) {
print_unescaped('<li>
<input type="text" class="site_name" name="site_name[]" value="" placeholder="'.$l->t('Name').'" />
<input type="text" class="site_url" name="site_url[]" value="" placeholder="'.$l->t('URL').'" />
<select class="site_icon" name="site_icon[]">');
foreach($_['images'] as $image) {
print_unescaped('<option value="'.basename($image).'">'.basename($image).'</option>');
}
print_unescaped('<option value="" selected>'.$l->t('Select an icon').'</option>
</select>
<img class="svg action delete_button" src="'.OCP\image_path("", "actions/delete.svg") .'" title="'.$l->t("Remove site").'" />
</li>');
}
?>
</ul>
<input type="button" id="add_external_site" value="<?php p($l->t("Add")); ?>" />
<span class="msg"></span>
</div>
</form>
|