/** * 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 FSFUpdater(); global $log; $log = $updater->Process($source); // think this has to be done last InstallExtras($source); FSF_Done(); }
function display($tpl = null) { JToolBarHelper::title(JText::_("ADMINISTRATION"), 'fsf_admin'); JToolBarHelper::cancel('cancellist'); FSFAdminHelper::DoSubToolbar(); $this->log = ""; $task = JRequest::getVar('task'); $updater = new FSFUpdater(); if ($task == "saveapi") { return $this->SaveAPI(); } if ($task == "cancellist") { $mainframe = JFactory::getApplication(); $link = FSFRoute::x('index.php?option=com_fsf&view=fsfs', false); $mainframe->redirect($link); return; } if ($task == "update") { $this->assignRef('log', $updater->Process()); parent::display(); return; } if ($task == "backup") { $this->assignRef('log', $updater->BackupData('fsf')); } 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); }