classes/admin/form/ImportOCS1Form.inc.php

Go to the documentation of this file.
00001 <?php
00002 
00015 //$Id$
00016 
00017 import('site.ImportOCS1');
00018 import('form.Form');
00019 
00020 class ImportOCS1Form extends Form {
00021 
00023    var $importer;
00024 
00029    function ImportOCS1Form() {
00030       parent::Form('admin/importOCS1.tpl');
00031       $this->importer = new ImportOCS1();
00032 
00033       // Validation checks for this form
00034       $this->addCheck(new FormValidator($this, 'conferencePath', 'required', 'admin.conferences.form.pathRequired'));
00035       $this->addCheck(new FormValidator($this, 'importPath', 'required', 'admin.conferences.form.importPathRequired'));
00036       $this->addCheck(new FormValidatorPost($this));
00037    }
00038 
00042    function display() {
00043       $templateMgr =& TemplateManager::getManager();
00044       $templateMgr->assign('importError', $this->importer->error());
00045       parent::display();
00046    }
00047 
00051    function readInputData() {
00052       $this->readUserVars(array('conferencePath', 'importPath', 'options'));
00053    }
00054 
00059    function execute() {
00060       $options = $this->getData('options');
00061       $conferenceId = $this->importer->import($this->getData('conferencePath'), $this->getData('importPath'), is_array($options) ? $options : array());
00062       return $conferenceId;
00063    }
00064 
00065    function getConflicts() {
00066       return $this->importer->getConflicts();
00067    }
00068 
00069    function getErrors() {
00070       return $this->importer->getErrors();
00071    }
00072 }
00073 
00074 ?>

Generated on 25 Jul 2013 for Open Conference Systems by  doxygen 1.4.7