first commit

This commit is contained in:
2026-02-08 21:16:11 +01:00
commit e17b7026fd
8881 changed files with 1160453 additions and 0 deletions

View File

@@ -0,0 +1,247 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_j2xml
*
* @version 3.9.229-rc1
*
* @author Helios Ciancio <info (at) eshiol (dot) it>
* @link https://www.eshiol.it
* @copyright Copyright (C) 2010 - 2023 Helios Ciancio. All Rights Reserved
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU/GPL v3
* J2XML is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License
* or other free or open source software licenses.
*/
// no direct access
defined('_JEXEC') or die();
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\CMS\Session\Session;
$version = new JVersion();
$ui = $version->isCompatible('4') ? 'uitab' : 'bootstrap';
// MooTools is loaded for B/C for extensions generating JavaScript in their install scripts, this call will be removed at 4.0
JHtml::_('jquery.framework', true);
JHtml::_('bootstrap.tooltip');
if (!$version->isCompatible('4'))
{
JHtml::_('behavior.framework');
}
JFactory::getDocument()->addScriptDeclaration('
Joomla.submitbutton4 = function() {
var form = document.getElementById("adminForm");
// do field validation
if (form.install_url.value == "" || form.install_url.value == "http://" || form.install_url.value == "https://") {
alert("' . JText::_('COM_J2XML_MSG_INSTALL_ENTER_A_URL', true) . '");
}
else
{
JoomlaInstaller.showLoading();
form.installtype.value = "url";
form.submit();
}
};
// Add spindle-wheel for installations:
jQuery(document).ready(function($) {
var outerDiv = $("#j2xml-import");
JoomlaInstaller.getLoadingOverlay()
.css("top", outerDiv.position().top - $(window).scrollTop())
.css("left", "0")
.css("width", "100%")
.css("height", "100%")
.css("display", "none")
.css("margin-top", "-10px");
});
var JoomlaInstaller = {
getLoadingOverlay: function () {
return jQuery("#loading");
},
showLoading: function () {
this.getLoadingOverlay().css("display", "block");
},
hideLoading: function () {
this.getLoadingOverlay().css("display", "none");
}
};');
JFactory::getDocument()->addStyleDeclaration('
#loading {
background: rgba(255, 255, 255, .8) url(\'' . JHtml::_('image', 'jui/ajax-loader.gif', '', null, true, true) . '\') 50% 15% no-repeat;
position: fixed;
opacity: 0.8;
-ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity = 80);
filter: alpha(opacity = 80);
overflow: hidden;
}');
?>
<?php JFactory::getApplication()->getLanguage()->load('com_j2xml.sys'); ?>
<div id="j2xml-import" class="clearfix">
<form enctype="multipart/form-data" action="<?php echo JRoute::_('index.php?option=com_j2xml'); ?>"
method="post" name="adminForm" id="adminForm" class="form-horizontal">
<?php if (!empty($this->sidebar)) : ?>
<div id="j-sidebar-container" class="span2">
<?php echo $this->sidebar; ?>
</div>
<div id="j-main-container" class="span10">
<?php else : ?>
<div id="j-main-container">
<?php endif; ?>
<!-- Render messages set by extension install scripts here -->
<?php if ($this->showMessage) : ?>
<?php echo $this->loadTemplate('message'); ?>
<?php endif; ?>
<?php echo JHtml::_($ui . '.startTabSet', 'myTab', array('active' => 'package')); ?>
<?php // Show installation tabs at the start ?>
<?php // $firstTab = JFactory::getApplication()->triggerEvent('onInstallerViewBeforeFirstTab', array()); ?>
<?php // Show installation tabs ?>
<?php // $tabs = JFactory::getApplication()->triggerEvent('onInstallerAddInstallationTab', array()); ?>
<?php
$tabs = array();
$tab = array();
$tab['name'] = 'package';
$tab['label'] = JText::_('COM_J2XML_PACKAGEIMPORTER_UPLOAD_DATA_FILE');
// Render the input
ob_start();
include __DIR__ . '/default_package.php';
$tab['content'] = ob_get_clean();
$tabs[] = $tab;
?>
<?php foreach ($tabs as $tab) : ?>
<?php echo JHtml::_($ui . '.addTab', 'myTab', $tab['name'], $tab['label']); ?>
<fieldset class="uploadform">
<?php echo $tab['content']; ?>
</fieldset>
<?php echo JHtml::_($ui . '.endTab'); ?>
<?php endforeach; ?>
<?php // Show installation tabs at the end ?>
<?php // $lastTab = JFactory::getApplication()->triggerEvent('onInstallerViewAfterLastTab', array()); ?>
<?php // $tabs = array_merge($firstTab, $tabs, $lastTab); ?>
<?php if (!$tabs) : ?>
<?php JFactory::getApplication()->enqueueMessage(JText::_('COM_J2XML_NO_INSTALLATION_PLUGINS_FOUND'), 'warning'); ?>
<?php endif; ?>
<?php if ($this->ftp) : ?>
<?php echo JHtml::_($ui . '.addTab', 'myTab', 'ftp', JText::_('COM_J2XML_MSG_DESCFTPTITLE')); ?>
<?php echo $this->loadTemplate('ftp'); ?>
<?php echo JHtml::_($ui . '.endTab'); ?>
<?php endif; ?>
<input type="hidden" name="installtype" value=""/>
<input type="hidden" name="task" value="import.import"/>
<?php echo JHtml::_('form.token'); ?>
<?php echo JHtml::_($ui . '.endTabSet'); ?>
</div>
<button class="hidden" id="j2xmlImportCloseBtn" type="button" onclick="this.form.install_package.val('');"></button>
<button class="hidden" id="j2xmlImportBtn" type="button" onclick="console.log('install_package');this.form.install_package.val('');"></button>
</form>
</div>
<div id="loading"></div>
<?php
JText::script('LIB_J2XML_MSG_FILE_FORMAT_NOT_SUPPORTED');
$doc = Factory::getDocument();
$cparams = JComponentHelper::getParams('com_j2xml');
$min = $cparams->get('debug', 0) ? '' : '.min';
JLog::add(new JLogEntry("loading ../media/lib_eshiol_j2xml/js/pako_inflate{$min}.js", JLog::DEBUG, 'com_j2xml'));
$doc->addScript("../media/lib_eshiol_j2xml/js/pako_inflate{$min}.js", array('version'=>'auto'));
JLog::add(new JLogEntry("loading ../media/lib_eshiol_j2xml/js/version_compare{$min}.js", JLog::DEBUG, 'com_j2xml'));
$doc->addScript("../media/lib_eshiol_j2xml/js/version_compare{$min}.js", array('version'=>'auto'));
JLog::add(new JLogEntry("loading ../media/lib_eshiol_j2xml/js/j2xml{$min}.js", JLog::DEBUG, 'com_j2xml'));
$doc->addScript("../media/lib_eshiol_j2xml/js/j2xml{$min}.js", array('version'=>'auto'));
JLog::add(new JLogEntry("loading ../media/lib_eshiol_j2xml/js/j2xml{$min}.js", JLog::DEBUG, 'com_j2xml'));
$doc->addScript("../media/lib_eshiol_j2xml/js/base64{$min}.js", array('version'=>'auto'));
JLog::add(new JLogEntry("loading ../media/com_j2xml/js/j2xml{$min}.js", JLog::DEBUG, 'com_j2xml'));
$doc->addScript("../media/com_j2xml/js/j2xml{$min}.js", array('version'=>'auto'));
// Trigger the onLoadJS event.
PluginHelper::importPlugin('j2xml');
Factory::getApplication()->triggerEvent('onLoadJS');
// Load the import options form
$selector = 'j2xmlImport';
if ($version->isCompatible('4'))
{
echo HTMLHelper::_('bootstrap.renderModal', $selector . 'Modal',
array(
'title' => Text::_('COM_J2XML_IMPORT'),
'url' => JRoute::_('index.php?'. http_build_query([
'option' => 'com_j2xml',
'view' => 'import',
'layout' => 'options',
'tmpl' => 'component',
Session::getFormToken() => 1
])),
'height' => '420px',
'width' => '300px',
'modalWidth' => '50',
'footer' =>
'<button type="button" class="btn btn-secondary" data-bs-dismiss="modal" aria-hidden="true">'
. Text::_('JTOOLBAR_CANCEL') . '</button>'
. '<button type="button" class="btn btn-success" data-bs-dismiss="modal" aria-hidden="true"'
. ' onclick="eshiol.j2xml.importerModal();">'
. Text::_("COM_J2XML_IMPORT") . '</button>'
)
);
}
elseif ($version->isCompatible('3.4'))
{
echo JHtml::_('bootstrap.renderModal', $selector . 'Modal',
array(
'title' => JText::_('COM_J2XML_IMPORT'),
'url' => JRoute::_('index.php?option=com_j2xml&amp;view=import&amp;layout=options&amp;tmpl=component'),
'height' => '370px',
'width' => '300px',
'modalWidth' => '50',
'modalHeight' => '50',
'footer' => '<a class="btn" data-dismiss="modal" type="button"'
. ' onclick="jQuery(\'#' . $selector .'Modal iframe\').contents().find(\'#' . $selector . 'CancelBtn\').click();">' . JText::_("JTOOLBAR_CANCEL") . '</a>'
. '<button class="btn btn-success" type="button"'
. ' onclick="eshiol.j2xml.importerModal();jQuery(\'#' . $selector . 'Modal iframe\').contents().find(\'#' . $selector . 'OkBtn\').click();">'
. JText::_("COM_J2XML_IMPORT") . '</button>'));
}
else
{
echo JHtml::_('bootstrap.renderModal', $selector . 'Modal',
array(
'title' => JText::_('COM_J2XML_IMPORT'),
'url' => JRoute::_('index.php?option=com_j2xml&amp;view=import&amp;layout=options&amp;tmpl=component'),
'height' => '370px',
'width' => '300px',
'modalWidth' => '40'),
addslashes('<div class="container-fluid"><div class="row-fluid"><div class="span12"><div class="btn-toolbar">'
. '<a class="btn btn-wrapper pull-right" data-dismiss="modal" type="button"'
. ' onclick="jQuery(\'#' . $selector .'Modal iframe\').contents().find(\'#' . $selector . 'CancelBtn\').click();">' . JText::_("JTOOLBAR_CANCEL") . '</a>'
. '<button class="btn btn-success btn-wrapper pull-right" type="button"'
. ' onclick="eshiol.j2xml.importerModal();jQuery(\'#' . $selector . 'Modal iframe\').contents().find(\'#' . $selector . 'OkBtn\').click();">'
. JText::_("COM_J2XML_IMPORT") . '</button>'
. '</div></div></div></div>'));
}

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/**
* @package Joomla.Administrator
* @subpackage com_j2xml
*
* @version 3.9.229-rc1
*
* @author Helios Ciancio <info (at) eshiol (dot) it>
* @link https://www.eshiol.it
* @copyright Copyright (C) 2010 - 2023 Helios Ciancio. All Rights Reserved
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU/GPL v3
* J2XML is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License
* or other free or open source software licenses.
*/
-->
<metadata>
<layout title="COM_J2XML_INSTALL_VIEW_DEFAULT_TITLE">
<message>
<![CDATA[COM_J2XML_INSTALL_VIEW_DEFAULT_DESC]]>
</message>
</layout>
</metadata>

View File

@@ -0,0 +1,452 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_j2xml
*
* @version 3.9.229-rc1
*
* @author Helios Ciancio <info (at) eshiol (dot) it>
* @link https://www.eshiol.it
* @copyright Copyright (C) 2010 - 2023 Helios Ciancio. All Rights Reserved
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU/GPL v3
* J2XML is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License
* or other free or open source software licenses.
*/
// no direct access
defined('_JEXEC') or die();
use Joomla\CMS\Component\ComponentHelper;
JHtml::_('bootstrap.tooltip');
$version = new JVersion();
if ($version->isCompatible('3.8'))
{
JHtml::_('jquery.token');
}
JText::script('COM_J2XML_IMPORTING');
JText::script('COM_J2XML_PACKAGEIMPORTER_UPLOAD_ERROR_UNKNOWN');
JText::script('COM_J2XML_PACKAGEIMPORTER_UPLOAD_ERROR_EMPTY');
JText::script('LIB_J2XML_MSG_FILE_FORMAT_UNKNOWN');
JText::script('LIB_J2XML_MSG_FILE_FORMAT_NOT_SUPPORTED');
JFactory::getDocument()->addScriptDeclaration('
Joomla.submitbuttonpackage = function()
{
var form = document.getElementById("adminForm");
// do field validation
if (form.install_package.value == "")
{
alert("' . JText::_('COM_J2XML_PACKAGEIMPORTER_NO_PACKAGE', true) . '");
}
else
{
JoomlaInstaller.showLoading();
form.installtype.value = "upload"
form.submit();
}
};
');
// Drag and Drop installation scripts
$token = JSession::getFormToken();
$return = JFactory::getApplication()->input->getBase64('return');
$document = JFactory::getDocument();
$params = ComponentHelper::getParams('com_j2xml');
$document->addScriptOptions('J2XML', array('HaltOnError' => (bool) $params->get('haltonerror', 1)));
// Drag-drop installation
$document->addScriptDeclaration(
<<<JS
jQuery(document).ready(function($) {
if (typeof FormData === 'undefined') {
$('#legacy-uploader').show();
$('#uploader-wrapper').hide();
return;
}
var uploading = false;
var dragZone = $('#dragarea');
var fileInput = $('#install_package');
var button = $('#select-file-button');
var url = 'index.php?option=com_installer&task=install.ajax_upload';
var returnUrl = $('#installer-return').val();
var actions = $('.upload-actions');
var progress = $('.upload-progress');
var progressBar = progress.find('.bar');
var percentage = progress.find('.uploading-number');
if (returnUrl) {
url += '&return=' + returnUrl;
}
button.on('click', function(e) {
fileInput.click();
});
fileInput.on('change', function (e) {
e.preventDefault();
e.stopPropagation();
if (uploading) {
return;
}
var files = e.originalEvent.target.files || e.originalEvent.dataTransfer.files;
if (!files.length) {
return;
}
var file = files[0];
var reader = new FileReader();
reader.onload = function(event) {
console.log('reader.onload');
try {
var data = pako.ungzip(this.result, {"to": "string"});
console.log('gzip');
} catch (err) {
console.log('xml');
var data = this.result;
}
tmp = strstr(data, '<?xml version="1.0" ');
data = (tmp !== false ? tmp : data);
console.log(data);
eshiol.j2xml.convert.forEach(function(fn) {
data = fn(data);
});
var xmlDoc;
var nodes = Array();
try {
xmlDoc = $.parseXML(data);
xml = $(xmlDoc);
root = xml.find(":root")[0];
if (root.nodeName != "j2xml") {
console.log(Joomla.JText._('LIB_J2XML_MSG_FILE_FORMAT_UNKNOWN'));
Joomla.renderMessages({'error': [Joomla.JText._('LIB_J2XML_MSG_FILE_FORMAT_UNKNOWN')]});
} else {
validated = false;
eshiol.j2xml.validate.forEach(function(fn) {
validated = validated || fn(data);
});
if (validated) {
console.log('j2xml file version ' + $(root).attr('version'));
$('#j2xml_filename').val(file.name);
$('#j2xml_data').val(btoa(unescape(encodeURIComponent(data))));
var j2xmlOptions = Joomla.getOptions('J2XML'),
JoomlaVersion = j2xmlOptions && j2xmlOptions.Joomla ? j2xmlOptions.Joomla : '3';
if (JoomlaVersion == '4') {
var el = document.getElementById('j2xmlImportModal')
var modal = bootstrap.Modal.getInstance(el) // Returns a Bootstrap modal instance
modal.show();
} else {
$('#j2xmlImportModal').modal();
}
fileInput.val('');
return false;
} else {
console.log('j2xml file version ' + $(root).attr('version') + ' not supported');
Joomla.renderMessages({'error': [Joomla.JText._('LIB_J2XML_MSG_FILE_FORMAT_NOT_SUPPORTED').replace('%s', $(root).attr('version'))]});
return false;
}
}
} catch(e) {
console.log(e);
Joomla.renderMessages({'error': [e.message.split('\\n').join('<br />')]});
return false;
}
};
reader.readAsText(file, 'UTF-8');
});
dragZone.on('dragenter', function(e) {
e.preventDefault();
e.stopPropagation();
dragZone.addClass('hover');
return false;
});
// Notify user when file is over the drop area
dragZone.on('dragover', function(e) {
e.preventDefault();
e.stopPropagation();
dragZone.addClass('hover');
return false;
});
dragZone.on('dragleave', function(e) {
e.preventDefault();
e.stopPropagation();
dragZone.removeClass('hover');
return false;
});
dragZone.on('drop', function(e) {
e.preventDefault();
e.stopPropagation();
dragZone.removeClass('hover');
if (uploading) {
return;
}
var files = e.originalEvent.target.files || e.originalEvent.dataTransfer.files;
if (!files.length) {
return;
}
var file = files[0];
var reader = new FileReader();
reader.onload = function(event) {
console.log('reader.onload');
try {
var data = pako.ungzip(this.result, {"to": "string"});
console.log('gzip');
} catch (err) {
console.log('xml');
var data = this.result;
}
tmp = strstr(data, '<?xml version="1.0" ');
data = (tmp !== false ? tmp : data);
console.log(data);
eshiol.j2xml.convert.forEach(function(fn) {
data = fn(data);
});
var xmlDoc;
var nodes = Array();
try {
xmlDoc = $.parseXML(data);
xml = $(xmlDoc);
root = xml.find(":root")[0];
if (root.nodeName != "j2xml") {
console.log(Joomla.JText._('LIB_J2XML_MSG_FILE_FORMAT_UNKNOWN'));
Joomla.renderMessages({'error': [Joomla.JText._('LIB_J2XML_MSG_FILE_FORMAT_UNKNOWN')]});
} else {
validated = false;
eshiol.j2xml.validate.forEach(function(fn) {
validated = validated || fn(data);
});
if (validated) {
console.log('j2xml file version ' + $(root).attr('version'));
$('#j2xml_filename').val(file.name);
$('#j2xml_data').val(btoa(unescape(encodeURIComponent(data))));
var j2xmlOptions = Joomla.getOptions('J2XML'),
JoomlaVersion = j2xmlOptions && j2xmlOptions.Joomla ? j2xmlOptions.Joomla : '3';
if (JoomlaVersion == '4') {
var el = document.getElementById('j2xmlImportModal')
var modal = bootstrap.Modal.getInstance(el) // Returns a Bootstrap modal instance
modal.show();
} else {
$('#j2xmlImportModal').modal();
}
fileInput.val('');
return false;
} else {
console.log(Joomla.JText._('LIB_J2XML_MSG_FILE_FORMAT_NOT_SUPPORTED').replace('%s', $(root).attr('version')));
Joomla.renderMessages({'error': [Joomla.JText._('LIB_J2XML_MSG_FILE_FORMAT_NOT_SUPPORTED').replace('%s', $(root).attr('version'))]});
return false;
}
}
} catch(e) {
console.log(e);
Joomla.renderMessages({'error': [Joomla.JText._('LIB_J2XML_MSG_FILE_FORMAT_UNKNOWN')]});
return false;
}
};
reader.readAsText(file, 'UTF-8');
});
});
JS
);
$document->addStyleDeclaration(
<<<CSS
#dragarea {
background-color: #fafbfc;
border: 1px dashed #999;
box-sizing: border-box;
padding: 5% 0;
transition: all 0.2s ease 0s;
width: 100%;
}
#dragarea p.lead {
color: #999;
}
#upload-icon {
font-size: 48px;
width: auto;
height: auto;
margin: 0;
line-height: 175%;
color: #999;
transition: all .2s;
}
#dragarea.hover {
border-color: #666;
background-color: #eee;
}
#dragarea.hover #upload-icon,
#dragarea p.lead {
color: #666;
}
.upload-progress, .install-progress {
width: 50%;
margin: 5px auto;
}
/* Default transition (.3s) is too slow, progress will not run to 100% */
.upload-progress .progress .bar {
-webkit-transition: width .1s;
-moz-transition: width .1s;
-o-transition: width .1s;
transition: width .1s;
}
#dragarea[data-state=pending] .upload-progress {
display: none;
}
#dragarea[data-state=pending] .install-progress {
display: none;
}
#dragarea[data-state=uploading] .install-progress {
display: none;
}
#dragarea[data-state=uploading] .upload-actions {
display: none;
}
#dragarea[data-state=installing] .upload-progress {
display: none;
}
#dragarea[data-state=installing] .upload-actions {
display: none;
}
CSS
);
$version = new \JVersion();
if ($version->isCompatible('3.7'))
{
$maxSize = JFilesystemHelper::fileUploadMaxSize();
}
if ($version->isCompatible('4'))
{
$document->addScriptOptions('progressBarContainerClass', 'progress');
$document->addScriptOptions('progressBarClass', 'progress-bar progress-bar-striped progress-bar-animated bg');
$document->addScriptOptions('progressBarErrorClass', 'progress-bar progress-bar-striped progress-bar-animated bg-error');
}
?>
<legend><?php echo JText::_('COM_J2XML_PACKAGEIMPORTER_UPLOAD_IMPORT_DATA'); ?></legend>
<div id="uploader-wrapper">
<div id="dragarea" data-state="pending">
<div id="dragarea-content" class="text-center">
<p>
<span id="upload-icon" class="icon-upload" aria-hidden="true"></span>
</p>
<div class="upload-progress">
<div class="progress<?php echo $version->isCompatible('4') ? '' : ' progress-striped active'; ?>">
<div class="<?php echo $version->isCompatible('4') ? 'progress-bar progress-bar-striped progress-bar-animated bg-success' : 'bar bar-success'; ?>"
style="width:0"
role="progressbar"
aria-valuenow="0"
aria-valuemin="0"
aria-valuemax="100"
></div>
</div>
<p class="lead">
<span class="uploading-text">
<?php echo JText::_('COM_J2XML_PACKAGEIMPORTER_UPLOADING'); ?>
</span>
<span class="uploading-number">0</span><span class="uploading-symbol">%</span>
</p>
</div>
<div class="install-progress">
<div class="progress progress-striped active">
<div class="bar" style="width: 100%;"></div>
</div>
<p class="lead">
<span class="installing-text">
<?php echo JText::_('COM_J2XML_PACKAGEIMPORTER_IMPORTING'); ?>
</span>
</p>
</div>
<div class="upload-actions">
<p class="lead">
<?php echo JText::_('COM_J2XML_PACKAGEIMPORTER_DRAG_FILE_HERE'); ?>
</p>
<p>
<button id="select-file-button" type="button" class="btn btn-success">
<span class="icon-copy" aria-hidden="true"></span>
<?php echo JText::_('COM_J2XML_PACKAGEIMPORTER_SELECT_FILE'); ?>
</button>
</p>
<?php if ($version->isCompatible('3.7')) : ?>
<p>
<?php echo JText::sprintf('JGLOBAL_MAXIMUM_UPLOAD_SIZE_LIMIT', $maxSize); ?>
</p>
<?php endif; ?>
</div>
</div>
</div>
</div>
<div id="legacy-uploader" style="display: none;">
<div class="control-group">
<label for="install_package" class="control-label"><?php echo JText::_('COM_J2XML_PACKAGEIMPORTER_DATA_FILE'); ?></label>
<div class="controls">
<input class="input_box" id="install_package" name="install_package" type="file" size="57" /><br>
<?php echo JText::sprintf('JGLOBAL_MAXIMUM_UPLOAD_SIZE_LIMIT', $maxSize); ?>
</div>
</div>
<div class="form-actions">
<!-- <button class="btn btn-primary" type="button" id="installbutton_package" onclick="Joomla.submitbuttonpackage()"> -->
<button class="btn btn-primary" type="button" id="installbutton_package">
<?php echo JText::_('COM_J2XML_PACKAGEIMPORTER_UPLOAD_AND_INSTALL'); ?>
</button>
</div>
<input id="installer-return" name="return" type="hidden" value="<?php echo $return; ?>" />
<input id="installer-token" name="token" type="hidden" value="<?php echo $token; ?>" />
</div>
<input id="j2xml_filename" name="j2xml_filename" type="hidden" value="" />
<input id="j2xml_data" name="j2xml_data" type="hidden" value="" />

View File

@@ -0,0 +1,104 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_j2xml
*
* @version 3.9.229-rc1
*
* @author Helios Ciancio <info (at) eshiol (dot) it>
* @link https://www.eshiol.it
* @copyright Copyright (C) 2010 - 2023 Helios Ciancio. All Rights Reserved
* @license http://www.gnu.org/licenses/gpl-3.0.html GNU/GPL v3
* J2XML is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License
* or other free or open source software licenses.
*/
// no direct access
defined('_JEXEC') or die();
$version = new JVersion();
if ($version->isCompatible('3.4'))
{
JHtml::_('behavior.formvalidator');
}
else
{
JHtml::_('behavior.formvalidation');
}
if ($version->isCompatible('4'))
{
$ui = 'uitab';
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();
$wa->useScript('showon');
}
else
{
$ui = 'bootstrap';
JHtml::_($ui . '.tooltip', '.hasTooltip', array(
'placement' => 'bottom'
));
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('behavior.tabstate');
JFactory::getDocument()->addScriptDeclaration(<<<EOL
// Select first tab
jQuery(document).ready(function() {
jQuery( '#j2xmlTabs a:first' ).tab( 'show' );
});
EOL
);
}
?>
<form
action="<?php echo JRoute::_('index.php?option=com_j2xml'); ?>"
id="adminForm" method="post" name="adminForm" autocomplete="off"
class="form-horizontal">
<?php $fieldsets = $this->form->getFieldsets(); ?>
<?php echo JHtml::_($ui . '.startTabSet', 'j2xmlImport', array('active' => 'export')); ?>
<?php foreach ($fieldsets as $name => $fieldSet) : ?>
<?php if ($name == 'details') continue; ?>
<?php $label = empty($fieldSet->label) ? 'COM_J2XML_' . $name . '_FIELDSET_LABEL' : $fieldSet->label; ?>
<?php echo JHtml::_($ui . '.addTab', 'j2xmlImport', $name, JText::_($label)); ?>
<?php foreach ($this->form->getFieldset($name) as $field) : ?>
<?php
$dataShowOn = '';
$groupClass = $field->type === 'Spacer' ? ' field-spacer' : '';
?>
<?php if ($field->showon) : ?>
<?php JHtml::_('jquery.framework'); ?>
<?php JHtml::_('script', 'jui/cms.js', array('version' => 'auto', 'relative' => true)); ?>
<?php $dataShowOn = ' data-showon=\'' . json_encode(JFormHelper::parseShowOnConditions($field->showon, $field->formControl, $field->group)) . '\''; ?>
<?php endif; ?>
<?php if ($field->hidden) : ?>
<?php echo $field->input; ?>
<?php else : ?>
<div class="control-group<?php echo $groupClass; ?>"<?php echo $dataShowOn; ?>>
<?php if ($name != 'permissions') : ?>
<div class="control-label">
<?php echo $field->label; ?>
</div>
<?php endif; ?>
<div class="<?php if ($name != 'permissions') : ?>controls<?php endif; ?>">
<?php echo $field->input; ?>
</div>
</div>
<?php endif; ?>
<?php endforeach; ?>
<?php echo JHtml::_($ui . '.endTab'); ?>
<?php endforeach; ?>
<?php echo JHtml::_($ui . '.endTabSet'); ?>
</form>