first commit
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
<?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();
|
||||
|
||||
jimport('joomla.application.component.controller');
|
||||
|
||||
require_once dirname(__FILE__) . '/json.php';
|
||||
|
||||
/**
|
||||
* Categories controller class.
|
||||
*
|
||||
* @since 3.1.111
|
||||
*/
|
||||
class J2xmlControllerCategories extends J2xmlControllerJson
|
||||
{
|
||||
/**
|
||||
* The _context for persistent state.
|
||||
*
|
||||
* @var string
|
||||
* @since 3.1.112
|
||||
*/
|
||||
protected $_context = 'j2xml.categories';
|
||||
|
||||
}
|
||||
100
administrator/components/com_j2xml/controllers/categories.php
Normal file
100
administrator/components/com_j2xml/controllers/categories.php
Normal file
@@ -0,0 +1,100 @@
|
||||
<?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();
|
||||
|
||||
/**
|
||||
* Content controller class.
|
||||
*
|
||||
* @since 1.5.3
|
||||
*/
|
||||
class J2xmlControllerCategories extends JControllerLegacy
|
||||
{
|
||||
|
||||
/**
|
||||
* The _context for persistent state.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_context = 'j2xml.categories';
|
||||
|
||||
/**
|
||||
* The params object
|
||||
*
|
||||
* @var JRegistry
|
||||
*/
|
||||
protected $params;
|
||||
|
||||
/**
|
||||
* Method to get a model object, loading it if required.
|
||||
*
|
||||
* @param string $name
|
||||
* The name of the model.
|
||||
* @param string $prefix
|
||||
* The prefix for the model class name.
|
||||
* @param array $config
|
||||
* Configuration array for model. Optional.
|
||||
*
|
||||
* @return JModelLegacy
|
||||
*
|
||||
* @since 3.9.0
|
||||
*/
|
||||
public function getModel($name = 'Export', $prefix = 'J2xmlModel', $config = array())
|
||||
{
|
||||
JLog::add(new JLogEntry(__METHOD__, JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
return parent::getModel($name, $prefix, array(
|
||||
'ignore_request' => true
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Display method for the raw categories data.
|
||||
*
|
||||
* @param boolean $cachable
|
||||
* If true, the view output will be cached
|
||||
* @param array $urlparams
|
||||
* An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
|
||||
*
|
||||
* @return J2xmlControllerUser This object to support chaining.
|
||||
*
|
||||
* @since 3.6.161
|
||||
* @todo This should be done as a view, not here!
|
||||
*/
|
||||
function display($cachable = false, $urlparams = false)
|
||||
{
|
||||
JLog::add(new JLogEntry(__METHOD__, JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
$app = JFactory::getApplication();
|
||||
$jform = $app->input->post->get('jform', array(), 'array');
|
||||
$data = array();
|
||||
foreach($jform as $k => $v)
|
||||
{
|
||||
if (substr($k, 0, 7) == 'export_')
|
||||
{
|
||||
$data[substr($k, 7)] = $v;
|
||||
}
|
||||
}
|
||||
// Save the posted data in the session.
|
||||
$app->setUserState('com_j2xml.export.data', $data);
|
||||
JLog::add(new JLogEntry('setUserState(\'com_j2xml.export.data\'): ' . print_r($data, true), JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
$this->input->set('view', 'categories');
|
||||
parent::display();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<?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();
|
||||
|
||||
jimport('joomla.application.component.controller');
|
||||
|
||||
require_once dirname(__FILE__) . '/json.php';
|
||||
|
||||
/**
|
||||
* Contact controller class.
|
||||
*
|
||||
* @since 3.6.161
|
||||
*/
|
||||
class J2xmlControllerContact extends J2xmlControllerJson
|
||||
{
|
||||
/**
|
||||
* The _context for persistent state.
|
||||
*
|
||||
* @var string
|
||||
* @since 3.1.112
|
||||
*/
|
||||
protected $_context = 'j2xml.contact';
|
||||
|
||||
}
|
||||
102
administrator/components/com_j2xml/controllers/contact.php
Normal file
102
administrator/components/com_j2xml/controllers/contact.php
Normal file
@@ -0,0 +1,102 @@
|
||||
<?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();
|
||||
|
||||
/**
|
||||
* Content controller class.
|
||||
*
|
||||
* @since 3.6.161
|
||||
*/
|
||||
class J2xmlControllerContact extends JControllerLegacy
|
||||
{
|
||||
|
||||
/**
|
||||
* The _context for persistent state.
|
||||
*
|
||||
* @var string
|
||||
* @since 3.6.161
|
||||
*/
|
||||
protected $_context = 'j2xml.contact';
|
||||
|
||||
/**
|
||||
* The params object
|
||||
*
|
||||
* @var JRegistry
|
||||
* @since 3.6.161
|
||||
*/
|
||||
protected $params;
|
||||
|
||||
/**
|
||||
* Method to get a model object, loading it if required.
|
||||
*
|
||||
* @param string $name
|
||||
* The name of the model.
|
||||
* @param string $prefix
|
||||
* The prefix for the model class name.
|
||||
* @param array $config
|
||||
* Configuration array for model. Optional.
|
||||
*
|
||||
* @return JModelLegacy
|
||||
*
|
||||
* @since 3.9.0
|
||||
*/
|
||||
public function getModel($name = 'Export', $prefix = 'J2xmlModel', $config = array())
|
||||
{
|
||||
JLog::add(new JLogEntry(__METHOD__, JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
return parent::getModel($name, $prefix, array(
|
||||
'ignore_request' => true
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Display method for the raw contacts data.
|
||||
*
|
||||
* @param boolean $cachable
|
||||
* If true, the view output will be cached
|
||||
* @param array $urlparams
|
||||
* An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
|
||||
*
|
||||
* @return J2xmlControllerUser This object to support chaining.
|
||||
*
|
||||
* @since 3.6.161
|
||||
* @todo This should be done as a view, not here!
|
||||
*/
|
||||
function display($cachable = false, $urlparams = false)
|
||||
{
|
||||
JLog::add(new JLogEntry(__METHOD__, JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
$app = JFactory::getApplication();
|
||||
$jform = $app->input->post->get('jform', array(), 'array');
|
||||
$data = array();
|
||||
foreach($jform as $k => $v)
|
||||
{
|
||||
if (substr($k, 0, 7) == 'export_')
|
||||
{
|
||||
$data[substr($k, 7)] = $v;
|
||||
}
|
||||
}
|
||||
// Save the posted data in the session.
|
||||
$app->setUserState('com_j2xml.export.data', $data);
|
||||
JLog::add(new JLogEntry('setUserState(\'com_j2xml.export.data\'): ' . print_r($data, true), JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
$this->input->set('view', 'contact');
|
||||
parent::display();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<?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();
|
||||
|
||||
jimport('joomla.application.component.controller');
|
||||
|
||||
require_once dirname(__FILE__) . '/json.php';
|
||||
|
||||
/**
|
||||
* Content controller class.
|
||||
*
|
||||
* @since 3.6.161
|
||||
*/
|
||||
class J2xmlControllerContent extends J2xmlControllerJson
|
||||
{
|
||||
/**
|
||||
* The _context for persistent state.
|
||||
*
|
||||
* @var string
|
||||
* @since 3.1.112
|
||||
*/
|
||||
protected $_context = 'j2xml.content';
|
||||
|
||||
}
|
||||
102
administrator/components/com_j2xml/controllers/content.php
Normal file
102
administrator/components/com_j2xml/controllers/content.php
Normal file
@@ -0,0 +1,102 @@
|
||||
<?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();
|
||||
|
||||
/**
|
||||
* Content controller class.
|
||||
*
|
||||
* @since 3.6.161
|
||||
*/
|
||||
class J2xmlControllerContent extends JControllerLegacy
|
||||
{
|
||||
|
||||
/**
|
||||
* The _context for persistent state.
|
||||
*
|
||||
* @var string
|
||||
* @since 3.6.161
|
||||
*/
|
||||
protected $_context = 'j2xml.content';
|
||||
|
||||
/**
|
||||
* The params object
|
||||
*
|
||||
* @var JRegistry
|
||||
* @since 3.6.161
|
||||
*/
|
||||
protected $params;
|
||||
|
||||
/**
|
||||
* Method to get a model object, loading it if required.
|
||||
*
|
||||
* @param string $name
|
||||
* The name of the model.
|
||||
* @param string $prefix
|
||||
* The prefix for the model class name.
|
||||
* @param array $config
|
||||
* Configuration array for model. Optional.
|
||||
*
|
||||
* @return JModelLegacy
|
||||
*
|
||||
* @since 3.9.0
|
||||
*/
|
||||
public function getModel($name = 'Export', $prefix = 'J2xmlModel', $config = array())
|
||||
{
|
||||
JLog::add(new JLogEntry(__METHOD__, JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
return parent::getModel($name, $prefix, array(
|
||||
'ignore_request' => true
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Display method for the raw articles data.
|
||||
*
|
||||
* @param boolean $cachable
|
||||
* If true, the view output will be cached
|
||||
* @param array $urlparams
|
||||
* An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
|
||||
*
|
||||
* @return J2xmlControllerUser This object to support chaining.
|
||||
*
|
||||
* @since 3.6.161
|
||||
* @todo This should be done as a view, not here!
|
||||
*/
|
||||
function display($cachable = false, $urlparams = false)
|
||||
{
|
||||
JLog::add(new JLogEntry(__METHOD__, JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
$app = JFactory::getApplication();
|
||||
$jform = $app->input->post->get('jform', array(), 'array');
|
||||
$data = array();
|
||||
foreach($jform as $k => $v)
|
||||
{
|
||||
if (substr($k, 0, 7) == 'export_')
|
||||
{
|
||||
$data[substr($k, 7)] = $v;
|
||||
}
|
||||
}
|
||||
// Save the posted data in the session.
|
||||
$app->setUserState('com_j2xml.export.data', $data);
|
||||
JLog::add(new JLogEntry('setUserState(\'com_j2xml.export.data\'): ' . print_r($data, true), JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
$this->input->set('view', 'content');
|
||||
parent::display();
|
||||
}
|
||||
}
|
||||
192
administrator/components/com_j2xml/controllers/cpanel.json.php
Normal file
192
administrator/components/com_j2xml/controllers/cpanel.json.php
Normal file
@@ -0,0 +1,192 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage com_j2xml
|
||||
*
|
||||
* @version 3.9.229-rc1
|
||||
* @since 3.6.160
|
||||
*
|
||||
* @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();
|
||||
|
||||
jimport('joomla.application.component.controller');
|
||||
|
||||
jimport('eshiol.J2xml.Importer');
|
||||
jimport('eshiol.J2xmlpro.Importer');
|
||||
jimport('cms.response.json');
|
||||
|
||||
require_once JPATH_ADMINISTRATOR . '/components/com_j2xml/helpers/j2xml.php';
|
||||
|
||||
/**
|
||||
* Controller class.
|
||||
*/
|
||||
class J2xmlControllerCpanel extends JControllerLegacy
|
||||
{
|
||||
|
||||
/**
|
||||
* The application object.
|
||||
*
|
||||
* @var JApplicationBase
|
||||
* @since 3.6.160
|
||||
*/
|
||||
protected $app;
|
||||
|
||||
function __construct ($default = array())
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->app = JFactory::getApplication();
|
||||
}
|
||||
|
||||
function import ()
|
||||
{
|
||||
$data = $this->app->input->post->get('j2xml_data', '', 'RAW');
|
||||
$filename = $this->app->input->post->get('j2xml_filename', '', 'RAW');
|
||||
|
||||
// Send json mime type.
|
||||
$this->app->mimeType = 'application/json';
|
||||
$this->app->setHeader('Content-Type', $this->app->mimeType . '; charset=' . $this->app->charSet);
|
||||
$this->app->sendHeaders();
|
||||
|
||||
$dispatcher = \JEventDispatcher::getInstance();
|
||||
JPluginHelper::importPlugin('j2xml');
|
||||
|
||||
$params = JComponentHelper::getParams('com_j2xml');
|
||||
|
||||
$results = $dispatcher->trigger('onContentPrepareData', array(
|
||||
'com_j2xml.cpanel',
|
||||
&$data
|
||||
));
|
||||
$data = strstr($data, '<?xml version="1.0" ');
|
||||
|
||||
$data = J2XMLHelper::stripInvalidXml($data);
|
||||
if (!defined('LIBXML_PARSEHUGE'))
|
||||
{
|
||||
define(LIBXML_PARSEHUGE, 524288);
|
||||
}
|
||||
$xml = simplexml_load_string($data, 'SimpleXMLElement', LIBXML_PARSEHUGE);
|
||||
|
||||
if (!$xml)
|
||||
{
|
||||
$errors = libxml_get_errors();
|
||||
foreach ($errors as $error)
|
||||
{
|
||||
$msg = $error->code . ' - ' . $error->message . ' at line ' . $error->line;
|
||||
switch ($error->level)
|
||||
{
|
||||
default:
|
||||
case LIBXML_ERR_WARNING:
|
||||
$this->app->enqueueMessage($msg, 'message');
|
||||
break;
|
||||
case LIBXML_ERR_ERROR:
|
||||
$this->app->enqueueMessage($msg, 'notice');
|
||||
break;
|
||||
case LIBXML_ERR_FATAL:
|
||||
$this->app->enqueueMessage($msg, 'error');
|
||||
break;
|
||||
}
|
||||
}
|
||||
libxml_clear_errors();
|
||||
}
|
||||
|
||||
if (!$xml)
|
||||
{
|
||||
echo new \JResponseJson($response = null, $message = JText::sprintf('LIB_J2XML_MSG_FILE_FORMAT_UNKNOWN'), $error = true,
|
||||
$ignoreMessages = false);
|
||||
$this->app->close();
|
||||
return false;
|
||||
}
|
||||
|
||||
$results = $dispatcher->trigger('onBeforeImport', array(
|
||||
'com_j2xml.cpanel',
|
||||
&$xml
|
||||
));
|
||||
|
||||
if (!$xml)
|
||||
{
|
||||
echo new \JResponseJson($response = null, $message = JText::sprintf('LIB_J2XML_MSG_FILE_FORMAT_UNKNOWN'), $error = true,
|
||||
$ignoreMessages = false);
|
||||
$this->app->close();
|
||||
return false;
|
||||
}
|
||||
elseif (strtoupper($xml->getName()) == 'J2XML')
|
||||
{
|
||||
if (!isset($xml['version']))
|
||||
{
|
||||
$app->enqueueMessage(JText::sprintf('LIB_J2XML_MSG_FILE_FORMAT_UNKNOWN'), 'error');
|
||||
}
|
||||
else
|
||||
{
|
||||
$iparams = new \JRegistry();
|
||||
|
||||
$iparams->set('filename', $filename);
|
||||
$iparams->set('version', (string) $xml['version']);
|
||||
$iparams->set('keep_user_id', $params->get('keep_id', 0));
|
||||
$iparams->set('categories', $params->get('import_categories', 1));
|
||||
$iparams->set('contacts', $params->get('import_contacts', 1));
|
||||
$iparams->set('fields', $params->get('import_fields', 1));
|
||||
$iparams->set('images', $params->get('import_images', 1));
|
||||
$iparams->set('keep_id', $params->get('keep_id', 0));
|
||||
$iparams->set('tags', $params->get('import_tags', 1));
|
||||
$iparams->set('users', $params->get('import_users', 1));
|
||||
$iparams->set('superusers', $params->get('import_superusers', 0));
|
||||
$iparams->set('usernotes', $params->get('import_usernotes', 1));
|
||||
$iparams->set('viewlevels', $params->get('import_viewlevels', 1));
|
||||
$iparams->set('content', $params->get('import_content'));
|
||||
$iparams->set('linksourcefile', $params->get('linksourcefile'));
|
||||
$iparams->set('weblinks', $params->get('import_weblinks'));
|
||||
$iparams->set('keep_frontpage', $params->get('keep_frontpage'));
|
||||
$iparams->set('keep_rating', $params->get('keep_rating'));
|
||||
$iparams->set('keep_data', $params->get('keep_data', 0));
|
||||
|
||||
if ($params->get('keep_category', 1) == 2)
|
||||
{
|
||||
$iparams->set('content_category_forceto', $params->get('category'));
|
||||
}
|
||||
|
||||
$importer = class_exists('eshiol\J2xmlpro\Importer') ? new eshiol\J2xmlpro\Importer() : new eshiol\J2xml\Importer();
|
||||
// set_time_limit(120);
|
||||
|
||||
try
|
||||
{
|
||||
$importer->import($xml, $iparams);
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
{
|
||||
JLog::add(JText::sprintf('LIB_J2XML_MSG_USERGROUP_ERROR', $ex->getMessage()), JLog::ERROR, 'lib_j2xml');
|
||||
$this->app->redirect('index.php?option=com_j2xml');
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
if (!$xml)
|
||||
{
|
||||
echo new \JResponseJson($response = null, $message = JText::sprintf('LIB_J2XML_MSG_FILE_FORMAT_UNKNOWN'), $error = true,
|
||||
$ignoreMessages = false);
|
||||
$this->app->close();
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
$params->set('filename', $filename);
|
||||
|
||||
// set_time_limit(120);
|
||||
$importer = class_exists('eshiol\J2xmlpro\Importer') ? new eshiol\J2xmlpro\Importer() : new eshiol\J2xml\Importer();
|
||||
$importer->import($xml, $params);
|
||||
}
|
||||
*/
|
||||
echo new \JResponseJson($response = null, $message = $this->app->getMessageQueue(), $error = false, $ignoreMessages = false);
|
||||
$this->app->close();
|
||||
}
|
||||
}
|
||||
263
administrator/components/com_j2xml/controllers/cpanel.php
Normal file
263
administrator/components/com_j2xml/controllers/cpanel.php
Normal file
@@ -0,0 +1,263 @@
|
||||
<?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();
|
||||
|
||||
JLoader::import('eshiol.J2xml.Importer');
|
||||
JLoader::import('eshiol.J2xmlpro.Importer');
|
||||
|
||||
require_once JPATH_ADMINISTRATOR . '/components/com_j2xml/helpers/j2xml.php';
|
||||
|
||||
/**
|
||||
* Controller class.
|
||||
*/
|
||||
class J2xmlControllerCpanel extends JControllerLegacy
|
||||
{
|
||||
|
||||
/**
|
||||
* The application object.
|
||||
*
|
||||
* @var JApplicationBase
|
||||
* @since 3.7.200
|
||||
*/
|
||||
protected $app;
|
||||
|
||||
/**
|
||||
* Custom Constructor
|
||||
*/
|
||||
function __construct ($default = array())
|
||||
{
|
||||
parent::__construct($default);
|
||||
|
||||
$this->app = JFactory::getApplication();
|
||||
}
|
||||
|
||||
public function display ($cachable = false, $urlparams = false)
|
||||
{
|
||||
$this->input->set('view', 'cpanel');
|
||||
$this->input->set('layout', 'default');
|
||||
parent::display($cachable, $urlparams);
|
||||
}
|
||||
|
||||
function import ()
|
||||
{
|
||||
JLog::add(new JLogEntry(__METHOD__, JLOG::DEBUG, 'com_j2xml'));
|
||||
|
||||
$app = JFactory::getApplication('administrator');
|
||||
if (isset($_SERVER["CONTENT_LENGTH"]))
|
||||
{
|
||||
if ($_SERVER["CONTENT_LENGTH"] > ((int) ini_get('post_max_size') * 1024 * 1024))
|
||||
{
|
||||
$app->enqueueMessage(JText::_('COM_J2XML_ERROR_WARNUPLOADTOOLARGE'), 'error');
|
||||
$this->setRedirect('index.php?option=com_j2xml');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Check for request forgeries
|
||||
JSession::checkToken() or jexit('Invalid Token');
|
||||
|
||||
$msg = '';
|
||||
$db = JFactory::getDBO();
|
||||
$date = JFactory::getDate();
|
||||
$now = $date->toSQL();
|
||||
$params = JComponentHelper::getParams('com_j2xml');
|
||||
$this->setRedirect('index.php?option=com_j2xml');
|
||||
libxml_use_internal_errors(true);
|
||||
$filetype = $this->input->get('j2xml_filetype', 1);
|
||||
switch ($filetype)
|
||||
{
|
||||
case 1:
|
||||
// Retrieve file details from uploaded file, sent from upload
|
||||
// form:
|
||||
$file = $this->input->files->get('j2xml_local', null, 'array');
|
||||
if (!isset($file))
|
||||
{
|
||||
$app->enqueueMessage(JText::_('COM_J2XML_MSG_UPLOAD_ERROR'), 'error');
|
||||
return false;
|
||||
}
|
||||
elseif ($file['error'] > 0)
|
||||
{
|
||||
$app->enqueueMessage(JText::_('COM_J2XML_MSG_UPLOAD_ERROR'), 'error');
|
||||
return false;
|
||||
}
|
||||
$filename = $file['tmp_name'];
|
||||
$x = explode(".", $file['name']);
|
||||
$extn = end($x);
|
||||
break;
|
||||
case 2:
|
||||
if (!($filename = $this->input->get('j2xml_url', null, 'URL')))
|
||||
{
|
||||
$app->enqueueMessage(JText::_('COM_J2XML_MSG_UPLOAD_ERROR'), 'error');
|
||||
return false;
|
||||
}
|
||||
$x = explode(".", $filename);
|
||||
$extn = end($x);
|
||||
break;
|
||||
case 3:
|
||||
if ($filename = $this->input->get('j2xml_server', null))
|
||||
{
|
||||
$filename = JPATH_ROOT . '/' . $filename;
|
||||
}
|
||||
else
|
||||
{
|
||||
$app->enqueueMessage(JText::_('COM_J2XML_MSG_UPLOAD_ERROR'), 'error');
|
||||
return false;
|
||||
}
|
||||
$x = explode(".", $filename);
|
||||
$extn = end($x);
|
||||
break;
|
||||
default:
|
||||
$app->enqueueMessage(JText::_('COM_J2XML_MSG_UPLOAD_ERROR'), 'error');
|
||||
return false;
|
||||
}
|
||||
if (!($data = implode(gzfile($filename))))
|
||||
{
|
||||
$contextOptions = array(
|
||||
'ssl' => array(
|
||||
'verify_peer' => false,
|
||||
'verify_peer_name' => false
|
||||
)
|
||||
);
|
||||
|
||||
$data = file_get_contents($filename, false, stream_context_create($arrContextOptions));
|
||||
}
|
||||
$data = mb_convert_encoding($data, 'UTF-8');
|
||||
|
||||
$dispatcher = \JEventDispatcher::getInstance();
|
||||
JPluginHelper::importPlugin('j2xml');
|
||||
|
||||
$results = $dispatcher->trigger('onContentPrepareData', array(
|
||||
'com_j2xml.cpanel',
|
||||
&$data
|
||||
));
|
||||
$data = strstr($data, '<?xml version="1.0" ');
|
||||
|
||||
$data = J2XMLHelper::stripInvalidXml($data);
|
||||
if (!defined('LIBXML_PARSEHUGE'))
|
||||
{
|
||||
define(LIBXML_PARSEHUGE, 524288);
|
||||
}
|
||||
$xml = simplexml_load_string($data, 'SimpleXMLElement', LIBXML_PARSEHUGE);
|
||||
|
||||
if (!$xml)
|
||||
{
|
||||
$errors = libxml_get_errors();
|
||||
foreach ($errors as $error)
|
||||
{
|
||||
$msg = $error->code . ' - ' . $error->message . ' at line ' . $error->line;
|
||||
switch ($error->level)
|
||||
{
|
||||
default:
|
||||
case LIBXML_ERR_WARNING:
|
||||
$app->enqueueMessage($msg, 'message');
|
||||
break;
|
||||
case LIBXML_ERR_ERROR:
|
||||
$app->enqueueMessage($msg, 'notice');
|
||||
break;
|
||||
case LIBXML_ERR_FATAL:
|
||||
$app->enqueueMessage($msg, 'error');
|
||||
break;
|
||||
}
|
||||
}
|
||||
libxml_clear_errors();
|
||||
$this->setRedirect('index.php?option=com_j2xml');
|
||||
}
|
||||
|
||||
if (!$xml)
|
||||
{
|
||||
$app->enqueueMessage(JText::sprintf('LIB_J2XML_MSG_FILE_FORMAT_UNKNOWN'), 'error');
|
||||
return false;
|
||||
}
|
||||
|
||||
$results = $dispatcher->trigger('onBeforeImport', array(
|
||||
'com_j2xml.cpanel',
|
||||
&$xml
|
||||
));
|
||||
|
||||
if (!$xml)
|
||||
{
|
||||
$app->enqueueMessage(JText::sprintf('LIB_J2XML_MSG_FILE_FORMAT_UNKNOWN'), 'error');
|
||||
}
|
||||
else
|
||||
{
|
||||
$xmlVersion = $xml['version'];
|
||||
$version = explode(".", $xmlVersion);
|
||||
$xmlVersionNumber = $version[0] . substr('0' . $version[1], strlen($version[1]) - 1) . substr('0' . $version[2], strlen($version[2]) - 1);
|
||||
|
||||
JPluginHelper::importPlugin('j2xml');
|
||||
$results = JFactory::getApplication()->triggerEvent('onValidateData', array(&$xml, $params));
|
||||
|
||||
$importer = class_exists('eshiol\J2xmlpro\Importer') ? new eshiol\J2xmlpro\Importer() : new eshiol\J2xml\Importer();
|
||||
if ($importer->isSupported($xmlVersionNumber) || in_array(true, $results, true))
|
||||
{
|
||||
$iparams = new \JRegistry();
|
||||
$iparams->set('filename', $filename);
|
||||
$iparams->set('version', (string) $xml['version']);
|
||||
|
||||
$iparams->set('categories', $params->get('import_categories', 1));
|
||||
$iparams->set('contacts', $params->get('import_contacts', 1));
|
||||
$iparams->set('content', $params->get('import_content', 2));
|
||||
$iparams->set('fields', $params->get('import_fields', 1));
|
||||
$iparams->set('images', $params->get('import_images', 1));
|
||||
if ($params->get('keep_category', 1) == 2)
|
||||
{
|
||||
$iparams->set('content_category_forceto', $params->get('category'));
|
||||
}
|
||||
$iparams->set('keep_access', $params->get('keep_access', 0));
|
||||
$iparams->set('keep_attribs', $params->get('keep_attribs', 1));
|
||||
$iparams->set('keep_author', $params->get('keep_author', 1));
|
||||
$iparams->set('keep_frontpage', $params->get('keep_frontpage', 1));
|
||||
$iparams->set('keep_id', $params->get('keep_id', 0));
|
||||
$iparams->set('keep_metadata', $params->get('keep_metadata', 1));
|
||||
$iparams->set('keep_rating', $params->get('keep_rating', 1));
|
||||
$iparams->set('keep_state', $params->get('keep_state', 2));
|
||||
$iparams->set('keep_user_attribs', $params->get('keep_user_attribs', 1));
|
||||
$iparams->set('keep_user_id', $params->get('keep_user_id', 0));
|
||||
$iparams->set('linksourcefile', $params->get('linksourcefile', 0));
|
||||
$iparams->set('reduild_links', $params->get('reduild_links', 0));
|
||||
$iparams->set('superusers', $params->get('import_superusers', 0));
|
||||
$iparams->set('tags', $params->get('import_tags', 1));
|
||||
$iparams->set('usernotes', $params->get('import_usernotes', 0));
|
||||
$iparams->set('users', $params->get('import_users', 1));
|
||||
$iparams->set('viewlevels', $params->get('import_viewlevels', 1));
|
||||
$iparams->set('weblinks', $params->get('import_weblinks', 1));
|
||||
$iparams->set('keep_data', $params->get('keep_data', 0));
|
||||
|
||||
// set_time_limit(120);
|
||||
try
|
||||
{
|
||||
$importer->import($xml, $iparams);
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
{
|
||||
JLog::add(JText::sprintf('LIB_J2XML_MSG_USERGROUP_ERROR', $ex->getMessage()), JLog::ERROR, 'lib_j2xml');
|
||||
$this->app->redirect('index.php?option=com_j2xml');
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
$app->enqueueMessage(JText::sprintf('LIB_J2XML_MSG_FILE_FORMAT_NOT_SUPPORTED', $xmlVersion),'error');
|
||||
}
|
||||
}
|
||||
$this->setRedirect('index.php?option=com_j2xml');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage com_j2xml
|
||||
*
|
||||
* @version 3.9.229-rc1
|
||||
* @since 3.7.172
|
||||
*
|
||||
* @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();
|
||||
|
||||
require_once dirname(__FILE__) . '/json.php';
|
||||
|
||||
/**
|
||||
* Content controller class.
|
||||
*/
|
||||
class J2xmlControllerFields extends J2xmlControllerJson
|
||||
{
|
||||
}
|
||||
53
administrator/components/com_j2xml/controllers/fields.php
Normal file
53
administrator/components/com_j2xml/controllers/fields.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage com_j2xml
|
||||
*
|
||||
* @version 3.9.229-rc1
|
||||
* @since 3.7.172
|
||||
*
|
||||
* @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();
|
||||
|
||||
/**
|
||||
* Content controller class.
|
||||
*/
|
||||
class J2xmlControllerFields extends JControllerLegacy
|
||||
{
|
||||
|
||||
function __construct ($default = array())
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function display ($cachable = false, $urlparams = false)
|
||||
{
|
||||
$this->input->set('view', 'fields');
|
||||
parent::display($cachable, $urlparams);
|
||||
}
|
||||
|
||||
/**
|
||||
* Export fields in XML format
|
||||
*/
|
||||
function export ()
|
||||
{
|
||||
// Check for request forgeries
|
||||
JSession::checkToken() or jexit('Invalid Token');
|
||||
|
||||
$cid = $this->input->post->get('cid', array(
|
||||
0
|
||||
), 'array');
|
||||
$ids = 'cid=' . implode(',', $cid);
|
||||
$this->setRedirect('index.php?option=com_j2xml&task=fields.display&format=raw&' . $ids);
|
||||
}
|
||||
}
|
||||
132
administrator/components/com_j2xml/controllers/import.php
Normal file
132
administrator/components/com_j2xml/controllers/import.php
Normal file
@@ -0,0 +1,132 @@
|
||||
<?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();
|
||||
|
||||
/**
|
||||
* Importer controller for J2xml class.
|
||||
*
|
||||
* @since 3.9
|
||||
*/
|
||||
class J2xmlControllerImport extends JControllerLegacy
|
||||
{
|
||||
/**
|
||||
* Import data.
|
||||
*
|
||||
* @return boolean
|
||||
*
|
||||
* @since 3.9
|
||||
*/
|
||||
public function import()
|
||||
{
|
||||
JLog::add(new JLogEntry(__METHOD__, JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
// Check for request forgeries.
|
||||
$version = new \JVersion();
|
||||
if ($version->isCompatible('3.7'))
|
||||
{
|
||||
$this->checkToken();
|
||||
}
|
||||
else
|
||||
{
|
||||
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
|
||||
}
|
||||
|
||||
/** @var J2xmlModelImport $model */
|
||||
$model = $this->getModel('import');
|
||||
|
||||
// @todo Reset the users acl here as well to kill off any missing bits.
|
||||
$result = $model->import();
|
||||
|
||||
$app = JFactory::getApplication();
|
||||
$redirect_url = $app->getUserState('com_j2xml.redirect_url');
|
||||
|
||||
if (!$redirect_url)
|
||||
{
|
||||
$redirect_url = base64_decode($app->input->get('return', ''));
|
||||
}
|
||||
|
||||
// Don't redirect to an external URL.
|
||||
if (!JUri::isInternal($redirect_url))
|
||||
{
|
||||
$redirect_url = '';
|
||||
}
|
||||
|
||||
if (empty($redirect_url))
|
||||
{
|
||||
$redirect_url = JRoute::_('index.php?option=com_j2xml&view=import', false);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Wipe out the user state when we're going to redirect.
|
||||
$app->setUserState('com_j2xml.redirect_url', '');
|
||||
$app->setUserState('com_j2xml.message', '');
|
||||
}
|
||||
|
||||
$this->setRedirect($redirect_url);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Import data from drag & drop ajax upload.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 3.9
|
||||
*/
|
||||
public function ajax_upload()
|
||||
{
|
||||
JLog::add(new JLogEntry(__METHOD__, JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
$app = JFactory::getApplication();
|
||||
$message = $app->getUserState('com_j2xml.message');
|
||||
|
||||
$jform = $app->input->post->get('jform', array(), 'array');
|
||||
$data = array();
|
||||
foreach($jform as $k => $v)
|
||||
{
|
||||
if (substr($k, 0, 7) == 'import_')
|
||||
{
|
||||
$data[substr($k, 7)] = $v;
|
||||
}
|
||||
}
|
||||
// Save the posted data in the session.
|
||||
$app->setUserState('com_j2xml.import.data', $data);
|
||||
JLog::add(new JLogEntry('setUserState(\'com_j2xml.import.data\'): ' . print_r($data, true), JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
// Do import
|
||||
// hide error messages
|
||||
ob_start();
|
||||
$result = $this->import();
|
||||
ob_end_clean();
|
||||
|
||||
// Get redirect URL
|
||||
$redirect = $this->redirect;
|
||||
|
||||
// Push message queue to session because we will redirect page by Javascript, not $app->redirect().
|
||||
// The "application.queue" is only set in redirect() method, so we must manually store it.
|
||||
$app->getSession()->set('application.queue', $app->getMessageQueue());
|
||||
|
||||
header('Content-Type: application/json');
|
||||
|
||||
echo new JResponseJson(array('redirect' => $redirect), $message, !$result);
|
||||
|
||||
exit();
|
||||
}
|
||||
}
|
||||
102
administrator/components/com_j2xml/controllers/json.php
Normal file
102
administrator/components/com_j2xml/controllers/json.php
Normal file
@@ -0,0 +1,102 @@
|
||||
<?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();
|
||||
|
||||
JLoader::import('joomla.application.component.controller');
|
||||
|
||||
use eshiol\J2xml\Exporter;
|
||||
use eshiol\J2xml\Sender;
|
||||
use eshiol\J2xml\Version;
|
||||
|
||||
JLoader::import('eshiol.J2xml.Exporter');
|
||||
JLoader::import('eshiol.J2xml.Sender');
|
||||
JLoader::import('eshiol.J2xml.Version');
|
||||
|
||||
|
||||
/**
|
||||
* Content controller class.
|
||||
*/
|
||||
class J2xmlControllerJson extends JControllerLegacy
|
||||
{
|
||||
|
||||
/**
|
||||
* The params object
|
||||
*
|
||||
* @var JRegistry
|
||||
*/
|
||||
protected $params;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param array $config
|
||||
* An optional associative array of configuration settings.
|
||||
* Recognized key values include 'name', 'default_task', 'model_path', and
|
||||
* 'view_path' (this list is not meant to be comprehensive).
|
||||
*
|
||||
* @since 12.2
|
||||
*/
|
||||
public function __construct($config = array())
|
||||
{
|
||||
JLog::add(new JLogEntry(__METHOD__, JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
parent::__construct($config);
|
||||
|
||||
$this->params = new JRegistry();
|
||||
}
|
||||
|
||||
/**
|
||||
* Export content
|
||||
*/
|
||||
function export()
|
||||
{
|
||||
JLog::add(new JLogEntry(__METHOD__, JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
if (!JSession::checkToken('request')) {
|
||||
// Check for a valid token. If invalid, send a 403 with the error message.
|
||||
JLog::add(new JLogEntry(JText::_('JINVALID_TOKEN'), JLog::WARNING, 'com_j2xml'));
|
||||
echo new JResponseJson();
|
||||
return;
|
||||
}
|
||||
|
||||
$app = JFactory::getApplication();
|
||||
$data = $app->input->post->getArray();
|
||||
// Save the posted data in the session.
|
||||
$app->setUserState('com_j2xml.send.data', $data);
|
||||
JLog::add(new JLogEntry('setUserState(\'com_j2xml.send.data\'): ' . print_r($data, true), JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
$cid = (array) $this->input->get('cid', array(0), 'array');
|
||||
|
||||
$j2xml = new Exporter();
|
||||
$export = strtolower(str_replace('J2xmlController', '', get_class($this)));
|
||||
$j2xml->$export($cid, $xml, $this->params);
|
||||
|
||||
$app = JFactory::getApplication();
|
||||
$version = explode(".", Version::$DOCVERSION);
|
||||
$xmlVersionNumber = $version[0] . $version[1] . substr('0' . $version[2], strlen($version[2]) - 1);
|
||||
|
||||
$dom = new \DOMDocument('1.0');
|
||||
$dom->preserveWhiteSpace = false;
|
||||
$dom->formatOutput = true;
|
||||
$dom->loadXML($xml->asXML());
|
||||
$data = $dom->saveXML();
|
||||
|
||||
echo new JResponseJson($data);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage com_j2xml
|
||||
*
|
||||
* @version 3.9.229-rc1
|
||||
* @since 3.6.164
|
||||
*
|
||||
* @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();
|
||||
|
||||
require_once dirname(__FILE__) . '/json.php';
|
||||
|
||||
/**
|
||||
* Menus controller class.
|
||||
*/
|
||||
class J2xmlControllerMenus extends J2xmlControllerJson
|
||||
{
|
||||
}
|
||||
53
administrator/components/com_j2xml/controllers/menus.php
Normal file
53
administrator/components/com_j2xml/controllers/menus.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage com_j2xml
|
||||
*
|
||||
* @version 3.9.229-rc1
|
||||
* @since 3.6.164
|
||||
*
|
||||
* @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();
|
||||
|
||||
/**
|
||||
* Menus controller class.
|
||||
*/
|
||||
class J2xmlControllerMenus extends JControllerLegacy
|
||||
{
|
||||
|
||||
function __construct ($default = array())
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function display ($cachable = false, $urlparams = false)
|
||||
{
|
||||
$this->input->set('view', 'menus');
|
||||
parent::display($cachable, $urlparams);
|
||||
}
|
||||
|
||||
/**
|
||||
* Export menus in XML format
|
||||
*/
|
||||
function export ()
|
||||
{
|
||||
// Check for request forgeries
|
||||
JSession::checkToken() or jexit('Invalid Token');
|
||||
|
||||
$cid = $this->input->post->get('cid', array(
|
||||
0
|
||||
), 'array');
|
||||
$ids = 'cid=' . implode(',', $cid);
|
||||
$this->setRedirect('index.php?option=com_j2xml&task=menus.display&format=raw&' . $ids);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage com_j2xml
|
||||
*
|
||||
* @version 3.9.229-rc1
|
||||
* @since 3.6.165
|
||||
*
|
||||
* @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();
|
||||
|
||||
require_once dirname(__FILE__) . '/json.php';
|
||||
|
||||
/**
|
||||
* Modules controller class.
|
||||
*/
|
||||
class J2xmlControllerModules extends J2xmlControllerJson
|
||||
{
|
||||
}
|
||||
53
administrator/components/com_j2xml/controllers/modules.php
Normal file
53
administrator/components/com_j2xml/controllers/modules.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage com_j2xml
|
||||
*
|
||||
* @version 3.9.229-rc1
|
||||
* @since 3.6.165
|
||||
*
|
||||
* @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();
|
||||
|
||||
/**
|
||||
* Modules controller class.
|
||||
*/
|
||||
class J2xmlControllerModules extends JControllerLegacy
|
||||
{
|
||||
|
||||
function __construct ($default = array())
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function display ($cachable = false, $urlparams = false)
|
||||
{
|
||||
$this->input->set('view', 'modules');
|
||||
parent::display($cachable, $urlparams);
|
||||
}
|
||||
|
||||
/**
|
||||
* Export modules in XML format
|
||||
*/
|
||||
function export ()
|
||||
{
|
||||
// Check for request forgeries
|
||||
JSession::checkToken() or jexit('Invalid Token');
|
||||
|
||||
$cid = $this->input->post->get('cid', array(
|
||||
0
|
||||
), 'array');
|
||||
$ids = 'cid=' . implode(',', $cid);
|
||||
$this->setRedirect('index.php?option=com_j2xml&task=modules.display&format=raw&' . $ids);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?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();
|
||||
|
||||
require_once dirname(__FILE__) . '/json.php';
|
||||
|
||||
/**
|
||||
* User notes JSON controller class.
|
||||
*
|
||||
* @since 3.9.213
|
||||
*/
|
||||
class J2xmlControllerUsernotes extends J2xmlControllerJson
|
||||
{
|
||||
|
||||
/**
|
||||
* The _context for persistent state.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_context = 'j2xml.usernotes';
|
||||
}
|
||||
100
administrator/components/com_j2xml/controllers/usernotes.php
Normal file
100
administrator/components/com_j2xml/controllers/usernotes.php
Normal file
@@ -0,0 +1,100 @@
|
||||
<?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();
|
||||
|
||||
/**
|
||||
* User notes controller class.
|
||||
*
|
||||
* @since 3.9.213
|
||||
*/
|
||||
class J2xmlControllerUsernotes extends JControllerLegacy
|
||||
{
|
||||
|
||||
/**
|
||||
* The _context for persistent state.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_context = 'j2xml.usernotes';
|
||||
|
||||
/**
|
||||
* The params object
|
||||
*
|
||||
* @var JRegistry
|
||||
*/
|
||||
protected $params;
|
||||
|
||||
/**
|
||||
* Method to get a model object, loading it if required.
|
||||
*
|
||||
* @param string $name
|
||||
* The name of the model.
|
||||
* @param string $prefix
|
||||
* The prefix for the model class name.
|
||||
* @param array $config
|
||||
* Configuration array for model. Optional.
|
||||
*
|
||||
* @return JModelLegacy
|
||||
*
|
||||
* @since 3.9.0
|
||||
*/
|
||||
public function getModel($name = 'Export', $prefix = 'J2xmlModel', $config = array())
|
||||
{
|
||||
JLog::add(new JLogEntry(__METHOD__, JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
return parent::getModel($name, $prefix, array(
|
||||
'ignore_request' => true
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Display method for the raw users data.
|
||||
*
|
||||
* @param boolean $cachable
|
||||
* If true, the view output will be cached
|
||||
* @param array $urlparams
|
||||
* An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
|
||||
*
|
||||
* @return J2xmlControllerUser This object to support chaining.
|
||||
*
|
||||
* @since 1.5
|
||||
* @todo This should be done as a view, not here!
|
||||
*/
|
||||
function display($cachable = false, $urlparams = false)
|
||||
{
|
||||
JLog::add(new JLogEntry(__METHOD__, JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
$app = JFactory::getApplication();
|
||||
$jform = $app->input->post->get('jform', array(), 'array');
|
||||
$data = array();
|
||||
foreach($jform as $k => $v)
|
||||
{
|
||||
if (substr($k, 0, 7) == 'export_')
|
||||
{
|
||||
$data[substr($k, 7)] = $v;
|
||||
}
|
||||
}
|
||||
// Save the posted data in the session.
|
||||
$app->setUserState('com_j2xml.export.data', $data);
|
||||
JLog::add(new JLogEntry('setUserState(\'com_j2xml.export.data\'): ' . print_r($data, true), JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
$this->input->set('view', 'usernotes');
|
||||
parent::display();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?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();
|
||||
|
||||
require_once dirname(__FILE__) . '/json.php';
|
||||
|
||||
/**
|
||||
* User JSON controller class.
|
||||
*
|
||||
* @since 3.1.112
|
||||
*/
|
||||
class J2xmlControllerUsers extends J2xmlControllerJson
|
||||
{
|
||||
|
||||
/**
|
||||
* The _context for persistent state.
|
||||
*
|
||||
* @var string
|
||||
* @since 3.1.112
|
||||
*/
|
||||
protected $_context = 'j2xml.users';
|
||||
}
|
||||
102
administrator/components/com_j2xml/controllers/users.php
Normal file
102
administrator/components/com_j2xml/controllers/users.php
Normal file
@@ -0,0 +1,102 @@
|
||||
<?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();
|
||||
|
||||
/**
|
||||
* Content controller class.
|
||||
*
|
||||
* @since 1.5.3beta4.39
|
||||
*/
|
||||
class J2xmlControllerUsers extends JControllerLegacy
|
||||
{
|
||||
|
||||
/**
|
||||
* The _context for persistent state.
|
||||
*
|
||||
* @var string
|
||||
* @since 1.8.186
|
||||
*/
|
||||
protected $_context = 'j2xml.users';
|
||||
|
||||
/**
|
||||
* The params object
|
||||
*
|
||||
* @var JRegistry
|
||||
* @since 1.8.186
|
||||
*/
|
||||
protected $params;
|
||||
|
||||
/**
|
||||
* Method to get a model object, loading it if required.
|
||||
*
|
||||
* @param string $name
|
||||
* The name of the model.
|
||||
* @param string $prefix
|
||||
* The prefix for the model class name.
|
||||
* @param array $config
|
||||
* Configuration array for model. Optional.
|
||||
*
|
||||
* @return JModelLegacy
|
||||
*
|
||||
* @since 3.9.0
|
||||
*/
|
||||
public function getModel($name = 'Export', $prefix = 'J2xmlModel', $config = array())
|
||||
{
|
||||
JLog::add(new JLogEntry(__METHOD__, JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
return parent::getModel($name, $prefix, array(
|
||||
'ignore_request' => true
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Display method for the raw users data.
|
||||
*
|
||||
* @param boolean $cachable
|
||||
* If true, the view output will be cached
|
||||
* @param array $urlparams
|
||||
* An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
|
||||
*
|
||||
* @return J2xmlControllerUser This object to support chaining.
|
||||
*
|
||||
* @since 1.5
|
||||
* @todo This should be done as a view, not here!
|
||||
*/
|
||||
function display($cachable = false, $urlparams = false)
|
||||
{
|
||||
JLog::add(new JLogEntry(__METHOD__, JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
$app = JFactory::getApplication();
|
||||
$jform = $app->input->post->get('jform', array(), 'array');
|
||||
$data = array();
|
||||
foreach($jform as $k => $v)
|
||||
{
|
||||
if (substr($k, 0, 7) == 'export_')
|
||||
{
|
||||
$data[substr($k, 7)] = $v;
|
||||
}
|
||||
}
|
||||
// Save the posted data in the session.
|
||||
$app->setUserState('com_j2xml.export.data', $data);
|
||||
JLog::add(new JLogEntry('setUserState(\'com_j2xml.export.data\'): ' . print_r($data, true), JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
$this->input->set('view', 'users');
|
||||
parent::display();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage com_j2xml
|
||||
*
|
||||
* @version 3.9.229-rc1
|
||||
* @since 3.7.192
|
||||
*
|
||||
* @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();
|
||||
|
||||
require_once dirname(__FILE__) . '/json.php';
|
||||
|
||||
/**
|
||||
* Viewlevels controller class.
|
||||
*/
|
||||
class J2xmlControllerUsers extends J2xmlControllerJson
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage com_j2xml
|
||||
*
|
||||
* @version 3.9.229-rc1
|
||||
* @since 3.7.192
|
||||
*
|
||||
* @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();
|
||||
|
||||
/**
|
||||
* Viewlevel controller class.
|
||||
*/
|
||||
class J2xmlControllerViewlevels extends JControllerLegacy
|
||||
{
|
||||
|
||||
function __construct ($default = array())
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
function display ($cachable = false, $urlparams = false)
|
||||
{
|
||||
$this->input->set('view', 'viewlevels');
|
||||
parent::display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Export viewlevels in XML format
|
||||
*/
|
||||
function export ()
|
||||
{
|
||||
// Check for request forgeries
|
||||
JSession::checkToken() or jexit('Invalid Token');
|
||||
|
||||
$cid = $this->input->post->get('cid', array(
|
||||
0
|
||||
), 'array');
|
||||
$id = 'cid=' . implode(',', $cid);
|
||||
$this->setRedirect('index.php?option=com_j2xml&task=viewlevels.display&format=raw&' . $id);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<?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();
|
||||
|
||||
jimport('joomla.application.component.controller');
|
||||
|
||||
require_once dirname(__FILE__) . '/json.php';
|
||||
|
||||
/**
|
||||
* Weblinks controller class.
|
||||
*
|
||||
* @since 3.6.161
|
||||
*/
|
||||
class J2xmlControllerWeblinks extends J2xmlControllerJson
|
||||
{
|
||||
/**
|
||||
* The _context for persistent state.
|
||||
*
|
||||
* @var string
|
||||
* @since 3.1.112
|
||||
*/
|
||||
protected $_context = 'j2xml.weblinks';
|
||||
|
||||
}
|
||||
102
administrator/components/com_j2xml/controllers/weblinks.php
Normal file
102
administrator/components/com_j2xml/controllers/weblinks.php
Normal file
@@ -0,0 +1,102 @@
|
||||
<?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();
|
||||
|
||||
/**
|
||||
* Content controller class.
|
||||
*
|
||||
* @since 3.6.161
|
||||
*/
|
||||
class J2xmlControllerWeblinks extends JControllerLegacy
|
||||
{
|
||||
|
||||
/**
|
||||
* The _context for persistent state.
|
||||
*
|
||||
* @var string
|
||||
* @since 3.6.161
|
||||
*/
|
||||
protected $_context = 'j2xml.weblinks';
|
||||
|
||||
/**
|
||||
* The params object
|
||||
*
|
||||
* @var JRegistry
|
||||
* @since 3.6.161
|
||||
*/
|
||||
protected $params;
|
||||
|
||||
/**
|
||||
* Method to get a model object, loading it if required.
|
||||
*
|
||||
* @param string $name
|
||||
* The name of the model.
|
||||
* @param string $prefix
|
||||
* The prefix for the model class name.
|
||||
* @param array $config
|
||||
* Configuration array for model. Optional.
|
||||
*
|
||||
* @return JModelLegacy
|
||||
*
|
||||
* @since 3.9.0
|
||||
*/
|
||||
public function getModel($name = 'Export', $prefix = 'J2xmlModel', $config = array())
|
||||
{
|
||||
JLog::add(new JLogEntry(__METHOD__, JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
return parent::getModel($name, $prefix, array(
|
||||
'ignore_request' => true
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Display method for the raw weblinks data.
|
||||
*
|
||||
* @param boolean $cachable
|
||||
* If true, the view output will be cached
|
||||
* @param array $urlparams
|
||||
* An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
|
||||
*
|
||||
* @return J2xmlControllerUser This object to support chaining.
|
||||
*
|
||||
* @since 3.6.161
|
||||
* @todo This should be done as a view, not here!
|
||||
*/
|
||||
function display($cachable = false, $urlparams = false)
|
||||
{
|
||||
JLog::add(new JLogEntry(__METHOD__, JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
$app = JFactory::getApplication();
|
||||
$jform = $app->input->post->get('jform', array(), 'array');
|
||||
$data = array();
|
||||
foreach($jform as $k => $v)
|
||||
{
|
||||
if (substr($k, 0, 7) == 'export_')
|
||||
{
|
||||
$data[substr($k, 7)] = $v;
|
||||
}
|
||||
}
|
||||
// Save the posted data in the session.
|
||||
$app->setUserState('com_j2xml.export.data', $data);
|
||||
JLog::add(new JLogEntry('setUserState(\'com_j2xml.export.data\'): ' . print_r($data, true), JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
$this->input->set('view', 'weblinks');
|
||||
parent::display();
|
||||
}
|
||||
}
|
||||
36
administrator/components/com_j2xml/controllers/website.php
Normal file
36
administrator/components/com_j2xml/controllers/website.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?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();
|
||||
|
||||
jimport('joomla.application.component.controllerform');
|
||||
|
||||
/**
|
||||
* Website controller class.
|
||||
*/
|
||||
class J2xmlControllerWebsite extends JControllerForm
|
||||
{
|
||||
|
||||
/**
|
||||
*
|
||||
* @var string The prefix to use with controller messages.
|
||||
* @since 1.6
|
||||
*/
|
||||
protected $text_prefix = 'COM_J2XML_WEBSITE';
|
||||
}
|
||||
56
administrator/components/com_j2xml/controllers/websites.php
Normal file
56
administrator/components/com_j2xml/controllers/websites.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?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();
|
||||
|
||||
jimport('joomla.application.component.controlleradmin');
|
||||
|
||||
/**
|
||||
* Website list controller class.
|
||||
*/
|
||||
class J2xmlControllerWebsites extends JControllerAdmin
|
||||
{
|
||||
|
||||
/**
|
||||
*
|
||||
* @var string The prefix to use with controller messages.
|
||||
* @since 1.6
|
||||
*/
|
||||
protected $text_prefix = 'COM_J2XML_WEBSITES';
|
||||
|
||||
/**
|
||||
* Method to get a model object, loading it if required.
|
||||
*
|
||||
* @param string $name
|
||||
* The model name. Optional.
|
||||
* @param string $prefix
|
||||
* The class prefix. Optional.
|
||||
* @param array $config
|
||||
* Configuration array for model. Optional.
|
||||
*
|
||||
* @return object The model.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
public function getModel ($name = 'Website', $prefix = 'J2XMLModel', $config = array('ignore_request' => true))
|
||||
{
|
||||
$model = parent::getModel($name, $prefix, $config);
|
||||
return $model;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user