-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathsetup_repository.php
More file actions
65 lines (50 loc) · 1.66 KB
/
Copy pathsetup_repository.php
File metadata and controls
65 lines (50 loc) · 1.66 KB
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
<?php
require_once("include/common.php");
header('Content-Type: text/html; charset=UTF-8');
tpl()->addJs('js/setup_repository.js');
/*
exec('wget -O /tmp/widgetslist_cvs http://linknx.cvs.sourceforge.net/viewvc/linknx/knxweb/widgets_knxweb2/widgetslist');
$result_tab = explode("\n",file_get_contents("/tmp/widgetslist_cvs" ));
exec('rm /tmp/widgetslist_cvs');
*/
$opts = array(
'http'=>array(
'method'=>"GET",
'header'=>"Content-Type: text/html; charset=utf-8",
'timeout' => 60
)
);
$context = stream_context_create($opts);
/* Repository Widgets */
$file = @file_get_contents('http://linknx.cvs.sourceforge.net/viewvc/linknx/knxweb/widgets_knxweb2/widgetslist', false, $context);
if ($file) {
/*
$order = array("\r\n", "\n", "\r");
$replace = '<br />';
echo str_replace($order, $replace, $file);
*/
$result_tab = explode("\n",$file);
$first_ligne = false;
foreach ($result_tab as $k => $v) {
$tab = explode("|",$v);
if (!isset($tab[3])) $tab[3] = '';
if ($first_ligne) $tab_widgetsdllist[] = $tab;
$first_ligne = true;
}
}
tpl()->assignByRef('tab_widgetsdllist', $tab_widgetsdllist);
//$widgets=getWidgets();
tpl()->assignByRef("widgets", $_widgets);
/* Repository Subpages */
$file = @file_get_contents('http://linknx.cvs.sourceforge.net/viewvc/linknx/knxweb/subpages_knxweb2/subpageslist', false, $context);
if ($file) {
$result_tab = explode("\n",$file);
$first_ligne = false;
foreach ($result_tab as $k => $v) {
if ($first_ligne) $tab_subpageslist[] = explode("|",$v);
$first_ligne = true;
}
}
tpl()->assignByRef('tab_subpagesdllist', $tab_subpageslist);
tpl()->display('setup_repository.tpl');
?>