| 1 | <?php |
| 2 | |
| 3 | function transport_load($transport) { |
| 4 | require_once(TRANSPORT_DIR.$transport.'.inc'); |
| 5 | } |
| 6 | |
| 7 | function transport_link($url) { |
| 8 | return "<a href='$url'>$url</a>"; |
| 9 | } |
| 10 | |
| 11 | function transport_translate($transport_handle) { |
| 12 | $transport = preg_split('/[:@]/',trim($transport_handle)); |
| 13 | transport_load($transport[0]); |
| 14 | global $transports; |
| 15 | |
| 16 | $id=$transport[1]; |
| 17 | $domain='defaulthost'; if(isset($transport[2])) $domain=$transport[2]; |
| 18 | $transport=$transport[0]; |
| 19 | |
| 20 | $node['node_status']='linked'; |
| 21 | $node['node_name']="$transport:$id@$domain"; |
| 22 | $node['url']=$transports[$transport]['get_node_url']($id); |
| 23 | $node['node_content']='Source: '.transport_link($node['url']).';<hr />'.$transports[$transport]['get_node_content']($id); |
| 24 | |
| 25 | return $node; |
| 26 | } |
| 27 | |
| 28 | function transport_process_node(&$node) { |
| 29 | if($node['external_link']=='transport') $node = array_merge($node, transport_translate($node['node_content'])); |
| 30 | } |