Changeset 15234
- Timestamp:
- 02/25/08 11:10:31 (7 months ago)
- Files:
-
- trunk/midcom/midcom.core/midcom/services/indexer/backend/XMLCommClient.php (modified) (29 diffs)
- trunk/midcom/midcom.core/midcom/services/permalinks.php (modified) (1 diff)
- trunk/midcom/midcom.helper.datamanager/datamanager.php (modified) (2 diffs)
- trunk/midcom/midcom.helper.datamanager2/csv.php (modified) (2 diffs)
- trunk/midcom/midcom.helper.datamanager2/widget.php (modified) (14 diffs)
- trunk/midcom/midcom.helper.datamanager2/widget/captcha.php (modified) (1 diff)
- trunk/midcom/midcom.helper.datamanager2/widget/hidden.php (modified) (1 diff)
- trunk/midcom/midcom.helper.datamanager2/widget/image.php (modified) (1 diff)
- trunk/midcom/midcom.helper.datamanager2/widget/photo.php (modified) (1 diff)
- trunk/midcom/midcom.helper.datamanager2/widget/text.php (modified) (1 diff)
- trunk/midcom/midcom.helper.datamanager2/widget/video.php (modified) (15 diffs)
- trunk/midcom/midcom.helper.replicator/exporter.php (modified) (16 diffs)
- trunk/midcom/net.nehmer.mail/mailbox.php (modified) (22 diffs)
- trunk/midcom/org.openpsa.calendar/calendar_midcomdba.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/midcom/midcom.core/midcom/services/indexer/backend/XMLCommClient.php
r14773 r15234 3 3 /** 4 4 * @package midcom.services 5 * @author The Midgard Project, http://www.midgard-project.org 5 * @author The Midgard Project, http://www.midgard-project.org 6 6 * @version $Id:XMLCommClient.php 3765 2006-07-31 08:51:39 +0000 (Mon, 31 Jul 2006) tarjei $ 7 7 * @copyright The Midgard Project, http://www.midgard-project.org … … 12 12 * This class provides an interface to the MRFC 14 XML driven indexer 13 13 * backends. 14 * 14 * 15 15 * This class is responsible for producing an XML Request file. 16 * 16 * 17 17 * ... 18 * 18 * 19 19 * @package midcom.services 20 20 * @see midcom_services_indexer … … 26 26 /** 27 27 * The index name to use 28 * 28 * 29 29 * @var string 30 30 * @access private 31 31 */ 32 32 var $_index_name = null; 33 33 34 34 /** 35 35 * The current request content. This does not include the XML header … … 38 38 */ 39 39 var $_request = ''; 40 40 41 41 /** 42 42 * Initialize an XMLComm Request Writer. 43 * 43 * 44 44 * All double-quotes will be silently removed from the index name. 45 * 45 * 46 46 * @param string $index_name The name of the Index to be used. If not specified, the midcom config key 'indexer_index_name' is used. 47 47 */ … … 59 59 $this->_index_name = $this->_encode_argument($this->_index_name); 60 60 } 61 61 62 62 /** 63 63 * Surrounds the request data with an xml header and the request tags 64 64 * and returns the result. 65 * 66 * @param boolean $mask_request Set this to true to mask all occur ences of </request> in the content with65 * 66 * @param boolean $mask_request Set this to true to mask all occurrences of </request> in the content with 67 67 * </request_>, which is required for the TCP backends. (PHP cannot close a TCP socket in one direction 68 68 * only, so EOF checks won't work. … … 85 85 return "{$prefix}\n{$this->_request}\n{$postfix}\n"; 86 86 } 87 87 88 88 /** 89 89 * Add a query to the request. 90 * 90 * 91 91 * @param string $id The ID of the request. 92 92 * @param string $query The query string (added as CDATA). … … 108 108 $start = $filter->get_start(); 109 109 $end = $filter->get_end(); 110 110 111 111 $this->_request .= " <datefilter field='{$field}'>\n"; 112 112 if ($start > 0) … … 122 122 $this->_request .= " </datefilter>\n"; 123 123 break; 124 124 125 125 default: 126 126 $_MIDCOM->generate_error(MIDCOM_ERRCRIT, "Indexer XMLCommClient: Encountered unknown filter type {$filter->type}."); … … 131 131 $this->_request .= "</query>\n"; 132 132 } 133 133 134 134 /** 135 135 * Index one or more documents. 136 * 136 * 137 137 * @param string $id The ID of the request. 138 * @param mixed $document One or more documents to be indexed, so this is either a 138 * @param mixed $document One or more documents to be indexed, so this is either a 139 139 * midcom_services_indexer_document or an Array of these objects. 140 140 */ … … 150 150 return; 151 151 } 152 152 153 153 $id = $this->_encode_argument($id); 154 154 $this->_request .= "<index id='{$id}'>\n"; 155 155 156 156 foreach ($documents as $document) 157 157 { 158 158 $RI = $this->_encode_argument($document->RI); 159 159 $this->_request .= " <document id='{$RI}'>\n"; 160 160 161 161 foreach ($document->list_fields() as $field_name) 162 162 { … … 166 166 $this->_request .= " <{$field['type']} name='{$field['name']}'>{$field['content']}</{$field['type']}>\n"; 167 167 } 168 168 169 169 $this->_request .= " </document>\n"; 170 170 } 171 171 172 172 $this->_request .= "</index>\n"; 173 173 } 174 174 175 175 /** 176 176 * Adds a delete request. 177 * 177 * 178 178 * @param string $id The ID of the request. 179 179 * @param string $RI The document's resource identifier. … … 185 185 $this->_request .= "<delete id='{$id}' documentid='{$RI}' />\n"; 186 186 } 187 187 188 188 /** 189 189 * Adds a drop index request. 190 * 190 * 191 191 * @param string $id The ID of the request. 192 192 */ … … 196 196 $this->_request .= "<deleteall id='{$id}' />\n"; 197 197 } 198 199 198 199 200 200 // HELPERS 201 201 202 202 /** 203 203 * Encodes an argument masking both single and double quotes. 204 * 204 * 205 205 * @param string $string String to modify. 206 * @return string The modified string. 206 * @return string The modified string. 207 207 */ 208 208 function _encode_argument($string) 209 209 { 210 return str_replace(Array('"', "'"), Array('"', '''), $this->_clean_content_control_chars($string)); 211 } 212 210 return str_replace(Array('"', "'"), Array('"', '''), $this->_clean_content_control_chars($string)); 211 } 212 213 213 /** 214 214 * Encodes a string using CDATA encoding. 215 * 215 * 216 216 * @param string $string The original string. 217 217 * @return string The encoded string including the CDATA tags. … … 223 223 /** 224 224 * Removes all control characters except LF from the content, as this might throw the indexer 225 * off-track (valid XML and the like). 226 * 227 * WARNING: This function could break UTF-8 sequences right now, I'm on the lookout for a 225 * off-track (valid XML and the like). 226 * 227 * WARNING: This function could break UTF-8 sequences right now, I'm on the lookout for a 228 228 * better regex, as I do not know if the /u pattern modifier is enough. I just hope so. 229 * 229 * 230 230 * @param string $string The string to process. 231 231 * @todo Finish Regex. … … 242 242 * This class provides an interface to the MRFC 14 XML driven indexer 243 243 * backends. 244 * 244 * 245 245 * This class is responsible for parsing a Respons XML file. It uses the 246 246 * PEAR XML_Parser base class. 247 * 247 * 248 248 * Note, that Expat does currently *not* support Input DTD validation. We trust 249 249 * the source for now. Eventually, this might get rewritten top libXML. 250 * 250 * 251 251 * ... 252 * 252 * 253 253 * @package midcom.services 254 254 * @see midcom_services_indexer … … 260 260 * Current Data collected by the CDATA handler, will be processed by 261 261 * the end-element handlers. 262 * 262 * 263 263 * @access private 264 264 * @var string 265 265 */ 266 266 var $_current_data = ''; 267 267 268 268 /** 269 269 * An array of resultsets. A resultset is an array of documents. 270 * 270 * 271 271 * They are indexed by the request id. 272 * 272 * 273 273 * Only valid after parsing the Request. 274 * 274 * 275 275 * @var Array 276 276 */ 277 277 var $resultsets = Array(); 278 278 279 279 /** 280 280 * An array of warnings that have been found. 281 * 281 * 282 282 * They are indexed by the request id. 283 * 283 * 284 284 * Only valid after parsing the Request. 285 * 285 * 286 286 * @var Array 287 287 */ 288 288 var $warnings = Array(); 289 289 290 290 /** 291 291 * The current document, before being added to the resultset. 292 * 292 * 293 293 * @access private 294 294 * @var midcom_services_indexer_document 295 295 */ 296 296 var $_current_document = null; 297 297 298 298 /** 299 299 * The current request ID. 300 * 300 * 301 301 * @access private 302 302 * @var string 303 303 */ 304 304 var $_current_id = ''; 305 305 306 306 /** 307 307 * The name of the current field, which is collected in _current_data at this time. 308 * 308 * 309 309 * @access private 310 310 * @var string 311 311 */ 312 312 var $_current_field = null; 313 313 314 314 /** 315 315 * The RI of the document currently being parsed. 316 * 316 * 317 317 * @access private 318 318 * @var string 319 319 */ 320 320 var $_current_document_id = ''; 321 322 321 322 323 323 /** 324 324 * Initialize the XML Parser. … … 332 332 parent::XML_Parser(null, 'event'); 333 333 } 334 335 334 335 336 336 /** 337 337 * The character data collector. 338 * 338 * 339 339 * This is an Expat Callback. 340 * 340 * 341 341 * @param object $parser The XML Parser resource 342 342 * @param string $data The read data. … … 347 347 $this->_current_data .= $data; 348 348 } 349 349 350 350 /** 351 351 * Start a new resultset. 352 * 352 * 353 353 * This will store the resultset id, the rest of the work is done by the 354 354 * document tag handlers. 355 * 355 * 356 356 * @param object $parser The XML parser resource 357 357 * @param string $name The name of the element being parsed … … 364 364 $this->resultsets[$this->_current_id] = Array(); 365 365 } 366 366 367 367 /** 368 368 * The resultset is complete. … … 376 376 $this->_current_id = ''; 377 377 } 378 378 379 379 /** 380 380 * Start a new document. 381 * 381 * 382 382 * This will prepare a new document and save the corresponding ID. 383 * 383 * 384 384 * @param object $parser The XML parser resource 385 385 * @param string $name The name of the element being parsed … … 393 393 $this->_current_document_id = $attribs['ID']; 394 394 } 395 395 396 396 /** 397 397 * The document is complete. … … 408 408 $this->_current_document_id = ''; 409 409 } 410 410 411 411 /** 412 412 * Start a new document field. 413 * 413 * 414 414 * @param object $parser The XML parser resource 415 415 * @param string $name The name of the element being parsed … … 422 422 $this->_current_data = ''; 423 423 } 424 424 425 425 /** 426 426 * The field is complete. … … 435 435 $this->_current_field = null; 436 436 } 437 437 438 438 /** 439 439 * Start a new warning record. 440 * 440 * 441 441 * @param object $parser The XML parser resource 442 442 * @param string $name The name of the element being parsed … … 449 449 $this->_current_data = ''; 450 450 } 451 451 452 452 /** 453 453 * The warning is complete. … … 461 461 $this->warnings[$this->_current_id] = $this->_current_data; 462 462 } 463 463 464 464 /** 465 465 * Start an error record. 466 * 466 * 467 467 * @param object $parser The XML parser resource 468 468 * @param string $name The name of the element being parsed … … 475 475 $this->_current_data = ''; 476 476 } 477 477 478 478 /** 479 479 * The error is complete. 480 * 480 * 481 481 * This will call generate_error with the error message, as this is a 482 482 * rather critical error. … … 493 493 debug_add($msg, MIDCOM_LOG_ERROR); 494 494 } 495 495 496 496 /** 497 497 * This function will parse the given string. Any error from Expat 498 498 * will trigger generate_error. 499 * 499 * 500 500 * @param string $string The XML data to be parsed. 501 501 */ … … 504 504 debug_push_class(__CLASS__, __FUNCTION__); 505 505 // Set the mode now, so that $this is a valid reference. 506 $this->setMode('func'); 507 506 $this->setMode('func'); 507 508 508 $result = parent::parseString($string, true); 509 509 510 510 if ($result !== true) 511 511 { trunk/midcom/midcom.core/midcom/services/permalinks.php
r14954 r15234 23 23 * 24 24 * The current Permalink implementation limits granularity to a GUID level -- permalinks 25 * map object GUIDs to pages. If you have mul itple pages showing the same object, you need25 * map object GUIDs to pages. If you have multiple pages showing the same object, you need 26 26 * to decide which one you wish to have as permalink and provide that URL for resolution. 27 27 * For the forward lookup, it is allowed to have multiple pages set the same permalink. trunk/midcom/midcom.helper.datamanager/datamanager.php
r15146 r15234 1912 1912 * of the separator or one of the two newline characters \n and \r will trigger 1913 1913 * quoting. In quoting mode, the entire string will be enclosed in double-quotes. 1914 * Any occur ence of a double quote in the original string will be transformed1914 * Any occurrence of a double quote in the original string will be transformed 1915 1915 * into two double quotes. Any leading or trailing whitespace around the data 1916 1916 * will be eliminated. … … 1932 1932 1933 1933 if (preg_match($pattern, $data) != 0) { 1934 // Qu toed operation required: Escape quotes1934 // Quoted operation required: Escape quotes 1935 1935 return '"' . str_replace('"','""',$data) . '"'; 1936 1936 } else { trunk/midcom/midcom.helper.datamanager2/csv.php
r14385 r15234 71 71 * of the separator or one of the two newline characters \n and \r will trigger 72 72 * quoting. In quoting mode, the entire string will be enclosed in double-quotes. 73 * Any occur ence of a double quote in the original string willebe transformed73 * Any occurrence of a double quote in the original string will be transformed 74 74 * into two double quotes. Any leading or trailing whitespace around the data 75 75 * will be eliminated. … … 91 91 if (preg_match($pattern, $string) != 0) 92 92 { 93 // Qu toed operation required: Escape quotes93 // Quoted operation required: Escape quotes 94 94 return '"' . str_replace('"','""',$string) . '"'; 95 95 } trunk/midcom/midcom.helper.datamanager2/widget.php
r14380 r15234 48 48 49 49 /** 50 * The name field holds the name of the field the widget is encapsulating. 51 * 50 * The name field holds the name of the field the widget is encapsulating. 51 * 52 52 * This maps to the schema's field name. You should never have to change them. 53 53 * … … 58 58 59 59 /** 60 * A reference to the schema field we should draw. 61 * 60 * A reference to the schema field we should draw. 61 * 62 62 * Description texts etc. are taken from here. 63 63 * … … 68 68 69 69 /** 70 * The schema (not the schema <i>database!</i>) to use for operation. 71 * 72 * This variable will always contain a parsed representation of the schema, so that 70 * The schema (not the schema <i>database!</i>) to use for operation. 71 * 72 * This variable will always contain a parsed representation of the schema, so that 73 73 * one can swiftly switch between individual schemas of the Database. 74 74 * … … 89 89 90 90 /** 91 * This is the Namespace to use for all HTML/CSS/JS elements. 92 * 93 * It is deduced by the formmanager and tries to be as smart as possible to work safely with 91 * This is the Namespace to use for all HTML/CSS/JS elements. 92 * 93 * It is deduced by the formmanager and tries to be as smart as possible to work safely with 94 94 * more then one form on a page. 95 95 * 96 * You have to prefix all elements which must be unique using this string (it includes a 96 * You have to prefix all elements which must be unique using this string (it includes a 97 97 * trailing underscore). 98 98 * … … 128 128 * @param Array $config The configuration data which should be used to customize the widget. 129 129 * @param midcom_helper_datamanager2_schema &$schema A reference to the full schema object. 130 * @param midcom_helper_datamanager2_type $type A reference to the type to which we are bound.130 * @param midcom_helper_datamanager2_type &$type A reference to the type to which we are bound. 131 131 * @param string $namespace The namespace to use including the trailing underscore. 132 132 * @param boolean $initialize_dependencies Whether to load JS and other dependencies on initialize … … 162 162 * Set the form reference. 163 163 * 164 * @param HTMLQuickForm $form The form to use.164 * @param HTMLQuickForm &$form The form to use. 165 165 */ 166 166 function set_form(&$form) … … 188 188 189 189 /** 190 * Gets an external configuration option referenced by its key. 191 * 192 * Besides other parts in the datamanager framework, nobody should ever have to 190 * Gets an external configuration option referenced by its key. 191 * 192 * Besides other parts in the datamanager framework, nobody should ever have to 193 193 * touch this information. 194 194 * … … 206 206 207 207 /** 208 * Sets an external configuration option. 209 * 210 * Besides other parts in the datamanager framework, nobody should ever have to 208 * Sets an external configuration option. 209 * 210 * Besides other parts in the datamanager framework, nobody should ever have to 211 211 * touch this information. 212 212 * … … 233 233 234 234 /** 235 * Returns the default value for this field as required by HTML_Quickform. 236 * 237 * You may either return a single value for simple types, or an array of form 238 * field name / value pairs in case of composite types. A value of null indicates 235 * Returns the default value for this field as required by HTML_Quickform. 236 * 237 * You may either return a single value for simple types, or an array of form 238 * field name / value pairs in case of composite types. A value of null indicates 239 239 * no applicable default. 240 240 * … … 262 262 /** 263 263 * This function is invoked if the widget should extract the corresponding data 264 * from the form results passed in $results. 265 * 266 * Form validation has already been done before, this function will only be called 264 * from the form results passed in $results. 265 * 266 * Form validation has already been done before, this function will only be called 267 267 * if and only if the form validation succeeds. 268 268 * … … 277 277 /** 278 278 * This event handler is called if and only if the Formmanager detects an actual 279 * form submission (this is tracked using a hidden form member). 280 * 281 * No Form validation has been done at this point. The event is triggered on all 279 * form submission (this is tracked using a hidden form member). 280 * 281 * No Form validation has been done at this point. The event is triggered on all 282 282 * submissions with the exception of the cancel and previous form events. 283 283 * … … 305 305 306 306 /** 307 * Freezes all form elements associated with the widget. 308 * 309 * The default implementation works on the default field name, you don't need to override 307 * Freezes all form elements associated with the widget. 308 * 309 * The default implementation works on the default field name, you don't need to override 310 310 * this function unless you have multiple widgets in the form. 311 311 * … … 322 322 323 323 /** 324 * Unfreezes all form elements associated with the widget. 325 * 326 * The default implementation works on the default field name, you don't need to override 324 * Unfreezes all form elements associated with the widget. 325 * 326 * The default implementation works on the default field name, you don't need to override 327 327 * this function unless you have multiple widgets in the form. 328 328 * … … 336 336 337 337 /** 338 * Checks if the widget is frozen. 339 * 340 * The default implementation works on the default field name, usually you don't need to 338 * Checks if the widget is frozen. 339 * 340 * The default implementation works on the default field name, usually you don't need to 341 341 * override this function unless you have some strange form element logic. 342 342 * trunk/midcom/midcom.helper.datamanager2/widget/captcha.php
r14329 r15234 169 169 170 170 /** 171 * QF Vali ation callback which verifies the passcode against the Captcha.171 * QF Validation callback which verifies the passcode against the Captcha. 172 172 */ 173 173 function validate($fields) trunk/midcom/midcom.helper.datamanager2/widget/hidden.php
r14773 r15234 69 69 70 70 /** 71 * QF Vali ation callback used for number types. It checks the number boundaries71 * QF Validation callback used for number types. It checks the number boundaries 72 72 * accordingly. 73 73 */ trunk/midcom/midcom.helper.datamanager2/widget/image.php
r14773 r15234 375 375 parent::on_submit($results); 376 376 377 // TODO: refa tor these checks to separate methods377 // TODO: refactor these checks to separate methods 378 378 if (array_key_exists("{$this->name}_delete", $results)) 379 379 { trunk/midcom/midcom.helper.datamanager2/widget/photo.php
r15158 r15234 29 29 function on_submit($results) 30 30 { 31 // TODO: refa tor these checks to separate methods31 // TODO: refactor these checks to separate methods 32 32 if (array_key_exists("{$this->name}_rotate", $results)) 33 33 { trunk/midcom/midcom.helper.datamanager2/widget/text.php
r14329 r15234 132 132 133 133 /** 134 * QF Vali ation callback used for number types. It checks the number boundaries134 * QF Validation callback used for number types. It checks the number boundaries 135 135 * accordingly. 136 136 */ trunk/midcom/midcom.helper.datamanager2/widget/video.php
r14773 r15234 84 84 ); 85 85 $this->_upload_element_video =& HTML_QuickForm::createElement('file', "{$this->name}_file_video", '', $attributes); 86 86 87 87 $elements = Array(); 88 88 $elements_video = Array(); … … 323 323 "{$size}, {$info['formattedsize']} Byte</li>\n"; 324 324 } 325 325 326 326 } 327 327 $static_html .= "</ul>\n"; … … 378 378 } 379 379 380 380 381 381 function _create_upload_elements_video(&$elements) 382 382 { 383 383 // The table 384 384 $static_html = "<table border='0' class='midcom_helper_datamanager2_widget_image_table' id='{$this->_namespace}{$this->name}_table'>\n"; 385 385 386 386 $elements[] =& HTML_QuickForm::createElement('static', "{$this->name}_start", '', $static_html); 387 387 … … 390 390 391 391 // Video info 392 392 393 393 $elements[] =& HTML_QuickForm::createElement('static', "{$this->name}_inter2", '', $static_html); 394 394 395 395 // The upload field 396 396 $static_html = "<tr><td>" . $this->_l10n->get('upload file') . "</td><td>\n"; … … 404 404 ); 405 405 //$elements[] =& HTML_QuickForm::createElement('submit', "{$this->name}_upload_video", $this->_l10n->get('upload file'), $attributes); 406 406 407 407 $static_html = "</td></tr>\n"; 408 408 … … 417 417 // The table 418 418 $static_html = "<table border='0' class='midcom_helper_datamanager2_widget_image_table' id='{$this->_namespace}{$this->name}_table'>\n"; 419 419 420 420 $elements[] =& HTML_QuickForm::createElement('static', "{$this->name}_start", '', $static_html); 421 421 … … 424 424 425 425 // Video info 426 426 427 427 foreach ($this->_type->attachments_info as $name => $info) 428 428 { … … 436 436 $static_html .= "</ul>\n"; 437 437 $elements[] =& HTML_QuickForm::createElement('static', "{$this->name}_inter2", '', $static_html); 438 438 439 439 // Add the Delete button 440 440 $attributes = Array … … 443 443 ); 444 444 $elements[] =& HTML_QuickForm::createElement('submit', "{$this->name}_delete_video", $this->_l10n->get('delete video'), $attributes); 445 445 446 446 // The upload field 447 447 $static_html = "</td></tr><tr><td>" . $this->_l10n->get('upload file') . "</td><td>\n"; … … 455 455 ); 456 456 //$elements[] =& HTML_QuickForm::createElement('submit', "{$this->name}_upload_video", $this->_l10n->get('upload file'), $attributes); 457 457 458 458 $static_html = "</td></tr>"; 459 459 … … 522 522 523 523 /** 524 * The on_submit event handles all file uploads immediately. 525 * 526 * They are passed through the type at that point. This is required, since we do not have 524 * The on_submit event handles all file uploads immediately. 525 * 526 * They are passed through the type at that point. This is required, since we do not have 527 527 * persistent upload file management on the QF side. Deletions take precedence over uploads. 528 528 */ … … 531 531 parent::on_submit($results); 532 532 533 // TODO: refa tor these checks to separate methods533 // TODO: refactor these checks to separate methods 534 534 if (array_key_exists("{$this->name}_delete_video", $results)) 535 535 { … … 571 571 } 572 572 573 } 573 } 574 574 else 575 575 { 576 576 if ($this->_upload_element_video->isUploadedFile()) 577 577 { 578 578 579 579 $file_video = $this->_upload_element_video->getValue(); 580 580 581 581 //echo "<pre>"; 582 582 //print_r($this->_upload_element_video); 583 583 //print_r($this->_upload_element); 584 584 //echo "</pre>"; 585 585 586 586 if (!empty($file_video['name'])) 587 587 { … … 599 599 } 600 600 } 601 601 602 602 if ($this->_upload_element->isUploadedFile()) 603 603 { 604 604 $file = $this->_upload_element->getValue(); 605 605 606 606 //echo "<pre>"; 607 607 //print_r($this->_upload_element_video); 608 608 //print_r($this->_upload_element); 609 609 //echo "</pre>"; 610 610 611 611 if ($this->show_title) 612 612 { … … 617 617 $title = ''; 618 618 } 619 619 620 620 if (!empty($file['name'])) 621 621 { trunk/midcom/midcom.helper.replicator/exporter.php
r14773 r15234 22 22 23 23 var $exportability = array(); 24 24 25 25 var $handled_dependencies = array(); 26 26 … … 35 35 { 36 36 $this->_component = 'midcom.helper.replicator'; 37 37 38 38 $this->subscription = $subscription; 39 39 40 40 parent::midcom_baseclasses_components_purecode(); 41 41 } 42 42 43 43 /** 44 44 * This is a static factory method which lets you dynamically create exporter instances. … … 58 58 $type = $subscription->exporter; 59 59 $filename = MIDCOM_ROOT . "/midcom/helper/replicator/exporter/{$type}.php"; 60 60 61 61 if (!file_exists($filename)) 62 62 { … … 66 66 require_once($filename); 67 67 68 $classname = "midcom_helper_replicator_exporter_{$type}"; 68 $classname = "midcom_helper_replicator_exporter_{$type}"; 69 69 if (!class_exists($classname)) 70 70 { … … 72 72 // This will exit. 73 73 } 74 74 75 75 /** 76 76 * Php 4.4.1 does not allow you to return a reference to an expression. … … 120 120 } 121 121 unset($privileges, $privilege, $qb); 122 122 123 123 debug_pop(); 124 124 return $serializations; … … 155 155 return false; 156 156 } 157 157 158 158 // Check that we can export parameters of the attachment as well before adding it to the serialized list 159 159 $attachment_parameters = $this->serialize_parameters($attachment); … … 218 218 debug_add("Attachment {$attachment->guid} is not exportable", MIDCOM_LOG_INFO); 219 219 continue; 220 } 221 220 } 221 222 222 $attachment_serialized = $this->serialize_attachment($attachment); 223 223 if ($attachment_serialized === false) … … 271 271 continue; 272 272 } 273 273 274 274 $parameter_serialized = midcom_helper_replicator_serialize($parameter); 275 275 if ($parameter_serialized === false) … … 304 304 debug_add("called for {$class} {$object->guid}"); 305 305 $serializations = array(); 306 $GLOBALS['midcom_helper_replicator_logger']->push_prefix('exporter'); 307 306 $GLOBALS['midcom_helper_replicator_logger']->push_prefix('exporter'); 307 308 308 // Special case of midgard_attachment (and classes extending it) 309 309 if (is_a($object, 'midgard_attachment')) … … 313 313 return $this->serialize_attachment($object); 314 314 } 315 315 316 316 if ( version_compare(mgd_version(), '1.8.2', '>=') 317 317 && !$skip_children) 318 318 { 319 // TODO: refa tor to separate method(s)
