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,298 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_j2xml
*
* @version 3.9.229-rc1
* @since 1.5.3
*
* @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();
JHTML::_('behavior.tooltip');
jimport('joomla.language.language');
$data = file_get_contents(JPATH_COMPONENT_ADMINISTRATOR . '/j2xml.xml');
$xml = simplexml_load_string($data);
$title = JText::_('Welcome_to_j2xml');
jimport('joomla.filesystem.folder');
jimport('joomla.filesystem.file');
$exts = array();
$version = new \JVersion();
$libraries = '/libraries' . ($version->isCompatible('3.9') ? '/eshiol' : '');
$files = array();
if ($version->isCompatible('3.9'))
{
if (JFolder::exists(JPATH_MANIFESTS . '/libraries/eshiol'))
{
$libraries = JFolder::files(JPATH_MANIFESTS . '/libraries/eshiol');
foreach ($libraries as $library)
{
$files[] = JPATH_MANIFESTS . '/libraries/eshiol/' . $library;
}
}
}
else
{
$files[] = JPATH_MANIFESTS . '/libraries/eshiol.xml';
$files[] = JPATH_MANIFESTS . '/libraries/j2xml.xml';
$files[] = JPATH_MANIFESTS . '/libraries/j2xmlpro.xml';
$files[] = JPATH_MANIFESTS . '/libraries/phpxmlrpc.xml';
}
$files[] = JPATH_SITE . '/plugins/system/j2xml/j2xml.xml';
$files[] = JPATH_SITE . '/plugins/content/setimages/setimages.xml';
$files[] = JPATH_SITE . '/plugins/content/j2xml/j2xml.xml';
$files[] = JPATH_SITE . '/plugins/content/j2xmlgi/j2xmlgi.xml';
$files[] = JPATH_SITE . '/plugins/content/j2xmlredirect/j2xmlredirect.xml';
if (JFolder::exists(JPATH_SITE . '/plugins/j2xml'))
{
$plugins = JFolder::folders(JPATH_SITE . '/plugins/j2xml');
foreach ($plugins as $plugin)
{
$files[] = JPATH_SITE . '/plugins/j2xml/' . $plugin . '/' . $plugin . '.xml';
}
}
$lang = JFactory::getLanguage();
foreach ($files as $file)
{
if (JFile::exists($file))
{
$xml = JFactory::getXML($file);
if ($xml)
{
if ($xml->getName() == 'extension')
{
$extension = pathinfo($file, PATHINFO_FILENAME);
$attr = $xml->attributes();
if ($attr['type'] == 'plugin')
{
$lang->load('plg_' . $attr['group'] . '_' . $extension);
}
else if ($attr['type'] = 'library')
{
$lang->load('lib_' . $extension);
}
$exts = $exts + array(
JText::_((string) $xml->name) .
// .' '.ucfirst($attr['group'])
' ' . ucfirst($attr['type']) => (string) $xml->version
);
}
}
}
}
?>
<form action="index.php" method="post" name="adminForm">
<?php if (class_exists('JPlatform') && version_compare(JPlatform::RELEASE, '12', 'ge')) { ?>
<?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;?>
<table>
<tr>
<?php if (!class_exists('JPlatform') || version_compare(JPlatform::RELEASE, '12', 'lt')): ?>
<td width='45%' class='adminform' valign='top'>
<p><?php JText::_('COM_J2XML_MSG_EXPORT'); ?></p>
<div id='cpanel'>
<?php
$link = 'index.php?option=com_content';
$this->_quickiconButton($link, 'icon-48-article.png', JText::_('COM_J2XML_TOOLBAR_ARTICLE_MANAGER'));
$link = 'index.php?option=com_j2xml&amp;view=websites';
$this->_quickiconButton($link, 'icon-48-websites.png', JText::_('COM_J2XML_TOOLBAR_WEBSITE_MANAGER'), '../media/com_j2xml/images/');
?>
</div>
<div class='clr'></div>
</td>
<?php endif; ?>
<td valign='top' style='padding: 7px 0 0 5px'>
<table class='adminlist'>
<tr>
<td colspan='3'>
<p><?php echo JText::_('COM_J2XML_XML_DESCRIPTION')?></p>
</td>
</tr>
<tr>
<td>
<?php echo JText::_('Installed_Version'); ?>
</td>
<td width='100px'>
<?php
$xml = JFactory::getXML(JPATH_COMPONENT . '/j2xml.xml');
echo $xml->version;
?>
</td>
<td rowspan='<?php echo 3 + count($exts); ?>'
style="text-align: center; width: 150px"><a
href='<?php echo JText::_('COM_J2XML_LINK'); ?>'> <img
src='../media/com_j2xml/images/j2xml.png' width='110'
height='110' alt='j2xml' title='j2xml' align='middle'
border='0'>
</a></td>
</tr>
<tr>
<td colspan="2">
<?php echo JText::_('Copyright'); ?>
<a href='https://www.eshiol.it' target='_blank'>
<?php echo str_replace("(C)", "&copy", $xml->copyright); ?>
<img src='../media/com_j2xml/images/eshiol.png' alt='eshiol.it'
title='eshiol.it' border='0'>
</a>
</td>
</tr>
<tr>
<td>
<?php echo JText::_('License'); ?>
</td>
<td><a href='http://www.gnu.org/licenses/gpl-3.0.html'
target='_blank'>GNU/GPL v3</a></td>
</tr>
<?php foreach ($exts as $k=>$v): ?>
<tr>
<td><?php echo $k; ?></td>
<td><?php echo $v; ?></td>
</tr>
<?php endforeach; ?>
</table>
</td>
</tr>
</table>
</div>
<?php } else { ?>
<?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;?>
<table>
<tr>
<?php if (!class_exists('JPlatform') || version_compare(JPlatform::RELEASE, '12', 'lt')): ?>
<td width='45%' class='adminform' valign='top'>
<p><?php echo JText::_('COM_J2XML_MSG_EXPORT'); ?></p>
<div id='cpanel'>
<?php
$link = 'index.php?option=com_content';
$this->_quickiconButton($link, 'icon-48-article.png', JText::_('COM_J2XML_TOOLBAR_ARTICLE_MANAGER'));
if (class_exists('JPlatform'))
{
$link = 'index.php?option=com_j2xml&amp;view=websites';
$this->_quickiconButton($link, 'icon-48-websites.png', JText::_('COM_J2XML_TOOLBAR_WEBSITE_MANAGER'), '../media/com_j2xml/images/');
}
?>
</div>
<div class='clr'></div>
</td>
<?php endif; ?>
<td valign='top' style='padding: 7px 0 0 5px'>
<table class='adminlist'>
<tr>
<td colspan='3'>
<p><?php echo JText::_('COM_J2XML_XML_DESCRIPTION')?></p>
</td>
</tr>
<tr>
<td>
<?php echo JText::_('Installed_Version'); ?>
</td>
<td width='100px'>
<?php
$xml = JFactory::getXML(JPATH_COMPONENT . '/j2xml.xml');
echo $xml->version;
?>
</td>
<td rowspan='<?php echo 3 + count($exts); ?>'
style="text-align: center; width: 150px"><a
href='<?php echo JText::_('COM_J2XML_LINK'); ?>'> <img
src='../media/com_j2xml/images/j2xml.png' width='110'
height='110' alt='j2xml' title='j2xml' align='middle'
border='0'>
</a></td>
</tr>
<tr>
<td colspan="2">
<?php echo JText::_('Copyright'); ?>
<a href='https://www.eshiol.it' target='_blank'>
<?php echo str_replace("(C)", "&copy", $xml->copyright); ?>
<img src='../media/com_j2xml/images/eshiol.png' alt='eshiol.it'
title='eshiol.it' border='0'>
</a>
</td>
</tr>
<tr>
<td>
<?php echo JText::_('License'); ?>
</td>
<td><a href='http://www.gnu.org/licenses/gpl-3.0.html'
target='_blank'>GNU/GPL v3</a></td>
</tr>
<?php foreach ($exts as $k=>$v): ?>
<tr>
<td><?php echo $k; ?></td>
<td><?php echo $v; ?></td>
</tr>
<?php endforeach; ?>
<?php $title = JText::_('Support_us'); ?>
<tr>
<td colspan="3">
<p><?php echo JText::_('COM_J2XML_MSG_DONATION1'); ?></p>
<div style="text-align: center;">
<form action="https://www.paypal.com/cgi-bin/webscr"
method="post">
<input type="hidden" name="cmd" value="_donations"> <input
type="hidden" name="business" value="info@eshiol.it"> <input
type="hidden" name="lc" value="en_US"> <input type="hidden"
name="item_name" value="eshiol.it"> <input type="hidden"
name="currency_code" value="EUR"> <input type="hidden"
name="bn"
value="PP-DonationsBF:btn_donateCC_LG.gif:NonHosted"> <input
type="image"
src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif"
border="0" name="submit" alt="PayPal secure payments."> <img
alt="" border="0"
src="https://www.paypal.com/en_US/i/scr/pixel.gif"
width="1" height="1">
</form>
</div>
<p><?php echo JText::_('COM_J2XML_MSG_DONATION2'); ?></p>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<?php } ?>
<input type="hidden" name="option" value="com_j2xml" /> <input
type="hidden" name="view" value="cpanel" /> <input type="hidden"
name="task" value="" />
<?php echo JHTML::_('form.token'); ?>
</form>

View File

@@ -0,0 +1,152 @@
<?php
/**
* @package Joomla.Administrator
* @subpackage com_j2xml
*
* @version 3.9.229-rc1
* @since 1.5.3
*
* @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();
JHtml::_('behavior.framework');
jimport('joomla.html.html.tabs');
/**
*
*/
class J2xmlViewCpanel extends JViewLegacy
{
function display ($tpl = null)
{
// Trigger the onAfterDispatch event.
JPluginHelper::importPlugin('j2xml');
// JFactory::getApplication()->triggerEvent('onAfterDispatch');
$info = $this->get('Info');
$this->assignRef('info', $info);
$params = JComponentHelper::getParams('com_j2xml');
$this->assignRef('params', $params);
J2XMLHelper::addSubmenu('cpanel');
$this->sidebar = JHtmlSidebar::render();
$this->addToolbar();
parent::display($tpl);
}
function _quickiconButton ($link, $image, $text, $path = null, $target = '', $onclick = '')
{
$app = JFactory::getApplication('administrator');
if ($target != '')
{
$target = 'target="' . $target . '"';
}
if ($onclick != '')
{
$onclick = 'onclick="' . $onclick . '"';
}
if ($path === null || $path === '')
{
$template = $app->getTemplate();
$path = '/templates/' . $template . '/images/header/';
}
$lang = JFactory::getLanguage();
if (!class_exists('JPlatform') || version_compare(JPlatform::RELEASE, '12', 'lt'))
{
?>
<div style="float:<?php echo ($lang->isRTL()) ? 'right' : 'left'; ?>;">
<div class="icon">
<a href="<?php echo $link; ?>" <?php echo $target;?>
<?php echo $onclick;?>>
<?php echo JHTML::_('image.administrator', $image, $path, NULL, NULL, $text ); ?>
<span><?php echo $text; ?></span>
</a>
</div>
</div>
<?php
}
}
/**
* Add the page title and toolbar.
*
* @since 1.6
*/
protected function addToolbar ()
{
require_once JPATH_COMPONENT . '/helpers/j2xml.php';
$canDo = j2xmlHelper::getActions();
$toolbar = JToolBar::getInstance('toolbar');
$toolbar->addButtonPath(JPATH_COMPONENT . DS . 'buttons');
JToolBarHelper::title(JText::_('COM_J2XML_TOOLBAR_J2XML'), 'j2xml.png');
$doc = JFactory::getDocument();
if ($canDo->get('core.create') || ($canDo->get('core.edit')))
{
jimport('eshiol.core.file');
$min = ($this->params->get('debug', 0) ? '' : '.min');
$doc->addScript("../media/lib_eshiol_core/js/encryption{$min}.js", array('version'=>'auto'));
$doc->addScript("../media/lib_eshiol_core/js/core{$min}.js", array('version'=>'auto'));
$doc->addScript("../media/lib_eshiol_core/js/version_compare{$min}.js", array('version'=>'auto'));
$db = JFactory::getDbo();
$query = $db->getQuery(true)
->select($db->quoteName('enabled'))
->from($db->quoteName('#__extensions'))
->where($db->quoteName('type') . ' = ' . $db->quote('library'));
$version = new \JVersion();
if ($version->isCompatible('3.9'))
{
$query->where($db->quoteName('element') . ' = ' . $db->quote('eshiol/J2xmlpro'));
}
else
{
$query->where($db->quoteName('element') . ' = ' . $db->quote('J2xmlpro'));
}
$pro = ((bool) $db->setQuery($query)->loadResult()) ? 'pro' : '';
$doc->addScript("../media/lib_eshiol_j2xml{$pro}/js/j2xml{$min}.js", array('version'=>'auto'));
$toolbar = JToolBar::getInstance('toolbar');
$toolbar->appendButton('File', 'j2xml', 'COM_J2XML_BUTTON_OPEN', 'COM_J2XML_BUTTON_IMPORT', 'j2xml.cpanel.import', 600, 400, null,
'xml,gz', null, $this->params->get('ajax', 0) ? 'eshiol.j2xml.importer' : null);
// $params = JComponentHelper::getParams('com_j2xml');
// $hostname = JFactory::getURI()->getHost();
$jinput = JFactory::getApplication()->input;
if (
// ($params->get('deveopment') &&
// ($hostname == 'localhost') &&
($jinput->getCmd('d3v3l0p', '0') === '1'))
{
$toolbar->appendButton('Link', 'purge', 'COM_J2XML_CONTENT_DELETE',
'index.php?option=com_j2xml&task=cpanel.clean&develop=1&' . JSession::getFormToken() . '=1');
}
JToolBarHelper::divider();
}
if ($canDo->get('core.admin'))
{
JToolBarHelper::preferences('com_j2xml');
}
$doc->addStyleDeclaration('#toolbar-credit{float:right;}');
$toolbar->appendButton('Link', 'credit', 'COM_J2XML_DONATE', 'https://www.eshiol.it/' . Jtext::_('COM_J2XML_DONATE_1'));
}
}
?>