4 |
* $Id$ |
* $Id$ |
5 |
* |
* |
6 |
* $Log$ |
* $Log$ |
7 |
|
* Revision 1.3 2003/04/09 07:57:15 joko |
8 |
|
* revamped 'function decode_item_expr' |
9 |
|
* introduced shortcut 'link::store' |
10 |
|
* |
11 |
* Revision 1.2 2003/04/09 00:32:42 jonen |
* Revision 1.2 2003/04/09 00:32:42 jonen |
12 |
* some tests according to form rendering at the decode functions |
* some tests according to form rendering at the decode functions |
13 |
* |
* |
37 |
|
|
38 |
|
|
39 |
// TODO: refactor to Data::Lift - subcomponent: handling will get way more easy! |
// TODO: refactor to Data::Lift - subcomponent: handling will get way more easy! |
40 |
function decode_item_array($item, $hidden_elements, $options) { |
function decode_item_array(&$item, $hidden_elements, $options) { |
41 |
//$options = $this->_options['decode_args']; |
//$options = $this->_options['decode_args']; |
42 |
//print "item: " . Dumper($item); |
//print "item: " . Dumper($item); |
43 |
//print "options: " . Dumper($options); |
//print "options: " . Dumper($options); |
61 |
} |
} |
62 |
|
|
63 |
// create new LinkBuilder instance and get link GUID by saving vars |
// create new LinkBuilder instance and get link GUID by saving vars |
64 |
$linkbuilder = new LinkBuilder(); |
$link_guid = link::store($link_vars); |
|
$link_guid = $linkbuilder->save($link_vars); |
|
65 |
|
|
66 |
$list[$key] = $link_guid; |
$list[$key] = $link_guid; |
67 |
} |
} |
96 |
//$container->add("->", html_a($_SERVER["PHP_SELF"] . "?ecdid=" . $ident . "&ecdm=" . $meta . "&" . $str_hidden, $key . " view"), html_br()); |
//$container->add("->", html_a($_SERVER["PHP_SELF"] . "?ecdid=" . $ident . "&ecdm=" . $meta . "&" . $str_hidden, $key . " view"), html_br()); |
97 |
|
|
98 |
// create new LinkBuilder instance and get link GUID by saving vars |
// create new LinkBuilder instance and get link GUID by saving vars |
99 |
$linkbuilder = new LinkBuilder(); |
$link_guid = link::store($link_vars); |
|
$link_guid = $linkbuilder->save($link_vars); |
|
100 |
|
|
101 |
$container->add("->", html_a($_SERVER["PHP_SELF"] . "?lbid=" . $link_guid, $key . " view"), html_br()); |
$container->add("->", html_a($_SERVER["PHP_SELF"] . "?lbid=" . $link_guid, $key . " view"), html_br()); |
102 |
} |
} |
103 |
$item = $container; |
$item = $container; |
104 |
} |
} |
105 |
return $item; |
//return $item; |
106 |
|
return 1; |
107 |
} |
} |
108 |
} |
} |
109 |
|
|
110 |
// decodes serialized string representations of object-references |
// decodes serialized string representations of object-references |
111 |
// TODO: refactor to Data::Lift - subcomponent: handling will get way more easy! |
// TODO: refactor to Data::Lift - subcomponent: handling will get way more easy! |
112 |
function decode_item_expr($item, $hidden_elements, $options) { |
function decode_item_expr(&$item, $hidden_elements, $options) { |
113 |
|
|
114 |
|
//return; |
115 |
|
|
116 |
|
// debug |
117 |
//$options = $this->_options['decode_args']; |
//$options = $this->_options['decode_args']; |
118 |
//print "item: $item<br/>"; |
//print "item: $item<br/>"; |
|
if(substr($item, 0, 2) == "o_") { |
|
|
$tmp = split($options['seperator'], $item); |
|
|
$ident = $tmp['1']; |
|
|
$meta = $tmp['2']; |
|
|
|
|
|
$link_vars = array( |
|
|
'ecdid' => $ident, |
|
|
'ecdm' => $meta, |
|
|
); |
|
|
foreach($hidden_elements as $label => $value) { |
|
|
$link_vars[$label] = $value; |
|
|
//$tmp_array[] = $label . "=" . $value; |
|
|
} |
|
|
|
|
|
//$str_hidden = join("&", $tmp_array); |
|
|
//$item = html_a($_SERVER["PHP_SELF"] . "?ecdid=" . $ident . "&ecdm=" . $meta . "&" . $str_hidden, "view"); |
|
|
|
|
|
$linkbuilder = new LinkBuilder(); |
|
|
$link_guid = $linkbuilder->save($link_vars); |
|
|
$item = html_a($_SERVER["PHP_SELF"] . "?lbid=" . $link_guid, "view"); |
|
119 |
|
|
120 |
return $item; |
// resolve 'o_{guid}_{classname}' - encoded string |
121 |
|
$link_meta = php::untwingle_reference($item); |
122 |
|
//print Dumper($link_meta); |
123 |
|
|
124 |
|
if (!is_array($link_meta)) { |
125 |
|
//return $item; |
126 |
|
//print "NO<br/>"; |
127 |
|
return; |
128 |
} |
} |
129 |
|
|
130 |
|
$link_vars = array( |
131 |
|
'ecdid' => $link_meta[ident], |
132 |
|
'ecdm' => $link_meta[type], |
133 |
|
); |
134 |
|
|
135 |
|
foreach($hidden_elements as $label => $value) { |
136 |
|
$link_vars[$label] = $value; |
137 |
|
} |
138 |
|
|
139 |
|
//$str_hidden = join("&", $tmp_array); |
140 |
|
//$item = html_a($_SERVER["PHP_SELF"] . "?ecdid=" . $ident . "&ecdm=" . $meta . "&" . $str_hidden, "view"); |
141 |
|
|
142 |
|
$link_guid = link::store($link_vars); |
143 |
|
$item = html_a($_SERVER["PHP_SELF"] . "?lbid=" . $link_guid, "view"); |
144 |
|
|
145 |
|
return 1; |
146 |
} |
} |
147 |
|
|
148 |
|
|