first commit
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Convert Forms
|
||||
* @version 3.2.12 Free
|
||||
*
|
||||
* @author Tassos Marinos <info@tassos.gr>
|
||||
* @link http://www.tassos.gr
|
||||
* @copyright Copyright © 2020 Tassos Marinos All Rights Reserved
|
||||
* @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html> or later
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
|
||||
HTMLHelper::_('behavior.formvalidator');
|
||||
HTMLHelper::_('behavior.keepalive');
|
||||
|
||||
if (!defined('nrJ4'))
|
||||
{
|
||||
JHtml::_('formbehavior.chosen', 'select');
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
Joomla.submitbutton = function(task)
|
||||
{
|
||||
if (task == 'conversion.cancel' || document.formvalidator.isValid(document.getElementById('adminForm')))
|
||||
{
|
||||
Joomla.submitform(task, document.getElementById('adminForm'));
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="form-horizontal">
|
||||
<form action="<?php echo JRoute::_('index.php?option=com_convertforms&view=conversion&layout=edit&id='.(int) $this->item->id); ?>" method="post" name="adminForm" id="adminForm">
|
||||
<div class="<?php echo defined('nrJ4') ? 'row' : 'row-fluid' ?>">
|
||||
<span class="span6 col-md-7">
|
||||
<h3><?php echo JText::_('COM_CONVERTFORMS_LEAD_USER_SUBMITTED_DATA') ?></h3>
|
||||
<?php echo $this->form->renderFieldset('params') ?>
|
||||
</span>
|
||||
<span class="span6 col-md-5">
|
||||
<h3><?php echo JText::_('COM_CONVERTFORMS_LEAD_INFO') ?></h3>
|
||||
<?php echo $this->form->renderFieldset('main') ?>
|
||||
</span>
|
||||
</div>
|
||||
<?php echo JHtml::_('form.token'); ?>
|
||||
<input type="hidden" name="task" value="conversion.edit" />
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package Convert Forms
|
||||
* @version 3.2.12 Free
|
||||
*
|
||||
* @author Tassos Marinos <info@tassos.gr>
|
||||
* @link http://www.tassos.gr
|
||||
* @copyright Copyright © 2020 Tassos Marinos All Rights Reserved
|
||||
* @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html> or later
|
||||
*/
|
||||
|
||||
defined('_JEXEC') or die('Restricted access');
|
||||
|
||||
// import Joomla view library
|
||||
jimport('joomla.application.component.view');
|
||||
|
||||
/**
|
||||
* Conversion View Class
|
||||
*/
|
||||
class ConvertFormsViewConversion extends JViewLegacy
|
||||
{
|
||||
/**
|
||||
* display method of Item view
|
||||
* @return void
|
||||
*/
|
||||
public function display($tpl = null)
|
||||
{
|
||||
// Access check.
|
||||
ConvertForms\Helper::authorise('convertforms.submissions.manage', true);
|
||||
|
||||
// get the Data
|
||||
$form = $this->get('Form');
|
||||
$item = $this->get('Item');
|
||||
|
||||
// Check for errors.
|
||||
if (!is_null($this->get('Errors')) && count($errors = $this->get('Errors')))
|
||||
{
|
||||
JFactory::getApplication()->enqueueMessage(implode("\n", $errors), 'error');
|
||||
return false;
|
||||
}
|
||||
|
||||
// Assign the Data
|
||||
$this->form = $form;
|
||||
$this->item = $item;
|
||||
$this->isnew = (!isset($_REQUEST["id"])) ? true : false;
|
||||
|
||||
// Set the toolbar
|
||||
$this->addToolBar();
|
||||
|
||||
// Display the template
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setting the toolbar
|
||||
*/
|
||||
protected function addToolBar()
|
||||
{
|
||||
$input = JFactory::getApplication()->input;
|
||||
$input->set('hidemainmenu', true);
|
||||
$isNew = ($this->item->id == 0);
|
||||
|
||||
JToolBarHelper::title($isNew ? JText::_('COM_CONVERTFORMS_NEW_CONVERSION') : JText::_('COM_CONVERTFORMS_EDIT_CONVERSION'));
|
||||
JToolbarHelper::apply('conversion.apply');
|
||||
JToolBarHelper::save('conversion.save');
|
||||
JToolBarHelper::cancel('conversion.cancel', $isNew ? 'JTOOLBAR_CANCEL' : 'JTOOLBAR_CLOSE');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user