Exemplo n.º 1
0
 /**
  * method to run after an install/update/uninstall method
  *
  * @return void
  */
 function postflight($type, $parent)
 {
     $source = $parent->getParent()->getPath('source');
     require_once $source . DS . 'admin' . DS . 'updatedb.php';
     $updater = new FSTUpdater();
     global $log;
     $log = $updater->Process($source);
     // think this has to be done last
     InstallExtras($source);
     FST_Done();
 }
Exemplo n.º 2
0
 function display($tpl = null)
 {
     JToolBarHelper::title(JText::_("ADMINISTRATION"), 'fst_admin');
     JToolBarHelper::cancel('cancellist');
     FSTAdminHelper::DoSubToolbar();
     $this->log = "";
     $task = JRequest::getVar('task');
     $updater = new FSTUpdater();
     if ($task == "saveapi") {
         return $this->SaveAPI();
     }
     if ($task == "cancellist") {
         $mainframe = JFactory::getApplication();
         $link = FSTRoute::x('index.php?option=com_fst&view=fsts', false);
         $mainframe->redirect($link);
         return;
     }
     if ($task == "update") {
         $this->assignRef('log', $updater->Process());
         parent::display();
         return;
     }
     if ($task == "backup") {
         $this->assignRef('log', $updater->BackupData('fst'));
     }
     if ($task == "restore") {
         // process any new file uploaded
         $file = JRequest::getVar('filedata', '', 'FILES', 'array');
         if (array_key_exists('error', $file) && $file['error'] == 0) {
             $data = file_get_contents($file['tmp_name']);
             $data = unserialize($data);
             global $log;
             $log = "";
             $log = $updater->RestoreData($data);
             $this->assignRef('log', $log);
             parent::display();
             return;
         }
     }
     parent::display($tpl);
 }