Index: trunk/core/kernel/db/db_tag_processor.php =================================================================== diff -u -r6428 -r6583 --- trunk/core/kernel/db/db_tag_processor.php (.../db_tag_processor.php) (revision 6428) +++ trunk/core/kernel/db/db_tag_processor.php (.../db_tag_processor.php) (revision 6583) @@ -1587,6 +1587,53 @@ return $ret; } + function ExportStatus($params) + { + $export_object =& $this->Application->recallObject('CatItemExportHelper'); + + $event = new kEvent($this->getPrefixSpecial().':OnDummy'); + + $action_method = 'perform'.ucfirst($this->Special); + $field_values = $export_object->$action_method($event); + + // finish code is done from JS now + if ($field_values['start_from'] == $field_values['total_records']) + { + if ($this->Special == 'import') { + $this->Application->StoreVar('PermCache_UpdateRequired', 1); + $this->Application->Redirect('categories/cache_updater', Array('m_opener' => 'r', 'pass' => 'm', 'continue' => 1, 'no_amp' => 1)); + } + elseif ($this->Special == 'export') { + $finish_t = $this->Application->RecallVar('export_finish_t'); + $this->Application->Redirect($finish_t, Array('pass' => 'all')); + $this->Application->RemoveVar('export_finish_t'); + } + } + + $export_options = $export_object->loadOptions($event); + return $export_options['start_from'] * 100 / $export_options['total_records']; + } + + /** + * Returns path where exported category items should be saved + * + * @param Array $params + */ + function ExportPath($params) + { + $ret = EXPORT_PATH.'/'; + + if( getArrayValue($params, 'as_url') ) + { + $ret = str_replace( FULL_PATH.'/', $this->Application->BaseURL(), $ret); + } + + $export_options = unserialize($this->Application->RecallVar($this->getPrefixSpecial().'_options')); + $ret .= $export_options['ExportFilename'].'.'.($export_options['ExportFormat'] == 1 ? 'csv' : 'xml'); + + return $ret; + } + } ?> \ No newline at end of file