Resolved #9 Layout Issue - Custom Lookup Field.
This commit is contained in:
@ -10,8 +10,8 @@
|
||||
|_|
|
||||
/-------------------------------------------------------------------------------------------------------------------------------/
|
||||
|
||||
@version 2.1.14
|
||||
@build 28th June, 2016
|
||||
@version 2.1.16
|
||||
@build 12th July, 2016
|
||||
@created 30th April, 2015
|
||||
@package Component Builder
|
||||
@subpackage import.php
|
||||
@ -199,7 +199,8 @@ class ComponentbuilderModelImport extends JModelLegacy
|
||||
protected function _getPackageFromUpload()
|
||||
{
|
||||
// Get the uploaded file information
|
||||
$input = JFactory::getApplication()->input;
|
||||
$app = JFactory::getApplication();
|
||||
$input = $app->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');
|
||||
@ -207,21 +208,21 @@ class ComponentbuilderModelImport extends JModelLegacy
|
||||
// Make sure that file uploads are enabled in php
|
||||
if (!(bool) ini_get('file_uploads'))
|
||||
{
|
||||
JError::raiseWarning('', JText::_('COM_COMPONENTBUILDER_IMPORT_MSG_WARNIMPORTFILE'));
|
||||
$app->enqueueMessage(JText::_('COM_COMPONENTBUILDER_IMPORT_MSG_WARNIMPORTFILE'), 'warning');
|
||||
return false;
|
||||
}
|
||||
|
||||
// If there is no uploaded file, we have a problem...
|
||||
if (!is_array($userfile))
|
||||
{
|
||||
JError::raiseWarning('', JText::_('COM_COMPONENTBUILDER_IMPORT_MSG_NO_FILE_SELECTED'));
|
||||
$app->enqueueMessage(JText::_('COM_COMPONENTBUILDER_IMPORT_MSG_NO_FILE_SELECTED'), 'warning');
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check if there was a problem uploading the file.
|
||||
if ($userfile['error'] || $userfile['size'] < 1)
|
||||
{
|
||||
JError::raiseWarning('', JText::_('COM_COMPONENTBUILDER_IMPORT_MSG_WARNIMPORTUPLOADERROR'));
|
||||
$app->enqueueMessage(JText::_('COM_COMPONENTBUILDER_IMPORT_MSG_WARNIMPORTUPLOADERROR'), 'warning');
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -259,7 +260,8 @@ class ComponentbuilderModelImport extends JModelLegacy
|
||||
*/
|
||||
protected function _getPackageFromFolder()
|
||||
{
|
||||
$input = JFactory::getApplication()->input;
|
||||
$app = JFactory::getApplication();
|
||||
$input = $app->input;
|
||||
|
||||
// Get the path to the package to import
|
||||
$p_dir = $input->getString('import_directory');
|
||||
@ -267,7 +269,7 @@ class ComponentbuilderModelImport extends JModelLegacy
|
||||
// Did you give us a valid path?
|
||||
if (!file_exists($p_dir))
|
||||
{
|
||||
JError::raiseWarning('', JText::_('COM_COMPONENTBUILDER_IMPORT_MSG_PLEASE_ENTER_A_PACKAGE_DIRECTORY'));
|
||||
$app->enqueueMessage(JText::_('COM_COMPONENTBUILDER_IMPORT_MSG_PLEASE_ENTER_A_PACKAGE_DIRECTORY'), 'warning');
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -277,7 +279,7 @@ class ComponentbuilderModelImport extends JModelLegacy
|
||||
// Did you give us a valid package?
|
||||
if (!$type)
|
||||
{
|
||||
JError::raiseWarning('', JText::_('COM_COMPONENTBUILDER_IMPORT_MSG_PATH_DOES_NOT_HAVE_A_VALID_PACKAGE'));
|
||||
$app->enqueueMessage(JText::_('COM_COMPONENTBUILDER_IMPORT_MSG_PATH_DOES_NOT_HAVE_A_VALID_PACKAGE'), 'warning');
|
||||
}
|
||||
|
||||
// check the extention
|
||||
@ -288,7 +290,7 @@ class ComponentbuilderModelImport extends JModelLegacy
|
||||
break;
|
||||
|
||||
default:
|
||||
JError::raiseWarning('', JText::_('COM_COMPONENTBUILDER_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'));
|
||||
$app->enqueueMessage(JText::_('COM_COMPONENTBUILDER_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning');
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
@ -308,15 +310,16 @@ class ComponentbuilderModelImport extends JModelLegacy
|
||||
*/
|
||||
protected function _getPackageFromUrl()
|
||||
{
|
||||
$input = JFactory::getApplication()->input;
|
||||
|
||||
$app = JFactory::getApplication();
|
||||
$input = $app->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_COMPONENTBUILDER_IMPORT_MSG_ENTER_A_URL'));
|
||||
$app->enqueueMessage(JText::_('COM_COMPONENTBUILDER_IMPORT_MSG_ENTER_A_URL'), 'warning');
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -326,7 +329,7 @@ class ComponentbuilderModelImport extends JModelLegacy
|
||||
// Was the package downloaded?
|
||||
if (!$p_file)
|
||||
{
|
||||
JError::raiseWarning('', JText::_('COM_COMPONENTBUILDER_IMPORT_MSG_INVALID_URL'));
|
||||
$app->enqueueMessage(JText::_('COM_COMPONENTBUILDER_IMPORT_MSG_INVALID_URL'), 'warning');
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -347,6 +350,7 @@ class ComponentbuilderModelImport extends JModelLegacy
|
||||
*/
|
||||
protected function check($archivename)
|
||||
{
|
||||
$app = JFactory::getApplication();
|
||||
// Clean the name
|
||||
$archivename = JPath::clean($archivename);
|
||||
|
||||
@ -360,7 +364,7 @@ class ComponentbuilderModelImport extends JModelLegacy
|
||||
default:
|
||||
// Cleanup the import files
|
||||
$this->remove($archivename);
|
||||
JError::raiseWarning('', JText::_('COM_COMPONENTBUILDER_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'));
|
||||
$app->enqueueMessage(JText::_('COM_COMPONENTBUILDER_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning');
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user