Example #1
0
 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);
 }