Skip to content

Commit

Permalink
first release
Browse files Browse the repository at this point in the history
  • Loading branch information
eshiol committed Jun 8, 2015
1 parent cb54a53 commit a52bc24
Show file tree
Hide file tree
Showing 141 changed files with 13,897 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# =========================
# Reserved files
# =========================

make.cmd
jce_j2xml_profile.xml
CHANGELOG
LICENSE

# Windows image file caches
Thumbs.db
ehthumbs.db
Expand All @@ -17,6 +26,7 @@ $RECYCLE.BIN/
# Windows shortcuts
*.lnk


# =========================
# Operating System Files
# =========================
Expand Down
240 changes: 240 additions & 0 deletions administrator/components/com_j2xml/buttons/import.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,240 @@
<?php
/**
* @version 3.1.120 administrator/components/com_j2xml/buttons/import.php
* @package J2XML
* @subpackage com_j2xml
* @since 1.5.0
*
* @author Helios Ciancio <[email protected]>
* @link http://www.eshiol.it
* @copyright Copyright (C) 2010-2014 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('Restricted access.');

if (version_compare(JPlatform::RELEASE, '12', 'ge'))
{
class JToolbarButtonImport extends JToolbarButton
{
/**
* Button type
*
* @var string
*/
protected $_name = 'Import';

/**
* Fetch the HTML for the button
*
* @param string $type Unused string.
* @param string $name The name of the button icon class.
* @param string $text Button text.
* @param string $task Task associated with the button.
* @param boolean $list True to allow lists
*
* @return string HTML string for the button
*
* @since 3.0
*/
public function fetchButton($type='Import', $name = '', $text1 = '', $text2 = '', $task = 'import', $list = true)
// public function fetchButton($type = 'Import', $name = '', $text = '', $task = '', $list = false)
{
$doAction = 'index.php?option=com_j2xml&amp;task='.$task;
$doTask = $this->_getCommand($name, $task, $list);

$class = $this->fetchIconClass($name);
if ($name == "apply" || $name == "new")
{
$btnClass = "btn btn-small btn-success";
$iconWhite = "icon-white";
}
else
{
$btnClass = "btn btn-small";
$iconWhite = "";
}

JFactory::getDocument()->addStyleDeclaration('div#toolbar div#toolbar-'.$name.' button.btn i.icon-'.$name.'-import::before {color: #2F96B4;content: "g";}');
JFactory::getDocument()->addStyleDeclaration('div#toolbar div#toolbar-'.$name.' button.btn i.icon-'.$name.'-open::before {color: #2F96B4;content: "r";}');
JFactory::getDocument()->addStyleDeclaration('div#toolbar div#toolbar-'.$name.' button.btn i.icon-'.$name.'-model::before {color: #2F96B4;content: "-";}');

$html = "";
$html .= "<form name=\"".$name."Form\" method=\"post\" enctype=\"multipart/form-data\" action=\"$doAction\" style=\"margin:0\">\n";

$i18n_text = JText::_($text2);
$class = $this->fetchIconClass($name.'-import');
$html .="
<div class=\"btn-group input-append\" style=\"margin-bottom:0px\">
<input type=\"file\" name=\"file_upload\" class=\"js-stools-search-string\" />
<input type=\"text\" name=\"remote_file\" placeholder=\"URL\" value=\"\" style=\"line-height:14px;height:14px;display:none\">
<button title=\"\" class=\"btn btn-small hasTooltip\" data-toggle=\"dropdown\">
<i class=\"caret\" style=\"margin-bottom:0\"></i>
</button>
<ul class=\"dropdown-menu\">
<li><a href=\"#\" onclick=\"javascript:document.j2xmlForm.file_upload.style.display='';document.j2xmlForm.remote_file.style.display='none';\">Local file</a></li>
<li><a href=\"#\" onclick=\"javascript:document.j2xmlForm.file_upload.style.display='none';document.j2xmlForm.remote_file.style.display='';\">URL</a></li>
</ul>
<button title=\"Import\" class=\"btn btn-small hasTooltip\" type=\"submit\" data-original-title=\"$i18n_text\">
<i class=\"icon-j2xml-import\"></i> $i18n_text
</button>
</div>
";

$html .= JHTML::_('form.token');
$html .= "</form> \n";
return $html;
}
/**
* Get the button CSS Id
*
* @param string $type Unused string.
* @param string $name Name to be used as apart of the id
* @param string $text Button text
* @param string $task The task associated with the button
* @param boolean $list True to allow use of lists
* @param boolean $hideMenu True to hide the menu on click
*
* @return string Button CSS Id
*
* @since 3.0
*/
public function fetchId($type = 'Import', $name = '', $text = '', $task = '', $list = true, $hideMenu = false)
{
return $this->_parent->getName() . '-' . $name;
}

/**
* Get the JavaScript command for the button
*
* @param string $name The task name as seen by the user
* @param string $task The task used by the application
* @param boolean $list True is requires a list confirmation.
*
* @return string JavaScript command string
*
* @since 3.0
*/
private function _getCommand($name, $task, $list)
{
$todo = JString::strtolower(JText::_($name));
$message = JText::sprintf('COM_J2XML_BUTTON_PLEASE_SELECT_A_FILE_TO', $todo);
$message = addslashes($message);

return "javascript:if((document.".$name."Form.file_upload.value=='') && (document.".$name."Form.remote_file.value=='http://')){alert('$message');}else{ document.".$name."Form.submit()}";
}
}

} else {

class JButtonImport extends JButton
{
/**
* Button type
*
* @access public
* @var string
*/
var $_name = 'Import';

function fetchButton($type='Import', $name = '', $text1 = '', $text2 = '', $task = 'import', $list = true, $hideMenu = false )
{
// Prepare the query
$db = JFactory::getDBO();
$query = $db->getQuery(true);
$query->select($db->quoteName('element'));
$query->from($db->quoteName('#__extensions'));
$query->where($db->quoteName('type') . ' = ' . $db->quote('library'));
$query->where($db->quoteName('element') . ' = ' . $db->quote('filemanager'));
$query->where($db->quoteName('enabled') . ' = 1');
$db->setQuery($query);
$filemanagerlib = ($db->loadResult() != null);

$doAction = 'index.php?option=com_j2xml&amp;task='.$task;
$doTask = $this->_getCommand($name, $task, $hideMenu);

$html = "";
$html .= "<form name=\"".$name."Form\" method=\"post\" enctype=\"multipart/form-data\" action=\"$doAction\" style=\"float:left\">\n";
$html .= "<input type=\"file\" name=\"file_upload\" />\n";
if ($filemanagerlib)
{
JHTML::script('FileManager.js','media/lib_filemanager/Source/');
JHTML::script('Language.en.js','media/lib_filemanager/Language/');
JHtml::script('com_j2xml/selectfile.js', false, true);
JHTML::stylesheet('FileManager.css','media/lib_filemanager/Css/');
$html .= "<input id=\"remote_file\" name=\"remote_file\" />";
}
$html .= JHTML::_('form.token');
$html .= "</form>\n";

if ($filemanagerlib)
{
$i18n_text = JText::_($text1);
$class = $this->fetchIconClass($name.'-open');
$html .= "<a href=\"#\" id=\"{$name}-open\" class=\"toolbar\">\n";
$html .= "<span class=\"$class\" title=\"$i18n_text\">\n";
$html .= "</span>\n";
$html .= "$i18n_text\n";
$html .= "</a>\n";
}
$i18n_text = JText::_($text2);
$class = $this->fetchIconClass($name.'-import');
$html .= "<a href=\"#\" onclick=\"$doTask\" class=\"toolbar\">\n";
$html .= "<span class=\"$class\" title=\"$i18n_text\">\n";
$html .= "</span>\n";
$html .= "$i18n_text\n";
$html .= "</a>\n";

return $html;
}

/**
* Get the name of the toolbar.
*
* @return string
* @since 1.5
*/
private function _getToolbarName()
{
return $this->_parent->getName();
}

/**
* Get the button CSS Id
*
* @access public
* @return string Button CSS Id
* @since 1.5
*/
public function fetchId($type='Import', $name = '', $text = '', $task = '', $list = true, $hideMenu = false)
{
return $this->_getToolbarName().'-'.$name;
}

/**
* Get the JavaScript command for the button
*
* @access private
* @param string $name The task name as seen by the user
* @param string $task The task used by the application
* @param ??? $list
* @param boolean $hide
* @return string JavaScript command string
* @since 1.5
*/
private function _getCommand($name, $task, $hide)
{
$todo = JString::strtolower(JText::_($name));
$message = JText::sprintf('COM_J2XML_BUTTON_PLEASE_SELECT_A_FILE_TO', $todo);
$message = addslashes($message);
$hidecode = $hide ? 'hideMainMenu();' : '';

return "javascript:if((document.".$name."Form.file_upload.value=='') && (document.".$name."Form.remote_file.value=='')){alert('$message');}else{ $hidecode document.".$name."Form.submit()}";
}
}
}
1 change: 1 addition & 0 deletions administrator/components/com_j2xml/buttons/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>
1 change: 1 addition & 0 deletions administrator/components/com_j2xml/config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?xml version="1.0" encoding="utf-8"?><config> <fieldset name="export" label="COM_J2XML_CONFIG_EXPORT_HEADER_LABEL" description="COM_J2XML_CONFIG_EXPORT_HEADER_DESC"> <field name="export_images" type="radio" class="btn-group" default="1" label="COM_J2XML_CONFIG_EXPORT_IMAGES_LABEL" description="COM_J2XML_CONFIG_EXPORT_IMAGES_DESC"> <option value="0">JNO </option> <option value="1">JYES </option> </field> <field name="export_users" type="radio" class="btn-group" default="1" label="COM_J2XML_CONFIG_EXPORT_USERS_LABEL" description="COM_J2XML_CONFIG_EXPORT_USERS_DESC"> <option value="0">JNO </option> <option value="1">JYES </option> </field> <field name="export_gzip" type="radio" class="btn-group" default="0" label="COM_J2XML_CONFIG_EXPORT_GZIP_LABEL" description="COM_J2XML_CONFIG_EXPORT_GZIP_DESC"> <option value="0">JNO </option> <option value="1">JYES </option> </field> </fieldset> <fieldset name="import" label="COM_J2XML_CONFIG_IMPORT_HEADER_LABEL" description="COM_J2XML_CONFIG_IMPORT_HEADER_DESC"> <field name="import_content" type="list" default="2" label="COM_J2XML_CONFIG_IMPORT_CONTENT_LABEL" description="COM_J2XML_CONFIG_IMPORT_CONTENT_DESC"> <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="list" default="1" label="COM_J2XML_CONFIG_IMPORT_IMAGES_LABEL" description="COM_J2XML_CONFIG_IMPORT_IMAGES_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_categories" type="list" default="1" label="COM_J2XML_CONFIG_IMPORT_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> <field name="import_users" type="list" default="1" label="COM_J2XML_CONFIG_IMPORT_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_weblinks" type="list" default="1" label="COM_J2XML_CONFIG_IMPORT_WEBLINKS_LABEL" description="COM_J2XML_CONFIG_IMPORT_WEBLINKS_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="articles" label="COM_J2XML_CONFIG_CONTENT_HEADER_LABEL" description="COM_J2XML_CONFIG_CONTENT_HEADER_DESC"> <field name="keep_id" type="radio" class="btn-group" 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="keep_access" type="list" default="0" label="COM_J2XML_CONFIG_KEEP_ACCESS_LABEL" description="COM_J2XML_CONFIG_KEEP_ACCESS_DESC"> <option value="0">COM_J2XML_CONFIG_KEEP_ACCESS_YES </option> <option value="1">COM_J2XML_CONFIG_KEEP_ACCESS_PUBLIC </option> <option value="2">COM_J2XML_CONFIG_KEEP_ACCESS_REGISTERED </option> <option value="3">COM_J2XML_CONFIG_KEEP_ACCESS_SPECIAL </option> </field> <field name="keep_state" type="list" default="2" label="COM_J2XML_CONFIG_KEEP_STATE_LABEL" description="COM_J2XML_CONFIG_KEEP_STATE_DESC"> <option value="2">COM_J2XML_CONFIG_KEEP_STATE_YES </option> <option value="1">COM_J2XML_CONFIG_KEEP_STATE_PUBLISHED </option> <option value="0">COM_J2XML_CONFIG_KEEP_STATE_UNPUBLISHED </option> </field> <field name="keep_author" type="radio" class="btn-group" default="1" label="COM_J2XML_CONFIG_KEEP_AUTHOR_LABEL" description="COM_J2XML_CONFIG_KEEP_AUTHOR_DESC"> <option value="0">JNO </option> <option value="1">JYES </option> </field> <field name="keep_category" type="list" default="1" label="COM_J2XML_CONFIG_KEEP_CATEGORY_LABEL" description="COM_J2XML_CONFIG_KEEP_CATEGORY_DESC"> <option value="1">JYES </option> <option value="2">COM_J2XML_CONFIG_KEEP_CATEGORY_FORCE </option> </field> <field name="category" type="category" extension="com_content" label="COM_J2XML_CONFIG_KEEP_CATEGORY_FORCE_CATEGORY_LABEL" description="COM_J2XML_CONFIG_KEEP_CATEGORY_FORCE_CATEGORY_DESC" /> <field name="keep_attribs" type="radio" class="btn-group" default="1" label="COM_J2XML_CONFIG_KEEP_ATTRIBS_LABEL" description="COM_J2XML_CONFIG_KEEP_ATTRIBS_DESC"> <option value="0">JNO </option> <option value="1">JYES </option> </field> <field name="keep_metadata" type="radio" class="btn-group" default="1" label="COM_J2XML_CONFIG_KEEP_METADATA_LABEL" description="COM_J2XML_CONFIG_KEEP_METADATA_DESC"> <option value="0">JNO </option> <option value="1">JYES </option> </field> <field name="keep_frontpage" type="radio" class="btn-group" default="1" label="COM_J2XML_CONFIG_KEEP_FRONTPAGE_LABEL" description="COM_J2XML_CONFIG_KEEP_FRONTPAGE_DESC"> <option value="0">JNO </option> <option value="1">JYES </option> </field> <field name="keep_rating" type="radio" class="btn-group" default="1" label="COM_J2XML_CONFIG_KEEP_RATING_LABEL" description="COM_J2XML_CONFIG_KEEP_RATING_DESC"> <option value="0">JNO </option> <option value="1">JYES </option> </field> </fieldset> <fieldset name="user" label="COM_J2XML_CONFIG_USERS_HEADER_LABEL" description="COM_J2XML_CONFIG_USERS_HEADER_DESC"> <field name="keep_user_id" type="radio" class="btn-group" 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="keep_user_attribs" type="radio" class="btn-group" default="1" label="COM_J2XML_CONFIG_KEEP_ATTRIBS_LABEL" description="COM_J2XML_CONFIG_KEEP_ATTRIBS_DESC"> <option value="0">JNO </option> <option value="1">JYES </option> </field> </fieldset> <fieldset name="advanced" label="COM_J2XML_CONFIG_ADVANCED_HEADER_LABEL" description="COM_J2XML_CONFIG_ADVANCED_HEADER_DESC"> <field name="root" type="hidden" default="" /> <field name="development" type="hidden" default="0" /> <field name="debug" type="radio" class="btn-group" default="0" label="COM_J2XML_CONFIG_DEBUG_LABEL" description="COM_J2XML_CONFIG_DEBUG_DESC"> <option value="0">JNO </option> <option value="1">JYES </option> </field> </fieldset> </config>
Expand Down
64 changes: 64 additions & 0 deletions administrator/components/com_j2xml/controller.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?php
/**
* @version 3.0.94 controller.php
*
* @package J2XML
* @subpackage com_j2xml
* @since 1.5.3
*
* @author Helios Ciancio <[email protected]>
* @link http://www.eshiol.it
* @copyright Copyright (C) 2010-2013 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');

/**
* J2XML master display controller
*/
class J2XMLController extends JControllerAbstract
{
/**
* 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)
{
require_once JPATH_COMPONENT.'/helpers/j2xml.php';
J2XMLHelper::updateReset();

$view = JRequest::getCmd('view', '');
$layout = JRequest::getCmd('layout', 'default');
$id = JRequest::getInt('id');

// Check for edit form.
if ($view == 'website' && $layout == 'edit' && !$this->checkEditId('com_j2xml.edit.website', $id)) {

// Somehow the person just went to the form - we don't allow that.
$this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
$this->setMessage($this->getError(), 'error');
$this->setRedirect(JRoute::_('index.php?option=com_j2xml&view=websites', false));

return false;
}
elseif ($view == '') {
$this->setRedirect(JRoute::_('index.php?option=com_j2xml&view=cpanel', false));
return false;
}
parent::display();
return $this;
}
}
Loading

0 comments on commit a52bc24

Please sign in to comment.