Example #1
0
 /**
  * Method to save the configuration.
  *
  * @return  void
  */
 public function displayTask()
 {
     // Get the document object.
     $document = App::get('document');
     $model = new Models\Application();
     // Access check.
     if (!User::authorise('core.admin', $model->getState('component.option'))) {
         App::abort(404, Lang::txt('JERROR_ALERTNOAUTHOR'));
     }
     $form = $model->getForm();
     $data = $model->getData();
     // Check for model errors.
     if ($errors = $model->getErrors()) {
         App::abort(500, implode('<br />', $errors));
     }
     // Bind the form to the data.
     if ($form && $data) {
         $form->bind($data);
     }
     // Get the params for com_users.
     $usersParams = Component::params('com_users');
     // Get the params for com_media.
     $mediaParams = Component::params('com_media');
     // Load settings for the FTP layer.
     $ftp = \JClientHelper::setCredentialsFromRequest('ftp');
     $this->view->set('model', $model)->set('form', $form)->set('data', $data)->set('ftp', $ftp)->set('usersParams', $usersParams)->set('mediaParams', $mediaParams)->set('document', $document)->setLayout('default')->display();
 }