Commit | Line | Data |
---|---|---|
301010e3 H |
1 | <?php |
2 | ||
3 | function transport_load($transport) { | |
b584ae7b | 4 | |
5 | // XXX security hotfix, TODO harvie rewrite | |
6 | require_once(TRANSPORT_DIR.'kyberia.sk.inc'); | |
301010e3 H |
7 | } |
8 | ||
bdd7d07d H |
9 | function transport_link($url) { |
10 | return "<a href='$url'>$url</a>"; | |
11 | } | |
12 | ||
cb5cd120 H |
13 | function transport_translate($transport_handle) { |
14 | $transport = preg_split('/[:@]/',trim($transport_handle)); | |
15 | transport_load($transport[0]); | |
16 | global $transports; | |
17 | ||
18 | $id=$transport[1]; | |
19 | $domain='defaulthost'; if(isset($transport[2])) $domain=$transport[2]; | |
20 | $transport=$transport[0]; | |
21 | ||
444d6866 | 22 | $node['node_status']='linked'; |
cb5cd120 H |
23 | $node['node_name']="$transport:$id@$domain"; |
24 | $node['url']=$transports[$transport]['get_node_url']($id); | |
bdd7d07d | 25 | $node['node_content']='Source: '.transport_link($node['url']).';<hr />'.$transports[$transport]['get_node_content']($id); |
cb5cd120 H |
26 | |
27 | return $node; | |
28 | } | |
e651ba44 H |
29 | |
30 | function transport_process_node(&$node) { | |
31 | if($node['external_link']=='transport') $node = array_merge($node, transport_translate($node['node_content'])); | |
32 | } |