| 4 |
* $Id$ |
* $Id$ |
| 5 |
* |
* |
| 6 |
* $Log$ |
* $Log$ |
| 7 |
|
* Revision 1.7 2003/07/02 12:32:27 jonen |
| 8 |
|
* fixed bugs |
| 9 |
|
* |
| 10 |
|
* Revision 1.6 2003/05/10 18:17:19 jonen |
| 11 |
|
* + added 'create/add new' links |
| 12 |
|
* |
| 13 |
* Revision 1.5 2003/04/18 13:38:40 jonen |
* Revision 1.5 2003/04/18 13:38:40 jonen |
| 14 |
* + added use of url::short function at 'decode_item_expr' |
* + added use of url::short function at 'decode_item_expr' |
| 15 |
* |
* |
| 89 |
} else { |
} else { |
| 90 |
//print "<b>2</b><br/>"; |
//print "<b>2</b><br/>"; |
| 91 |
$container = container(); |
$container = container(); |
| 92 |
foreach($item as $key => $value) { |
|
| 93 |
|
// add default 'add new' link |
| 94 |
|
$link_vars_create = array( |
| 95 |
|
'ecdid' => $options[label], |
| 96 |
|
'ecdm' => $options[parent_guid], |
| 97 |
|
'ecdmx' => $options[parent_class], |
| 98 |
|
'ecmod' => "create", |
| 99 |
|
'ecat' => 'item' |
| 100 |
|
); |
| 101 |
|
foreach($hidden_elements as $label => $value) { |
| 102 |
|
if(!$link_vars_create[$label]) { |
| 103 |
|
$link_vars_create[$label] = $value; |
| 104 |
|
} |
| 105 |
|
} |
| 106 |
|
$url_short = url::short($_SERVER["PHP_SELF"], $link_vars_create); |
| 107 |
|
$container->add(_HTML_SPACE, html_a( $url_short, $key . " add new"), html_br()); |
| 108 |
|
|
| 109 |
|
if(count($item) != 0) { |
| 110 |
|
foreach($item as $key => $value) { |
| 111 |
$link_meta = php::untwingle_reference($value, $options); |
$link_meta = php::untwingle_reference($value, $options); |
| 112 |
$link_vars = array( |
$link_vars = array( |
| 113 |
'ecdid' => $link_meta[ident], |
'ecdid' => $link_meta[ident], |
| 114 |
'ecdm' => $link_meta[type] |
'ecdm' => $link_meta[type], |
| 115 |
|
'ecat' => 'item' |
| 116 |
); |
); |
| 117 |
|
|
| 118 |
foreach($hidden_elements as $label => $value) { |
foreach($hidden_elements as $label => $value) { |
| 119 |
$link_vars[$label] = $value; |
if(!$link_vars[$label]) { |
| 120 |
|
$link_vars[$label] = $value; |
| 121 |
|
} |
| 122 |
//$tmp_array[] = $label . "=" . $value; |
//$tmp_array[] = $label . "=" . $value; |
| 123 |
} |
} |
| 124 |
|
|
| 131 |
|
|
| 132 |
// V2 - more flexible - adjustable link shrinking via some constant defined elsewhere |
// V2 - more flexible - adjustable link shrinking via some constant defined elsewhere |
| 133 |
$url_short = url::short($_SERVER["PHP_SELF"], $link_vars); |
$url_short = url::short($_SERVER["PHP_SELF"], $link_vars); |
| 134 |
$container->add("->", html_a( $url_short, $key . " view"), html_br()); |
$container->add( _HTML_SPACE, html_a( $url_short, $key . " - " . " view"), html_br()); |
| 135 |
|
|
| 136 |
|
} |
| 137 |
} |
} |
| 138 |
$item = $container; |
$item = $container; |
| 139 |
} |
} |
| 152 |
//$options = $this->_options['decode_args']; |
//$options = $this->_options['decode_args']; |
| 153 |
//print "item: $item<br/>"; |
//print "item: $item<br/>"; |
| 154 |
|
|
| 155 |
// resolve 'o_{guid}_{classname}' - encoded string |
if($item == "_REF") { |
| 156 |
$link_meta = php::untwingle_reference($item); |
$link_vars_create = array( |
| 157 |
//print Dumper($link_meta); |
'ecdid' => $options[label], |
| 158 |
|
'ecdm' => $options[parent_guid], |
| 159 |
if (!is_array($link_meta)) { |
'ecdmx' => $options[parent_class], |
| 160 |
//return $item; |
'ecmod' => "create", |
| 161 |
//print "NO<br/>"; |
'ecat' => 'item' |
| 162 |
return; |
); |
| 163 |
} |
foreach($hidden_elements as $label => $value) { |
| 164 |
|
if(!$link_vars_create[$label]) { |
| 165 |
$link_vars = array( |
$link_vars_create[$label] = $value; |
| 166 |
'ecdid' => $link_meta[ident], |
} |
| 167 |
'ecdm' => $link_meta[type], |
} |
| 168 |
); |
$url_short = url::short($_SERVER["PHP_SELF"], $link_vars_create); |
| 169 |
|
$item = html_a( $url_short, " create"); |
| 170 |
foreach($hidden_elements as $label => $value) { |
} else { |
| 171 |
$link_vars[$label] = $value; |
// resolve 'o_{guid}_{classname}' - encoded string |
| 172 |
} |
$link_meta = php::untwingle_reference($item); |
| 173 |
|
//print Dumper($link_meta); |
| 174 |
|
|
| 175 |
|
if (!is_array($link_meta)) { |
| 176 |
|
//return $item; |
| 177 |
|
//print "NO<br/>"; |
| 178 |
|
return; |
| 179 |
|
} |
| 180 |
|
|
| 181 |
|
$link_vars = array( |
| 182 |
|
'ecdid' => $link_meta[ident], |
| 183 |
|
'ecdm' => $link_meta[type], |
| 184 |
|
'ecat' => 'item' |
| 185 |
|
); |
| 186 |
|
|
| 187 |
|
foreach($hidden_elements as $label => $value) { |
| 188 |
|
if(!$link_vars[$label]) { |
| 189 |
|
$link_vars[$label] = $value; |
| 190 |
|
} |
| 191 |
|
} |
| 192 |
|
|
| 193 |
// V1 |
// V1 |
| 194 |
//$str_hidden = join("&", $tmp_array); |
//$str_hidden = join("&", $tmp_array); |
| 195 |
//$item = html_a($_SERVER["PHP_SELF"] . "?ecdid=" . $ident . "&ecdm=" . $meta . "&" . $str_hidden, "view"); |
//$item = html_a($_SERVER["PHP_SELF"] . "?ecdid=" . $ident . "&ecdm=" . $meta . "&" . $str_hidden, "view"); |
| 196 |
|
|
| 197 |
// V2 |
// V2 |
| 198 |
//$link_guid = link::store($link_vars); |
//$link_guid = link::store($link_vars); |
| 199 |
//$item = html_a($_SERVER["PHP_SELF"] . "?lbid=" . $link_guid, "view"); |
//$item = html_a($_SERVER["PHP_SELF"] . "?lbid=" . $link_guid, "view"); |
| 200 |
|
|
| 201 |
// V3 - more flexible - adjustable link shrinking via some constant defined elsewhere |
// V3 - more flexible - adjustable link shrinking via some constant defined elsewhere |
| 202 |
$url_short = url::short($_SERVER["PHP_SELF"], $link_vars); |
$url_short = url::short($_SERVER["PHP_SELF"], $link_vars); |
| 203 |
$item = html_a( $url_short, " view"); |
$item = html_a( $url_short, " view"); |
| 204 |
|
} |
| 205 |
|
|
| 206 |
return 1; |
return 1; |
| 207 |
} |
} |