/[cvs]/nfo/php/libs/org.netfrag.glib/Data/Lift/hash/job/html.php
ViewVC logotype

Annotation of /nfo/php/libs/org.netfrag.glib/Data/Lift/hash/job/html.php

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations)
Sat Feb 22 16:21:11 2003 UTC (21 years, 7 months ago) by joko
Branch: MAIN
+ initial commit

1 joko 1.1 <?
2     // -------------------------------------------------------------------------
3     // $Id: Deep.php,v 1.1 2003/02/03 14:51:44 joko Exp $
4     // -------------------------------------------------------------------------
5     // $Log: Deep.php,v $
6     // -------------------------------------------------------------------------
7    
8    
9     // Data::Lift::hash::content2html -
10     // Convert hash containing content information to html
11    
12    
13     //class Data_Lift_hash_job_html extends Data_Lift {
14     class Data_Lift_hash_job_html {
15    
16     function perform(&$data) {
17    
18     //print Dumper($data);
19     //return $data;
20    
21     //$description = '';
22    
23     //print Dumper($value[description]);
24    
25     // V1:
26     //$name = $value[name];
27     //$description = $value[metadata][description];
28    
29     //$description = str_replace("", "\n", $description);
30    
31     /*
32     // V2:
33     $name = $key;
34     if (!is_array($value[description])) {
35     $description = $value[description];
36     $description = preg_replace("/^\n+/", " ", $description);
37     }
38     if (!$description) {
39     $description = 'n/a';
40     }
41    
42     $description = str_replace("\n", "<br/>", $description);
43    
44     //$description = preg_replace("/\n+/", " ", $description);
45     //$description = preg_replace("/^\s+/", "", $description);
46     */
47    
48     // V3:
49    
50     // 1. modify description
51     $description = $data[description];
52    
53     if (is_array($description)) {
54     if (count($description)) {
55     $description = Dumper($description);
56     } else {
57     unset($description);
58     }
59     } else {
60     $description = str_replace("\n", "<br/>", $description);
61     }
62    
63     // if no description could be figured out, set to "not assigned"
64     if (!$description) {
65     $description = 'n/a';
66     }
67     $data[description] = $description;
68    
69     // 2. try to make up some detailed information about steps from additional metadata
70     $steps = array();
71     // check 'container'
72     foreach ($data[container] as $key => $value) {
73     if (is_array($value)) {
74     $arg_parts = array();
75    
76     foreach ($value as $step_entry) {
77     if (is_array($value)) {
78     $value = join(', ', $value);
79     }
80     if (is_array($step_entry)) {
81     $buf = array();
82     foreach ($step_entry as $opt_name => $opt_value) {
83     // special case 'target'
84     if ($opt_name == 'target') {
85     $link = rAnchor($opt_value, array( job => $opt_value ) );
86     $opt_value = $link->render();
87     }
88     array_push($buf, "<i>$opt_name</i>=$opt_value");
89     }
90     $value = join(', ', $buf);
91     }
92     array_push($arg_parts, "<b>$key</b>: $value");
93     }
94    
95     $args = join('<br/>', $arg_parts);
96     } else {
97     $args = "<b>$key</b>: $value";
98     }
99     array_push($steps, $args);
100     }
101     $data[steps] = join('<br/>', $steps);
102    
103     }
104    
105     }
106    
107     ?>

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed