00001 <?php
00002
00016
00017
00018
00019 import('site.ImportOJS1');
00020 import('form.Form');
00021
00022 class ImportOJS1Form extends Form {
00023
00027 var $importer;
00028
00033 function ImportOJS1Form() {
00034 parent::Form('admin/importOJS1.tpl');
00035 $this->importer = &new ImportOJS1();
00036
00037
00038 $this->addCheck(new FormValidator($this, 'journalPath', 'required', 'admin.journals.form.pathRequired'));
00039 $this->addCheck(new FormValidator($this, 'importPath', 'required', 'admin.journals.form.importPathRequired'));
00040 $this->addCheck(new FormValidatorPost($this));
00041 }
00042
00046 function display() {
00047 $templateMgr = &TemplateManager::getManager();
00048 $templateMgr->assign('importError', $this->importer->error());
00049 parent::display();
00050 }
00051
00055 function readInputData() {
00056 $this->readUserVars(array('journalPath', 'importPath', 'options'));
00057 }
00058
00063 function execute() {
00064 $options = $this->getData('options');
00065 $journalId = $this->importer->import($this->getData('journalPath'), $this->getData('importPath'), is_array($options) ? $options : array());
00066 return $journalId;
00067 }
00068
00069 function getConflicts() {
00070 return $this->importer->getConflicts();
00071 }
00072
00073 function getRedirects() {
00074 return $this->importer->getRedirects();
00075 }
00076 }
00077
00078 ?>