| Server IP : 54.36.91.62 / Your IP : 216.73.217.112 Web Server : Apache System : Linux webm013.cluster127.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64 User : coopiak ( 151928) PHP Version : 8.3.23 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/coopiak/amisdesseniors-fr/administrator/components/com_rsform/controllers/ |
Upload File : |
<?php
/**
* @package RSForm! Pro
* @copyright (C) 2007-2019 www.rsjoomla.com
* @license GPL, http://www.gnu.org/copyleft/gpl.html
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Filter\OutputFilter;
use Joomla\CMS\Table\Table;
class RsformControllerWizard extends RsformController
{
public function add()
{
$app = Factory::getApplication();
$app->input->set('view', 'wizard');
$app->input->set('layout', 'default');
parent::display();
}
public function stepFinal()
{
$app = Factory::getApplication();
$rsformConfig = RSFormProConfig::getInstance();
$data = $app->input->post->get('jform', array(), 'array');
$row = Table::getInstance('RSForm_Forms', 'Table');
$predefinedForm = !empty($data['PredefinedForm']) ? $data['PredefinedForm'] : false;
// Default Language
$data['Lang'] = Factory::getLanguage()->getDefault();
// Set a title if missing
if (!isset($data['FormTitle']) || !strlen($data['FormTitle']))
{
$data['FormTitle'] = Text::_('RSFP_FORM_DEFAULT_TITLE');
}
$data['FormName'] = OutputFilter::stringURLSafe($data['FormTitle']);
// Layout
if (empty($data['FormLayoutName']))
{
$data['FormLayoutName'] = $rsformConfig->get('global.default_layout', 'responsive');
}
$data['LoadFormLayoutFramework'] = $rsformConfig->get('global.default_load_layout_framework', 1);
// Admin Email
if (!empty($data['AdminEmail']))
{
$data['AdminEmailFrom'] = $app->get('mailfrom');
$data['AdminEmailFromName'] = $app->get('fromname');
$data['AdminEmailSubject'] = Text::sprintf('RSFP_ADMIN_EMAIL_DEFAULT_SUBJECT', $data['FormTitle']);
$data['AdminEmailText'] = Text::_('RSFP_ADMIN_EMAIL_DEFAULT_MESSAGE');
}
// User Email
if (!empty($data['UserEmail']))
{
$data['UserEmailFrom'] = $app->get('mailfrom');
$data['UserEmailFromName'] = $app->get('fromname');
$data['UserEmailSubject'] = Text::_('RSFP_USER_EMAIL_DEFAULT_SUBJECT');
$data['UserEmailText'] = Text::_('RSFP_USER_EMAIL_DEFAULT_MESSAGE');
}
// Save so we can have a form ID
try
{
if (!$row->save($data))
{
throw new Exception($row->getError());
}
if ($predefinedForm)
{
$model = $this->getModel('Wizard', 'RsformModel');
$model->addFields($row, $predefinedForm, $data);
// Store it again, some data has changed
if (!$row->store())
{
throw new Exception($row->getError());
}
}
$app->triggerEvent('onRsformFormNew', array('formId' => $row->FormId));
$this->setRedirect('index.php?option=com_rsform&view=forms&layout=edit&formId=' . $row->FormId);
}
catch (Exception $e)
{
$this->setRedirect('index.php?option=com_rsform&view=forms', $e->getMessage(), 'error');
}
}
}