Passed
Push — dpa_buda13 ( 0241f6 )
by David
10:52
created

show_buda_apps()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 9
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 3
eloc 8
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 9
rs 10
1
<?php
2
3
require_once('../inc/util.inc');
4
require_once('../inc/buda.inc');
5
require_once('../inc/keywords.inc');
6
require_once('../project/remote_apps.inc');
7
8
function show_buda_apps() {
9
    $apps = get_buda_apps();
10
    foreach ($apps as $app) {
11
        $desc = get_buda_desc($app);
12
        table_row(
13
            $desc->long_name,
14
            $desc->description,
15
            empty($desc->url)?'':"<a href=$desc->url>View</a>",
16
            kw_array_to_str($desc->sci_kw)
17
        );
18
    }
19
}
20
21
function main() {
22
    global $remote_apps;
23
    page_head("Apps");
24
    echo sprintf('%s distributes jobs for the following applications:<p>', PROJECT);
25
    start_table('table-striped');
26
    table_header(
27
        'Name',
28
        'Description',
29
        'Web page',
30
        'Science keywords'
31
    );
32
    foreach ($remote_apps as $category => $apps) {
33
        if (strstr($category, 'Docker')) {
34
            show_buda_apps();
35
        } else {
36
            foreach ($apps as $app) {
37
                table_row(
38
                    $app->long_name,
39
                    $app->description,
40
                    "<a href=$app->url>View</a>",
41
                    kw_array_to_str($app->sci_kw)
42
                );
43
            }
44
            echo '</ul>';
45
        }
46
    }
47
    end_table();
48
    page_tail();
49
}
50
51
main();
52
53
?>
54