Server : LiteSpeed System : Linux server 3.10.0-1160.90.1.el7.x86_64 #1 SMP Thu May 4 15:21:22 UTC 2023 x86_64 User : alsaif ( 1057) PHP Version : 7.4.33 Disable Function : show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname Directory : /home/alsaif/public_html/administrator/components/com_convertforms/controllers/ |
<?php
/**
* @package Convert Forms
* @version 4.3.3 Pro
*
* @author Tassos Marinos <info@tassos.gr>
* @link https://www.tassos.gr
* @copyright Copyright © 2023 Tassos All Rights Reserved
* @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html> or later
*/
defined('_JEXEC') or die('Restricted access');
// import Joomla controlleradmin library
jimport('joomla.application.component.controlleradmin');
class ConvertformsControllerForms extends JControllerAdmin
{
protected $text_prefix = 'COM_CONVERTFORMS_FORM';
/**
* Proxy for getModel.
* @since 2.5
*/
public function getModel($name = 'form', $prefix = 'ConvertFormsModel', $config = array('ignore_request' => true))
{
return parent::getModel($name, $prefix, $config);
}
/**
* Import Method
* Set layout to import
*/
public function import()
{
$app = JFactory::getApplication();
$file = $app->input->files->get("file");
if (!empty($file))
{
if (isset($file['name']))
{
// Get the model.
$model = $this->getModel('Forms');
$model_item = $this->getModel('Form');
$model->import($model_item);
}
else
{
$app->enqueueMessage(JText::_('NR_PLEASE_CHOOSE_A_VALID_FILE'), 'error');
$app->redirect('index.php?option=com_convertforms&view=forms&layout=import');
}
}
else
{
$app->redirect('index.php?option=com_convertforms&view=forms&layout=import');
}
}
/**
* Export Method
* Export the selected items specified by id
*/
public function export()
{
$ids = JFactory::getApplication()->input->get('cid', array(), 'array');
// Get the model.
$model = $this->getModel('Forms');
$model->export($ids);
}
/**
* Copy Method
* Copy all items specified by array cid
* and set Redirection to the list of items
*/
public function duplicate()
{
$ids = JFactory::getApplication()->input->get('cid', array(), 'array');
// Get the model.
$model = $this->getModel('Form');
foreach ($ids as $id)
{
$model->copy($id);
}
JFactory::getApplication(JText::sprintf('COM_CONVERTFORMS_FORM_N_ITEMS_COPIED', count($ids)));
JFactory::getApplication()->redirect('index.php?option=com_convertforms&view=forms');
}
}