Added the option to customize the import of data per view.

This commit is contained in:
Llewellyn van der Merwe 2016-05-04 05:53:33 +01:00
parent 951e0c1f5d
commit 6b70aa45e6
374 changed files with 4370 additions and 2718 deletions

View File

@ -1,4 +1,4 @@
# Component Builder (2.1.4) # Component Builder (2.1.5)
This is a [Joomla 3.x] (http://www.joomla.org/) component. This is a [Joomla 3.x] (http://www.joomla.org/) component.
@ -32,32 +32,32 @@ Would you require more help VDM.io has a number of support plans available [visi
+ *Author*: [Llewellyn van der Merwe] (mailto:info@vdm.io) + *Author*: [Llewellyn van der Merwe] (mailto:info@vdm.io)
+ *Name*: [Component Builder] (https://www.vdm.io/joomla-component-builder) + *Name*: [Component Builder] (https://www.vdm.io/joomla-component-builder)
+ *First Build*: 30th April, 2015 + *First Build*: 30th April, 2015
+ *Last Build*: 2nd May, 2016 + *Last Build*: 4th May, 2016
+ *Version*: 2.1.4 + *Version*: 2.1.5
+ *Copyright*: Copyright (C) 2015. All Rights Reserved + *Copyright*: Copyright (C) 2015. All Rights Reserved
+ *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
## Build Time ## Build Time
**225 Hours** or **28 Eight Hour Days** (actual time the author saved - **227 Hours** or **28 Eight Hour Days** (actual time the author saved -
due to [Automated Component Builder] (https://www.vdm.io/joomla-component-builder)) due to [Automated Component Builder] (https://www.vdm.io/joomla-component-builder))
> (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**, > (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**,
> never making one mistake or taking any coffee break.) > never making one mistake or taking any coffee break.)
+ *Line count*: **80712** + *Line count*: **81571**
+ *File count*: **496** + *File count*: **498**
+ *Folder count*: **98** + *Folder count*: **98**
**148 Hours** or **19 Eight Hour Days** (the actual time the author spent) **150 Hours** or **19 Eight Hour Days** (the actual time the author spent)
> (with the following break down: > (with the following break down:
> **debugging @56hours** = codingtime / 4; > **debugging @57hours** = codingtime / 4;
> **planning @32hours** = codingtime / 7; > **planning @32hours** = codingtime / 7;
> **mapping @23hours** = codingtime / 10; > **mapping @23hours** = codingtime / 10;
> **office @38hours** = codingtime / 6;) > **office @38hours** = codingtime / 6;)
**373 Hours** or **47 Eight Hour Days** **377 Hours** or **47 Eight Hour Days**
(a total of the realistic time frame for this project) (a total of the realistic time frame for this project)
> (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**, > (if creating a folder and file took **5 seconds** and writing one line of code took **10 seconds**,

View File

@ -9,8 +9,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage admin.css @subpackage admin.css

View File

@ -9,8 +9,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage admin_view.css @subpackage admin_view.css

View File

@ -9,8 +9,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage admin_views.css @subpackage admin_views.css

View File

@ -9,8 +9,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage component.css @subpackage component.css

View File

@ -9,8 +9,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage components.css @subpackage components.css

View File

@ -9,8 +9,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage custom_admin_view.css @subpackage custom_admin_view.css

View File

@ -9,8 +9,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage custom_admin_views.css @subpackage custom_admin_views.css

View File

@ -9,8 +9,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage dashboard.css @subpackage dashboard.css

View File

@ -9,8 +9,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage dynamic_get.css @subpackage dynamic_get.css

View File

@ -9,8 +9,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage dynamic_gets.css @subpackage dynamic_gets.css

View File

@ -9,8 +9,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage field.css @subpackage field.css

View File

@ -9,8 +9,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage fields.css @subpackage fields.css

View File

@ -9,8 +9,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage fieldtype.css @subpackage fieldtype.css

View File

@ -9,8 +9,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage fieldtypes.css @subpackage fieldtypes.css

View File

@ -9,8 +9,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage help_document.css @subpackage help_document.css

View File

@ -9,8 +9,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage help_documents.css @subpackage help_documents.css

View File

@ -9,8 +9,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage layout.css @subpackage layout.css

View File

@ -9,8 +9,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage layouts.css @subpackage layouts.css

View File

@ -9,8 +9,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage site_view.css @subpackage site_view.css

View File

@ -9,8 +9,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage site_views.css @subpackage site_views.css

View File

@ -9,8 +9,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage snippet.css @subpackage snippet.css

View File

@ -9,8 +9,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage snippets.css @subpackage snippets.css

View File

@ -9,8 +9,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage template.css @subpackage template.css

View File

@ -9,8 +9,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage templates.css @subpackage templates.css

View File

@ -0,0 +1,70 @@
<?php
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@package Component Builder
@subpackage componentbuilder.php
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
Builds Complex Joomla Components
/-----------------------------------------------------------------------------------------------------------------------------*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
?>
###BOM###
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
/**
* ###Component### ###View### Controller
*/
class ###Component###Controller###View### extends JControllerLegacy
{
/**
* Import an spreadsheet.
*
* @return void
*/
public function import()
{
// Check for request forgeries
JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
$model = $this->getModel('import');
if ($model->import())
{
$cache = JFactory::getCache('mod_menu');
$cache->clean();
// TODO: Reset the users acl here as well to kill off any missing bits
}
$app = JFactory::getApplication();
$redirect_url = $app->getUserState('com_###component###.redirect_url');
if (empty($redirect_url))
{
$redirect_url = JRoute::_('index.php?option=com_###component###&view=###view###', false);
}
else
{
// wipe out the user state when we're going to redirect
$app->setUserState('com_###component###.redirect_url', '');
$app->setUserState('com_###component###.message', '');
$app->setUserState('com_###component###.extension_message', '');
}
$this->setRedirect($redirect_url);
}
}

View File

@ -0,0 +1,498 @@
<?php
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@package Component Builder
@subpackage componentbuilder.php
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
Builds Complex Joomla Components
/-----------------------------------------------------------------------------------------------------------------------------*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
?>
###BOM###
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
/**
* ###Component### ###View### Model
*/
class ###Component###Model###View### extends JModelLegacy
{
/**
* @var object JTable object
*/
protected $_table = null;
/**
* @var object JTable object
*/
protected $_url = null;
/**
* Model context string.
*
* @var string
*/
protected $_context = 'com_###component###.import';
/**
* Import Settings
*/
protected $getType = NULL;
protected $dataType = NULL;
/**
* Method to auto-populate the model state.
*
* Note. Calling getState in this method will result in recursion.
*
* @return void
*
*/
protected function populateState()
{
$app = JFactory::getApplication('administrator');
$this->setState('message', $app->getUserState('com_###component###.message'));
$app->setUserState('com_###component###.message', '');
// Recall the 'Import from Directory' path.
$path = $app->getUserStateFromRequest($this->_context . '.import_directory', 'import_directory', $app->get('tmp_path'));
$this->setState('import.directory', $path);
// set uploading values
$this->use_streams = false;
$this->allow_unsafe = false;
$this->safeFileOptions = array();
parent::populateState();
}
/**
* Import an spreadsheet from either folder, url or upload.
*
* @return boolean result of import
*
*/
public function import()
{
$this->setState('action', 'import');
$app = JFactory::getApplication();
$session = JFactory::getSession();
$package = null;
$continue = false;
// get import type
$this->getType = $app->input->getString('gettype', NULL);
// get import type
$this->dataType = $session->get('dataType_VDM_IMPORTINTO', NULL);
if ($package === null)
{
switch ($this->getType)
{
case 'folder':
// Remember the 'Import from Directory' path.
$app->getUserStateFromRequest($this->_context . '.import_directory', 'import_directory');
$package = $this->_getPackageFromFolder();
break;
case 'upload':
$package = $this->_getPackageFromUpload();
break;
case 'url':
$package = $this->_getPackageFromUrl();
break;
case 'continue':
$continue = true;
$package = $session->get('package', null);
$package = json_decode($package, true);
// clear session
$session->clear('package');
$session->clear('dataType');
$session->clear('hasPackage');
break;
default:
$app->setUserState('com_###component###.message', JText::_('COM_###COMPONENT###_IMPORT_NO_IMPORT_TYPE_FOUND'));
return false;
break;
}
}
// Was the package valid?
if (!$package || !$package['type'])
{
if (in_array($this->getType, array('upload', 'url')))
{
$this->remove($package['packagename']);
}
$app->setUserState('com_###component###.message', JText::_('COM_###COMPONENT###_IMPORT_UNABLE_TO_FIND_IMPORT_PACKAGE'));
return false;
}
// first link data to table headers
if(!$continue){
$package = json_encode($package);
$session->set('package', $package);
$session->set('dataType', $this->dataType);
$session->set('hasPackage', true);
return true;
}
// set the data
$headerList = json_decode($session->get($this->dataType.'_VDM_IMPORTHEADERS', false), true);
if (!$this->setData($package,$this->dataType,$headerList))
{
// There was an error importing the package
$msg = JText::_('COM_###COMPONENT###_IMPORT_ERROR');
$back = $session->get('backto_VDM_IMPORT', NULL);
if ($back)
{
$app->setUserState('com_###component###.redirect_url', 'index.php?option=com_###component###&view='.$back);
$session->clear('backto_VDM_IMPORT');
}
$result = false;
}
else
{
// Package imported sucessfully
$msg = JText::sprintf('COM_###COMPONENT###_IMPORT_SUCCESS', $package['packagename']);
$back = $session->get('backto_VDM_IMPORT', NULL);
if ($back)
{
$app->setUserState('com_###component###.redirect_url', 'index.php?option=com_###component###&view='.$back);
$session->clear('backto_VDM_IMPORT');
}
$result = true;
}
// Set some model state values
$app->enqueueMessage($msg);
// remove file after import
$this->remove($package['packagename']);
$session->clear($this->getType.'_VDM_IMPORTHEADERS');
return $result;
}
/**
* Works out an importation spreadsheet from a HTTP upload
*
* @return spreadsheet definition or false on failure
*/
protected function _getPackageFromUpload()
{
// 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('import_package', null, 'raw');
// Make sure that file uploads are enabled in php
if (!(bool) ini_get('file_uploads'))
{
JError::raiseWarning('', JText::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTFILE'));
return false;
}
// If there is no uploaded file, we have a problem...
if (!is_array($userfile))
{
JError::raiseWarning('', JText::_('COM_###COMPONENT###_IMPORT_MSG_NO_FILE_SELECTED'));
return false;
}
// Check if there was a problem uploading the file.
if ($userfile['error'] || $userfile['size'] < 1)
{
JError::raiseWarning('', JText::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTUPLOADERROR'));
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');
$p_file = JFile::upload($tmp_src, $tmp_dest, $this->use_streams, $this->allow_unsafe, $this->safeFileOptions);
// Was the package downloaded?
if (!$p_file)
{
$session = JFactory::getSession();
$session->clear('package');
$session->clear('dataType');
$session->clear('hasPackage');
// was not uploaded
return false;
}
// check that this is a valid spreadsheet
$package = $this->check($userfile['name']);
return $package;
}
/**
* Import an spreadsheet from a directory
*
* @return array Spreadsheet details or false on failure
*
*/
protected function _getPackageFromFolder()
{
$input = JFactory::getApplication()->input;
// Get the path to the package to import
$p_dir = $input->getString('import_directory');
$p_dir = JPath::clean($p_dir);
// Did you give us a valid path?
if (!file_exists($p_dir))
{
JError::raiseWarning('', JText::_('COM_###COMPONENT###_IMPORT_MSG_PLEASE_ENTER_A_PACKAGE_DIRECTORY'));
return false;
}
// Detect the package type
$type = $this->getType;
// Did you give us a valid package?
if (!$type)
{
JError::raiseWarning('', JText::_('COM_###COMPONENT###_IMPORT_MSG_PATH_DOES_NOT_HAVE_A_VALID_PACKAGE'));
}
// check the extention
switch(strtolower(pathinfo($p_dir, PATHINFO_EXTENSION))){
case 'xls':
case 'ods':
case 'csv':
break;
default:
JError::raiseWarning('', JText::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'));
return false;
break;
}
$package['packagename'] = null;
$package['dir'] = $p_dir;
$package['type'] = $type;
return $package;
}
/**
* Import an spreadsheet from a URL
*
* @return Package details or false on failure
*
*/
protected function _getPackageFromUrl()
{
$input = JFactory::getApplication()->input;
// Get the URL of the package to import
$url = $input->getString('import_url');
// Did you give us a URL?
if (!$url)
{
JError::raiseWarning('', JText::_('COM_###COMPONENT###_IMPORT_MSG_ENTER_A_URL'));
return false;
}
// Download the package at the URL given
$p_file = JInstallerHelper::downloadPackage($url);
// Was the package downloaded?
if (!$p_file)
{
JError::raiseWarning('', JText::_('COM_###COMPONENT###_IMPORT_MSG_INVALID_URL'));
return false;
}
// check that this is a valid spreadsheet
$package = $this->check($p_file);
return $package;
}
/**
* Check a file and verifies it as a spreadsheet file
* Supports .csv .xlsx .xls and .ods
*
* @param string $p_filename The uploaded package filename or import directory
*
* @return array of elements
*
*/
protected function check($archivename)
{
// Clean the name
$archivename = JPath::clean($archivename);
// check the extention
switch(strtolower(pathinfo($archivename, PATHINFO_EXTENSION))){
case 'xls':
case 'ods':
case 'csv':
break;
default:
// Cleanup the import files
$this->remove($archivename);
JError::raiseWarning('', JText::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'));
return false;
break;
}
$config = JFactory::getConfig();
// set Package Name
$check['packagename'] = $archivename;
// set directory
$check['dir'] = $config->get('tmp_path'). '/' .$archivename;
// set type
$check['type'] = $this->getType;
return $check;
}
/**
* Clean up temporary uploaded spreadsheet
*
* @param string $package Name of the uploaded spreadsheet file
*
* @return boolean True on success
*
*/
protected function remove($package)
{
jimport('joomla.filesystem.file');
$config = JFactory::getConfig();
$package = $config->get('tmp_path'). '/' .$package;
// Is the package file a valid file?
if (is_file($package))
{
JFile::delete($package);
}
elseif (is_file(JPath::clean($package)))
{
// It might also be just a base filename
JFile::delete(JPath::clean($package));
}
}
/**
* Set the data from the spreadsheet to the database
*
* @param string $package Paths to the uploaded package file
*
* @return boolean false on failure
*
**/
protected function setData($package,$table,$target_headers)
{###IMPORT_SETDATE_METOD_CUSTOM###
}
/**
* Save the data from the file to the database
*
* @param string $package Paths to the uploaded package file
*
* @return boolean false on failure
*
**/
protected function save($data,$table)
{###IMPORT_SAVE_METOD_CUSTOM###
}
protected function getAlias($name,$type = false)
{
// sanitize the name to an alias
if (JFactory::getConfig()->get('unicodeslugs') == 1)
{
$alias = JFilterOutput::stringURLUnicodeSlug($name);
}
else
{
$alias = JFilterOutput::stringURLSafe($name);
}
// must be a uniqe alias
if ($type)
{
return $this->getUniqe($alias,'alias',$type);
}
return $alias;
}
/**
* Method to generate a uniqe value.
*
* @param string $field name.
* @param string $value data.
* @param string $type table.
*
* @return string New value.
*/
protected function getUniqe($value,$field,$type)
{
// insure the filed is always uniqe
while (isset($this->uniqeValueArray[$type][$field][$value]))
{
$value = JString::increment($value, 'dash');
}
$this->uniqeValueArray[$type][$field][$value] = $value;
return $value;
}
protected function getAliasesUsed($table)
{
// Get a db connection.
$db = JFactory::getDbo();
// first we check if there is a alias column
$columns = $db->getTableColumns('#__###component###_'.$table);
if(isset($columns['alias'])){
// Create a new query object.
$query = $db->getQuery(true);
$query->select($db->quoteName(array('alias')));
$query->from($db->quoteName('#__###component###_'.$table));
$db->setQuery($query);
$db->execute();
if ($db->getNumRows())
{
$aliases = $db->loadColumn();
foreach($aliases as $alias)
{
$this->uniqeValueArray[$table]['alias'][$alias] = $alias;
}
}
return true;
}
return false;
}
}

View File

@ -0,0 +1,113 @@
<?php
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@package Component Builder
@subpackage componentbuilder.php
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
Builds Complex Joomla Components
/-----------------------------------------------------------------------------------------------------------------------------*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
?>
###BOM###
// No direct access to this file
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED###
// import Joomla view library
jimport('joomla.application.component.view');
/**
* ###Component### ###View### View
*/
class ###Component###View###View### extends JViewLegacy
{
protected $headerList;
protected $hasPackage = false;
protected $headers;
protected $hasHeader = 0;
protected $dataType;
public function display($tpl = null)
{
if ($this->getLayout() !== 'modal')
{
// Include helper submenu
###Component###Helper::addSubmenu('import');
}
// Check for errors.
if (count($errors = $this->get('Errors'))){
JError::raiseError(500, implode('<br />', $errors));
return false;
}
$paths = new stdClass;
$paths->first = '';
$state = $this->get('state');
$this->paths = &$paths;
$this->state = &$state;
// get global action permissions
$this->canDo = ###Component###Helper::getActions('import');
// We don't need toolbar in the modal window.
if ($this->getLayout() !== 'modal')
{
$this->addToolbar();
$this->sidebar = JHtmlSidebar::render();
}
// get the session object
$session = JFactory::getSession();
// check if it has package
$this->hasPackage = $session->get('hasPackage', false);
$this->dataType = $session->get('dataType', false);
if($this->hasPackage && $this->dataType)
{
$this->headerList = json_decode($session->get($this->dataType.'_VDM_IMPORTHEADERS', false),true);
$this->headers = ###Component###Helper::getFileHeaders($this->dataType);
// clear the data type
$session->clear('dataType');
}
// Display the template
parent::display($tpl);
}
/**
* Setting the toolbar
*/
protected function addToolBar()
{
JToolBarHelper::title(JText::_('COM_###COMPONENT###_IMPORT_TITLE'), 'upload');
JHtmlSidebar::setAction('index.php?option=com_###component###&view=###view###');
if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
{
JToolBarHelper::preferences('com_###component###');
}
// set help url for this view if found
$help_url = ###Component###Helper::getHelpUrl('###view###');
if (###Component###Helper::checkString($help_url))
{
JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $help_url);
}
}
}

View File

@ -0,0 +1,35 @@
<?php
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@package Component Builder
@subpackage componentbuilder.php
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
Builds Complex Joomla Components
/-----------------------------------------------------------------------------------------------------------------------------*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
?>
###BOM###
// No direct access to this file
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED###
JHtml::_('jquery.framework');
JHtml::_('bootstrap.tooltip');
JHtml::_('script', 'system/core.js', false, true);
?>###IMPORT_DEFAULT_VIEW_CUSTOM###

View File

@ -465,6 +465,28 @@
"rename": false, "rename": false,
"type": "import" "type": "import"
}, },
"JControllerLegacy_import_custom.php": {
"path": "c0mp0n3nt/admin/controllers",
"rename": "JControllerLegacy_import_custom",
"type": "customimport"
},
"JModelLegacy_import_custom.php": {
"path": "c0mp0n3nt/admin/models",
"rename": "JModelLegacy_import_custom",
"type": "customimport"
},
"JViewLegacy_import_custom.php": {
"path": "c0mp0n3nt/admin/views/VIEW",
"rename": "new",
"newName": "view.html.php",
"type": "customimport"
},
"default_import_custom.php": {
"path": "c0mp0n3nt/admin/views/VIEW/tmpl",
"rename": "new",
"newName": "default.php",
"type": "customimport"
},
"JControllerLegacyHelp.php": { "JControllerLegacyHelp.php": {
"path": "c0mp0n3nt/admin/controllers", "path": "c0mp0n3nt/admin/controllers",
"rename": "new", "rename": "new",

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage componentbuilder.php @subpackage componentbuilder.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage controller.php @subpackage controller.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage admin_view.php @subpackage admin_view.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage admin_views.php @subpackage admin_views.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage ajax.json.php @subpackage ajax.json.php
@ -45,6 +45,7 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
// load the tasks // load the tasks
$this->registerTask('tableColumns', 'ajax'); $this->registerTask('tableColumns', 'ajax');
$this->registerTask('fieldSelectOptions', 'ajax'); $this->registerTask('fieldSelectOptions', 'ajax');
$this->registerTask('getImportScripts', 'ajax');
$this->registerTask('layoutDetails', 'ajax'); $this->registerTask('layoutDetails', 'ajax');
$this->registerTask('templateDetails', 'ajax'); $this->registerTask('templateDetails', 'ajax');
$this->registerTask('snippetDetails', 'ajax'); $this->registerTask('snippetDetails', 'ajax');
@ -143,6 +144,44 @@ class ComponentbuilderControllerAjax extends JControllerLegacy
} }
} }
break; break;
case 'getImportScripts':
try
{
$returnRaw = $jinput->get('raw', false, 'BOOLEAN');
$typeValue = $jinput->get('type', NULL, 'WORD');
if($typeValue && $user->id != 0)
{
$result = $this->getModel('ajax')->getImportScripts($typeValue);
}
else
{
$result = false;
}
if(array_key_exists('callback',$_GET))
{
echo $_GET['callback'] . "(".json_encode($result).");";
}
elseif($returnRaw)
{
echo json_encode($result);
}
else
{
echo "(".json_encode($result).");";
}
}
catch(Exception $e)
{
if(array_key_exists('callback',$_GET))
{
echo $_GET['callback']."(".json_encode($e).");";
}
else
{
echo "(".json_encode($e).");";
}
}
break;
case 'layoutDetails': case 'layoutDetails':
try try
{ {

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage compiler.php @subpackage compiler.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage component.php @subpackage component.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage componentbuilder.php @subpackage componentbuilder.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage components.php @subpackage components.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage custom_admin_view.php @subpackage custom_admin_view.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage custom_admin_views.php @subpackage custom_admin_views.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage dynamic_get.php @subpackage dynamic_get.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage dynamic_gets.php @subpackage dynamic_gets.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage field.php @subpackage field.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage fields.php @subpackage fields.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage fieldtype.php @subpackage fieldtype.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage fieldtypes.php @subpackage fieldtypes.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage help.php @subpackage help.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage help_document.php @subpackage help_document.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage help_documents.php @subpackage help_documents.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage import.php @subpackage import.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage layout.php @subpackage layout.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage layouts.php @subpackage layouts.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage site_view.php @subpackage site_view.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage site_views.php @subpackage site_views.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage snippet.php @subpackage snippet.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage snippets.php @subpackage snippets.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage template.php @subpackage template.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage templates.php @subpackage templates.php

View File

@ -1086,6 +1086,20 @@ class Get
} }
} }
// set custom import scripts
if (isset($view->add_custom_import) && $view->add_custom_import == 1)
{
$addImportArray = array('php_import_setdata','php_import_save','html_import_view');
foreach ($addImportArray as $importScripter)
{
if (isset($view->$importScripter) && strlen($view->$importScripter) > 0)
{
$this->customScriptBuilder[$importScripter]['import_'.$name_list] = $this->setCustomContentLang(base64_decode($view->$importScripter));
unset($view->$importScripter);
}
}
}
// add_Ajax for this view // add_Ajax for this view
if ($view->add_php_ajax == 1) if ($view->add_php_ajax == 1)
{ {
@ -1985,9 +1999,11 @@ class Get
*/ */
public function setCustomContentLang($content) public function setCustomContentLang($content)
{ {
// insure string is not broken
$content = str_replace('COM_###COMPONENT###',$this->langPrefix,$content);
// set language data // set language data
$langCheck[] = ComponentbuilderHelper::getAllBetween($content, "JText::_('","')"); $langCheck[] = ComponentbuilderHelper::getAllBetween($content, "JText::_('","'");
$langCheck[] = ComponentbuilderHelper::getAllBetween($content, 'JText::_("','")'); $langCheck[] = ComponentbuilderHelper::getAllBetween($content, 'JText::_("','"');
$langCheck[] = ComponentbuilderHelper::getAllBetween($content, "JText::sprintf('","'"); $langCheck[] = ComponentbuilderHelper::getAllBetween($content, "JText::sprintf('","'");
$langCheck[] = ComponentbuilderHelper::getAllBetween($content, 'JText::sprintf("','"'); $langCheck[] = ComponentbuilderHelper::getAllBetween($content, 'JText::sprintf("','"');
$langHolders = array(); $langHolders = array();
@ -2003,6 +2019,7 @@ class Get
{ {
foreach ($lang as $string) foreach ($lang as $string)
{ {
// this is there to insure we dont break already added Language strings
if (ComponentbuilderHelper::safeString($string,'U') == $string) if (ComponentbuilderHelper::safeString($string,'U') == $string)
{ {
continue; continue;

View File

@ -4736,7 +4736,7 @@ class Interpretation extends Fields
{ {
// add final list of needed lang strings // add final list of needed lang strings
$componentName = JFilterOutput::cleanText($this->componentData->name); $componentName = JFilterOutput::cleanText($this->componentData->name);
$this->langContent['adminsys'][$this->langPrefix] = $this->langContent['adminsys'][$this->langPrefix] = $componentName;
$this->langContent['adminsys'][$this->langPrefix.'_CONFIGURATION'] = $componentName.' Configuration'; $this->langContent['adminsys'][$this->langPrefix.'_CONFIGURATION'] = $componentName.' Configuration';
$this->langContent[$this->lang][$this->langPrefix] = $componentName; $this->langContent[$this->lang][$this->langPrefix] = $componentName;
$this->langContent['admin'][$this->langPrefix.'_BACK'] = 'Back'; $this->langContent['admin'][$this->langPrefix.'_BACK'] = 'Back';
@ -6830,7 +6830,15 @@ class Interpretation extends Fields
$this->langContent[$this->lang][$selectImportFileNote] = 'Select the file to import data to '.$viewName_list.'.'; $this->langContent[$this->lang][$selectImportFileNote] = 'Select the file to import data to '.$viewName_list.'.';
} }
$method[] = "\t\t\t\t\$message = JText::_('".$selectImportFileNote."');"; $method[] = "\t\t\t\t\$message = JText::_('".$selectImportFileNote."');";
// if this view has custom script it must have as custom import (model, veiw, controller)
if (isset($this->importCustomScripts[$viewName_list]) && $this->importCustomScripts[$viewName_list])
{
$method[] = "\t\t\t\t\$this->setRedirect(JRoute::_('index.php?option=com_".$this->fileContentStatic['###component###']."&view=import_".$viewName_list."', false), \$message);";
}
else
{
$method[] = "\t\t\t\t\$this->setRedirect(JRoute::_('index.php?option=com_".$this->fileContentStatic['###component###']."&view=import', false), \$message);"; $method[] = "\t\t\t\t\$this->setRedirect(JRoute::_('index.php?option=com_".$this->fileContentStatic['###component###']."&view=import', false), \$message);";
}
$method[] = "\t\t\t\treturn;"; $method[] = "\t\t\t\treturn;";
$method[] = "\t\t\t}"; $method[] = "\t\t\t}";
$method[] = "\t\t}"; $method[] = "\t\t}";
@ -6888,6 +6896,39 @@ class Interpretation extends Fields
return $button; return $button;
} }
public function setImportCustomScripts($viewName_list)
{
// setup Ajax files
$target = array('admin' => 'import_'.$viewName_list);
$this->buildDynamique($target,'customimport');
// load the custom script to the files
if (isset($this->customScriptBuilder['php_import_setdata']['import_'.$viewName_list]))
{
// ###IMPORT_SETDATE_METOD_CUSTOM### <<<DYNAMIC>>>
$this->fileContentDynamic['import_'.$viewName_list]['###IMPORT_SETDATE_METOD_CUSTOM###'] = "\n".str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder['php_import_setdata']['import_'.$viewName_list]);
unset($this->customScriptBuilder['php_import_setdata']['import_'.$viewName_list]);
}
if (isset($this->customScriptBuilder['php_import_save']['import_'.$viewName_list]))
{
// ###IMPORT_SAVE_METOD_CUSTOM### <<<DYNAMIC>>>
$this->fileContentDynamic['import_'.$viewName_list]['###IMPORT_SAVE_METOD_CUSTOM###'] = "\n".str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder['php_import_save']['import_'.$viewName_list]);
unset($this->customScriptBuilder['php_import_save']['import_'.$viewName_list]);
}
if (isset($this->customScriptBuilder['html_import_view']['import_'.$viewName_list]))
{
// ###IMPORT_DEFAULT_VIEW_CUSTOM### <<<DYNAMIC>>>
$this->fileContentDynamic['import_'.$viewName_list]['###IMPORT_DEFAULT_VIEW_CUSTOM###'] = "\n".str_replace(array_keys($this->placeholders),array_values($this->placeholders),$this->customScriptBuilder['html_import_view']['import_'.$viewName_list]);
unset($this->customScriptBuilder['html_import_view']['import_'.$viewName_list]);
}
// insure we have the view placeholders setup
$this->fileContentDynamic['import_'.$viewName_list]['###VIEW###'] = 'IMPORT_'.$this->placeholders['###VIEWS###'];
$this->fileContentDynamic['import_'.$viewName_list]['###View###'] = 'Import_'.$this->placeholders['###views###'];
$this->fileContentDynamic['import_'.$viewName_list]['###view###'] = 'import_'.$this->placeholders['###views###'];
$this->fileContentDynamic['import_'.$viewName_list]['###VIEWS###'] = 'IMPORT_'.$this->placeholders['###VIEWS###'];
$this->fileContentDynamic['import_'.$viewName_list]['###Views###'] = 'Import_'.$this->placeholders['###views###'];
$this->fileContentDynamic['import_'.$viewName_list]['###views###'] = 'import_'.$this->placeholders['###views###'];
}
public function setListQuery($viewName_single, $viewName_list) public function setListQuery($viewName_single, $viewName_list)
{ {
// check if this view has category added // check if this view has category added
@ -12363,7 +12404,7 @@ for developing fast and powerful web interfaces. For more info visit <a href=\"h
public function buildPermissions(&$view, $nameView, $nameViews, $menuControllers, $type = 'admin') public function buildPermissions(&$view, $nameView, $nameViews, $menuControllers, $type = 'admin')
{ {
if (ComponentbuilderHelper::checkArray($view['settings']->permissions) || (isset($view['port']) && $view['port']) || (isset($view['history']) && $view['history'])) if (isset($view['settings']->permissions) && ComponentbuilderHelper::checkArray($view['settings']->permissions) || (isset($view['port']) && $view['port']) || (isset($view['history']) && $view['history']))
{ {
// add export/import permissions to each view that has export/import options // add export/import permissions to each view that has export/import options
if (isset($view['port']) && $view['port']) if (isset($view['port']) && $view['port'])

View File

@ -33,6 +33,9 @@ defined('_JEXEC') or die('Restricted access');
class Infusion extends Interpretation class Infusion extends Interpretation
{ {
public $eximportView = array();
public $importCustomScripts = array();
/** /**
* Constructor * Constructor
*/ */
@ -192,15 +195,6 @@ class Infusion extends Interpretation
$site_edit_view_array[] = "\t\t\t\t'".$viewName_single."'"; $site_edit_view_array[] = "\t\t\t\t'".$viewName_single."'";
$this->lang = 'both'; $this->lang = 'both';
} }
// set the export/import option
if ($view['port'])
{
$this->eximportView[$viewName_list] = true;
}
else
{
$this->eximportView[$viewName_list] = false;
}
// check if help is being loaded // check if help is being loaded
$this->checkHelp($viewName_single); $this->checkHelp($viewName_single);
// set custom admin view list links // set custom admin view list links
@ -227,6 +221,8 @@ class Infusion extends Interpretation
// set some place holder for the views // set some place holder for the views
$this->placeholders['###view###'] = $viewName_single; $this->placeholders['###view###'] = $viewName_single;
$this->placeholders['###VIEW###'] = $viewName_u;
$this->placeholders['###View###'] = $viewName_f;
// set license per view if needed // set license per view if needed
$this->setLockLicensePer($viewName_single); $this->setLockLicensePer($viewName_single);
@ -349,6 +345,24 @@ class Infusion extends Interpretation
// set some place holder for the views // set some place holder for the views
$this->placeholders['###views###'] = $viewName_list; $this->placeholders['###views###'] = $viewName_list;
$this->placeholders['###VIEWS###'] = $viewsName_u;
$this->placeholders['###Views###'] = $viewsName_f;
// set the export/import option
if ($view['port'])
{
$this->eximportView[$viewName_list] = true;
if (1 == $view['settings']->add_custom_import)
{
// this view has custom import scripting
$this->importCustomScripts[$viewName_list] = true;
$this->setImportCustomScripts($viewName_list);
}
}
else
{
$this->eximportView[$viewName_list] = false;
}
// set Autocheckin function // set Autocheckin function
if ($view['checkin'] == 1) if ($view['checkin'] == 1)

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage componentbuilder.php @subpackage componentbuilder.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage batch_.php @subpackage batch_.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage indenter.php @subpackage indenter.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage js.php @subpackage js.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage minify.php @subpackage minify.php

View File

@ -72,6 +72,9 @@ COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_CSS_VIEW="Add Css View"
COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_CSS_VIEWS="Add Css Views" COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_CSS_VIEWS="Add Css Views"
COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_CSS_VIEWS_LABEL="Add CSS (views)" COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_CSS_VIEWS_LABEL="Add CSS (views)"
COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_CSS_VIEW_LABEL="Add CSS (view)" COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_CSS_VIEW_LABEL="Add CSS (view)"
COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_CUSTOM_IMPORT="Add Custom Import"
COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_CUSTOM_IMPORT_DESCRIPTION="Override the default import methods."
COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_CUSTOM_IMPORT_LABEL="Add Custom Import"
COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_JAVASCRIPT_VIEWS_FILE="Add Javascript Views File" COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_JAVASCRIPT_VIEWS_FILE="Add Javascript Views File"
COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_JAVASCRIPT_VIEWS_FILE_LABEL="Add JavaScript (views-file)" COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_JAVASCRIPT_VIEWS_FILE_LABEL="Add JavaScript (views-file)"
COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_JAVASCRIPT_VIEWS_FOOTER="Add Javascript Views Footer" COM_COMPONENTBUILDER_ADMIN_VIEW_ADD_JAVASCRIPT_VIEWS_FOOTER="Add Javascript Views Footer"
@ -143,6 +146,7 @@ COM_COMPONENTBUILDER_ADMIN_VIEW_CSS_VIEWS_LABEL="CSS"
COM_COMPONENTBUILDER_ADMIN_VIEW_CSS_VIEW_DESCRIPTION="Add your CSS here! [Do not add the style tags]" COM_COMPONENTBUILDER_ADMIN_VIEW_CSS_VIEW_DESCRIPTION="Add your CSS here! [Do not add the style tags]"
COM_COMPONENTBUILDER_ADMIN_VIEW_CSS_VIEW_HINT="// CSS for the edit view" COM_COMPONENTBUILDER_ADMIN_VIEW_CSS_VIEW_HINT="// CSS for the edit view"
COM_COMPONENTBUILDER_ADMIN_VIEW_CSS_VIEW_LABEL="CSS" COM_COMPONENTBUILDER_ADMIN_VIEW_CSS_VIEW_LABEL="CSS"
COM_COMPONENTBUILDER_ADMIN_VIEW_CUSTOM_IMPORT="Custom Import"
COM_COMPONENTBUILDER_ADMIN_VIEW_DESCRIPTION="Description" COM_COMPONENTBUILDER_ADMIN_VIEW_DESCRIPTION="Description"
COM_COMPONENTBUILDER_ADMIN_VIEW_DESCRIPTION_DESCRIPTION="Add Description Here" COM_COMPONENTBUILDER_ADMIN_VIEW_DESCRIPTION_DESCRIPTION="Add Description Here"
COM_COMPONENTBUILDER_ADMIN_VIEW_DESCRIPTION_HINT="Add Description Here" COM_COMPONENTBUILDER_ADMIN_VIEW_DESCRIPTION_HINT="Add Description Here"
@ -161,6 +165,10 @@ COM_COMPONENTBUILDER_ADMIN_VIEW_FLOAT="FLOAT"
COM_COMPONENTBUILDER_ADMIN_VIEW_FULL_WIDTH_IN_TAB="Full Width in Tab" COM_COMPONENTBUILDER_ADMIN_VIEW_FULL_WIDTH_IN_TAB="Full Width in Tab"
COM_COMPONENTBUILDER_ADMIN_VIEW_HIDE="Hide" COM_COMPONENTBUILDER_ADMIN_VIEW_HIDE="Hide"
COM_COMPONENTBUILDER_ADMIN_VIEW_HTML="HTML" COM_COMPONENTBUILDER_ADMIN_VIEW_HTML="HTML"
COM_COMPONENTBUILDER_ADMIN_VIEW_HTML_IMPORT_VIEW="Html Import View"
COM_COMPONENTBUILDER_ADMIN_VIEW_HTML_IMPORT_VIEW_DESCRIPTION="Add your HTML & PHP here! [Use <?php echo $name; ?> for PHP]"
COM_COMPONENTBUILDER_ADMIN_VIEW_HTML_IMPORT_VIEW_HINT="// The HTML for the view of your custom import method."
COM_COMPONENTBUILDER_ADMIN_VIEW_HTML_IMPORT_VIEW_LABEL="HTML & PHP (view)"
COM_COMPONENTBUILDER_ADMIN_VIEW_ICON="Icon" COM_COMPONENTBUILDER_ADMIN_VIEW_ICON="Icon"
COM_COMPONENTBUILDER_ADMIN_VIEW_ICON_ADD="Icon Add" COM_COMPONENTBUILDER_ADMIN_VIEW_ICON_ADD="Icon Add"
COM_COMPONENTBUILDER_ADMIN_VIEW_ICON_ADD_DESCRIPTION="Must be 128px x 128px and a png format.." COM_COMPONENTBUILDER_ADMIN_VIEW_ICON_ADD_DESCRIPTION="Must be 128px x 128px and a png format.."
@ -240,6 +248,10 @@ COM_COMPONENTBUILDER_ADMIN_VIEW_NAME_SINGLE_HINT="Single Record Name Here"
COM_COMPONENTBUILDER_ADMIN_VIEW_NAME_SINGLE_LABEL="Name (single record)" COM_COMPONENTBUILDER_ADMIN_VIEW_NAME_SINGLE_LABEL="Name (single record)"
COM_COMPONENTBUILDER_ADMIN_VIEW_NEW="A New Admin View" COM_COMPONENTBUILDER_ADMIN_VIEW_NEW="A New Admin View"
COM_COMPONENTBUILDER_ADMIN_VIEW_NO="No" COM_COMPONENTBUILDER_ADMIN_VIEW_NO="No"
COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_ADVANCED_IMPORT_DESCRIPTION="<p>The scripts that are automatic added to the input fields below is identical to the default import scripts used. Adapt them to your own custom needs.</p>"
COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_ADVANCED_IMPORT_LABEL="Advanced notice."
COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_BEGINNER_IMPORT_DESCRIPTION="<p>Please do not change this area unless you would like to add special import to this view that goes beyond the default import concept that Component Builder already does automatic if this view is set to have import & export in the component area where this view is linked to the component.</p>"
COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_BEGINNER_IMPORT_LABEL="Beginners notice."
COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_ON_CONDITIONS_DESCRIPTION="Here you can add conditional field settings" COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_ON_CONDITIONS_DESCRIPTION="Here you can add conditional field settings"
COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_ON_CONDITIONS_LABEL="Condition Implementation" COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_ON_CONDITIONS_LABEL="Condition Implementation"
COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_ON_PERMISSIONS_DESCRIPTION="Only if you add permissions here will this view have permissions." COM_COMPONENTBUILDER_ADMIN_VIEW_NOTE_ON_PERMISSIONS_DESCRIPTION="Only if you add permissions here will this view have permissions."
@ -302,6 +314,14 @@ COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_GETLISTQUERY="Php Getlistquery"
COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_GETLISTQUERY_DESCRIPTION="Add your PHP here! [Do not add the php tags]" COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_GETLISTQUERY_DESCRIPTION="Add your PHP here! [Do not add the php tags]"
COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_GETLISTQUERY_HINT="// PHP Here that should run in the getlistquery Method (to add custom filtering)" COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_GETLISTQUERY_HINT="// PHP Here that should run in the getlistquery Method (to add custom filtering)"
COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_GETLISTQUERY_LABEL="PHP" COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_GETLISTQUERY_LABEL="PHP"
COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_IMPORT_SAVE="Php Import Save"
COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_IMPORT_SAVE_DESCRIPTION="Add your PHP here! [Do not add the php tags]"
COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_IMPORT_SAVE_HINT="// PHP Here that should run in the save Method, $data, $table"
COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_IMPORT_SAVE_LABEL="Save Method PHP"
COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_IMPORT_SETDATA="Php Import Setdata"
COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_IMPORT_SETDATA_DESCRIPTION="Add your PHP here! [Do not add the php tags]"
COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_IMPORT_SETDATA_HINT="// PHP Here that should run in the setData Method, $package,$table,$target_headers"
COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_IMPORT_SETDATA_LABEL="setData Method PHP"
COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_POSTSAVEHOOK="Php Postsavehook" COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_POSTSAVEHOOK="Php Postsavehook"
COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_POSTSAVEHOOK_DESCRIPTION="Add your PHP here! [Do not add the php tags]" COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_POSTSAVEHOOK_DESCRIPTION="Add your PHP here! [Do not add the php tags]"
COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_POSTSAVEHOOK_HINT="// PHP Here that should run in the postSaveHook Method (object) $model is the data model object and (array) $validData is the validated data." COM_COMPONENTBUILDER_ADMIN_VIEW_PHP_POSTSAVEHOOK_HINT="// PHP Here that should run in the postSaveHook Method (object) $model is the data model object and (array) $validData is the validated data."

View File

@ -1,4 +1,4 @@
COM_COMPONENTBUILDER="Component Builder Configuration" COM_COMPONENTBUILDER="Component Builder"
COM_COMPONENTBUILDER_CONFIGURATION="Component Builder Configuration" COM_COMPONENTBUILDER_CONFIGURATION="Component Builder Configuration"
COM_COMPONENTBUILDER_MENU="&#187; Component Builder" COM_COMPONENTBUILDER_MENU="&#187; Component Builder"
COM_COMPONENTBUILDER_MENU_ADMIN_VIEWS="Admin Views" COM_COMPONENTBUILDER_MENU_ADMIN_VIEWS="Admin Views"

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage css_fullwidth.php @subpackage css_fullwidth.php

View File

@ -0,0 +1,54 @@
<?php
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
__ __ _ _____ _ _ __ __ _ _ _
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
| |
|_|
/-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.5
@build 4th May, 2016
@created 30th April, 2015
@package Component Builder
@subpackage custom_import_fullwidth.php
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
@my wife Roline van der Merwe <http://www.vdm.io/>
@copyright Copyright (C) 2015. All Rights Reserved
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
Builds Complex Joomla Components
/-----------------------------------------------------------------------------------------------------------------------------*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
$form = $displayData->getForm();
$fields = $displayData->get('fields') ?: array(
'note_beginner_import',
'note_advanced_import',
'add_custom_import',
'html_import_view',
'php_import_setdata',
'php_import_save'
);
?>
<div class="form-vertical">
<?php foreach($fields as $field): ?>
<div class="control-group">
<div class="control-label">
<?php echo $form->getLabel($field); ?>
</div>
<div class="controls">
<?php echo $form->getInput($field); ?>
</div>
</div>
<?php endforeach; ?>
</div>

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage fields_fullwidth.php @subpackage fields_fullwidth.php
@ -29,7 +29,7 @@
defined('_JEXEC') or die('Restricted access'); defined('_JEXEC') or die('Restricted access');
// set the defaults // set the defaults
$items = $displayData->vxafields; $items = $displayData->vxdfields;
$user = JFactory::getUser(); $user = JFactory::getUser();
$id = $displayData->item->id; $id = $displayData->item->id;
$edit = "index.php?option=com_componentbuilder&view=fields&task=field.edit"; $edit = "index.php?option=com_componentbuilder&view=fields&task=field.edit";

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage javascript_fullwidth.php @subpackage javascript_fullwidth.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage mysql_fullwidth.php @subpackage mysql_fullwidth.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage mysql_left.php @subpackage mysql_left.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage php_fullwidth.php @subpackage php_fullwidth.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage publishing.php @subpackage publishing.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage publlshing.php @subpackage publlshing.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage settings_above.php @subpackage settings_above.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage settings_left.php @subpackage settings_left.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage settings_right.php @subpackage settings_right.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage settings_under.php @subpackage settings_under.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage batchselection.php @subpackage batchselection.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage admin_views_fullwidth.php @subpackage admin_views_fullwidth.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage details_above.php @subpackage details_above.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage details_left.php @subpackage details_left.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage details_right.php @subpackage details_right.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage details_under.php @subpackage details_under.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage ftp_servers_fullwidth.php @subpackage ftp_servers_fullwidth.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage publishing.php @subpackage publishing.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage publlshing.php @subpackage publlshing.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage readme_left.php @subpackage readme_left.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage readme_right.php @subpackage readme_right.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage scripts_fullwidth.php @subpackage scripts_fullwidth.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage settings_left.php @subpackage settings_left.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage settings_right.php @subpackage settings_right.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage site_views_fullwidth.php @subpackage site_views_fullwidth.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage custom_buttons_fullwidth.php @subpackage custom_buttons_fullwidth.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage custom_buttons_left.php @subpackage custom_buttons_left.php

View File

@ -10,8 +10,8 @@
|_| |_|
/-------------------------------------------------------------------------------------------------------------------------------/ /-------------------------------------------------------------------------------------------------------------------------------/
@version 2.1.4 @version 2.1.5
@build 2nd May, 2016 @build 4th May, 2016
@created 30th April, 2015 @created 30th April, 2015
@package Component Builder @package Component Builder
@subpackage custom_script_fullwidth.php @subpackage custom_script_fullwidth.php

Some files were not shown because too many files have changed in this diff Show More