Example #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 FSSUpdater();
     global $log;
     $log = $updater->Process($source);
     // think this has to be done last
     InstallExtras($source);
     FSS_Done();
 }
Example #2
0
 function display($tpl = null)
 {
     JToolBarHelper::title(JText::_("ADMINISTRATION"), 'fss_admin');
     JToolBarHelper::cancel('cancellist');
     FSSAdminHelper::DoSubToolbar();
     $this->log = "";
     $task = JRequest::getVar('task');
     $updater = new FSSUpdater();
     if ($task == "saveapi") {
         return $this->SaveAPI();
     }
     if ($task == "cancellist") {
         $mainframe = JFactory::getApplication();
         $link = FSSRoute::_('index.php?option=com_fss&view=fsss', false);
         $mainframe->redirect($link);
         return;
     }
     if ($task == "update") {
         $this->log = $updater->Process();
         parent::display();
         return;
     }
     if ($task == "backup") {
         $this->log = $updater->BackupData('fss');
     }
     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->log = $log;
             parent::display();
             return;
         }
     }
     parent::display($tpl);
 }