This repository was archived by the owner on Aug 15, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmod_jform.php
More file actions
49 lines (42 loc) · 1.4 KB
/
mod_jform.php
File metadata and controls
49 lines (42 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
/**
* @package JForm Module
* @version 1.0.0
* @author Igor Berdicheskiy - septdir.ru
* @copyright Copyright (c) 2013 - 2018 Igor Berdicheskiy. All rights reserved.
* @license GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
* @link https://septdir.ru
*/
defined('_JEXEC') or die;
use Joomla\CMS\Helper\ModuleHelper;
use Joomla\CMS\Factory;
use Joomla\CMS\Uri\Uri;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Language\Text;
// Include Module Helper
require_once __DIR__ . '/helper.php';
$helper = new modJFormHelper($module);
// Get form
$form = $helper->getForm();
if ($form)
{
$ajax = $params->get('ajax');
$default_action = Uri::root(true) . '/index.php?option=com_ajax&module=' . $module->name;
$action = $params->get('action', $default_action);
// Set default action params
if ($action == $default_action)
{
$action .= '&module_id=' . $module->id;
$action .= '&Itemid=' . Factory::getApplication()->input->get('Itemid');
$action .= ($ajax) ? '&ajax=1' : '';
$action .= ($ajax) ? '&format=json' : '&format=raw';
}
// Get Return field value
$return = ($params->get('return', 0)) ? Route::_($params->get('return')) : Uri::getInstance()->toString();
$return = (!$ajax) ? base64_encode($return) : false;
require ModuleHelper::getLayoutPath($module->module, $params->get('layout', 'default'));
}
else
{
echo Text::_('MOD_JFORM_ERROR_FORM_NOT_FOUND');
}