first commit
This commit is contained in:
27
administrator/components/com_j2xml/access.xml
Normal file
27
administrator/components/com_j2xml/access.xml
Normal file
@@ -0,0 +1,27 @@
|
||||
<?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.
|
||||
*/
|
||||
-->
|
||||
<access component="com_j2xml">
|
||||
<section name="component">
|
||||
<action name="core.admin" title="JACTION_ADMIN" description="JACTION_ADMIN_COMPONENT_DESC" />
|
||||
<action name="core.options" title="JACTION_OPTIONS" description="JACTION_OPTIONS_COMPONENT_DESC" />
|
||||
<action name="core.manage" title="JACTION_MANAGE" description="JACTION_MANAGE_COMPONENT_DESC" />
|
||||
<action name="core.delete" title="JACTION_DELETE" description="JACTION_DELETE_COMPONENT_DESC" />
|
||||
<action name="core.edit.state" title="JACTION_EDITSTATE" description="JACTION_EDITSTATE_COMPONENT_DESC" />
|
||||
</section>
|
||||
</access>
|
||||
436
administrator/components/com_j2xml/config.xml
Normal file
436
administrator/components/com_j2xml/config.xml
Normal file
@@ -0,0 +1,436 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
/**
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage Components.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.
|
||||
*/
|
||||
-->
|
||||
<config>
|
||||
<fieldset name="export"
|
||||
label="COM_J2XML_CONFIG_EXPORT_HEADER_LABEL">
|
||||
<field
|
||||
name="export_compression"
|
||||
type="radio"
|
||||
label="COM_J2XML_CONFIG_COMPRESS_LABEL"
|
||||
description="COM_J2XML_CONFIG_COMPRESS_DESC"
|
||||
default="0"
|
||||
class="btn-group btn-group-yesno"
|
||||
layout="joomla.form.field.radio.switcher">
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
<field
|
||||
name="export_fields"
|
||||
type="radio"
|
||||
label="COM_J2XML_CONFIG_FIELDS_LABEL"
|
||||
description="COM_J2XML_CONFIG_EXPORT_FIELDS_DESC"
|
||||
default="0"
|
||||
class="btn-group btn-group-yesno"
|
||||
layout="joomla.form.field.radio.switcher">
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
<field
|
||||
name="export_images"
|
||||
type="radio"
|
||||
label="COM_J2XML_CONFIG_IMAGES_LABEL"
|
||||
description="COM_J2XML_CONFIG_EXPORT_IMAGES_DESC"
|
||||
default="0"
|
||||
class="btn-group btn-group-yesno"
|
||||
layout="joomla.form.field.radio.switcher">
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
<field
|
||||
name="export_tags"
|
||||
type="radio"
|
||||
label="COM_J2XML_CONFIG_TAGS_LABEL"
|
||||
description="COM_J2XML_CONFIG_EXPORT_TAGS_DESC"
|
||||
default="1"
|
||||
class="btn-group btn-group-yesno"
|
||||
layout="joomla.form.field.radio.switcher">
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
<field
|
||||
name="export_contacts"
|
||||
type="radio"
|
||||
label="COM_J2XML_CONFIG_CONTACTS_LABEL"
|
||||
description="COM_J2XML_CONFIG_EXPORT_CONTACTS_DESC"
|
||||
default="1"
|
||||
class="btn-group btn-group-yesno"
|
||||
layout="joomla.form.field.radio.switcher">
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
|
||||
<field name="spacer1" type="spacer" hr="true" />
|
||||
|
||||
<field
|
||||
name="export_users"
|
||||
type="radio"
|
||||
label="COM_J2XML_CONFIG_USERS_LABEL"
|
||||
description="COM_J2XML_CONFIG_EXPORT_USERS_DESC"
|
||||
default="1"
|
||||
class="btn-group btn-group-yesno"
|
||||
layout="joomla.form.field.radio.switcher">
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
<field
|
||||
name="export_password"
|
||||
type="radio"
|
||||
label="COM_J2XML_CONFIG_PASSWORD_LABEL"
|
||||
description="COM_J2XML_CONFIG_EXPORT_PASSWORD_DESC"
|
||||
default="0"
|
||||
class="btn-group btn-group-yesno"
|
||||
layout="joomla.form.field.radio.switcher"
|
||||
showon="export_users!:0">
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
<field
|
||||
name="export_usernotes"
|
||||
type="radio"
|
||||
label="COM_J2XML_CONFIG_USERNOTES_LABEL"
|
||||
description="COM_J2XML_CONFIG_EXPORT_USERNOTES_DESC"
|
||||
default="0"
|
||||
class="btn-group btn-group-yesno"
|
||||
layout="joomla.form.field.radio.switcher"
|
||||
showon="export_users!:0">
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
|
||||
<field name="spacer2" type="spacer" hr="true" />
|
||||
|
||||
<field
|
||||
name="export_categories"
|
||||
type="radio"
|
||||
label="COM_J2XML_CONFIG_CATEGORIES_LABEL"
|
||||
description="COM_J2XML_CONFIG_EXPORT_CATEGORIES_DESC"
|
||||
default="1"
|
||||
class="btn-group btn-group-yesno"
|
||||
layout="joomla.form.field.radio.switcher">
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
|
||||
</fieldset>
|
||||
|
||||
<fieldset name="import"
|
||||
label="COM_J2XML_CONFIG_IMPORT_HEADER_LABEL">
|
||||
<field
|
||||
name="import_keep_id"
|
||||
type="radio"
|
||||
class="btn-group btn-group-yesno"
|
||||
layout="joomla.form.field.radio.switcher"
|
||||
default="0"
|
||||
label="COM_J2XML_CONFIG_KEEP_ID_LABEL"
|
||||
description="COM_J2XML_CONFIG_KEEP_ID_DESC">
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
<field
|
||||
name="import_fields"
|
||||
type="list"
|
||||
default="0"
|
||||
label="COM_J2XML_CONFIG_FIELDS_LABEL"
|
||||
description="COM_J2XML_CONFIG_IMPORT_FIELDS_DESC">
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">COM_J2XML_YES_IF_NOT_EXISTS</option>
|
||||
<option value="2">COM_J2XML_YES_OVERWRITE_IF_EXISTS</option>
|
||||
</field>
|
||||
<field
|
||||
name="import_images"
|
||||
type="radio"
|
||||
label="COM_J2XML_CONFIG_IMAGES_LABEL"
|
||||
description="COM_J2XML_CONFIG_IMPORT_IMAGES_DESC"
|
||||
default="0"
|
||||
class="btn-group btn-group-yesno"
|
||||
layout="joomla.form.field.radio.switcher">
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
<field
|
||||
name="import_tags"
|
||||
type="radio"
|
||||
label="COM_J2XML_CONFIG_TAGS_LABEL"
|
||||
description="COM_J2XML_CONFIG_IMPORT_TAGS_DESC"
|
||||
default="1"
|
||||
class="btn-group btn-group-yesno"
|
||||
layout="joomla.form.field.radio.switcher">
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
<field
|
||||
name="import_contacts"
|
||||
type="radio"
|
||||
label="COM_J2XML_CONFIG_CONTACTS_LABEL"
|
||||
description="COM_J2XML_CONFIG_IMPORT_CONTACTS_DESC"
|
||||
default="1"
|
||||
class="btn-group btn-group-yesno"
|
||||
layout="joomla.form.field.radio.switcher">
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
|
||||
<field name="spacer3" type="spacer" hr="true" />
|
||||
|
||||
<field
|
||||
name="import_users"
|
||||
type="list"
|
||||
default="1"
|
||||
label="COM_J2XML_CONFIG_USERS_LABEL"
|
||||
description="COM_J2XML_CONFIG_IMPORT_USERS_DESC">
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">COM_J2XML_YES_IF_NOT_EXISTS</option>
|
||||
<option value="2">COM_J2XML_YES_OVERWRITE_IF_EXISTS</option>
|
||||
</field>
|
||||
<field
|
||||
name="import_keep_user_id"
|
||||
type="radio"
|
||||
class="btn-group btn-group-yesno"
|
||||
layout="joomla.form.field.radio.switcher"
|
||||
default="0"
|
||||
label="COM_J2XML_CONFIG_KEEP_USER_ID_LABEL"
|
||||
description="COM_J2XML_CONFIG_KEEP_USER_ID_DESC"
|
||||
showon="import_users:1,2">
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
<field
|
||||
name="import_password"
|
||||
type="radio"
|
||||
label="COM_J2XML_CONFIG_PASSWORD_LABEL"
|
||||
description="COM_J2XML_CONFIG_IMPORT_PASSWORD_DESC"
|
||||
default="0"
|
||||
class="btn-group btn-group-yesno"
|
||||
layout="joomla.form.field.radio.switcher"
|
||||
showon="import_users:1,2">
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
<field
|
||||
name="import_superusers"
|
||||
type="radio"
|
||||
class="btn-group btn-group-yesno"
|
||||
layout="joomla.form.field.radio.switcher"
|
||||
default="0"
|
||||
label="COM_J2XML_CONFIG_SUPERUSERS_LABEL"
|
||||
description="COM_J2XML_CONFIG_IMPORT_SUPERUSERS_DESC"
|
||||
showon="import_users:1,2">
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
<field
|
||||
name="import_usernotes"
|
||||
type="radio"
|
||||
label="COM_J2XML_CONFIG_USERNOTES_LABEL"
|
||||
description="COM_J2XML_CONFIG_IMPORT_USERNOTES_DESC"
|
||||
default="0"
|
||||
class="btn-group btn-group-yesno"
|
||||
layout="joomla.form.field.radio.switcher"
|
||||
showon="import_users:1,2">
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
|
||||
<field name="spacer4" type="spacer" hr="true" />
|
||||
|
||||
<field
|
||||
name="com_content_category_default"
|
||||
type="category"
|
||||
extension="com_content"
|
||||
label="COM_J2XML_CONFIG_IMPORT_CONTENT_DEFAULT_CATEGORY_LABEL"
|
||||
description="COM_J2XML_CONFIG_IMPORT_CONTENT_DEFAULT_CATEGORY_DESC" />
|
||||
</fieldset>
|
||||
|
||||
<fieldset name="send"
|
||||
label="COM_J2XML_CONFIG_SEND_HEADER_LABEL">
|
||||
<field
|
||||
name="send_compression"
|
||||
type="radio"
|
||||
label="COM_J2XML_CONFIG_COMPRESS_LABEL"
|
||||
description="COM_J2XML_CONFIG_COMPRESS_DESC"
|
||||
default="0"
|
||||
class="btn-group btn-group-yesno"
|
||||
layout="joomla.form.field.radio.switcher">
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
<field
|
||||
name="send_fields"
|
||||
type="list"
|
||||
default="0"
|
||||
label="COM_J2XML_CONFIG_FIELDS_LABEL"
|
||||
description="COM_J2XML_CONFIG_SEND_FIELDS_DESC">
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">COM_J2XML_YES_IF_NOT_EXISTS</option>
|
||||
<option value="2">COM_J2XML_YES_OVERWRITE_IF_EXISTS</option>
|
||||
</field>
|
||||
<field
|
||||
name="send_images"
|
||||
type="list"
|
||||
label="COM_J2XML_CONFIG_IMAGES_LABEL"
|
||||
description="COM_J2XML_CONFIG_SEND_IMAGES_DESC"
|
||||
default="0">
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
<field
|
||||
name="send_tags"
|
||||
type="list"
|
||||
label="COM_J2XML_CONFIG_TAGS_LABEL"
|
||||
description="COM_J2XML_CONFIG_SEND_TAGS_DESC"
|
||||
default="1">
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
<field
|
||||
name="send_contacts"
|
||||
type="list"
|
||||
label="COM_J2XML_CONFIG_CONTACTS_LABEL"
|
||||
description="COM_J2XML_CONFIG_SEND_CONTACTS_DESC"
|
||||
default="1">
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="spacer3"
|
||||
type="spacer"
|
||||
hr="true"
|
||||
/>
|
||||
|
||||
<field
|
||||
name="send_users"
|
||||
type="list"
|
||||
default="1"
|
||||
label="COM_J2XML_CONFIG_USERS_LABEL"
|
||||
description="COM_J2XML_CONFIG_SEND_USERS_DESC">
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">COM_J2XML_YES_IF_NOT_EXISTS</option>
|
||||
<option value="2">COM_J2XML_YES_OVERWRITE_IF_EXISTS</option>
|
||||
</field>
|
||||
<field
|
||||
name="send_keep_user_id"
|
||||
type="list"
|
||||
default="0"
|
||||
label="COM_J2XML_CONFIG_KEEP_USER_ID_LABEL"
|
||||
description="COM_J2XML_CONFIG_KEEP_USER_ID_DESC"
|
||||
showon="send_users!:0">
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="1">JYES</option>
|
||||
<option value="0">JNO</option>
|
||||
</field>
|
||||
<field
|
||||
name="send_password"
|
||||
type="list"
|
||||
label="COM_J2XML_CONFIG_PASSWORD_LABEL"
|
||||
description="COM_J2XML_CONFIG_SEND_PASSWORD_DESC"
|
||||
default="0"
|
||||
showon="send_users!:0">
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="1">JYES</option>
|
||||
<option value="0">JNO</option>
|
||||
</field>
|
||||
<field
|
||||
name="send_superusers"
|
||||
type="list"
|
||||
default="0"
|
||||
label="COM_J2XML_CONFIG_SUPERUSERS_LABEL"
|
||||
description="COM_J2XML_CONFIG_IMPORT_SUPERUSERS_DESC"
|
||||
showon="send_users:1,2">
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="1">JYES</option>
|
||||
<option value="0">JNO</option>
|
||||
</field>
|
||||
<field
|
||||
name="send_usernotes"
|
||||
type="list"
|
||||
default="0"
|
||||
label="COM_J2XML_CONFIG_USERNOTES_LABEL"
|
||||
description="COM_J2XML_CONFIG_IMPORT_USERNOTES_DESC"
|
||||
showon="send_users:1,2">
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="1">JYES</option>
|
||||
<option value="0">JNO</option>
|
||||
</field>
|
||||
</fieldset>
|
||||
|
||||
<fieldset
|
||||
name="advanced"
|
||||
label="COM_J2XML_CONFIG_ADVANCED_HEADER_LABEL">
|
||||
<field name="debug"
|
||||
type="radio"
|
||||
class="btn-group btn-group-yesno"
|
||||
layout="joomla.form.field.radio.switcher"
|
||||
default="0"
|
||||
description="COM_J2XML_DEBUG_SYSTEM_DESC" label="COM_J2XML_DEBUG_SYSTEM_LABEL"
|
||||
>
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
|
||||
<field name="log"
|
||||
type="text"
|
||||
label="COM_J2XML_DEBUG_FILENAME_LABEL"
|
||||
description="COM_J2XML_DEBUG_FILENAME_DESC"
|
||||
default="eshiol.log.php"
|
||||
showon="debug:1"
|
||||
/>
|
||||
|
||||
<field name="ajax"
|
||||
type="radio"
|
||||
class="btn-group btn-group-yesno"
|
||||
layout="joomla.form.field.radio.switcher"
|
||||
default="1"
|
||||
description="COM_J2XML_AJAX_DESC"
|
||||
label="COM_J2XML_AJAX_LABEL"
|
||||
>
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="xmlrpc"
|
||||
type="radio"
|
||||
class="btn-group btn-group-yesno"
|
||||
layout="joomla.form.field.radio.switcher"
|
||||
default="0"
|
||||
label="COM_J2XML_XMLRPC_LABEL"
|
||||
description="COM_J2XML_XMLRPC_DESC">
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="haltonerror"
|
||||
type="radio"
|
||||
class="btn-group btn-group-yesno"
|
||||
layout="joomla.form.field.radio.switcher"
|
||||
default="1"
|
||||
label="COM_J2XML_HALTONERROR_LABEL"
|
||||
description="COM_J2XML_HALTONERROR_DESC">
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
</fieldset>
|
||||
</config>
|
||||
76
administrator/components/com_j2xml/controller.php
Normal file
76
administrator/components/com_j2xml/controller.php
Normal file
@@ -0,0 +1,76 @@
|
||||
<?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');
|
||||
|
||||
/**
|
||||
* J2XML master display controller
|
||||
*
|
||||
* @since 1.5.3
|
||||
*/
|
||||
class J2xmlController extends JControllerLegacy
|
||||
{
|
||||
|
||||
/**
|
||||
* Method to display a view.
|
||||
*
|
||||
* @param
|
||||
* boolean If true, the view output will be cached
|
||||
* @param
|
||||
* array An array of safe url parameters and their variable types, for valid values see {@link JFilterInput::clean()}.
|
||||
*
|
||||
* @return JController This object to support chaining.
|
||||
* @since 1.5
|
||||
*/
|
||||
public function display($cachable = false, $urlparams = false)
|
||||
{
|
||||
JLog::add(new JLogEntry(__METHOD__, JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
// Get the document object.
|
||||
$document = JFactory::getDocument();
|
||||
|
||||
// Set the default view name and format from the Request.
|
||||
$vName = $this->input->get('view', 'import');
|
||||
$vFormat = $document->getType();
|
||||
$lName = $this->input->get('layout', 'default', 'string');
|
||||
|
||||
// Get and render the view.
|
||||
if ($view = $this->getView($vName, $vFormat))
|
||||
{
|
||||
$ftp = JClientHelper::setCredentialsFromRequest('ftp');
|
||||
$view->ftp = &$ftp;
|
||||
|
||||
// Get the model for the view.
|
||||
$model = $this->getModel($vName, 'J2xmlModel');
|
||||
$model->getState();
|
||||
|
||||
// Push the model into the view (as default).
|
||||
$view->setModel($model, true);
|
||||
$view->setLayout($lName);
|
||||
|
||||
// Push document object into the view.
|
||||
$view->document = $document;
|
||||
|
||||
$view->display();
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
124
administrator/components/com_j2xml/j2xml.php
Normal file
124
administrator/components/com_j2xml/j2xml.php
Normal file
@@ -0,0 +1,124 @@
|
||||
<?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::registerNamespace('eshiol\\j2xml', JPATH_LIBRARIES);
|
||||
|
||||
$params = JComponentHelper::getParams('com_j2xml');
|
||||
if ($params->get('debug', 0))
|
||||
{
|
||||
ini_set('display_errors', 'On');
|
||||
error_reporting(E_ALL | E_STRICT);
|
||||
}
|
||||
|
||||
JLoader::import('joomla.log.log');
|
||||
if ($params->get('debug') || defined('JDEBUG') && JDEBUG)
|
||||
{
|
||||
JLog::addLogger(
|
||||
array('text_file' => $params->get('log', 'eshiol.log.php'), 'extension' => 'com_j2xml_file'),
|
||||
JLog::DEBUG | JLog::ERROR,
|
||||
array('lib_j2xml', 'com_j2xml'));
|
||||
}
|
||||
JLog::addLogger(
|
||||
array('logger' => 'messagequeue', 'extension' => 'com_j2xml'),
|
||||
JLog::ALL & ~JLog::DEBUG,
|
||||
array('lib_j2xml', 'com_j2xml'));
|
||||
|
||||
$version = new JVersion();
|
||||
JFactory::getDocument()->addScriptOptions('J2XML', array('Joomla' => ($version->isCompatible('4') ? 4 : 3) ));
|
||||
|
||||
// Merge the default translation with the current translation
|
||||
$lang = JFactory::getApplication()->getLanguage();
|
||||
// Back-end translation
|
||||
$lang->load('com_j2xml', JPATH_ADMINISTRATOR, 'en-GB', true);
|
||||
$lang->load('com_j2xml', JPATH_ADMINISTRATOR, $lang->getDefault(), true);
|
||||
$lang->load('com_j2xml', JPATH_ADMINISTRATOR, null, true);
|
||||
|
||||
$lang->load('lib_j2xml', JPATH_SITE, null, false, false) || $lang->load('lib_j2xml', JPATH_ADMINISTRATOR, null, false, false) ||
|
||||
// Fallback to the lib_j2xml file in the default language
|
||||
$lang->load('lib_j2xml', JPATH_SITE, null, true) || $lang->load('lib_j2xml', JPATH_ADMINISTRATOR, null, true);
|
||||
|
||||
$jinput = JFactory::getApplication()->input;
|
||||
$controllerClass = 'J2xmlController';
|
||||
$task = $jinput->getCmd('task', '');
|
||||
|
||||
if (strpos($task, '.') === false)
|
||||
{
|
||||
$controllerPath = JPATH_COMPONENT_ADMINISTRATOR . '/controller.php';
|
||||
}
|
||||
else
|
||||
{
|
||||
// We have a defined controller/task pair -- lets split them out
|
||||
list ($controllerName, $task) = explode('.', $task);
|
||||
|
||||
// Define the controller name and path
|
||||
$controllerName = strtolower($controllerName);
|
||||
|
||||
$controllerPath = JPATH_COMPONENT_ADMINISTRATOR . '/controllers/' . $controllerName;
|
||||
$format = $jinput->getCmd('format');
|
||||
if ($format == 'json')
|
||||
{
|
||||
$controllerPath .= '.' . strtolower($format);
|
||||
}
|
||||
$controllerPath .= '.php';
|
||||
// Set the name for the controller and instantiate it
|
||||
$controllerClass .= ucfirst($controllerName);
|
||||
}
|
||||
|
||||
// If the controller file path exists, include it ... else lets die with a 500 error
|
||||
if (file_exists($controllerPath))
|
||||
{
|
||||
require_once ($controllerPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new \Exception('Invalid Controller ' . $controllerName);
|
||||
}
|
||||
|
||||
if (class_exists($controllerClass))
|
||||
{
|
||||
$controller = new $controllerClass();
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new \Exception('Invalid Controller Class ' . $controllerClass);
|
||||
}
|
||||
|
||||
// $config = JFactory::getConfig();
|
||||
|
||||
JLog::add(new JLogEntry("{$controllerClass}::execute({$task})", JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
// Perform the Request task
|
||||
$controller->execute($task);
|
||||
|
||||
// Redirect if set by the controller
|
||||
$controller->redirect();
|
||||
|
||||
/*
|
||||
JHtml::_('behavior.tabstate');
|
||||
|
||||
if (!JFactory::getUser()->authorise('core.manage', 'com_j2xml'))
|
||||
{
|
||||
throw new JAccessExceptionNotallowed(JText::_('JERROR_ALERTNOAUTHOR'), 403);
|
||||
}
|
||||
|
||||
$controller = JControllerLegacy::getInstance('J2xml');
|
||||
$controller->execute(JFactory::getApplication()->input->get('task'));
|
||||
$controller->redirect();
|
||||
*/
|
||||
61
administrator/components/com_j2xml/j2xml.xml
Normal file
61
administrator/components/com_j2xml/j2xml.xml
Normal file
@@ -0,0 +1,61 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<extension version="3.0" type="component" method="upgrade">
|
||||
<name>com_j2xml</name>
|
||||
<creationDate>06 March 2023</creationDate>
|
||||
<author>Helios Ciancio</author>
|
||||
<authorUrl>www.eshiol.it</authorUrl>
|
||||
<authorEmail>info (at) eshiol (dot) it</authorEmail>
|
||||
<copyright><![CDATA[(C) 2010 - 2023 Helios Ciancio <info (at) eshiol (dot) it> (https://www.eshiol.it). All Rights Reserved.
|
||||
]]></copyright>
|
||||
<license>http://www.gnu.org/licenses/gpl-3.0.html GNU/GPL v3</license>
|
||||
<version>3.9.229-rc1</version>
|
||||
<description>COM_J2XML_XML_DESCRIPTION</description>
|
||||
<install>
|
||||
<sql>
|
||||
<file driver="mysql" charset="utf8">sql/install.mysql.utf8.sql</file>
|
||||
<file driver="postgresql" charset="utf8">sql/install.postgresql.utf8.sql</file>
|
||||
</sql>
|
||||
</install>
|
||||
<uninstall>
|
||||
<sql>
|
||||
<file driver="mysql" charset="utf8">sql/uninstall.mysql.utf8.sql</file>
|
||||
<file driver="postgresql" charset="utf8">sql/uninstall.postgresql.utf8.sql</file>
|
||||
</sql>
|
||||
</uninstall>
|
||||
<update>
|
||||
<schemas>
|
||||
<schemapath type="mysql">sql/updates/mysql</schemapath>
|
||||
<schemapath type="postgresql">sql/updates/postgresql</schemapath>
|
||||
</schemas>
|
||||
</update>
|
||||
<files folder="site">
|
||||
<filename>j2xml.php</filename>
|
||||
<folder>controllers</folder>
|
||||
<folder>helpers</folder>
|
||||
</files>
|
||||
<administration>
|
||||
<!-- Administration Menu Section -->
|
||||
<menu>com_j2xml</menu>
|
||||
<!-- Administration Main File Copy Section -->
|
||||
<!-- Note the folder attribute: This attribute describes the folder
|
||||
to copy FROM in the package to install therefore files copied
|
||||
in this section are copied from /admin/ in the package -->
|
||||
<files folder="admin">
|
||||
<filename>j2xml.php</filename>
|
||||
<filename>access.xml</filename>
|
||||
<filename>config.xml</filename>
|
||||
<filename>controller.php</filename>
|
||||
<folder>controllers</folder>
|
||||
<folder>models</folder>
|
||||
<folder>sql</folder>
|
||||
<folder>views</folder>
|
||||
</files>
|
||||
<languages folder="admin/language">
|
||||
<language tag="en-GB">en-GB/en-GB.com_j2xml.ini</language>
|
||||
<language tag="en-GB">en-GB/en-GB.com_j2xml.sys.ini</language>
|
||||
</languages>
|
||||
</administration>
|
||||
<media destination="com_j2xml" folder="media">
|
||||
<folder>js</folder>
|
||||
</media>
|
||||
</extension>
|
||||
155
administrator/components/com_j2xml/models/export.php
Normal file
155
administrator/components/com_j2xml/models/export.php
Normal file
@@ -0,0 +1,155 @@
|
||||
<?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();
|
||||
|
||||
/**
|
||||
* Export model.
|
||||
*
|
||||
* @since 3.9.0
|
||||
*/
|
||||
class J2xmlModelExport extends JModelForm
|
||||
{
|
||||
|
||||
/**
|
||||
* The model context
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_context = 'j2xml';
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param array $config
|
||||
* An optional associative array of configuration settings.
|
||||
*
|
||||
* @see JModelLegacy
|
||||
* @since 3.9.0
|
||||
*/
|
||||
public function __construct($config = array())
|
||||
{
|
||||
JLog::add(new JLogEntry(__METHOD__, JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
$layout = JFactory::getApplication()->input->get('layout', 'default');
|
||||
if ($layout != 'default')
|
||||
{
|
||||
$this->_context .= '.' . $layout;
|
||||
}
|
||||
|
||||
parent::__construct($config);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the record form.
|
||||
*
|
||||
* @param array $data
|
||||
* Data for the form.
|
||||
* @param boolean $loadData
|
||||
* True if the form is to load its own data (default case), false if not.
|
||||
*
|
||||
* @return JForm|boolean A JForm object on success, false on failure
|
||||
*
|
||||
* @since 3.9.0
|
||||
*/
|
||||
public function getForm($data = array(), $loadData = true)
|
||||
{
|
||||
JLog::add(new JLogEntry(__METHOD__, JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
try
|
||||
{
|
||||
$form = $this->loadForm($this->_context, 'export', array(
|
||||
'control' => 'jform',
|
||||
'load_data' => false
|
||||
));
|
||||
|
||||
$layout = JFactory::getApplication()->input->get('layout', 'default');
|
||||
if ($layout != 'default')
|
||||
{
|
||||
$form->loadFile('export_' . $layout);
|
||||
|
||||
if ($layout != 'users')
|
||||
{
|
||||
$form->loadFile('export_users');
|
||||
/* if ($layout == 'contact')
|
||||
{
|
||||
$form->setFieldAttribute('export_contacts', 'type', 'hidden');
|
||||
} */
|
||||
}
|
||||
/* else
|
||||
{
|
||||
$form->setFieldAttribute('export_users', 'type', 'hidden');
|
||||
} */
|
||||
}
|
||||
|
||||
if ($loadData)
|
||||
{
|
||||
// Get the data for the form.
|
||||
$data = $this->loadFormData();
|
||||
}
|
||||
else
|
||||
{
|
||||
$data = array();
|
||||
}
|
||||
|
||||
// Allow for additional modification of the form, and events to be triggered.
|
||||
// We pass the data because plugins may require it.
|
||||
$this->preprocessForm($form, $data);
|
||||
|
||||
// Load the data into the form after the plugins have operated.
|
||||
$form->bind($data);
|
||||
}
|
||||
catch (\Exception $e)
|
||||
{
|
||||
$this->setError($e->getMessage());
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return $form;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the data that should be injected in the form.
|
||||
*
|
||||
* @return mixed The data for the form.
|
||||
*
|
||||
* @since 3.9.0
|
||||
*/
|
||||
protected function loadFormData()
|
||||
{
|
||||
JLog::add(new JLogEntry(__METHOD__, JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
// Check the session for previously entered form data.
|
||||
$data = JFactory::getApplication()->getUserState('com_j2xml.export.data', array());
|
||||
JLog::add(new JLogEntry('getUserState(\'com_j2xml.export.data\'): ' . print_r($data, true), JLog::DEBUG, 'com_j2xml'));
|
||||
$jform = array();
|
||||
foreach($data as $k => $v)
|
||||
{
|
||||
$jform['export_' . $k] = $v;
|
||||
}
|
||||
|
||||
$params = JComponentHelper::getParams('com_j2xml');
|
||||
$data = array_merge($params->toArray(), $jform);
|
||||
JLog::add(new JLogEntry('data: ' . print_r($data, true), JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
$this->preprocessData($this->_context, $data);
|
||||
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
81
administrator/components/com_j2xml/models/forms/export.xml
Normal file
81
administrator/components/com_j2xml/models/forms/export.xml
Normal file
@@ -0,0 +1,81 @@
|
||||
<?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.
|
||||
*/
|
||||
-->
|
||||
<form>
|
||||
<fieldset name="export">
|
||||
<field
|
||||
name="cid"
|
||||
type="hidden"
|
||||
/>
|
||||
<field
|
||||
name="export_compression"
|
||||
type="radio"
|
||||
label="COM_J2XML_CONFIG_COMPRESS_LABEL"
|
||||
description="COM_J2XML_CONFIG_COMPRESS_DESC"
|
||||
default="0"
|
||||
class="btn-group btn-group-yesno"
|
||||
layout="joomla.form.field.radio.switcher">
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
<field
|
||||
name="export_categories"
|
||||
type="radio"
|
||||
label="COM_J2XML_CONFIG_CATEGORIES_LABEL"
|
||||
description="COM_J2XML_CONFIG_EXPORT_CATEGORIES_DESC"
|
||||
default="1"
|
||||
class="btn-group btn-group-yesno"
|
||||
layout="joomla.form.field.radio.switcher">
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
<field
|
||||
name="export_fields"
|
||||
type="radio"
|
||||
label="COM_J2XML_CONFIG_FIELDS_LABEL"
|
||||
description="COM_J2XML_CONFIG_EXPORT_FIELDS_DESC"
|
||||
default="0"
|
||||
class="btn-group btn-group-yesno"
|
||||
layout="joomla.form.field.radio.switcher">
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
<field
|
||||
name="export_images"
|
||||
type="radio"
|
||||
label="COM_J2XML_CONFIG_IMAGES_LABEL"
|
||||
description="COM_J2XML_CONFIG_EXPORT_IMAGES_DESC"
|
||||
default="0"
|
||||
class="btn-group btn-group-yesno"
|
||||
layout="joomla.form.field.radio.switcher">
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
<field
|
||||
name="export_tags"
|
||||
type="radio"
|
||||
label="COM_J2XML_CONFIG_TAGS_LABEL"
|
||||
description="COM_J2XML_CONFIG_EXPORT_TAGS_DESC"
|
||||
default="1"
|
||||
class="btn-group btn-group-yesno"
|
||||
layout="joomla.form.field.radio.switcher">
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
</fieldset>
|
||||
</form>
|
||||
@@ -0,0 +1,23 @@
|
||||
<?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.
|
||||
*/
|
||||
-->
|
||||
<form>
|
||||
<fieldset name="content">
|
||||
<field name="note1" type="note" description="COM_J2XML_CONFIG_EXPORT_CONTENT_DESC" />
|
||||
</fieldset>
|
||||
</form>
|
||||
@@ -0,0 +1,68 @@
|
||||
<?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.
|
||||
*/
|
||||
-->
|
||||
<form>
|
||||
<fieldset name="users">
|
||||
<field
|
||||
name="export_users"
|
||||
type="radio"
|
||||
label="COM_J2XML_CONFIG_USERS_LABEL"
|
||||
description="COM_J2XML_CONFIG_EXPORT_USERS_DESC"
|
||||
default="0"
|
||||
class="btn-group btn-group-yesno"
|
||||
layout="joomla.form.field.radio.switcher">
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
<field
|
||||
name="export_password"
|
||||
type="radio"
|
||||
label="COM_J2XML_CONFIG_PASSWORD_LABEL"
|
||||
description="COM_J2XML_CONFIG_EXPORT_PASSWORD_DESC"
|
||||
default="0"
|
||||
class="btn-group btn-group-yesno"
|
||||
layout="joomla.form.field.radio.switcher"
|
||||
showon="export_users:1">
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
<field
|
||||
name="export_usernotes"
|
||||
type="radio"
|
||||
label="COM_J2XML_CONFIG_USERNOTES_LABEL"
|
||||
description="COM_J2XML_CONFIG_EXPORT_USERNOTES_DESC"
|
||||
default="0"
|
||||
class="btn-group btn-group-yesno"
|
||||
layout="joomla.form.field.radio.switcher"
|
||||
showon="export_users:1">
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
<field
|
||||
name="export_contacts"
|
||||
type="radio"
|
||||
label="COM_J2XML_CONFIG_CONTACTS_LABEL"
|
||||
description="COM_J2XML_CONFIG_EXPORT_CONTACTS_DESC"
|
||||
default="0"
|
||||
class="btn-group btn-group-yesno"
|
||||
layout="joomla.form.field.radio.switcher">
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
</fieldset>
|
||||
</form>
|
||||
203
administrator/components/com_j2xml/models/forms/import.xml
Normal file
203
administrator/components/com_j2xml/models/forms/import.xml
Normal file
@@ -0,0 +1,203 @@
|
||||
<?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.
|
||||
*/
|
||||
-->
|
||||
<form>
|
||||
<fieldset name="import">
|
||||
<field
|
||||
name="import_content"
|
||||
type="list"
|
||||
default="2"
|
||||
label="COM_J2XML_CONFIG_CONTENT_LABEL"
|
||||
description="COM_J2XML_CONFIG_IMPORT_CONTENT_DESC">
|
||||
<option
|
||||
value="">JGLOBAL_USE_GLOBAL
|
||||
</option>
|
||||
<option
|
||||
value="1">COM_J2XML_YES_IF_NOT_EXISTS
|
||||
</option>
|
||||
<option
|
||||
value="2">COM_J2XML_YES_OVERWRITE_IF_EXISTS
|
||||
</option>
|
||||
<option
|
||||
value="3">COM_J2XML_YES_OVERWRITE_IF_NEWER
|
||||
</option>
|
||||
</field>
|
||||
<field
|
||||
name="import_fields"
|
||||
type="list"
|
||||
default="0"
|
||||
label="COM_J2XML_CONFIG_FIELDS_LABEL"
|
||||
description="COM_J2XML_CONFIG_IMPORT_FIELDS_DESC">
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">COM_J2XML_YES_IF_NOT_EXISTS</option>
|
||||
<option value="2">COM_J2XML_YES_OVERWRITE_IF_EXISTS</option>
|
||||
</field>
|
||||
<field
|
||||
name="import_images"
|
||||
type="radio"
|
||||
label="COM_J2XML_CONFIG_IMAGES_LABEL"
|
||||
description="COM_J2XML_CONFIG_IMPORT_IMAGES_DESC"
|
||||
default="0"
|
||||
class="btn-group btn-group-yesno"
|
||||
layout="joomla.form.field.radio.switcher">
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
<field
|
||||
name="import_tags"
|
||||
type="radio"
|
||||
label="COM_J2XML_CONFIG_TAGS_LABEL"
|
||||
description="COM_J2XML_CONFIG_IMPORT_TAGS_DESC"
|
||||
default="1"
|
||||
class="btn-group btn-group-yesno"
|
||||
layout="joomla.form.field.radio.switcher">
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
<field
|
||||
name="import_contacts"
|
||||
type="list"
|
||||
label="COM_J2XML_CONFIG_CONTACTS_LABEL"
|
||||
description="COM_J2XML_CONFIG_IMPORT_CONTACTS_DESC"
|
||||
default="0"
|
||||
showon="import_users:1,2">
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
<option value="2">COM_J2XML_YES_OVERWRITE_IF_EXISTS</option>
|
||||
</field>
|
||||
<field
|
||||
name="import_categories"
|
||||
type="list"
|
||||
default="1"
|
||||
label="COM_J2XML_CONFIG_CATEGORIES_LABEL"
|
||||
description="COM_J2XML_CONFIG_IMPORT_CATEGORIES_DESC">
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">COM_J2XML_YES_IF_NOT_EXISTS</option>
|
||||
<option value="2">COM_J2XML_YES_OVERWRITE_IF_EXISTS</option>
|
||||
</field>
|
||||
</fieldset>
|
||||
<fieldset name="users">
|
||||
<field
|
||||
name="import_users"
|
||||
type="list"
|
||||
default="1"
|
||||
label="COM_J2XML_CONFIG_USERS_LABEL"
|
||||
description="COM_J2XML_CONFIG_IMPORT_USERS_DESC">
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">COM_J2XML_YES_IF_NOT_EXISTS</option>
|
||||
<option value="2">COM_J2XML_YES_OVERWRITE_IF_EXISTS</option>
|
||||
</field>
|
||||
<field
|
||||
name="import_keep_user_id"
|
||||
type="radio"
|
||||
class="btn-group btn-group-yesno"
|
||||
layout="joomla.form.field.radio.switcher"
|
||||
default="0"
|
||||
label="COM_J2XML_CONFIG_KEEP_USER_ID_LABEL"
|
||||
description="COM_J2XML_CONFIG_KEEP_USER_ID_DESC"
|
||||
showon="import_users:1,2">
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
<field
|
||||
name="import_password"
|
||||
type="radio"
|
||||
label="COM_J2XML_CONFIG_PASSWORD_LABEL"
|
||||
description="COM_J2XML_CONFIG_IMPORT_PASSWORD_DESC"
|
||||
default="0"
|
||||
class="btn-group btn-group-yesno"
|
||||
layout="joomla.form.field.radio.switcher"
|
||||
showon="import_users:1,2">
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
<field
|
||||
name="import_superusers"
|
||||
type="radio"
|
||||
class="btn-group btn-group-yesno"
|
||||
layout="joomla.form.field.radio.switcher"
|
||||
default="0"
|
||||
label="COM_J2XML_CONFIG_SUPERUSERS_LABEL"
|
||||
description="COM_J2XML_CONFIG_IMPORT_SUPERUSERS_DESC"
|
||||
showon="import_users:1,2">
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
<field
|
||||
name="import_usernotes"
|
||||
type="radio"
|
||||
label="COM_J2XML_CONFIG_USERNOTES_LABEL"
|
||||
description="COM_J2XML_CONFIG_IMPORT_USERNOTES_DESC"
|
||||
default="0"
|
||||
class="btn-group btn-group-yesno"
|
||||
layout="joomla.form.field.radio.switcher"
|
||||
showon="import_users:1,2">
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
</fieldset>
|
||||
<fieldset name="content">
|
||||
<field
|
||||
name="import_keep_id"
|
||||
type="radio"
|
||||
class="btn-group btn-group-yesno"
|
||||
layout="joomla.form.field.radio.switcher"
|
||||
default="0"
|
||||
label="COM_J2XML_CONFIG_KEEP_ID_LABEL"
|
||||
description="COM_J2XML_CONFIG_KEEP_ID_DESC">
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
<field
|
||||
name="import_keep_category"
|
||||
type="list"
|
||||
default="1"
|
||||
label="COM_J2XML_CONFIG_KEEP_CATEGORY_LABEL"
|
||||
description="COM_J2XML_CONFIG_KEEP_CONTENT_CATEGORY_DESC">
|
||||
<option value="1">JYES</option>
|
||||
<option value="2">COM_J2XML_CONFIG_KEEP_CATEGORY_FORCE</option>
|
||||
</field>
|
||||
<field
|
||||
name="import_content_category_forceto"
|
||||
type="category"
|
||||
extension="com_content"
|
||||
label="COM_J2XML_CONFIG_CATEGORY_FORCETO_LABEL"
|
||||
description="COM_J2XML_CONFIG_CONTENT_CATEGORY_FORCETO_DESC"
|
||||
showon="import_keep_category:2" />
|
||||
|
||||
<field
|
||||
name="com_content_category_default"
|
||||
type="category"
|
||||
extension="com_content"
|
||||
label="COM_J2XML_CONFIG_IMPORT_CONTENT_DEFAULT_CATEGORY_LABEL"
|
||||
description="COM_J2XML_CONFIG_IMPORT_CONTENT_DEFAULT_CATEGORY_DESC"
|
||||
showon="import_categories:0[AND]import_keep_category:1" />
|
||||
|
||||
<field
|
||||
name="import_keep_data"
|
||||
type="radio"
|
||||
label="COM_J2XML_CONFIG_KEEP_DATA_LABEL"
|
||||
description="COM_J2XML_CONFIG_KEEP_DATA_DESC"
|
||||
default="0"
|
||||
class="btn-group btn-group-yesno"
|
||||
layout="joomla.form.field.radio.switcher">
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
</fieldset>
|
||||
</form>
|
||||
96
administrator/components/com_j2xml/models/forms/send.xml
Normal file
96
administrator/components/com_j2xml/models/forms/send.xml
Normal file
@@ -0,0 +1,96 @@
|
||||
<?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.
|
||||
*/
|
||||
-->
|
||||
<form>
|
||||
<fieldset name="send">
|
||||
<field
|
||||
name="cid"
|
||||
type="hidden"
|
||||
/>
|
||||
<field
|
||||
name="remote_url"
|
||||
type="url"
|
||||
label="COM_J2XML_CONFIG_SEND_URL_LABEL"
|
||||
description="COM_J2XML_CONFIG_SEND_URL_DESC"
|
||||
required="true"
|
||||
filter="url"
|
||||
/>
|
||||
<!--
|
||||
<field
|
||||
name="username"
|
||||
type="text"
|
||||
label="COM_J2XML_CONFIG_SEND_USERNAME_LABEL"
|
||||
description="COM_J2XML_CONFIG_SEND_USERNAME_DESC"
|
||||
required="true"
|
||||
/>
|
||||
<field
|
||||
name="password"
|
||||
type="password"
|
||||
label="COM_J2XML_CONFIG_PASSWORD_LABEL"
|
||||
description="COM_J2XML_CONFIG_SEND_PASSWORD_DESC"
|
||||
required="true"
|
||||
autocomplete="off"
|
||||
/>
|
||||
-->
|
||||
<field
|
||||
name="send_compression"
|
||||
type="radio"
|
||||
label="COM_J2XML_CONFIG_COMPRESS_LABEL"
|
||||
description="COM_J2XML_CONFIG_COMPRESS_DESC"
|
||||
default="0"
|
||||
class="btn-group btn-group-yesno"
|
||||
layout="joomla.form.field.radio.switcher">
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
<field
|
||||
name="send_fields"
|
||||
type="list"
|
||||
default="0"
|
||||
label="COM_J2XML_CONFIG_FIELDS_LABEL"
|
||||
description="COM_J2XML_CONFIG_IMPORT_FIELDS_DESC"
|
||||
class="chzn-color">
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">COM_J2XML_YES_IF_NOT_EXISTS</option>
|
||||
<option value="2">COM_J2XML_YES_OVERWRITE_IF_EXISTS</option>
|
||||
</field>
|
||||
<field
|
||||
name="send_images"
|
||||
type="list"
|
||||
label="COM_J2XML_CONFIG_IMAGES_LABEL"
|
||||
description="COM_J2XML_CONFIG_SEND_IMAGES_DESC"
|
||||
default="0"
|
||||
class="chzn-color">
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
<field
|
||||
name="send_tags"
|
||||
type="list"
|
||||
label="COM_J2XML_CONFIG_TAGS_LABEL"
|
||||
description="COM_J2XML_CONFIG_SEND_TAGS_DESC"
|
||||
default="1"
|
||||
class="chzn-color">
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
</fieldset>
|
||||
</form>
|
||||
@@ -0,0 +1,62 @@
|
||||
<?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.
|
||||
*/
|
||||
-->
|
||||
<form>
|
||||
<fieldset name="content">
|
||||
<field
|
||||
name="send_content"
|
||||
type="list"
|
||||
default="2"
|
||||
label="COM_J2XML_CONFIG_CONTENT_LABEL"
|
||||
description="COM_J2XML_CONFIG_SEND_CONTENT_DESC">
|
||||
<option
|
||||
value="">JGLOBAL_USE_GLOBAL
|
||||
</option>
|
||||
<option
|
||||
value="1">COM_J2XML_YES_IF_NOT_EXISTS
|
||||
</option>
|
||||
<option
|
||||
value="2">COM_J2XML_YES_OVERWRITE_IF_EXISTS
|
||||
</option>
|
||||
<option
|
||||
value="3">COM_J2XML_YES_OVERWRITE_IF_NEWER
|
||||
</option>
|
||||
</field>
|
||||
<field
|
||||
name="send_categories"
|
||||
type="radio"
|
||||
label="COM_J2XML_CONFIG_CATEGORIES_LABEL"
|
||||
description="COM_J2XML_CONFIG_SEND_CATEGORIES_DESC"
|
||||
default="1"
|
||||
class="btn-group btn-group-yesno"
|
||||
layout="joomla.form.field.radio.switcher">
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
<field
|
||||
name="send_keep_data"
|
||||
type="list"
|
||||
label="COM_J2XML_CONFIG_KEEP_DATA_LABEL"
|
||||
description="COM_J2XML_CONFIG_KEEP_DATA_DESC"
|
||||
default="">
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
</fieldset>
|
||||
</form>
|
||||
@@ -0,0 +1,83 @@
|
||||
<?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.
|
||||
*/
|
||||
-->
|
||||
<form>
|
||||
<fieldset name="users">
|
||||
<field
|
||||
name="send_users"
|
||||
type="list"
|
||||
default="1"
|
||||
label="COM_J2XML_CONFIG_USERS_LABEL"
|
||||
description="COM_J2XML_CONFIG_IMPORT_USERS_DESC">
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="1">COM_J2XML_YES_IF_NOT_EXISTS</option>
|
||||
<option value="2">COM_J2XML_YES_OVERWRITE_IF_EXISTS</option>
|
||||
</field>
|
||||
<field
|
||||
name="send_keep_user_id"
|
||||
type="list"
|
||||
default="0"
|
||||
label="COM_J2XML_CONFIG_KEEP_USER_ID_LABEL"
|
||||
description="COM_J2XML_CONFIG_KEEP_USER_ID_DESC">
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
<field
|
||||
name="send_password"
|
||||
type="list"
|
||||
label="COM_J2XML_CONFIG_PASSWORD_LABEL"
|
||||
description="COM_J2XML_CONFIG_EXPORT_PASSWORD_DESC"
|
||||
default="0">
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
<field
|
||||
name="send_superusers"
|
||||
type="list"
|
||||
default="0"
|
||||
label="COM_J2XML_CONFIG_SUPERUSERS_LABEL"
|
||||
description="COM_J2XML_CONFIG_IMPORT_SUPERUSERS_DESC">
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
<field
|
||||
name="send_usernotes"
|
||||
type="list"
|
||||
label="COM_J2XML_CONFIG_USERNOTES_LABEL"
|
||||
description="COM_J2XML_CONFIG_IMPORT_USERNOTES_DESC"
|
||||
default="0">
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
<field
|
||||
name="send_contacts"
|
||||
type="list"
|
||||
label="COM_J2XML_CONFIG_CONTACTS_LABEL"
|
||||
description="COM_J2XML_CONFIG_IMPORT_CONTACTS_DESC"
|
||||
default="0">
|
||||
<option value="">JGLOBAL_USE_GLOBAL</option>
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">COM_J2XML_YES_IF_NOT_EXISTS</option>
|
||||
<option value="2">COM_J2XML_YES_OVERWRITE_IF_EXISTS</option>
|
||||
</field>
|
||||
</fieldset>
|
||||
</form>
|
||||
498
administrator/components/com_j2xml/models/import.php
Normal file
498
administrator/components/com_j2xml/models/import.php
Normal file
@@ -0,0 +1,498 @@
|
||||
<?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('eshiol.J2xml.Importer');
|
||||
jimport('eshiol.J2xmlpro.Importer');
|
||||
jimport('eshiol.J2xml.Messages');
|
||||
jimport('eshiol.J2xml.Version');
|
||||
jimport('eshiol.J2xmlpro.Version');
|
||||
|
||||
/**
|
||||
* J2XML Import Model
|
||||
*
|
||||
* @since 3.9
|
||||
*/
|
||||
class J2xmlModelImport extends JModelForm
|
||||
{
|
||||
/**
|
||||
* @var object JTable object
|
||||
*/
|
||||
protected $_table = null;
|
||||
|
||||
/**
|
||||
* @var object JTable object
|
||||
*/
|
||||
protected $_url = null;
|
||||
|
||||
/**
|
||||
* Model context string.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_context = 'com_j2xml.import';
|
||||
|
||||
/**
|
||||
* Method to auto-populate the model state.
|
||||
*
|
||||
* Note. Calling getState in this method will result in recursion.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 3.9
|
||||
*/
|
||||
protected function populateState ()
|
||||
{
|
||||
JLog::add(new JLogEntry(__METHOD__, JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
$app = JFactory::getApplication('administrator');
|
||||
|
||||
$this->setState('message', $app->getUserState('com_j2xml.message'));
|
||||
$app->setUserState('com_j2xml.message', '');
|
||||
|
||||
parent::populateState();
|
||||
}
|
||||
|
||||
/**
|
||||
* Import data from either folder, URL or upload.
|
||||
*
|
||||
* @return boolean result of import.
|
||||
*
|
||||
* @since 3.9
|
||||
*/
|
||||
public function import()
|
||||
{
|
||||
JLog::add(new JLogEntry(__METHOD__, JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
$this->setState('action', 'import');
|
||||
|
||||
// Set FTP credentials, if given.
|
||||
JClientHelper::setCredentialsFromRequest('ftp');
|
||||
$app = JFactory::getApplication();
|
||||
|
||||
// Load j2xml plugins for assistance if required:
|
||||
JPluginHelper::importPlugin('j2xml');
|
||||
|
||||
$package = null;
|
||||
|
||||
$installType = $app->input->getWord('installtype');
|
||||
|
||||
if ($package === null)
|
||||
{
|
||||
switch ($installType)
|
||||
{
|
||||
case 'folder':
|
||||
// Remember the 'Import from Directory' path.
|
||||
$app->getUserStateFromRequest($this->_context . '.install_directory', 'install_directory');
|
||||
$package = $this->_getDataFromFolder();
|
||||
break;
|
||||
|
||||
case 'upload':
|
||||
$package = $this->_getDataFromUpload();
|
||||
break;
|
||||
|
||||
case 'url':
|
||||
$package = $this->_getDataFromUrl();
|
||||
break;
|
||||
|
||||
default:
|
||||
$app->setUserState('com_j2xml.message', JText::_('COM_J2XML_NO_IMPORT_TYPE_FOUND'));
|
||||
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
JLog::add(new JLogEntry('package: ' . print_r($package, true), JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
if (!($data = implode(gzfile($package['packagefile'])))) {
|
||||
$data = file_get_contents($package['packagefile']);
|
||||
}
|
||||
JLog::add(new JLogEntry('data: ' . $data, JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
$jform = JFactory::getApplication()->input->post->get('jform', array(), 'array');
|
||||
|
||||
$fparams = new JRegistry($jform);
|
||||
JLog::add(new JLogEntry('jform: ' . print_r($fparams->toArray(), true), JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
$cparams = JComponentHelper::getParams('com_j2xml');
|
||||
JLog::add(new JLogEntry('cparams: ' . print_r($cparams->toArray(), true), JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
$params = new JRegistry();
|
||||
$params->set('categories', $fparams->get('import_categories', $cparams->get('import_categories', 1)));
|
||||
$params->set('contacts', $fparams->get('import_contacts', $cparams->get('import_contacts', 0)));
|
||||
$params->set('content', $fparams->get('import_content', $cparams->get('import_content', 1)));
|
||||
$params->set('fields', $fparams->get('import_fields', $cparams->get('import_fields', 0)));
|
||||
$params->set('images', $fparams->get('import_images', $cparams->get('import_images', 0)));
|
||||
$params->set('keep_category', $fparams->get('import_keep_category', $cparams->get('import_keep_category', 1)));
|
||||
if ($params->get('keep_category') == 2)
|
||||
{
|
||||
$params->set('content_category_forceto', $fparams->get('import_content_category_forceto', $cparams->get('com_content_category_default')));
|
||||
}
|
||||
$params->set('keep_id', $fparams->get('import_keep_id', $cparams->get('import_keep_id', 0)));
|
||||
$params->set('keep_user_id', $fparams->get('import_keep_user_id', $cparams->get('import_keep_user_id', 0)));
|
||||
$params->set('tags', $fparams->get('import_tags', $cparams->get('import_tags', 1)));
|
||||
$params->set('superusers', $fparams->get('import_superusers', $cparams->get('import_superusers', 0)));
|
||||
$params->set('usernotes', $fparams->get('import_usernotes', $cparams->get('import_usernotes', 0)));
|
||||
$params->set('users', $fparams->get('import_users', $cparams->get('import_users', 1)));
|
||||
$params->set('viewlevels', $fparams->get('import_viewlevels', $cparams->get('import_viewlevels', 1)));
|
||||
$params->set('weblinks', $fparams->get('import_weblinks', $cparams->get('import_weblinks', 0)));
|
||||
$params->set('keep_data', $fparams->get('import_keep_data', $cparams->get('import_keep_data', 0)));
|
||||
|
||||
JLog::add(new JLogEntry('params: ' . print_r($params->toArray(), true), JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
// This event allows a custom import of the data or a customization of the data:
|
||||
JPluginHelper::importPlugin('j2xml');
|
||||
|
||||
$results = JFactory::getApplication()->triggerEvent('onContentPrepareData', array('com_j2xml.import', &$data, $params));
|
||||
|
||||
if (in_array(false, $results, true))
|
||||
{
|
||||
JLog::add(new JLogEntry(JText::_('LIB_J2XML_MSG_PLUGIN_ERROR'), JLog::ERROR, 'com_j2xml'));
|
||||
|
||||
if (in_array($installType, array('upload', 'url')))
|
||||
{
|
||||
JInstallerHelper::cleanupInstall($package['packagefile'], $package['extractdir']);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
$data = strstr($data, '<?xml version="1.0" ');
|
||||
if (!defined('LIBXML_PARSEHUGE'))
|
||||
{
|
||||
define(LIBXML_PARSEHUGE, 524288);
|
||||
}
|
||||
|
||||
$xml = simplexml_load_string($data, 'SimpleXMLElement', LIBXML_PARSEHUGE);
|
||||
if (!$xml)
|
||||
{
|
||||
return;
|
||||
}
|
||||
elseif (strtoupper($xml->getName()) != 'J2XML')
|
||||
{
|
||||
JLog::add(new JLogEntry(JText::_('LIB_J2XML_MSG_FILE_FORMAT_UNKNOWN'), JLog::ERROR, 'com_j2xml'));
|
||||
return false;
|
||||
}
|
||||
elseif (!isset($xml['version']))
|
||||
{
|
||||
JLog::add(new JLogEntry(JText::_('LIB_J2XML_MSG_FILE_FORMAT_UNKNOWN'), JLog::ERROR, 'com_j2xml'));
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
JLog::add(new JLogEntry('Importing...', JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
$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);
|
||||
|
||||
$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))
|
||||
{
|
||||
$params->set('version', (string) $xml['version']);
|
||||
|
||||
$results = JFactory::getApplication()->triggerEvent('onContentBeforeImport', array('com_j2xml.import', &$xml, $params));
|
||||
|
||||
$importer->import($xml, $params);
|
||||
|
||||
JInstallerHelper::cleanupInstall($package['packagefile'], $package['extractdir']);
|
||||
}
|
||||
else
|
||||
{
|
||||
JLog::add(new JLogEntry(JText::sprintf('LIB_J2XML_MSG_FILE_FORMAT_NOT_SUPPORTED', $xmlVersion), JLog::ERROR, 'com_j2xml'));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Cleanup the install files.
|
||||
if (!is_file($package['packagefile']))
|
||||
{
|
||||
$config = JFactory::getConfig();
|
||||
$package['packagefile'] = $config->get('tmp_path') . '/' . $package['packagefile'];
|
||||
}
|
||||
|
||||
JInstallerHelper::cleanupInstall($package['packagefile'], $package['extractdir']);
|
||||
|
||||
// Clear the cached extension data and menu cache
|
||||
//$this->cleanCache('com_content', 0);
|
||||
//$this->cleanCache('com_content', 1);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Works out an import data package from a HTTP upload.
|
||||
*
|
||||
* @return Package definition or false on failure.
|
||||
*/
|
||||
protected function _getDataFromUpload()
|
||||
{
|
||||
JLog::add(new JLogEntry(__METHOD__, JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
// Get the uploaded file information.
|
||||
$input = JFactory::getApplication()->input;
|
||||
|
||||
// Do not change the filter type 'raw'. We need this to let files containing PHP code to upload. See JInputFiles::get.
|
||||
$userfile = $input->files->get('install_package', null, 'raw');
|
||||
|
||||
// Make sure that file uploads are enabled in php.
|
||||
if (!(bool) ini_get('file_uploads'))
|
||||
{
|
||||
JError::raiseWarning('', JText::_('COM_J2XML_MSG_IMPORT_WARNXMLFILE'));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Make sure that zlib is loaded so that the package can be unpacked.
|
||||
if (!extension_loaded('zlib'))
|
||||
{
|
||||
JError::raiseWarning('', JText::_('COM_J2XML_MSG_IMPORT_WARNXMLZLIB'));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// If there is no uploaded file, we have a problem...
|
||||
if (!is_array($userfile))
|
||||
{
|
||||
JError::raiseWarning('', JText::_('COM_J2XML_MSG_INSTALL_NO_FILE_SELECTED'));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Is the PHP tmp directory missing?
|
||||
if ($userfile['error'] && ($userfile['error'] == UPLOAD_ERR_NO_TMP_DIR))
|
||||
{
|
||||
JError::raiseWarning(
|
||||
'',
|
||||
JText::_('COM_J2XML_MSG_IMPORT_WARNXMLUPLOADERROR') . '<br />' . JText::_('COM_J2XML_MSG_WARNINGS_PHPUPLOADNOTSET')
|
||||
);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Is the max upload size too small in php.ini?
|
||||
if ($userfile['error'] && ($userfile['error'] == UPLOAD_ERR_INI_SIZE))
|
||||
{
|
||||
JError::raiseWarning(
|
||||
'',
|
||||
JText::_('COM_J2XML_MSG_IMPORT_WARNXMLUPLOADERROR') . '<br />' . JText::_('COM_J2XML_MSG_WARNINGS_SMALLUPLOADSIZE')
|
||||
);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check if there was a different problem uploading the file.
|
||||
if ($userfile['error'] || $userfile['size'] < 1)
|
||||
{
|
||||
JError::raiseWarning('', JText::_('COM_J2XML_MSG_IMPORT_WARNXMLUPLOADERROR'));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Build the appropriate paths.
|
||||
$config = JFactory::getConfig();
|
||||
$tmp_dest = $config->get('tmp_path') . '/' . $userfile['name'];
|
||||
$tmp_src = $userfile['tmp_name'];
|
||||
|
||||
// Move uploaded file.
|
||||
jimport('joomla.filesystem.file');
|
||||
JFile::upload($tmp_src, $tmp_dest, false, true);
|
||||
|
||||
// Unpack the downloaded package file.
|
||||
$package = JInstallerHelper::unpack($tmp_dest, true);
|
||||
|
||||
return $package;
|
||||
}
|
||||
|
||||
/**
|
||||
* Import data from a directory
|
||||
*
|
||||
* @return array Package details or false on failure
|
||||
*
|
||||
* @since 3.9
|
||||
*/
|
||||
protected function _getDataFromFolder()
|
||||
{
|
||||
JLog::add(new JLogEntry(__METHOD__, JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
$input = JFactory::getApplication()->input;
|
||||
|
||||
// Get the path to the package to install.
|
||||
$p_dir = $input->getString('install_directory');
|
||||
$p_dir = JPath::clean($p_dir);
|
||||
|
||||
// Did you give us a valid directory?
|
||||
if (!is_dir($p_dir))
|
||||
{
|
||||
JError::raiseWarning('', JText::_('COM_J2XML_MSG_INSTALL_PLEASE_ENTER_A_PACKAGE_DIRECTORY'));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
$package['packagefile'] = null;
|
||||
$package['extractdir'] = null;
|
||||
$package['dir'] = $p_dir;
|
||||
|
||||
return $package;
|
||||
}
|
||||
|
||||
/**
|
||||
* Import data from a URL.
|
||||
*
|
||||
* @return Package details or false on failure.
|
||||
*
|
||||
* @since 3.9
|
||||
*/
|
||||
protected function _getDataFromUrl()
|
||||
{
|
||||
JLog::add(new JLogEntry(__METHOD__, JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
$input = JFactory::getApplication()->input;
|
||||
|
||||
// Get the URL of the data to install.
|
||||
$url = $input->getString('install_url');
|
||||
|
||||
// Did you give us a URL?
|
||||
if (!$url)
|
||||
{
|
||||
JError::raiseWarning('', JText::_('COM_J2XML_MSG_INSTALL_ENTER_A_URL'));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Handle updater XML file case:
|
||||
/*
|
||||
if (preg_match('/\.xml\s*$/', $url))
|
||||
{
|
||||
jimport('joomla.updater.update');
|
||||
$update = new JUpdate;
|
||||
$update->loadFromXml($url);
|
||||
$package_url = trim($update->get('downloadurl', false)->_data);
|
||||
|
||||
if ($package_url)
|
||||
{
|
||||
$url = $package_url;
|
||||
}
|
||||
|
||||
unset($update);
|
||||
}
|
||||
*/
|
||||
|
||||
// Download the package at the URL given.
|
||||
$p_file = JInstallerHelper::downloadPackage($url);
|
||||
|
||||
// Was the package downloaded?
|
||||
if (!$p_file)
|
||||
{
|
||||
JError::raiseWarning('', JText::_('COM_J2XML_MSG_INSTALL_INVALID_URL'));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
$config = JFactory::getConfig();
|
||||
$tmp_dest = $config->get('tmp_path');
|
||||
|
||||
// Unpack the downloaded package file.
|
||||
$package = JInstallerHelper::unpack($tmp_dest . '/' . $p_file, true);
|
||||
|
||||
return $package;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the record form.
|
||||
*
|
||||
* @param array $data
|
||||
* Data for the form.
|
||||
* @param boolean $loadData
|
||||
* True if the form is to load its own data (default case), false if not.
|
||||
*
|
||||
* @return JForm|boolean A JForm object on success, false on failure
|
||||
*
|
||||
* @since 3.9.0
|
||||
*/
|
||||
public function getForm($data = array(), $loadData = true)
|
||||
{
|
||||
JLog::add(new JLogEntry(__METHOD__, JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
try
|
||||
{
|
||||
$form = $this->loadForm($this->_context, 'import', array(
|
||||
'control' => 'jform',
|
||||
'load_data' => false
|
||||
));
|
||||
|
||||
if ($loadData)
|
||||
{
|
||||
// Get the data for the form.
|
||||
$data = $this->loadFormData();
|
||||
}
|
||||
else
|
||||
{
|
||||
$data = array();
|
||||
}
|
||||
|
||||
// Allow for additional modification of the form, and events to be triggered.
|
||||
// We pass the data because plugins may require it.
|
||||
$this->preprocessForm($form, $data);
|
||||
|
||||
// Load the data into the form after the plugins have operated.
|
||||
$form->bind($data);
|
||||
}
|
||||
catch (\Exception $e)
|
||||
{
|
||||
$this->setError($e->getMessage());
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return $form;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the data that should be injected in the form.
|
||||
*
|
||||
* @return mixed The data for the form.
|
||||
*
|
||||
* @since 3.9.0
|
||||
*/
|
||||
protected function loadFormData()
|
||||
{
|
||||
JLog::add(new JLogEntry(__METHOD__, JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
// Check the session for previously entered form data.
|
||||
$data = JFactory::getApplication()->getUserState('com_j2xml.import.data', array());
|
||||
JLog::add(new JLogEntry('getUserState(\'com_j2xml.import.data\'): ' . print_r($data, true), JLog::DEBUG, 'com_j2xml'));
|
||||
$jform = array();
|
||||
foreach($data as $k => $v)
|
||||
{
|
||||
$jform['import_' . $k] = $v;
|
||||
}
|
||||
|
||||
$params = JComponentHelper::getParams('com_j2xml');
|
||||
$data = array_merge($params->toArray(), $jform);
|
||||
JLog::add(new JLogEntry('data: ' . print_r($data, true), JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
$this->preprocessData($this->_context, $data);
|
||||
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
155
administrator/components/com_j2xml/models/send.php
Normal file
155
administrator/components/com_j2xml/models/send.php
Normal file
@@ -0,0 +1,155 @@
|
||||
<?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();
|
||||
|
||||
/**
|
||||
* Send model.
|
||||
*
|
||||
* @since 3.9.0
|
||||
*/
|
||||
class J2xmlModelSend extends JModelForm
|
||||
{
|
||||
|
||||
/**
|
||||
* The model context
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $_context = 'j2xml';
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param array $config
|
||||
* An optional associative array of configuration settings.
|
||||
*
|
||||
* @see JModelLegacy
|
||||
* @since 3.9.0
|
||||
*/
|
||||
public function __construct($config = array())
|
||||
{
|
||||
JLog::add(new JLogEntry(__METHOD__, JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
$layout = JFactory::getApplication()->input->get('layout', 'default');
|
||||
if ($layout != 'default')
|
||||
{
|
||||
$this->_context .= '.' . $layout;
|
||||
}
|
||||
|
||||
parent::__construct($config);
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the record form.
|
||||
*
|
||||
* @param array $data
|
||||
* Data for the form.
|
||||
* @param boolean $loadData
|
||||
* True if the form is to load its own data (default case), false if not.
|
||||
*
|
||||
* @return JForm|boolean A JForm object on success, false on failure
|
||||
*
|
||||
* @since 3.9.0
|
||||
*/
|
||||
public function getForm($data = array(), $loadData = true)
|
||||
{
|
||||
JLog::add(new JLogEntry(__METHOD__, JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
try
|
||||
{
|
||||
$form = $this->loadForm($this->_context, 'send', array(
|
||||
'control' => 'jform',
|
||||
'load_data' => false
|
||||
));
|
||||
|
||||
$layout = JFactory::getApplication()->input->get('layout', 'default');
|
||||
if ($layout != 'default')
|
||||
{
|
||||
$form->loadFile('send_' . $layout);
|
||||
|
||||
if ($layout != 'users')
|
||||
{
|
||||
$form->loadFile('send_users');
|
||||
/* if ($layout == 'contact')
|
||||
{
|
||||
$form->setFieldAttribute('send_contacts', 'type', 'hidden');
|
||||
} */
|
||||
}
|
||||
/* else
|
||||
{
|
||||
$form->setFieldAttribute('send_users', 'type', 'hidden');
|
||||
} */
|
||||
}
|
||||
|
||||
if ($loadData)
|
||||
{
|
||||
// Get the data for the form.
|
||||
$data = $this->loadFormData();
|
||||
}
|
||||
else
|
||||
{
|
||||
$data = array();
|
||||
}
|
||||
|
||||
// Allow for additional modification of the form, and events to be triggered.
|
||||
// We pass the data because plugins may require it.
|
||||
$this->preprocessForm($form, $data);
|
||||
|
||||
// Load the data into the form after the plugins have operated.
|
||||
$form->bind($data);
|
||||
}
|
||||
catch (\Exception $e)
|
||||
{
|
||||
$this->setError($e->getMessage());
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return $form;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method to get the data that should be injected in the form.
|
||||
*
|
||||
* @return mixed The data for the form.
|
||||
*
|
||||
* @since 3.9.0
|
||||
*/
|
||||
protected function loadFormData()
|
||||
{
|
||||
JLog::add(new JLogEntry(__METHOD__, JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
// Check the session for previously entered form data.
|
||||
$data = JFactory::getApplication()->getUserState('com_j2xml.send.data', array());
|
||||
JLog::add(new JLogEntry('getUserState(\'com_j2xml.send.data\'): ' . print_r($data, true), JLog::DEBUG, 'com_j2xml'));
|
||||
$jform = array();
|
||||
foreach($data as $k => $v)
|
||||
{
|
||||
$jform['send_' . $k] = $v;
|
||||
}
|
||||
|
||||
$params = JComponentHelper::getParams('com_j2xml');
|
||||
$data = array_merge($params->toArray(), $jform);
|
||||
JLog::add(new JLogEntry('data: ' . print_r($data, true), JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
$this->preprocessData($this->_context, $data);
|
||||
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
CREATE TABLE IF NOT EXISTS `#__j2xml_usergroups` (
|
||||
`id` int(10) unsigned NOT NULL,
|
||||
`parent_id` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`title` varchar(100) NOT NULL DEFAULT '',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 DEFAULT COLLATE = utf8mb4_unicode_ci;
|
||||
@@ -0,0 +1,5 @@
|
||||
CREATE TABLE IF NOT EXISTS "#__j2xml_usergroups" (
|
||||
"id" serial NOT NULL,
|
||||
"parent_id" bigint DEFAULT 0 NOT NULL,
|
||||
"title" varchar(100) DEFAULT '' NOT NULL,
|
||||
PRIMARY KEY ("id"));
|
||||
@@ -0,0 +1 @@
|
||||
DROP TABLE IF EXISTS `#__j2xml_usergroups`;
|
||||
@@ -0,0 +1 @@
|
||||
DROP TABLE IF EXISTS "#__j2xml_usergroups";
|
||||
@@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
||||
@@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
||||
@@ -0,0 +1,54 @@
|
||||
<?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__) . '/../raw.php';
|
||||
|
||||
/**
|
||||
* J2XML Component Categories RAW View
|
||||
*
|
||||
* @since 3.6.161
|
||||
*/
|
||||
class J2xmlViewCategories extends J2xmlView
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param array $config
|
||||
* A named configuration array for object construction.
|
||||
* name: the name (optional) of the view (defaults to the view class name suffix).
|
||||
* charset: the character set to use for display
|
||||
* escape: the name (optional) of the function to use for escaping strings
|
||||
* base_path: the parent path (optional) of the views directory (defaults to the component folder)
|
||||
* template_plath: the path (optional) of the layout directory (defaults to base_path + /views/ + view name
|
||||
* helper_path: the path (optional) of the helper files (defaults to base_path + /helpers/)
|
||||
* layout: the layout (optional) to use to display the view
|
||||
*/
|
||||
public function __construct($config = array())
|
||||
{
|
||||
JLog::add(new JLogEntry(__METHOD__, JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
parent::__construct($config);
|
||||
|
||||
$jform = JFactory::getApplication()->input->post->get('jform', array(), 'array');
|
||||
|
||||
$this->params->loadArray($jform);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
<?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__) . '/../raw.php';
|
||||
|
||||
/**
|
||||
* J2XML Component Contact RAW View
|
||||
*
|
||||
* @since 3.6.161
|
||||
*/
|
||||
class J2xmlViewContact extends J2xmlView
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param array $config
|
||||
* A named configuration array for object construction.
|
||||
* name: the name (optional) of the view (defaults to the view class name suffix).
|
||||
* charset: the character set to use for display
|
||||
* escape: the name (optional) of the function to use for escaping strings
|
||||
* base_path: the parent path (optional) of the views directory (defaults to the component folder)
|
||||
* template_plath: the path (optional) of the layout directory (defaults to base_path + /views/ + view name
|
||||
* helper_path: the path (optional) of the helper files (defaults to base_path + /helpers/)
|
||||
* layout: the layout (optional) to use to display the view
|
||||
*/
|
||||
public function __construct($config = array())
|
||||
{
|
||||
JLog::add(new JLogEntry(__METHOD__, JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
parent::__construct($config);
|
||||
|
||||
$jform = JFactory::getApplication()->input->post->get('jform', array(), 'array');
|
||||
|
||||
$this->params->loadArray($jform);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
<?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__) . '/../raw.php';
|
||||
|
||||
/**
|
||||
* J2XML Component Content RAW View
|
||||
*
|
||||
* @since 3.6.161
|
||||
*/
|
||||
class J2xmlViewContent extends J2xmlView
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param array $config
|
||||
* A named configuration array for object construction.
|
||||
* name: the name (optional) of the view (defaults to the view class name suffix).
|
||||
* charset: the character set to use for display
|
||||
* escape: the name (optional) of the function to use for escaping strings
|
||||
* base_path: the parent path (optional) of the views directory (defaults to the component folder)
|
||||
* template_plath: the path (optional) of the layout directory (defaults to base_path + /views/ + view name
|
||||
* helper_path: the path (optional) of the helper files (defaults to base_path + /helpers/)
|
||||
* layout: the layout (optional) to use to display the view
|
||||
*/
|
||||
public function __construct($config = array())
|
||||
{
|
||||
JLog::add(new JLogEntry(__METHOD__, JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
parent::__construct($config);
|
||||
|
||||
$jform = JFactory::getApplication()->input->post->get('jform', array(), 'array');
|
||||
|
||||
$this->params->loadArray($jform);
|
||||
}
|
||||
}
|
||||
298
administrator/components/com_j2xml/views/cpanel/tmpl/default.php
Normal file
298
administrator/components/com_j2xml/views/cpanel/tmpl/default.php
Normal 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&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)", "©", $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&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)", "©", $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>
|
||||
152
administrator/components/com_j2xml/views/cpanel/view.html.php
Normal file
152
administrator/components/com_j2xml/views/cpanel/view.html.php
Normal 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'));
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,51 @@
|
||||
<?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();
|
||||
?>
|
||||
<fieldset title="<?php echo JText::_('COM_J2XML_MSG_DESCFTPTITLE'); ?>">
|
||||
<legend><?php echo JText::_('COM_J2XML_MSG_DESCFTPTITLE'); ?></legend>
|
||||
|
||||
<?php echo JText::_('COM_J2XML_MSG_DESCFTP'); ?>
|
||||
|
||||
<?php if ($this->ftp instanceof Exception) : ?>
|
||||
<p><?php echo JText::_($this->ftp->getMessage()); ?></p>
|
||||
<?php endif; ?>
|
||||
|
||||
<table class="adminform">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td width="120">
|
||||
<label for="username"><?php echo JText::_('JGLOBAL_USERNAME'); ?></label>
|
||||
</td>
|
||||
<td>
|
||||
<input type="text" id="username" name="username" class="input_box" size="70" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="120">
|
||||
<label for="password"><?php echo JText::_('JGLOBAL_PASSWORD'); ?></label>
|
||||
</td>
|
||||
<td>
|
||||
<input type="password" id="password" name="password" class="input_box" size="70" value="" />
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</fieldset>
|
||||
@@ -0,0 +1,31 @@
|
||||
<?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();
|
||||
|
||||
$state = $this->get('State');
|
||||
$message = $state->get('message');
|
||||
?>
|
||||
|
||||
<?php if ($message) : ?>
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<strong><?php echo $message; ?></strong>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
97
administrator/components/com_j2xml/views/default/view.php
Normal file
97
administrator/components/com_j2xml/views/default/view.php
Normal file
@@ -0,0 +1,97 @@
|
||||
<?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();
|
||||
|
||||
/**
|
||||
* J2XML Default View
|
||||
*
|
||||
* @since 3.9
|
||||
*/
|
||||
class J2xmlViewDefault extends JViewLegacy
|
||||
{
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param array $config Configuration array
|
||||
*
|
||||
* @since 3.9
|
||||
*/
|
||||
public function __construct($config = null)
|
||||
{
|
||||
JLog::add(new JLogEntry(__METHOD__, JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
$app = JFactory::getApplication();
|
||||
parent::__construct($config);
|
||||
$this->_addPath('template', $this->_basePath . '/views/default/tmpl');
|
||||
$this->_addPath('template', JPATH_THEMES . '/' . $app->getTemplate() . '/html/com_j2xml/default');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the view.
|
||||
*
|
||||
* @param string $tpl Template
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 3.9
|
||||
*/
|
||||
public function display($tpl = null)
|
||||
{
|
||||
JLog::add(new JLogEntry(__METHOD__, JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
// Get data from the model.
|
||||
$state = $this->get('State');
|
||||
|
||||
// Are there messages to display?
|
||||
$showMessage = false;
|
||||
|
||||
if (is_object($state))
|
||||
{
|
||||
$message = $state->get('message');
|
||||
$showMessage = (bool) $message;
|
||||
}
|
||||
|
||||
$this->showMessage = $showMessage;
|
||||
$this->state = &$state;
|
||||
|
||||
$this->addToolbar();
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the page title and toolbar.
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 3.9
|
||||
*/
|
||||
protected function addToolbar()
|
||||
{
|
||||
JLog::add(new JLogEntry(__METHOD__, JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
$canDo = JHelperContent::getActions('com_j2xml');
|
||||
JToolbarHelper::title(JText::_('COM_J2XML_HEADER_' . $this->getName()), 'upload import');
|
||||
|
||||
if ($canDo->get('core.admin') || $canDo->get('core.options'))
|
||||
{
|
||||
JToolbarHelper::preferences('com_j2xml');
|
||||
JToolbarHelper::divider();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
<?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\Language\Text;
|
||||
|
||||
$version = new JVersion();
|
||||
|
||||
if ($version->isCompatible('3.4'))
|
||||
{
|
||||
JHtml::_('behavior.formvalidator');
|
||||
}
|
||||
else
|
||||
{
|
||||
JHtml::_('behavior.formvalidation');
|
||||
}
|
||||
|
||||
if ($version->isCompatible('4'))
|
||||
{
|
||||
$ui = 'uitab';
|
||||
}
|
||||
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( '#j2xmlCategoriesTabs a:first' ).tab( 'show' );
|
||||
});
|
||||
EOL
|
||||
);
|
||||
}
|
||||
?>
|
||||
|
||||
<form
|
||||
action="<?php echo JRoute::_('index.php?option=com_j2xml&task=categories.display&format=raw'); ?>"
|
||||
id="adminForm" method="post" name="adminForm" autocomplete="off"
|
||||
class="form-horizontal">
|
||||
|
||||
<?php $fieldsets = $this->form->getFieldsets(); ?>
|
||||
|
||||
<?php echo JHtml::_($ui . '.startTabSet', 'j2xmlCategories', 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', 'j2xmlCategories', $name, Text::_($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'); ?>
|
||||
|
||||
<button class="hidden" id="j2xmlExportOkBtn" type="button"
|
||||
onclick="this.form.submit();window.top.setTimeout('window.parent.jQuery(\'#j2xmlExportModal\').modal(\'hide\')', 700);">
|
||||
|
||||
<?php /** if ($version->isCompatible('4')) : ?>
|
||||
onclick="this.form.submit();window.top.setTimeout('window.parent.Joomla.Modal.getCurrent().close();', 700);"> ?>
|
||||
<?php else : ?>
|
||||
onclick="this.form.submit();window.top.setTimeout('window.parent.jQuery(\'#j2xmlExportModal\').modal(\'hide\')', 700);">
|
||||
<?php endif; **/ ?>
|
||||
</button>
|
||||
</form>
|
||||
112
administrator/components/com_j2xml/views/export/tmpl/contact.php
Normal file
112
administrator/components/com_j2xml/views/export/tmpl/contact.php
Normal file
@@ -0,0 +1,112 @@
|
||||
<?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\Language\Text;
|
||||
|
||||
$version = new JVersion();
|
||||
|
||||
if ($version->isCompatible('3.4'))
|
||||
{
|
||||
JHtml::_('behavior.formvalidator');
|
||||
}
|
||||
else
|
||||
{
|
||||
JHtml::_('behavior.formvalidation');
|
||||
}
|
||||
|
||||
if ($version->isCompatible('4'))
|
||||
{
|
||||
$ui = 'uitab';
|
||||
}
|
||||
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( '#j2xmlContactTabs a:first' ).tab( 'show' );
|
||||
});
|
||||
EOL
|
||||
);
|
||||
}
|
||||
?>
|
||||
|
||||
<form
|
||||
action="<?php echo JRoute::_('index.php?option=com_j2xml&task=contact.display&format=raw'); ?>"
|
||||
id="adminForm" method="post" name="adminForm" autocomplete="off"
|
||||
class="form-horizontal">
|
||||
|
||||
<?php $fieldsets = $this->form->getFieldsets(); ?>
|
||||
|
||||
<?php echo JHtml::_($ui . '.startTabSet', 'j2xmlContact', 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', 'j2xmlContact', $name, Text::_($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'); ?>
|
||||
|
||||
<button class="hidden" id="j2xmlExportOkBtn" type="button"
|
||||
onclick="this.form.submit();window.top.setTimeout('window.parent.jQuery(\'#j2xmlExportModal\').modal(\'hide\')', 700);">
|
||||
|
||||
<?php /** if ($version->isCompatible('4')) : ?>
|
||||
onclick="this.form.submit();window.top.setTimeout('window.parent.Joomla.Modal.getCurrent().close();', 700);"> ?>
|
||||
<?php else : ?>
|
||||
onclick="this.form.submit();window.top.setTimeout('window.parent.jQuery(\'#j2xmlExportModal\').modal(\'hide\')', 700);">
|
||||
<?php endif; **/ ?>
|
||||
</button>
|
||||
</form>
|
||||
112
administrator/components/com_j2xml/views/export/tmpl/content.php
Normal file
112
administrator/components/com_j2xml/views/export/tmpl/content.php
Normal file
@@ -0,0 +1,112 @@
|
||||
<?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\Language\Text;
|
||||
|
||||
$version = new JVersion();
|
||||
|
||||
if ($version->isCompatible('3.4'))
|
||||
{
|
||||
JHtml::_('behavior.formvalidator');
|
||||
}
|
||||
else
|
||||
{
|
||||
JHtml::_('behavior.formvalidation');
|
||||
}
|
||||
|
||||
if ($version->isCompatible('4'))
|
||||
{
|
||||
$ui = 'uitab';
|
||||
}
|
||||
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( '#j2xmlContentTabs a:first' ).tab( 'show' );
|
||||
});
|
||||
EOL
|
||||
);
|
||||
}
|
||||
?>
|
||||
|
||||
<form
|
||||
action="<?php echo JRoute::_('index.php?option=com_j2xml&task=content.display&format=raw'); ?>"
|
||||
id="adminForm" method="post" name="adminForm" autocomplete="off"
|
||||
class="form-horizontal">
|
||||
|
||||
<?php $fieldsets = $this->form->getFieldsets(); ?>
|
||||
|
||||
<?php echo JHtml::_($ui . '.startTabSet', 'j2xmlContent', 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', 'j2xmlContent', $name, Text::_($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'); ?>
|
||||
|
||||
<button class="hidden" id="j2xmlExportOkBtn" type="button"
|
||||
onclick="this.form.submit();window.top.setTimeout('window.parent.jQuery(\'#j2xmlExportModal\').modal(\'hide\')', 700);">
|
||||
|
||||
<?php /** if ($version->isCompatible('4')) : ?>
|
||||
onclick="this.form.submit();window.top.setTimeout('window.parent.Joomla.Modal.getCurrent().close();', 700);"> ?>
|
||||
<?php else : ?>
|
||||
onclick="this.form.submit();window.top.setTimeout('window.parent.jQuery(\'#j2xmlExportModal\').modal(\'hide\')', 700);">
|
||||
<?php endif; **/ ?>
|
||||
</button>
|
||||
</form>
|
||||
112
administrator/components/com_j2xml/views/export/tmpl/menus.php
Normal file
112
administrator/components/com_j2xml/views/export/tmpl/menus.php
Normal file
@@ -0,0 +1,112 @@
|
||||
<?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\Language\Text;
|
||||
|
||||
$version = new JVersion();
|
||||
|
||||
if ($version->isCompatible('3.4'))
|
||||
{
|
||||
JHtml::_('behavior.formvalidator');
|
||||
}
|
||||
else
|
||||
{
|
||||
JHtml::_('behavior.formvalidation');
|
||||
}
|
||||
|
||||
if ($version->isCompatible('4'))
|
||||
{
|
||||
$ui = 'uitab';
|
||||
}
|
||||
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( '#j2xmlMenusTabs a:first' ).tab( 'show' );
|
||||
});
|
||||
EOL
|
||||
);
|
||||
}
|
||||
?>
|
||||
|
||||
<form
|
||||
action="<?php echo JRoute::_('index.php?option=com_j2xml&task=menus.display&format=raw'); ?>"
|
||||
id="adminForm" method="post" name="adminForm" autocomplete="off"
|
||||
class="form-horizontal">
|
||||
|
||||
<?php $fieldsets = $this->form->getFieldsets(); ?>
|
||||
|
||||
<?php echo JHtml::_($ui . '.startTabSet', 'j2xmlMenus', 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', 'j2xmlMenus', $name, Text::_($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'); ?>
|
||||
|
||||
<button class="hidden" id="j2xmlExportOkBtn" type="button"
|
||||
onclick="this.form.submit();window.top.setTimeout('window.parent.jQuery(\'#j2xmlExportModal\').modal(\'hide\')', 700);">
|
||||
|
||||
<?php /** if ($version->isCompatible('4')) : ?>
|
||||
onclick="this.form.submit();window.top.setTimeout('window.parent.Joomla.Modal.getCurrent().close();', 700);"> ?>
|
||||
<?php else : ?>
|
||||
onclick="this.form.submit();window.top.setTimeout('window.parent.jQuery(\'#j2xmlExportModal\').modal(\'hide\')', 700);">
|
||||
<?php endif; **/ ?>
|
||||
</button>
|
||||
</form>
|
||||
112
administrator/components/com_j2xml/views/export/tmpl/modules.php
Normal file
112
administrator/components/com_j2xml/views/export/tmpl/modules.php
Normal file
@@ -0,0 +1,112 @@
|
||||
<?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\Language\Text;
|
||||
|
||||
$version = new JVersion();
|
||||
|
||||
if ($version->isCompatible('3.4'))
|
||||
{
|
||||
JHtml::_('behavior.formvalidator');
|
||||
}
|
||||
else
|
||||
{
|
||||
JHtml::_('behavior.formvalidation');
|
||||
}
|
||||
|
||||
if ($version->isCompatible('4'))
|
||||
{
|
||||
$ui = 'uitab';
|
||||
}
|
||||
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( '#j2xmlModulesTabs a:first' ).tab( 'show' );
|
||||
});
|
||||
EOL
|
||||
);
|
||||
}
|
||||
?>
|
||||
|
||||
<form
|
||||
action="<?php echo JRoute::_('index.php?option=com_j2xml&task=modules.display&format=raw'); ?>"
|
||||
id="adminForm" method="post" name="adminForm" autocomplete="off"
|
||||
class="form-horizontal">
|
||||
|
||||
<?php $fieldsets = $this->form->getFieldsets(); ?>
|
||||
|
||||
<?php echo JHtml::_($ui . '.startTabSet', 'j2xmlModules', 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', 'j2xmlModules', $name, Text::_($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'); ?>
|
||||
|
||||
<button class="hidden" id="j2xmlExportOkBtn" type="button"
|
||||
onclick="this.form.submit();window.top.setTimeout('window.parent.jQuery(\'#j2xmlExportModal\').modal(\'hide\')', 700);">
|
||||
|
||||
<?php /** if ($version->isCompatible('4')) : ?>
|
||||
onclick="this.form.submit();window.top.setTimeout('window.parent.Joomla.Modal.getCurrent().close();', 700);"> ?>
|
||||
<?php else : ?>
|
||||
onclick="this.form.submit();window.top.setTimeout('window.parent.jQuery(\'#j2xmlExportModal\').modal(\'hide\')', 700);">
|
||||
<?php endif; **/ ?>
|
||||
</button>
|
||||
</form>
|
||||
@@ -0,0 +1,112 @@
|
||||
<?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\Language\Text;
|
||||
|
||||
$version = new JVersion();
|
||||
|
||||
if ($version->isCompatible('3.4'))
|
||||
{
|
||||
JHtml::_('behavior.formvalidator');
|
||||
}
|
||||
else
|
||||
{
|
||||
JHtml::_('behavior.formvalidation');
|
||||
}
|
||||
|
||||
if ($version->isCompatible('4'))
|
||||
{
|
||||
$ui = 'uitab';
|
||||
}
|
||||
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( '#j2xmlUsernotesTabs a:first' ).tab( 'show' );
|
||||
});
|
||||
EOL
|
||||
);
|
||||
}
|
||||
?>
|
||||
|
||||
<form
|
||||
action="<?php echo JRoute::_('index.php?option=com_j2xml&task=usernotes.display&format=raw'); ?>"
|
||||
id="adminForm" method="post" name="adminForm" autocomplete="off"
|
||||
class="form-horizontal">
|
||||
|
||||
<?php $fieldsets = $this->form->getFieldsets(); ?>
|
||||
|
||||
<?php echo JHtml::_($ui . '.startTabSet', 'j2xmlUsernotes', 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', 'j2xmlUsernotes', $name, Text::_($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'); ?>
|
||||
|
||||
<button class="hidden" id="j2xmlExportOkBtn" type="button"
|
||||
onclick="this.form.submit();window.top.setTimeout('window.parent.jQuery(\'#j2xmlExportModal\').modal(\'hide\')', 700);">
|
||||
|
||||
<?php /** if ($version->isCompatible('4')) : ?>
|
||||
onclick="this.form.submit();window.top.setTimeout('window.parent.Joomla.Modal.getCurrent().close();', 700);"> ?>
|
||||
<?php else : ?>
|
||||
onclick="this.form.submit();window.top.setTimeout('window.parent.jQuery(\'#j2xmlExportModal\').modal(\'hide\')', 700);">
|
||||
<?php endif; **/ ?>
|
||||
</button>
|
||||
</form>
|
||||
112
administrator/components/com_j2xml/views/export/tmpl/users.php
Normal file
112
administrator/components/com_j2xml/views/export/tmpl/users.php
Normal file
@@ -0,0 +1,112 @@
|
||||
<?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\Language\Text;
|
||||
|
||||
$version = new JVersion();
|
||||
|
||||
if ($version->isCompatible('3.4'))
|
||||
{
|
||||
JHtml::_('behavior.formvalidator');
|
||||
}
|
||||
else
|
||||
{
|
||||
JHtml::_('behavior.formvalidation');
|
||||
}
|
||||
|
||||
if ($version->isCompatible('4'))
|
||||
{
|
||||
$ui = 'uitab';
|
||||
}
|
||||
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( '#j2xmlUsersTabs a:first' ).tab( 'show' );
|
||||
});
|
||||
EOL
|
||||
);
|
||||
}
|
||||
?>
|
||||
|
||||
<form
|
||||
action="<?php echo JRoute::_('index.php?option=com_j2xml&task=users.display&format=raw'); ?>"
|
||||
id="adminForm" method="post" name="adminForm" autocomplete="off"
|
||||
class="form-horizontal">
|
||||
|
||||
<?php $fieldsets = $this->form->getFieldsets(); ?>
|
||||
|
||||
<?php echo JHtml::_($ui . '.startTabSet', 'j2xmlUsers', 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', 'j2xmlUsers', $name, Text::_($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'); ?>
|
||||
|
||||
<button class="hidden" id="j2xmlExportOkBtn" type="button"
|
||||
onclick="this.form.submit();window.top.setTimeout('window.parent.jQuery(\'#j2xmlExportModal\').modal(\'hide\')', 700);">
|
||||
|
||||
<?php /** if ($version->isCompatible('4')) : ?>
|
||||
onclick="this.form.submit();window.top.setTimeout('window.parent.Joomla.Modal.getCurrent().close();', 700);"> ?>
|
||||
<?php else : ?>
|
||||
onclick="this.form.submit();window.top.setTimeout('window.parent.jQuery(\'#j2xmlExportModal\').modal(\'hide\')', 700);">
|
||||
<?php endif; **/ ?>
|
||||
</button>
|
||||
</form>
|
||||
@@ -0,0 +1,112 @@
|
||||
<?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\Language\Text;
|
||||
|
||||
$version = new JVersion();
|
||||
|
||||
if ($version->isCompatible('3.4'))
|
||||
{
|
||||
JHtml::_('behavior.formvalidator');
|
||||
}
|
||||
else
|
||||
{
|
||||
JHtml::_('behavior.formvalidation');
|
||||
}
|
||||
|
||||
if ($version->isCompatible('4'))
|
||||
{
|
||||
$ui = 'uitab';
|
||||
}
|
||||
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( '#j2xmlWeblinksTabs a:first' ).tab( 'show' );
|
||||
});
|
||||
EOL
|
||||
);
|
||||
}
|
||||
?>
|
||||
|
||||
<form
|
||||
action="<?php echo JRoute::_('index.php?option=com_j2xml&task=weblinks.display&format=raw'); ?>"
|
||||
id="adminForm" method="post" name="adminForm" autocomplete="off"
|
||||
class="form-horizontal">
|
||||
|
||||
<?php $fieldsets = $this->form->getFieldsets(); ?>
|
||||
|
||||
<?php echo JHtml::_($ui . '.startTabSet', 'j2xmlWeblinks', 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', 'j2xmlWeblinks', $name, Text::_($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'); ?>
|
||||
|
||||
<button class="hidden" id="j2xmlExportOkBtn" type="button"
|
||||
onclick="this.form.submit();window.top.setTimeout('window.parent.jQuery(\'#j2xmlExportModal\').modal(\'hide\')', 700);">
|
||||
|
||||
<?php /** if ($version->isCompatible('4')) : ?>
|
||||
onclick="this.form.submit();window.top.setTimeout('window.parent.Joomla.Modal.getCurrent().close();', 700);"> ?>
|
||||
<?php else : ?>
|
||||
onclick="this.form.submit();window.top.setTimeout('window.parent.jQuery(\'#j2xmlExportModal\').modal(\'hide\')', 700);">
|
||||
<?php endif; **/ ?>
|
||||
</button>
|
||||
</form>
|
||||
@@ -0,0 +1,59 @@
|
||||
<?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();
|
||||
|
||||
/**
|
||||
* View class for export items.
|
||||
*
|
||||
* @since 3.9.0
|
||||
*/
|
||||
class J2xmlViewExport extends JViewLegacy
|
||||
{
|
||||
|
||||
/**
|
||||
* The JForm object
|
||||
*
|
||||
* @var JForm
|
||||
*/
|
||||
protected $form;
|
||||
|
||||
/**
|
||||
* Display the view
|
||||
*
|
||||
* @param string $tpl
|
||||
* The name of the template file to parse; automatically searches through the template paths.
|
||||
*
|
||||
* @return mixed A string if successful, otherwise an Error object.
|
||||
*/
|
||||
public function display($tpl = null)
|
||||
{
|
||||
JLog::add(new JLogEntry(__METHOD__, JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
// Initialiase variables.
|
||||
$this->form = $this->get('Form');
|
||||
|
||||
// Check for errors.
|
||||
if (count($errors = $this->get('Errors')))
|
||||
{
|
||||
throw new Exception(implode("\n", $errors), 500);
|
||||
}
|
||||
|
||||
return parent::display($tpl);
|
||||
}
|
||||
}
|
||||
30
administrator/components/com_j2xml/views/fields/view.raw.php
Normal file
30
administrator/components/com_j2xml/views/fields/view.raw.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?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__) . '/../raw.php';
|
||||
|
||||
/**
|
||||
* J2XML Component Fields View
|
||||
*/
|
||||
class J2xmlViewFields extends J2xmlView
|
||||
{
|
||||
}
|
||||
?>
|
||||
247
administrator/components/com_j2xml/views/import/tmpl/default.php
Normal file
247
administrator/components/com_j2xml/views/import/tmpl/default.php
Normal 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&view=import&layout=options&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&view=import&layout=options&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>'));
|
||||
}
|
||||
@@ -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>
|
||||
@@ -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="" />
|
||||
104
administrator/components/com_j2xml/views/import/tmpl/options.php
Normal file
104
administrator/components/com_j2xml/views/import/tmpl/options.php
Normal 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>
|
||||
@@ -0,0 +1,80 @@
|
||||
<?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::register('J2XMLViewDefault', dirname(__DIR__) . '/default/view.php');
|
||||
|
||||
/**
|
||||
* J2xml Import View
|
||||
*
|
||||
* @since 3.9.0
|
||||
*/
|
||||
class J2xmlViewImport extends J2xmlViewDefault
|
||||
{
|
||||
/**
|
||||
* Display the view
|
||||
*
|
||||
* @param string $tpl Template
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
* @since 3.9
|
||||
*/
|
||||
public function display($tpl = null)
|
||||
{
|
||||
JLog::add(new JLogEntry(__METHOD__, JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
// Initialiase variables.
|
||||
$this->form = $this->get('Form');
|
||||
|
||||
$paths = new stdClass;
|
||||
$paths->first = '';
|
||||
$state = $this->get('state');
|
||||
|
||||
$this->paths = &$paths;
|
||||
$this->state = &$state;
|
||||
|
||||
JPluginHelper::importPlugin('installer');
|
||||
|
||||
parent::display($tpl);
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the page title and toolbar.
|
||||
*
|
||||
* @since 1.6
|
||||
*/
|
||||
protected function addToolbar ()
|
||||
{
|
||||
JLog::add(new JLogEntry(__METHOD__, JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
JToolBarHelper::title(JText::_('COM_J2XML_TOOLBAR_J2XML'), 'upload import');
|
||||
|
||||
if (JFactory::getUser()->authorise('core.admin'))
|
||||
{
|
||||
JToolBarHelper::preferences('com_j2xml');
|
||||
}
|
||||
|
||||
$doc = JFactory::getDocument();
|
||||
$doc->addStyleDeclaration('#toolbar-credit{float:right;}');
|
||||
|
||||
$toolbar = JToolBar::getInstance('toolbar');
|
||||
$toolbar->appendButton('Popup', 'credit', 'COM_J2XML_DONATE', 'https://www.eshiol.it/' . Jtext::_('COM_J2XML_DONATE_1') . '?tmpl=component', 550, 350);
|
||||
}
|
||||
}
|
||||
30
administrator/components/com_j2xml/views/menus/view.raw.php
Normal file
30
administrator/components/com_j2xml/views/menus/view.raw.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Administrator
|
||||
* @subpackage com_j2xml
|
||||
*
|
||||
* @version 3.9.229-rc1
|
||||
* @since 3.9.213
|
||||
*
|
||||
* @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__) . '/../raw.php';
|
||||
|
||||
/**
|
||||
* J2XML Component Menus View
|
||||
*/
|
||||
class J2xmlViewMenus extends J2xmlView
|
||||
{
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,31 @@
|
||||
<?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__) . '/../raw.php';
|
||||
|
||||
/**
|
||||
* J2XML Component Modules View
|
||||
*
|
||||
* @since 3.9.213
|
||||
*/
|
||||
class J2xmlViewModules extends J2xmlView
|
||||
{
|
||||
}
|
||||
?>
|
||||
132
administrator/components/com_j2xml/views/raw.php
Normal file
132
administrator/components/com_j2xml/views/raw.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();
|
||||
|
||||
use eshiol\J2xml\Exporter;
|
||||
use eshiol\J2xml\Version;
|
||||
|
||||
JLoader::import('eshiol.J2xml.Exporter');
|
||||
JLoader::import('eshiol.J2xml.Version');
|
||||
|
||||
/**
|
||||
* J2XML Component base RAW View
|
||||
*
|
||||
* @since 3.2.137
|
||||
*/
|
||||
class J2xmlView extends JViewLegacy
|
||||
{
|
||||
|
||||
/**
|
||||
* The list of IDs to be exported
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $ids;
|
||||
|
||||
/**
|
||||
* The params object
|
||||
*
|
||||
* @var JRegistry
|
||||
*/
|
||||
protected $params;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param array $config
|
||||
* A named configuration array for object construction.
|
||||
* name: the name (optional) of the view (defaults to the view class name suffix).
|
||||
* charset: the character set to use for display
|
||||
* escape: the name (optional) of the function to use for escaping strings
|
||||
* base_path: the parent path (optional) of the views directory (defaults to the component folder)
|
||||
* template_plath: the path (optional) of the layout directory (defaults to base_path + /views/ + view name
|
||||
* helper_path: the path (optional) of the helper files (defaults to base_path + /helpers/)
|
||||
* layout: the layout (optional) to use to display the view
|
||||
*/
|
||||
public function __construct($config = array())
|
||||
{
|
||||
JLog::add(new JLogEntry(__METHOD__, JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
parent::__construct($config);
|
||||
|
||||
$jform = JFactory::getApplication()->input->post->get('jform', array(), 'array');
|
||||
|
||||
$this->ids = explode(",", $jform['cid']);
|
||||
unset($jform['cid']);
|
||||
|
||||
$this->params = new JRegistry();
|
||||
$this->params->loadArray($jform);
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute and display a template script.
|
||||
*
|
||||
* @param string $tpl
|
||||
* The name of the template file to parse; automatically searches through the template paths.
|
||||
*
|
||||
* @return mixed A string if successful, otherwise an Error object.
|
||||
*
|
||||
* @see JViewLegacy::loadTemplate()
|
||||
*/
|
||||
function display($tpl = null)
|
||||
{
|
||||
JLog::add(new JLogEntry(__METHOD__, JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
$params = new JRegistry();
|
||||
foreach ($this->params->toArray() as $k => $v)
|
||||
{
|
||||
$params->set(substr($k, 0, 7) == 'export_' ? substr($k, 7) : $k, $v);
|
||||
}
|
||||
|
||||
$j2xml = new Exporter();
|
||||
$get_xml = strtolower(str_replace('J2xmlView', '', get_class($this)));
|
||||
$j2xml->$get_xml($this->ids, $xml, $params);
|
||||
|
||||
$out = 'j2xml' . str_replace('.', '', Version::$DOCVERSION) . JFactory::getDate()->format("YmdHis");
|
||||
|
||||
$dom = new DOMDocument('1.0');
|
||||
$dom->preserveWhiteSpace = false;
|
||||
$dom->formatOutput = true;
|
||||
$dom->loadXML($xml->asXML());
|
||||
$data = $dom->saveXML();
|
||||
|
||||
// modify the MIME type
|
||||
$document = JFactory::getDocument();
|
||||
$compression = $params->get('compression', 0);
|
||||
|
||||
if (!\extension_loaded('zlib') || ini_get('zlib.output_compression'))
|
||||
{
|
||||
$document->setMimeEncoding('text/xml', true);
|
||||
JFactory::getApplication()->setHeader('Content-disposition', 'attachment; filename="' . $out . '.xml"', true);
|
||||
}
|
||||
elseif ($compression)
|
||||
{
|
||||
$document->setMimeEncoding('application/gzip', true);
|
||||
JFactory::getApplication()->setHeader('Content-disposition', 'attachment; filename="' . $out . '.gz"', true);
|
||||
$data = gzencode($data, 4);
|
||||
}
|
||||
else
|
||||
{
|
||||
$document->setMimeEncoding('text/xml', true);
|
||||
JFactory::getApplication()->setHeader('Content-disposition', 'attachment; filename="' . $out . '.xml"', true);
|
||||
}
|
||||
echo $data;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,154 @@
|
||||
<?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\Language\Text;
|
||||
|
||||
$version = new JVersion();
|
||||
|
||||
$ui = $version->isCompatible('4') ? 'uitab' : 'bootstrap';
|
||||
|
||||
if ($version->isCompatible('3.4'))
|
||||
{
|
||||
JHtml::_('behavior.formvalidator');
|
||||
}
|
||||
else
|
||||
{
|
||||
JHtml::_('behavior.formvalidation');
|
||||
}
|
||||
|
||||
JHtml::_('behavior.keepalive');
|
||||
JHtml::_('jquery.framework', true);
|
||||
|
||||
if ($version->isCompatible( '4' ))
|
||||
{
|
||||
JFactory::getDocument()->getWebAssetManager()
|
||||
->useScript( 'webcomponent.toolbar-button' );
|
||||
$this->document->addScriptOptions('progressBarContainerClass', 'progress');
|
||||
$this->document->addScriptOptions('progressBarClass', 'progress-bar progress-bar-striped progress-bar-animated bg-success');
|
||||
}
|
||||
else
|
||||
{
|
||||
JHtml::_('behavior.framework');
|
||||
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( '#j2xmlCategoriesTabs a:first' ).tab( 'show' );
|
||||
|
||||
// url validator
|
||||
document.formvalidator.setHandler( 'url', function( value, element ) {
|
||||
var regex = /^(https?|ftp|rmtp|mms):\/\/(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)*)(:(\d+))?\/?/i;
|
||||
return regex.test( value );
|
||||
});
|
||||
});
|
||||
EOL
|
||||
);
|
||||
}
|
||||
|
||||
$params = JComponentHelper::getParams('com_j2xml');
|
||||
$min = ($params->get('debug', 0) ? '' : '.min');
|
||||
$doc = JFactory::getDocument();
|
||||
$doc->addScript("../media/lib_eshiol_phpxmlrpc/js/jquery.xmlrpc{$min}.js", array('version'=>'auto'));
|
||||
$doc->addScript("../media/lib_eshiol_j2xml/js/j2xml{$min}.js", array('version'=>'auto'));
|
||||
|
||||
JText::script('COM_J2XML_SEND_ERROR');
|
||||
JText::script('COM_J2XML_SEND_ERROR_REMOTEURL_IS_REQUIRED');
|
||||
JText::script('LIB_J2XML_SENDING');
|
||||
JText::script('LIB_J2XML_MSG_XMLRPC_DISABLED');
|
||||
JText::script('LIB_J2XML_ERROR_UNKNOWN');
|
||||
JText::script('LIB_J2XML_ERROR_STATUS0');
|
||||
?>
|
||||
|
||||
<form action="<?php echo JRoute::_('index.php?option=com_j2xml'); ?>"
|
||||
id="adminForm" method="post" name="adminForm"
|
||||
class="form-horizontal form-validate">
|
||||
|
||||
<?php $fieldsets = $this->form->getFieldsets(); ?>
|
||||
|
||||
<?php echo JHtml::_($ui . '.startTabSet', 'j2xmlCategories', 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', 'j2xmlCategories', $name, Text::_($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'); ?>
|
||||
|
||||
<button class="hidden" id="j2xmlSendOkBtn" type="button"
|
||||
onclick="
|
||||
eshiol.removeMessages(window.parent.jQuery('#system-message-container'));
|
||||
|
||||
var f = document.adminForm;
|
||||
if (document.formvalidator.isValid(f)) {
|
||||
window.top.setTimeout('window.parent.jQuery(\'#j2xmlSendModal\').modal(\'hide\')', 700);
|
||||
|
||||
eshiol.j2xml.send({
|
||||
export_url: 'index.php?option=com_j2xml&task=categories.export&format=json&<?php echo JSession::getFormToken(); ?>=1',
|
||||
remote_url: jQuery('#jform_remote_url').val().replace(/\/?$/, '/') + 'index.php?option=com_j2xml&task=services.import&format=xmlrpc',
|
||||
compression: jQuery('#jform_compression').val(),
|
||||
password: jQuery('input:radio[name=\'jform\[password\]\']:checked').first().val(),
|
||||
fields: jQuery('input:radio[name=\'jform\[fields\]\']:checked').first().val(),
|
||||
});
|
||||
}
|
||||
else {
|
||||
var msg = new Array();
|
||||
msg.push(Joomla.JText._('COM_J2XML_SEND_ERROR'));
|
||||
if (jQuery('#jform_remote_url').hasClass('invalid')) {
|
||||
msg.push(Joomla.JText._('COM_J2XML_SEND_ERROR_REMOTEURL_IS_REQUIRED'));
|
||||
}
|
||||
// alert (msg.join('\n'));
|
||||
return false;
|
||||
}
|
||||
"></button>
|
||||
</form>
|
||||
154
administrator/components/com_j2xml/views/send/tmpl/contact.php
Normal file
154
administrator/components/com_j2xml/views/send/tmpl/contact.php
Normal file
@@ -0,0 +1,154 @@
|
||||
<?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\Language\Text;
|
||||
|
||||
$version = new JVersion();
|
||||
|
||||
$ui = $version->isCompatible('4') ? 'uitab' : 'bootstrap';
|
||||
|
||||
if ($version->isCompatible('3.4'))
|
||||
{
|
||||
JHtml::_('behavior.formvalidator');
|
||||
}
|
||||
else
|
||||
{
|
||||
JHtml::_('behavior.formvalidation');
|
||||
}
|
||||
|
||||
JHtml::_('behavior.keepalive');
|
||||
JHtml::_('jquery.framework', true);
|
||||
|
||||
if ($version->isCompatible( '4' ))
|
||||
{
|
||||
JFactory::getDocument()->getWebAssetManager()
|
||||
->useScript( 'webcomponent.toolbar-button' );
|
||||
$this->document->addScriptOptions('progressBarContainerClass', 'progress');
|
||||
$this->document->addScriptOptions('progressBarClass', 'progress-bar progress-bar-striped progress-bar-animated bg-success');
|
||||
}
|
||||
else
|
||||
{
|
||||
JHtml::_('behavior.framework');
|
||||
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( '#j2xmlContactTabs a:first' ).tab( 'show' );
|
||||
|
||||
// url validator
|
||||
document.formvalidator.setHandler( 'url', function( value, element ) {
|
||||
var regex = /^(https?|ftp|rmtp|mms):\/\/(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)*)(:(\d+))?\/?/i;
|
||||
return regex.test( value );
|
||||
});
|
||||
});
|
||||
EOL
|
||||
);
|
||||
}
|
||||
|
||||
$params = JComponentHelper::getParams('com_j2xml');
|
||||
$min = ($params->get('debug', 0) ? '' : '.min');
|
||||
$doc = JFactory::getDocument();
|
||||
$doc->addScript("../media/lib_eshiol_phpxmlrpc/js/jquery.xmlrpc{$min}.js", array('version'=>'auto'));
|
||||
$doc->addScript("../media/lib_eshiol_j2xml/js/j2xml{$min}.js", array('version'=>'auto'));
|
||||
|
||||
JText::script('COM_J2XML_SEND_ERROR');
|
||||
JText::script('COM_J2XML_SEND_ERROR_REMOTEURL_IS_REQUIRED');
|
||||
JText::script('LIB_J2XML_SENDING');
|
||||
JText::script('LIB_J2XML_MSG_XMLRPC_DISABLED');
|
||||
JText::script('LIB_J2XML_ERROR_UNKNOWN');
|
||||
JText::script('LIB_J2XML_ERROR_STATUS0');
|
||||
?>
|
||||
|
||||
<form action="<?php echo JRoute::_('index.php?option=com_j2xml'); ?>"
|
||||
id="adminForm" method="post" name="adminForm"
|
||||
class="form-horizontal form-validate">
|
||||
|
||||
<?php $fieldsets = $this->form->getFieldsets(); ?>
|
||||
|
||||
<?php echo JHtml::_($ui . '.startTabSet', 'j2xmlContact', 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', 'j2xmlContact', $name, Text::_($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'); ?>
|
||||
|
||||
<button class="hidden" id="j2xmlSendOkBtn" type="button"
|
||||
onclick="
|
||||
eshiol.removeMessages(window.parent.jQuery('#system-message-container'));
|
||||
|
||||
var f = document.adminForm;
|
||||
if (document.formvalidator.isValid(f)) {
|
||||
window.top.setTimeout('window.parent.jQuery(\'#j2xmlSendModal\').modal(\'hide\')', 700);
|
||||
|
||||
eshiol.j2xml.send({
|
||||
export_url: 'index.php?option=com_j2xml&task=contact.export&format=json&<?php echo JSession::getFormToken(); ?>=1',
|
||||
remote_url: jQuery('#jform_remote_url').val().replace(/\/?$/, '/') + 'index.php?option=com_j2xml&task=services.import&format=xmlrpc',
|
||||
compression: jQuery('#jform_compression').val(),
|
||||
password: jQuery('input:radio[name=\'jform\[password\]\']:checked').first().val(),
|
||||
fields: jQuery('input:radio[name=\'jform\[fields\]\']:checked').first().val(),
|
||||
});
|
||||
}
|
||||
else {
|
||||
var msg = new Array();
|
||||
msg.push(Joomla.JText._('COM_J2XML_SEND_ERROR'));
|
||||
if (jQuery('#jform_remote_url').hasClass('invalid')) {
|
||||
msg.push(Joomla.JText._('COM_J2XML_SEND_ERROR_REMOTEURL_IS_REQUIRED'));
|
||||
}
|
||||
// alert (msg.join('\n'));
|
||||
return false;
|
||||
}
|
||||
"></button>
|
||||
</form>
|
||||
154
administrator/components/com_j2xml/views/send/tmpl/content.php
Normal file
154
administrator/components/com_j2xml/views/send/tmpl/content.php
Normal file
@@ -0,0 +1,154 @@
|
||||
<?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\Language\Text;
|
||||
|
||||
$version = new JVersion();
|
||||
|
||||
$ui = $version->isCompatible('4') ? 'uitab' : 'bootstrap';
|
||||
|
||||
if ($version->isCompatible('3.4'))
|
||||
{
|
||||
JHtml::_('behavior.formvalidator');
|
||||
}
|
||||
else
|
||||
{
|
||||
JHtml::_('behavior.formvalidation');
|
||||
}
|
||||
|
||||
JHtml::_('behavior.keepalive');
|
||||
JHtml::_('jquery.framework', true);
|
||||
|
||||
if ($version->isCompatible( '4' ))
|
||||
{
|
||||
JFactory::getDocument()->getWebAssetManager()
|
||||
->useScript( 'webcomponent.toolbar-button' );
|
||||
$this->document->addScriptOptions('progressBarContainerClass', 'progress');
|
||||
$this->document->addScriptOptions('progressBarClass', 'progress-bar progress-bar-striped progress-bar-animated bg-success');
|
||||
}
|
||||
else
|
||||
{
|
||||
JHtml::_('behavior.framework');
|
||||
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( '#j2xmlContentTabs a:first' ).tab( 'show' );
|
||||
|
||||
// url validator
|
||||
document.formvalidator.setHandler( 'url', function( value, element ) {
|
||||
var regex = /^(https?|ftp|rmtp|mms):\/\/(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)*)(:(\d+))?\/?/i;
|
||||
return regex.test( value );
|
||||
});
|
||||
});
|
||||
EOL
|
||||
);
|
||||
}
|
||||
|
||||
$params = JComponentHelper::getParams('com_j2xml');
|
||||
$min = ($params->get('debug', 0) ? '' : '.min');
|
||||
$doc = JFactory::getDocument();
|
||||
$doc->addScript("../media/lib_eshiol_phpxmlrpc/js/jquery.xmlrpc{$min}.js", array('version'=>'auto'));
|
||||
$doc->addScript("../media/lib_eshiol_j2xml/js/j2xml{$min}.js", array('version'=>'auto'));
|
||||
|
||||
JText::script('COM_J2XML_SEND_ERROR');
|
||||
JText::script('COM_J2XML_SEND_ERROR_REMOTEURL_IS_REQUIRED');
|
||||
JText::script('LIB_J2XML_SENDING');
|
||||
JText::script('LIB_J2XML_MSG_XMLRPC_DISABLED');
|
||||
JText::script('LIB_J2XML_ERROR_UNKNOWN');
|
||||
JText::script('LIB_J2XML_ERROR_STATUS0');
|
||||
?>
|
||||
|
||||
<form action="<?php echo JRoute::_('index.php?option=com_j2xml'); ?>"
|
||||
id="adminForm" method="post" name="adminForm"
|
||||
class="form-horizontal form-validate">
|
||||
|
||||
<?php $fieldsets = $this->form->getFieldsets(); ?>
|
||||
|
||||
<?php echo JHtml::_($ui . '.startTabSet', 'j2xmlContent', 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', 'j2xmlContent', $name, Text::_($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'); ?>
|
||||
|
||||
<button class="hidden" id="j2xmlSendOkBtn" type="button"
|
||||
onclick="
|
||||
eshiol.removeMessages(window.parent.jQuery('#system-message-container'));
|
||||
|
||||
var f = document.adminForm;
|
||||
if (document.formvalidator.isValid(f)) {
|
||||
window.top.setTimeout('window.parent.jQuery(\'#j2xmlSendModal\').modal(\'hide\')', 700);
|
||||
|
||||
eshiol.j2xml.send({
|
||||
export_url: 'index.php?option=com_j2xml&task=content.export&format=json&<?php echo JSession::getFormToken(); ?>=1',
|
||||
remote_url: jQuery('#jform_remote_url').val().replace(/\/?$/, '/') + 'index.php?option=com_j2xml&task=services.import&format=xmlrpc',
|
||||
compression: jQuery('#jform_compression').val(),
|
||||
password: jQuery('input:radio[name=\'jform\[password\]\']:checked').first().val(),
|
||||
fields: jQuery('input:radio[name=\'jform\[fields\]\']:checked').first().val(),
|
||||
});
|
||||
}
|
||||
else {
|
||||
var msg = new Array();
|
||||
msg.push(Joomla.JText._('COM_J2XML_SEND_ERROR'));
|
||||
if (jQuery('#jform_remote_url').hasClass('invalid')) {
|
||||
msg.push(Joomla.JText._('COM_J2XML_SEND_ERROR_REMOTEURL_IS_REQUIRED'));
|
||||
}
|
||||
// alert (msg.join('\n'));
|
||||
return false;
|
||||
}
|
||||
"></button>
|
||||
</form>
|
||||
154
administrator/components/com_j2xml/views/send/tmpl/menus.php
Normal file
154
administrator/components/com_j2xml/views/send/tmpl/menus.php
Normal file
@@ -0,0 +1,154 @@
|
||||
<?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\Language\Text;
|
||||
|
||||
$version = new JVersion();
|
||||
|
||||
$ui = $version->isCompatible('4') ? 'uitab' : 'bootstrap';
|
||||
|
||||
if ($version->isCompatible('3.4'))
|
||||
{
|
||||
JHtml::_('behavior.formvalidator');
|
||||
}
|
||||
else
|
||||
{
|
||||
JHtml::_('behavior.formvalidation');
|
||||
}
|
||||
|
||||
JHtml::_('behavior.keepalive');
|
||||
JHtml::_('jquery.framework', true);
|
||||
|
||||
if ($version->isCompatible( '4' ))
|
||||
{
|
||||
JFactory::getDocument()->getWebAssetManager()
|
||||
->useScript( 'webcomponent.toolbar-button' );
|
||||
$this->document->addScriptOptions('progressBarContainerClass', 'progress');
|
||||
$this->document->addScriptOptions('progressBarClass', 'progress-bar progress-bar-striped progress-bar-animated bg-success');
|
||||
}
|
||||
else
|
||||
{
|
||||
JHtml::_('behavior.framework');
|
||||
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( '#j2xmlMenusTabs a:first' ).tab( 'show' );
|
||||
|
||||
// url validator
|
||||
document.formvalidator.setHandler( 'url', function( value, element ) {
|
||||
var regex = /^(https?|ftp|rmtp|mms):\/\/(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)*)(:(\d+))?\/?/i;
|
||||
return regex.test( value );
|
||||
});
|
||||
});
|
||||
EOL
|
||||
);
|
||||
}
|
||||
|
||||
$params = JComponentHelper::getParams('com_j2xml');
|
||||
$min = ($params->get('debug', 0) ? '' : '.min');
|
||||
$doc = JFactory::getDocument();
|
||||
$doc->addScript("../media/lib_eshiol_phpxmlrpc/js/jquery.xmlrpc{$min}.js", array('version'=>'auto'));
|
||||
$doc->addScript("../media/lib_eshiol_j2xml/js/j2xml{$min}.js", array('version'=>'auto'));
|
||||
|
||||
JText::script('COM_J2XML_SEND_ERROR');
|
||||
JText::script('COM_J2XML_SEND_ERROR_REMOTEURL_IS_REQUIRED');
|
||||
JText::script('LIB_J2XML_SENDING');
|
||||
JText::script('LIB_J2XML_MSG_XMLRPC_DISABLED');
|
||||
JText::script('LIB_J2XML_ERROR_UNKNOWN');
|
||||
JText::script('LIB_J2XML_ERROR_STATUS0');
|
||||
?>
|
||||
|
||||
<form action="<?php echo JRoute::_('index.php?option=com_j2xml'); ?>"
|
||||
id="adminForm" method="post" name="adminForm"
|
||||
class="form-horizontal form-validate">
|
||||
|
||||
<?php $fieldsets = $this->form->getFieldsets(); ?>
|
||||
|
||||
<?php echo JHtml::_($ui . '.startTabSet', 'j2xmlMenus', 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', 'j2xmlMenus', $name, Text::_($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'); ?>
|
||||
|
||||
<button class="hidden" id="j2xmlSendOkBtn" type="button"
|
||||
onclick="
|
||||
eshiol.removeMessages(window.parent.jQuery('#system-message-container'));
|
||||
|
||||
var f = document.adminForm;
|
||||
if (document.formvalidator.isValid(f)) {
|
||||
window.top.setTimeout('window.parent.jQuery(\'#j2xmlSendModal\').modal(\'hide\')', 700);
|
||||
|
||||
eshiol.j2xml.send({
|
||||
export_url: 'index.php?option=com_j2xml&task=menus.export&format=json&<?php echo JSession::getFormToken(); ?>=1',
|
||||
remote_url: jQuery('#jform_remote_url').val().replace(/\/?$/, '/') + 'index.php?option=com_j2xml&task=services.import&format=xmlrpc',
|
||||
compression: jQuery('#jform_compression').val(),
|
||||
password: jQuery('input:radio[name=\'jform\[password\]\']:checked').first().val(),
|
||||
fields: jQuery('input:radio[name=\'jform\[fields\]\']:checked').first().val(),
|
||||
});
|
||||
}
|
||||
else {
|
||||
var msg = new Array();
|
||||
msg.push(Joomla.JText._('COM_J2XML_SEND_ERROR'));
|
||||
if (jQuery('#jform_remote_url').hasClass('invalid')) {
|
||||
msg.push(Joomla.JText._('COM_J2XML_SEND_ERROR_REMOTEURL_IS_REQUIRED'));
|
||||
}
|
||||
// alert (msg.join('\n'));
|
||||
return false;
|
||||
}
|
||||
"></button>
|
||||
</form>
|
||||
154
administrator/components/com_j2xml/views/send/tmpl/users.php
Normal file
154
administrator/components/com_j2xml/views/send/tmpl/users.php
Normal file
@@ -0,0 +1,154 @@
|
||||
<?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\Language\Text;
|
||||
|
||||
$version = new JVersion();
|
||||
|
||||
$ui = $version->isCompatible('4') ? 'uitab' : 'bootstrap';
|
||||
|
||||
if ($version->isCompatible('3.4'))
|
||||
{
|
||||
JHtml::_('behavior.formvalidator');
|
||||
}
|
||||
else
|
||||
{
|
||||
JHtml::_('behavior.formvalidation');
|
||||
}
|
||||
|
||||
JHtml::_('behavior.keepalive');
|
||||
JHtml::_('jquery.framework', true);
|
||||
|
||||
if ($version->isCompatible( '4' ))
|
||||
{
|
||||
JFactory::getDocument()->getWebAssetManager()
|
||||
->useScript( 'webcomponent.toolbar-button' );
|
||||
$this->document->addScriptOptions('progressBarContainerClass', 'progress');
|
||||
$this->document->addScriptOptions('progressBarClass', 'progress-bar progress-bar-striped progress-bar-animated bg-success');
|
||||
}
|
||||
else
|
||||
{
|
||||
JHtml::_('behavior.framework');
|
||||
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( '#j2xmlUsersTabs a:first' ).tab( 'show' );
|
||||
|
||||
// url validator
|
||||
document.formvalidator.setHandler( 'url', function( value, element ) {
|
||||
var regex = /^(https?|ftp|rmtp|mms):\/\/(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)*)(:(\d+))?\/?/i;
|
||||
return regex.test( value );
|
||||
});
|
||||
});
|
||||
EOL
|
||||
);
|
||||
}
|
||||
|
||||
$params = JComponentHelper::getParams('com_j2xml');
|
||||
$min = ($params->get('debug', 0) ? '' : '.min');
|
||||
$doc = JFactory::getDocument();
|
||||
$doc->addScript("../media/lib_eshiol_phpxmlrpc/js/jquery.xmlrpc{$min}.js", array('version'=>'auto'));
|
||||
$doc->addScript("../media/lib_eshiol_j2xml/js/j2xml{$min}.js", array('version'=>'auto'));
|
||||
|
||||
JText::script('COM_J2XML_SEND_ERROR');
|
||||
JText::script('COM_J2XML_SEND_ERROR_REMOTEURL_IS_REQUIRED');
|
||||
JText::script('LIB_J2XML_SENDING');
|
||||
JText::script('LIB_J2XML_MSG_XMLRPC_DISABLED');
|
||||
JText::script('LIB_J2XML_ERROR_UNKNOWN');
|
||||
JText::script('LIB_J2XML_ERROR_STATUS0');
|
||||
?>
|
||||
|
||||
<form action="<?php echo JRoute::_('index.php?option=com_j2xml'); ?>"
|
||||
id="adminForm" method="post" name="adminForm"
|
||||
class="form-horizontal form-validate">
|
||||
|
||||
<?php $fieldsets = $this->form->getFieldsets(); ?>
|
||||
|
||||
<?php echo JHtml::_($ui . '.startTabSet', 'j2xmlUsers', 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', 'j2xmlUsers', $name, Text::_($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'); ?>
|
||||
|
||||
<button class="hidden" id="j2xmlSendOkBtn" type="button"
|
||||
onclick="
|
||||
eshiol.removeMessages(window.parent.jQuery('#system-message-container'));
|
||||
|
||||
var f = document.adminForm;
|
||||
if (document.formvalidator.isValid(f)) {
|
||||
window.top.setTimeout('window.parent.jQuery(\'#j2xmlSendModal\').modal(\'hide\')', 700);
|
||||
|
||||
eshiol.j2xml.send({
|
||||
export_url: 'index.php?option=com_j2xml&task=users.export&format=json&<?php echo JSession::getFormToken(); ?>=1',
|
||||
remote_url: jQuery('#jform_remote_url').val().replace(/\/?$/, '/') + 'index.php?option=com_j2xml&task=services.import&format=xmlrpc',
|
||||
compression: jQuery('#jform_compression').val(),
|
||||
password: jQuery('input:radio[name=\'jform\[password\]\']:checked').first().val(),
|
||||
fields: jQuery('input:radio[name=\'jform\[fields\]\']:checked').first().val(),
|
||||
});
|
||||
}
|
||||
else {
|
||||
var msg = new Array();
|
||||
msg.push(Joomla.JText._('COM_J2XML_SEND_ERROR'));
|
||||
if (jQuery('#jform_remote_url').hasClass('invalid')) {
|
||||
msg.push(Joomla.JText._('COM_J2XML_SEND_ERROR_REMOTEURL_IS_REQUIRED'));
|
||||
}
|
||||
// alert (msg.join('\n'));
|
||||
return false;
|
||||
}
|
||||
"></button>
|
||||
</form>
|
||||
154
administrator/components/com_j2xml/views/send/tmpl/weblinks.php
Normal file
154
administrator/components/com_j2xml/views/send/tmpl/weblinks.php
Normal file
@@ -0,0 +1,154 @@
|
||||
<?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\Language\Text;
|
||||
|
||||
$version = new JVersion();
|
||||
|
||||
$ui = $version->isCompatible('4') ? 'uitab' : 'bootstrap';
|
||||
|
||||
if ($version->isCompatible('3.4'))
|
||||
{
|
||||
JHtml::_('behavior.formvalidator');
|
||||
}
|
||||
else
|
||||
{
|
||||
JHtml::_('behavior.formvalidation');
|
||||
}
|
||||
|
||||
JHtml::_('behavior.keepalive');
|
||||
JHtml::_('jquery.framework', true);
|
||||
|
||||
if ($version->isCompatible( '4' ))
|
||||
{
|
||||
JFactory::getDocument()->getWebAssetManager()
|
||||
->useScript( 'webcomponent.toolbar-button' );
|
||||
$this->document->addScriptOptions('progressBarContainerClass', 'progress');
|
||||
$this->document->addScriptOptions('progressBarClass', 'progress-bar progress-bar-striped progress-bar-animated bg-success');
|
||||
}
|
||||
else
|
||||
{
|
||||
JHtml::_('behavior.framework');
|
||||
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( '#j2xmlWeblinksTabs a:first' ).tab( 'show' );
|
||||
|
||||
// url validator
|
||||
document.formvalidator.setHandler( 'url', function( value, element ) {
|
||||
var regex = /^(https?|ftp|rmtp|mms):\/\/(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)*)(:(\d+))?\/?/i;
|
||||
return regex.test( value );
|
||||
});
|
||||
});
|
||||
EOL
|
||||
);
|
||||
}
|
||||
|
||||
$params = JComponentHelper::getParams('com_j2xml');
|
||||
$min = ($params->get('debug', 0) ? '' : '.min');
|
||||
$doc = JFactory::getDocument();
|
||||
$doc->addScript("../media/lib_eshiol_phpxmlrpc/js/jquery.xmlrpc{$min}.js", array('version'=>'auto'));
|
||||
$doc->addScript("../media/lib_eshiol_j2xml/js/j2xml{$min}.js", array('version'=>'auto'));
|
||||
|
||||
JText::script('COM_J2XML_SEND_ERROR');
|
||||
JText::script('COM_J2XML_SEND_ERROR_REMOTEURL_IS_REQUIRED');
|
||||
JText::script('LIB_J2XML_SENDING');
|
||||
JText::script('LIB_J2XML_MSG_XMLRPC_DISABLED');
|
||||
JText::script('LIB_J2XML_ERROR_UNKNOWN');
|
||||
JText::script('LIB_J2XML_ERROR_STATUS0');
|
||||
?>
|
||||
|
||||
<form action="<?php echo JRoute::_('index.php?option=com_j2xml'); ?>"
|
||||
id="adminForm" method="post" name="adminForm"
|
||||
class="form-horizontal form-validate">
|
||||
|
||||
<?php $fieldsets = $this->form->getFieldsets(); ?>
|
||||
|
||||
<?php echo JHtml::_($ui . '.startTabSet', 'j2xmlWeblinks', 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', 'j2xmlWeblinks', $name, Text::_($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'); ?>
|
||||
|
||||
<button class="hidden" id="j2xmlSendOkBtn" type="button"
|
||||
onclick="
|
||||
eshiol.removeMessages(window.parent.jQuery('#system-message-container'));
|
||||
|
||||
var f = document.adminForm;
|
||||
if (document.formvalidator.isValid(f)) {
|
||||
window.top.setTimeout('window.parent.jQuery(\'#j2xmlSendModal\').modal(\'hide\')', 700);
|
||||
|
||||
eshiol.j2xml.send({
|
||||
export_url: 'index.php?option=com_j2xml&task=weblinks.export&format=json&<?php echo JSession::getFormToken(); ?>=1',
|
||||
remote_url: jQuery('#jform_remote_url').val().replace(/\/?$/, '/') + 'index.php?option=com_j2xml&task=services.import&format=xmlrpc',
|
||||
compression: jQuery('#jform_compression').val(),
|
||||
password: jQuery('input:radio[name=\'jform\[password\]\']:checked').first().val(),
|
||||
fields: jQuery('input:radio[name=\'jform\[fields\]\']:checked').first().val(),
|
||||
});
|
||||
}
|
||||
else {
|
||||
var msg = new Array();
|
||||
msg.push(Joomla.JText._('COM_J2XML_SEND_ERROR'));
|
||||
if (jQuery('#jform_remote_url').hasClass('invalid')) {
|
||||
msg.push(Joomla.JText._('COM_J2XML_SEND_ERROR_REMOTEURL_IS_REQUIRED'));
|
||||
}
|
||||
// alert (msg.join('\n'));
|
||||
return false;
|
||||
}
|
||||
"></button>
|
||||
</form>
|
||||
59
administrator/components/com_j2xml/views/send/view.html.php
Normal file
59
administrator/components/com_j2xml/views/send/view.html.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<?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();
|
||||
|
||||
/**
|
||||
* View class for send items.
|
||||
*
|
||||
* @since 3.9.0
|
||||
*/
|
||||
class J2xmlViewSend extends JViewLegacy
|
||||
{
|
||||
|
||||
/**
|
||||
* The JForm object
|
||||
*
|
||||
* @var JForm
|
||||
*/
|
||||
protected $form;
|
||||
|
||||
/**
|
||||
* Display the view
|
||||
*
|
||||
* @param string $tpl
|
||||
* The name of the template file to parse; automatically searches through the template paths.
|
||||
*
|
||||
* @return mixed A string if successful, otherwise an Error object.
|
||||
*/
|
||||
public function display($tpl = null)
|
||||
{
|
||||
JLog::add(new JLogEntry(__METHOD__, JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
// Initialiase variables.
|
||||
$this->form = $this->get('Form');
|
||||
|
||||
// Check for errors.
|
||||
if (count($errors = $this->get('Errors')))
|
||||
{
|
||||
throw new Exception(implode("\n", $errors), 500);
|
||||
}
|
||||
|
||||
return parent::display($tpl);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
<?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__) . '/../raw.php';
|
||||
|
||||
/**
|
||||
* J2XML Component User notes RAW View
|
||||
*
|
||||
* @since 3.9.213
|
||||
*/
|
||||
class J2xmlViewUsernotes extends J2xmlView
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param array $config
|
||||
* A named configuration array for object construction.
|
||||
* name: the name (optional) of the view (defaults to the view class name suffix).
|
||||
* charset: the character set to use for display
|
||||
* escape: the name (optional) of the function to use for escaping strings
|
||||
* base_path: the parent path (optional) of the views directory (defaults to the component folder)
|
||||
* template_plath: the path (optional) of the layout directory (defaults to base_path + /views/ + view name
|
||||
* helper_path: the path (optional) of the helper files (defaults to base_path + /helpers/)
|
||||
* layout: the layout (optional) to use to display the view
|
||||
*/
|
||||
public function __construct($config = array())
|
||||
{
|
||||
JLog::add(new JLogEntry(__METHOD__, JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
parent::__construct($config);
|
||||
|
||||
$jform = JFactory::getApplication()->input->post->get('jform', array(), 'array');
|
||||
|
||||
$this->params->loadArray($jform);
|
||||
}
|
||||
}
|
||||
54
administrator/components/com_j2xml/views/users/view.raw.php
Normal file
54
administrator/components/com_j2xml/views/users/view.raw.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?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__) . '/../raw.php';
|
||||
|
||||
/**
|
||||
* J2XML Component Users RAW View
|
||||
*
|
||||
* @since 1.5.3beta4.39
|
||||
*/
|
||||
class J2xmlViewUsers extends J2xmlView
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param array $config
|
||||
* A named configuration array for object construction.
|
||||
* name: the name (optional) of the view (defaults to the view class name suffix).
|
||||
* charset: the character set to use for display
|
||||
* escape: the name (optional) of the function to use for escaping strings
|
||||
* base_path: the parent path (optional) of the views directory (defaults to the component folder)
|
||||
* template_plath: the path (optional) of the layout directory (defaults to base_path + /views/ + view name
|
||||
* helper_path: the path (optional) of the helper files (defaults to base_path + /helpers/)
|
||||
* layout: the layout (optional) to use to display the view
|
||||
*/
|
||||
public function __construct($config = array())
|
||||
{
|
||||
JLog::add(new JLogEntry(__METHOD__, JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
parent::__construct($config);
|
||||
|
||||
$jform = JFactory::getApplication()->input->post->get('jform', array(), 'array');
|
||||
|
||||
$this->params->loadArray($jform);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?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__) . '/../raw.php';
|
||||
|
||||
/**
|
||||
* J2XML Component Viewlevels View
|
||||
*/
|
||||
class J2xmlViewViewlevels extends J2xmlView
|
||||
{
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,54 @@
|
||||
<?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__) . '/../raw.php';
|
||||
|
||||
/**
|
||||
* J2XML Component Weblinks RAW View
|
||||
*
|
||||
* @since 3.6.161
|
||||
*/
|
||||
class J2xmlViewWeblinks extends J2xmlView
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param array $config
|
||||
* A named configuration array for object construction.
|
||||
* name: the name (optional) of the view (defaults to the view class name suffix).
|
||||
* charset: the character set to use for display
|
||||
* escape: the name (optional) of the function to use for escaping strings
|
||||
* base_path: the parent path (optional) of the views directory (defaults to the component folder)
|
||||
* template_plath: the path (optional) of the layout directory (defaults to base_path + /views/ + view name
|
||||
* helper_path: the path (optional) of the helper files (defaults to base_path + /helpers/)
|
||||
* layout: the layout (optional) to use to display the view
|
||||
*/
|
||||
public function __construct($config = array())
|
||||
{
|
||||
JLog::add(new JLogEntry(__METHOD__, JLog::DEBUG, 'com_j2xml'));
|
||||
|
||||
parent::__construct($config);
|
||||
|
||||
$jform = JFactory::getApplication()->input->post->get('jform', array(), 'array');
|
||||
|
||||
$this->params->loadArray($jform);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user