classes/rt/ocs/ConferenceRTAdmin.inc.php

Go to the documentation of this file.
00001 <?php
00002 
00015 //$Id$
00016 
00017 import('rt.RTAdmin');
00018 import('rt.ocs.RTDAO');
00019 
00020 define('RT_DIRECTORY', 'rt');
00021 define('DEFAULT_RT_LOCALE', 'en_US');
00022 
00023 class ConferenceRTAdmin extends RTAdmin {
00024 
00026    var $conferenceId;
00027 
00029    var $dao;
00030 
00031 
00032    function ConferenceRTAdmin($conferenceId) {
00033       $this->conferenceId = $conferenceId;
00034       $this->dao =& DAORegistry::getDAO('RTDAO');
00035    }
00036 
00037    function restoreVersions($deleteBeforeLoad = true) {
00038       import('rt.RTXMLParser');
00039       $parser = new RTXMLParser();
00040 
00041       if ($deleteBeforeLoad) $this->dao->deleteVersionsByConferenceId($this->conferenceId);
00042 
00043       $localeFilesLocation = RT_DIRECTORY . DIRECTORY_SEPARATOR . AppLocale::getLocale();
00044       if (!file_exists($localeFilesLocation)) {
00045          // If no reading tools exist for the given locale, use the default set
00046          $localeFilesLocation = RT_DIRECTORY . DIRECTORY_SEPARATOR . DEFAULT_RT_LOCALE;
00047          $overrideLocale = true;
00048       } else {
00049          $overrideLocale = false;
00050       }
00051 
00052       $versions = $parser->parseAll($localeFilesLocation);
00053       foreach ($versions as $version) {
00054          if ($overrideLocale) {
00055             $version->setLocale(AppLocale::getLocale());
00056          }
00057          $this->dao->insertVersion($this->conferenceId, $version);
00058       }
00059    }
00060 
00061    function importVersion($filename) {
00062       import ('rt.RTXMLParser');
00063       $parser = new RTXMLParser();
00064 
00065       $version =& $parser->parse($filename);
00066       $this->dao->insertVersion($this->conferenceId, $version);
00067    }
00068 }
00069 
00070 ?>

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