/** * @return bool */ protected function _postImport() { $addedIds = (array) $this->_jbsession->get('ids', 'import-ids'); $addedIds = array_filter($addedIds); $mode = $this->_jbsession->get('lose', 'import'); if ($mode == 0) { $this->_('No post precessing', 'Info'); } else { $this->_('Total items imported: ' . count($addedIds), 'Info'); } $this->_jbsession->set('ids', $addedIds, 'import-ids'); @$this->_jbimport->itemsPostProcess(); return true; }
/** * Call after all items loaded */ public function postImport() { try { $importType = $this->_jbrequest->get('import-type'); if ($importType == 'items') { $this->_jbimport->itemsPostProcess(); } else { if ($importType == 'categories') { $this->_jbimport->categoriesPostProcess(); } } // remove all csv files $files = (array) JFolder::files($this->app->jbpath->sysPath('tmp'), '\\.csv'); foreach ($files as $csvFile) { JFile::delete($csvFile); } $this->app->jbajax->send(); } catch (Exception $e) { jexit("Exception: " . $e->getMessage()); } }