Index: trunk/core/units/general/cat_dbitem_export.php =================================================================== diff -u -r3616 -r3629 --- trunk/core/units/general/cat_dbitem_export.php (.../cat_dbitem_export.php) (revision 3616) +++ trunk/core/units/general/cat_dbitem_export.php (.../cat_dbitem_export.php) (revision 3629) @@ -192,6 +192,9 @@ } else { $check_fields = $this->exportOptions['DuplicateCheckFields'] ? explode('|', substr($this->exportOptions['DuplicateCheckFields'], 1, -1)) : Array(); + foreach ($check_fields as $index => $check_field) { + // get field name from kMultilanguage formatter + } } if (!$check_fields) { @@ -322,6 +325,10 @@ if ($this->exportOptions['start_from'] == 0) // first export step { + if (!getArrayValue($this->exportOptions, 'IsBaseCategory')) { + $this->exportOptions['IsBaseCategory'] = 0; + } + if ($this->exportOptions['IsBaseCategory'] ) { $sql = 'SELECT CachedNavbar FROM '.TABLE_PREFIX.'Category @@ -358,7 +365,7 @@ $data_array = Array(); foreach ($this->exportFields as $export_field) { - $data_array = array_merge($data_array, $this->getFieldValue($export_field) ); + $data_array = array_merge($data_array, $this->getFieldValue($export_field) ); } $this->writeRecord($data_array); $records_exported++; @@ -752,7 +759,7 @@ FROM '.TABLE_PREFIX.'Category WHERE CategoryId = '.$category_id; $category_path = $this->Conn->GetOne($sql); - $category_path = explode('>', $category_path); + $category_path = $category_path ? explode('>', $category_path) : Array(); if ($this->exportOptions['IsBaseCategory']) { $i = $this->exportOptions['BaseLevel']; Index: trunk/kernel/units/general/cat_event_handler.php =================================================================== diff -u -r3616 -r3629 --- trunk/kernel/units/general/cat_event_handler.php (.../cat_event_handler.php) (revision 3616) +++ trunk/kernel/units/general/cat_event_handler.php (.../cat_event_handler.php) (revision 3629) @@ -1064,7 +1064,21 @@ */ function OnExport(&$event) { - $selected_ids = $this->Application->GetVar('linklist'); + // use old fasion (in-portal) grid + $selector_name = $this->Application->getUnitOption($event->Prefix, 'CatalogSelectorName'); + if ($selector_name) { + $selected_ids = $this->Application->GetVar($selector_name); + } + else { + $this->StoreSelectedIDs($event); + $selected_ids = $this->getSelectedIDs($event); + + if (implode(',', $selected_ids) == '') { + // K4 fix when no ids found bad selected ids array is formed + $selected_ids = false; + } + } + $selected_cats_ids = $this->Application->GetVar('export_categories'); $this->Application->StoreVar($event->Prefix.'_export_ids', $selected_ids ? implode(',', $selected_ids) : '' ); Index: trunk/core/units/general/cat_event_handler.php =================================================================== diff -u -r3616 -r3629 --- trunk/core/units/general/cat_event_handler.php (.../cat_event_handler.php) (revision 3616) +++ trunk/core/units/general/cat_event_handler.php (.../cat_event_handler.php) (revision 3629) @@ -1064,7 +1064,21 @@ */ function OnExport(&$event) { - $selected_ids = $this->Application->GetVar('linklist'); + // use old fasion (in-portal) grid + $selector_name = $this->Application->getUnitOption($event->Prefix, 'CatalogSelectorName'); + if ($selector_name) { + $selected_ids = $this->Application->GetVar($selector_name); + } + else { + $this->StoreSelectedIDs($event); + $selected_ids = $this->getSelectedIDs($event); + + if (implode(',', $selected_ids) == '') { + // K4 fix when no ids found bad selected ids array is formed + $selected_ids = false; + } + } + $selected_cats_ids = $this->Application->GetVar('export_categories'); $this->Application->StoreVar($event->Prefix.'_export_ids', $selected_ids ? implode(',', $selected_ids) : '' ); Index: trunk/kernel/admin/include/toolbar/browse.php =================================================================== diff -u -r3543 -r3629 --- trunk/kernel/admin/include/toolbar/browse.php (.../browse.php) (revision 3543) +++ trunk/kernel/admin/include/toolbar/browse.php (.../browse.php) (revision 3629) @@ -550,6 +550,10 @@ action_prefix = activeTab.getAttribute("ActionPrefix"); if (page.length == 0) page = activeTab.getAttribute("EditURL"); + if (actionValue == 'export') { + save_selected_categories('export_categories'); + } + if ( action_prefix.match("k4:(.*)") ) { act = RegExp.$1; @@ -558,9 +562,8 @@ eval(act); return; } - else if(actionValue == 'import' || actionValue == 'export') + else if(actionValue == 'export') { - save_selected_categories('export_categories'); return k4_actionHandler(actionValue, activeTab.getAttribute("PrefixSpecial")); } } Index: trunk/kernel/units/general/cat_dbitem_export.php =================================================================== diff -u -r3616 -r3629 --- trunk/kernel/units/general/cat_dbitem_export.php (.../cat_dbitem_export.php) (revision 3616) +++ trunk/kernel/units/general/cat_dbitem_export.php (.../cat_dbitem_export.php) (revision 3629) @@ -192,6 +192,9 @@ } else { $check_fields = $this->exportOptions['DuplicateCheckFields'] ? explode('|', substr($this->exportOptions['DuplicateCheckFields'], 1, -1)) : Array(); + foreach ($check_fields as $index => $check_field) { + // get field name from kMultilanguage formatter + } } if (!$check_fields) { @@ -322,6 +325,10 @@ if ($this->exportOptions['start_from'] == 0) // first export step { + if (!getArrayValue($this->exportOptions, 'IsBaseCategory')) { + $this->exportOptions['IsBaseCategory'] = 0; + } + if ($this->exportOptions['IsBaseCategory'] ) { $sql = 'SELECT CachedNavbar FROM '.TABLE_PREFIX.'Category @@ -358,7 +365,7 @@ $data_array = Array(); foreach ($this->exportFields as $export_field) { - $data_array = array_merge($data_array, $this->getFieldValue($export_field) ); + $data_array = array_merge($data_array, $this->getFieldValue($export_field) ); } $this->writeRecord($data_array); $records_exported++; @@ -752,7 +759,7 @@ FROM '.TABLE_PREFIX.'Category WHERE CategoryId = '.$category_id; $category_path = $this->Conn->GetOne($sql); - $category_path = explode('>', $category_path); + $category_path = $category_path ? explode('>', $category_path) : Array(); if ($this->exportOptions['IsBaseCategory']) { $i = $this->exportOptions['BaseLevel'];