Changeset 6087
- Timestamp:
- 05/31/07 15:52:47 (1 year ago)
- Files:
-
- trunk/src/midcom.helper.datamanager2/datamanager.php (modified) (1 diff)
- trunk/src/midcom.helper.xml/objectmapper.php (modified) (2 diffs)
- trunk/src/org.openpsa.products/handler/product/api.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/midcom.helper.datamanager2/datamanager.php
r5875 r6087 306 306 307 307 /** 308 * Little helper function returning an accociative array of all field values converted to XML 309 * using their default convert_to_csv or convert_to_raw options. 310 * 311 * @return Array All field values in their XML representation indexed by their name. 312 */ 313 function get_content_xml() 314 { 315 $result = Array(); 316 foreach ($this->schema->field_order as $name) 317 { 318 if (is_a($this->types[$name], 'midcom_helper_datamanager2_type_blobs')) 319 { 320 $result[$name] = explode(',', $this->types[$name]->convert_to_csv()); 321 } 322 elseif (is_a($this->types[$name], 'midcom_helper_datamanager2_type_select')) 323 { 324 $this->types[$name]->csv_export_key = true; 325 $this->types[$name]->multiple_storagemode = 'array'; 326 $result[$name] = $this->types[$name]->convert_to_storage(); 327 } 328 else 329 { 330 $result[$name] = $this->types[$name]->convert_to_storage(); 331 } 332 } 333 return $result; 334 } 335 336 /** 308 337 * Little helper function returning an accociative array of all field values converted to CSV 309 338 * using their default convert_to_csv option. trunk/src/midcom.helper.xml/objectmapper.php
r6074 r6087 200 200 function dm2data($datamanager, $fallback_label = 'default') 201 201 { 202 $content = $datamanager->get_content_ csv();202 $content = $datamanager->get_content_xml(); 203 203 $label = $datamanager->schema->name; 204 204 if ($label == 'default') … … 229 229 foreach ($array as $key => $field) 230 230 { 231 if (is_numeric($key)) 232 { 233 $key = 'value'; 234 } 235 231 236 if (empty($field)) 232 237 { 233 238 $data .= "{$prefix} <{$key}/>\n"; 234 239 } 240 235 241 elseif (is_array($field)) 236 242 { trunk/src/org.openpsa.products/handler/product/api.php
r6068 r6087 38 38 } 39 39 40 $_MIDCOM->auth->require_valid_user('basic');40 //$_MIDCOM->auth->require_valid_user('basic'); 41 41 42 42 //Content-Type
