importer = &new ImportOCS1(); // Validation checks for this form $this->addCheck(new FormValidator($this, 'conferencePath', 'required', 'admin.conferences.form.pathRequired')); $this->addCheck(new FormValidator($this, 'importPath', 'required', 'admin.conferences.form.importPathRequired')); $this->addCheck(new FormValidatorPost($this)); } /** * Display the form. */ function display() { $templateMgr = &TemplateManager::getManager(); $templateMgr->assign('importError', $this->importer->error()); parent::display(); } /** * Assign form data to user-submitted data. */ function readInputData() { $this->readUserVars(array('conferencePath', 'importPath', 'options')); } /** * Import content. * @return boolean/int false or conference ID */ function execute() { $options = $this->getData('options'); $conferenceId = $this->importer->import($this->getData('conferencePath'), $this->getData('importPath'), is_array($options) ? $options : array()); return $conferenceId; } function getConflicts() { return $this->importer->getConflicts(); } function getErrors() { return $this->importer->getErrors(); } } ?>