diff --git a/README.md b/README.md index 6d7725439..de33008d8 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Component Builder (2.1.14) +# Component Builder (2.1.16) This is a [Joomla 3.x] (http://www.joomla.org/) component. @@ -32,12 +32,12 @@ Would you require more help please open and issue here on [gitHub today](https:/ + *Author*: [Llewellyn van der Merwe] (mailto:info@vdm.io) + *Name*: [Component Builder] (https://www.vdm.io/joomla-component-builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 28th June, 2016 -+ *Version*: 2.1.14 ++ *Last Build*: 12th July, 2016 ++ *Version*: 2.1.16 + *Copyright*: Copyright (C) 2015. All Rights Reserved + *License*: GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html -+ *Line count*: **83201** -+ *File count*: **507** ++ *Line count*: **83187** ++ *File count*: **509** + *Folder count*: **98** > This **component** was build with a Joomla [Automated Component Builder] (https://www.vdm.io/joomla-component-builder). diff --git a/admin/assets/css/admin.css b/admin/assets/css/admin.css index 6da1e0497..bed8f8e5d 100644 --- a/admin/assets/css/admin.css +++ b/admin/assets/css/admin.css @@ -9,8 +9,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 admin.css diff --git a/admin/assets/css/admin_view.css b/admin/assets/css/admin_view.css index d0e6ce5a9..1e0c0d291 100644 --- a/admin/assets/css/admin_view.css +++ b/admin/assets/css/admin_view.css @@ -9,8 +9,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 admin_view.css diff --git a/admin/assets/css/admin_views.css b/admin/assets/css/admin_views.css index d3323720c..9fbe8879b 100644 --- a/admin/assets/css/admin_views.css +++ b/admin/assets/css/admin_views.css @@ -9,8 +9,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 admin_views.css diff --git a/admin/assets/css/component.css b/admin/assets/css/component.css index 7a7b35577..f592d57e8 100644 --- a/admin/assets/css/component.css +++ b/admin/assets/css/component.css @@ -9,8 +9,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 component.css diff --git a/admin/assets/css/components.css b/admin/assets/css/components.css index 8baab5d70..6cbb3f092 100644 --- a/admin/assets/css/components.css +++ b/admin/assets/css/components.css @@ -9,8 +9,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 components.css diff --git a/admin/assets/css/custom_admin_view.css b/admin/assets/css/custom_admin_view.css index 710842eb3..2500222ba 100644 --- a/admin/assets/css/custom_admin_view.css +++ b/admin/assets/css/custom_admin_view.css @@ -9,8 +9,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 custom_admin_view.css diff --git a/admin/assets/css/custom_admin_views.css b/admin/assets/css/custom_admin_views.css index 064216d98..f29d889ce 100644 --- a/admin/assets/css/custom_admin_views.css +++ b/admin/assets/css/custom_admin_views.css @@ -9,8 +9,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 custom_admin_views.css diff --git a/admin/assets/css/dashboard.css b/admin/assets/css/dashboard.css index c9c202f99..52499ef0b 100644 --- a/admin/assets/css/dashboard.css +++ b/admin/assets/css/dashboard.css @@ -9,8 +9,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 dashboard.css diff --git a/admin/assets/css/dynamic_get.css b/admin/assets/css/dynamic_get.css index 9be590d73..0655cc185 100644 --- a/admin/assets/css/dynamic_get.css +++ b/admin/assets/css/dynamic_get.css @@ -9,8 +9,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 dynamic_get.css diff --git a/admin/assets/css/dynamic_gets.css b/admin/assets/css/dynamic_gets.css index 327357cdb..5d06b67bd 100644 --- a/admin/assets/css/dynamic_gets.css +++ b/admin/assets/css/dynamic_gets.css @@ -9,8 +9,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 dynamic_gets.css diff --git a/admin/assets/css/field.css b/admin/assets/css/field.css index 2f7443cca..884e5dca7 100644 --- a/admin/assets/css/field.css +++ b/admin/assets/css/field.css @@ -9,8 +9,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 field.css diff --git a/admin/assets/css/fields.css b/admin/assets/css/fields.css index b163cf3a7..c84cf6617 100644 --- a/admin/assets/css/fields.css +++ b/admin/assets/css/fields.css @@ -9,8 +9,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 fields.css diff --git a/admin/assets/css/fieldtype.css b/admin/assets/css/fieldtype.css index a9f408881..a2600a685 100644 --- a/admin/assets/css/fieldtype.css +++ b/admin/assets/css/fieldtype.css @@ -9,8 +9,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 fieldtype.css diff --git a/admin/assets/css/fieldtypes.css b/admin/assets/css/fieldtypes.css index a91839840..03c0ca9f7 100644 --- a/admin/assets/css/fieldtypes.css +++ b/admin/assets/css/fieldtypes.css @@ -9,8 +9,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 fieldtypes.css diff --git a/admin/assets/css/help_document.css b/admin/assets/css/help_document.css index a4486519b..b80931c95 100644 --- a/admin/assets/css/help_document.css +++ b/admin/assets/css/help_document.css @@ -9,8 +9,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 help_document.css diff --git a/admin/assets/css/help_documents.css b/admin/assets/css/help_documents.css index d9458829f..419500cc8 100644 --- a/admin/assets/css/help_documents.css +++ b/admin/assets/css/help_documents.css @@ -9,8 +9,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 help_documents.css diff --git a/admin/assets/css/layout.css b/admin/assets/css/layout.css index b3b3e8a9b..b73f73e4b 100644 --- a/admin/assets/css/layout.css +++ b/admin/assets/css/layout.css @@ -9,8 +9,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 layout.css diff --git a/admin/assets/css/layouts.css b/admin/assets/css/layouts.css index d6724cf19..725882bbd 100644 --- a/admin/assets/css/layouts.css +++ b/admin/assets/css/layouts.css @@ -9,8 +9,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 layouts.css diff --git a/admin/assets/css/site_view.css b/admin/assets/css/site_view.css index 306c0945c..092498f6c 100644 --- a/admin/assets/css/site_view.css +++ b/admin/assets/css/site_view.css @@ -9,8 +9,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 site_view.css diff --git a/admin/assets/css/site_views.css b/admin/assets/css/site_views.css index 74d55b03e..5352ef9c2 100644 --- a/admin/assets/css/site_views.css +++ b/admin/assets/css/site_views.css @@ -9,8 +9,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 site_views.css diff --git a/admin/assets/css/snippet.css b/admin/assets/css/snippet.css index 51cecd1a9..e82d5ac4d 100644 --- a/admin/assets/css/snippet.css +++ b/admin/assets/css/snippet.css @@ -9,8 +9,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 snippet.css diff --git a/admin/assets/css/snippets.css b/admin/assets/css/snippets.css index 9edb98a1a..403944f0a 100644 --- a/admin/assets/css/snippets.css +++ b/admin/assets/css/snippets.css @@ -9,8 +9,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 snippets.css diff --git a/admin/assets/css/template.css b/admin/assets/css/template.css index 6015b5fb2..ead1cf6f7 100644 --- a/admin/assets/css/template.css +++ b/admin/assets/css/template.css @@ -9,8 +9,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 template.css diff --git a/admin/assets/css/templates.css b/admin/assets/css/templates.css index bd4882f8c..cf3db75b2 100644 --- a/admin/assets/css/templates.css +++ b/admin/assets/css/templates.css @@ -9,8 +9,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 templates.css diff --git a/admin/compiler/joomla_3/Helper.php b/admin/compiler/joomla_3/Helper.php index 4cc60ac42..9c5e763c4 100644 --- a/admin/compiler/joomla_3/Helper.php +++ b/admin/compiler/joomla_3/Helper.php @@ -486,7 +486,7 @@ abstract class ###Component###Helper if (!$asset->check() || !$asset->store()) { - JError::raiseWarning(500, $asset->getError()); + JFactory::getApplication()->enqueueMessage($asset->getError(), 'warning'); return false; } else diff --git a/admin/compiler/joomla_3/Helper_site.php b/admin/compiler/joomla_3/Helper_site.php index 8b912c779..3cb87307f 100644 --- a/admin/compiler/joomla_3/Helper_site.php +++ b/admin/compiler/joomla_3/Helper_site.php @@ -171,7 +171,7 @@ abstract class ###Component###Helper if (!$asset->check() || !$asset->store()) { - JError::raiseWarning(500, $asset->getError()); + JFactory::getApplication()->enqueueMessage($asset->getError(), 'warning'); return false; } else diff --git a/admin/compiler/joomla_3/JControllerLegacyAjaxSite.php b/admin/compiler/joomla_3/JControllerLegacyAjaxSite.php index 810f56404..ddea7efad 100644 --- a/admin/compiler/joomla_3/JControllerLegacyAjaxSite.php +++ b/admin/compiler/joomla_3/JControllerLegacyAjaxSite.php @@ -63,7 +63,7 @@ class ###Component###ControllerAjax extends JControllerLegacy } else { - if($callback = $jinput->get('callback', null, 'CMD') + if($callback = $jinput->get('callback', null, 'CMD')) { echo $callback."(".json_encode(false).");"; } diff --git a/admin/compiler/joomla_3/JModelItem_custom_admin.php b/admin/compiler/joomla_3/JModelItem_custom_admin.php index 5a38162de..df4c942f9 100644 --- a/admin/compiler/joomla_3/JModelItem_custom_admin.php +++ b/admin/compiler/joomla_3/JModelItem_custom_admin.php @@ -97,9 +97,10 @@ class ###Component###Model###SView### extends JModelItem // check if this user has permission to access item if (!$this->user->authorise('###sview###.access', 'com_###component###')) { - JError::raiseWarning(500, JText::_('Not authorised!')); + $app = JFactory::getApplication(); + $app->enqueueMessage(JText::_('Not authorised!'), 'error'); // redirect away if not a correct (TODO for now we go to default view) - JFactory::getApplication()->redirect('index.php?option=com_###component###'); + $app->redirect('index.php?option=com_###component###'); return false; } $this->userId = $this->user->get('id'); @@ -126,7 +127,7 @@ class ###Component###Model###SView### extends JModelItem if ($e->getCode() == 404) { // Need to go thru the error handler to allow Redirect to work. - JError::raiseError(404, $e->getMessage()); + JError::raiseWaring(404, $e->getMessage()); } else { diff --git a/admin/compiler/joomla_3/JModelItem_site.php b/admin/compiler/joomla_3/JModelItem_site.php index 1a35c99cd..2207c9955 100644 --- a/admin/compiler/joomla_3/JModelItem_site.php +++ b/admin/compiler/joomla_3/JModelItem_site.php @@ -99,9 +99,10 @@ class ###Component###Model###SView### extends JModelItem // check if this user has permission to access item if (!$this->user->authorise('site.###sview###.access', 'com_###component###')) { - JError::raiseWarning(500, JText::_('Not authorised!')); + $app = JFactory::getApplication(); + $app->enqueueMessage(JText::_('Not authorised!'), 'error'); // redirect away if not a correct (TODO for now we go to default view) - JFactory::getApplication()->redirect(JRoute::_('index.php?option=com_###component###&view=###SITE_DEFAULT_VIEW###')); + $app->redirect(JRoute::_('index.php?option=com_###component###&view=###SITE_DEFAULT_VIEW###')); return false; } $this->userId = $this->user->get('id'); @@ -128,7 +129,7 @@ class ###Component###Model###SView### extends JModelItem if ($e->getCode() == 404) { // Need to go thru the error handler to allow Redirect to work. - JError::raiseError(404, $e->getMessage()); + JError::raiseWaring(404, $e->getMessage()); } else { diff --git a/admin/compiler/joomla_3/JModelLegacy_import.php b/admin/compiler/joomla_3/JModelLegacy_import.php index 2422a1840..28f496992 100644 --- a/admin/compiler/joomla_3/JModelLegacy_import.php +++ b/admin/compiler/joomla_3/JModelLegacy_import.php @@ -201,7 +201,8 @@ class ###Component###ModelImport 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'); @@ -209,21 +210,21 @@ class ###Component###ModelImport extends JModelLegacy // Make sure that file uploads are enabled in php if (!(bool) ini_get('file_uploads')) { - JError::raiseWarning('', JText::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTFILE')); + $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTFILE'), 'warning'); 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')); + $app->enqueueMessage(JText::_('COM_###COMPONENT###_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_###COMPONENT###_IMPORT_MSG_WARNIMPORTUPLOADERROR')); + $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTUPLOADERROR'), 'warning'); return false; } @@ -261,7 +262,8 @@ class ###Component###ModelImport 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'); @@ -269,7 +271,7 @@ class ###Component###ModelImport extends JModelLegacy // Did you give us a valid path? if (!file_exists($p_dir)) { - JError::raiseWarning('', JText::_('COM_###COMPONENT###_IMPORT_MSG_PLEASE_ENTER_A_PACKAGE_DIRECTORY')); + $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_PLEASE_ENTER_A_PACKAGE_DIRECTORY'), 'warning'); return false; } @@ -279,7 +281,7 @@ class ###Component###ModelImport extends JModelLegacy // Did you give us a valid package? if (!$type) { - JError::raiseWarning('', JText::_('COM_###COMPONENT###_IMPORT_MSG_PATH_DOES_NOT_HAVE_A_VALID_PACKAGE')); + $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_PATH_DOES_NOT_HAVE_A_VALID_PACKAGE'), 'warning'); } // check the extention @@ -290,7 +292,7 @@ class ###Component###ModelImport extends JModelLegacy break; default: - JError::raiseWarning('', JText::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE')); + $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning'); return false; break; } @@ -310,15 +312,16 @@ class ###Component###ModelImport 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_###COMPONENT###_IMPORT_MSG_ENTER_A_URL')); + $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_ENTER_A_URL'), 'warning'); return false; } @@ -328,7 +331,7 @@ class ###Component###ModelImport extends JModelLegacy // Was the package downloaded? if (!$p_file) { - JError::raiseWarning('', JText::_('COM_###COMPONENT###_IMPORT_MSG_INVALID_URL')); + $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_INVALID_URL'), 'warning'); return false; } @@ -349,6 +352,7 @@ class ###Component###ModelImport extends JModelLegacy */ protected function check($archivename) { + $app = JFactory::getApplication(); // Clean the name $archivename = JPath::clean($archivename); @@ -362,7 +366,7 @@ class ###Component###ModelImport extends JModelLegacy default: // Cleanup the import files $this->remove($archivename); - JError::raiseWarning('', JText::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE')); + $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning'); return false; break; } diff --git a/admin/compiler/joomla_3/JModelLegacy_import_custom.php b/admin/compiler/joomla_3/JModelLegacy_import_custom.php index 5825f9083..3dfedbe16 100644 --- a/admin/compiler/joomla_3/JModelLegacy_import_custom.php +++ b/admin/compiler/joomla_3/JModelLegacy_import_custom.php @@ -91,7 +91,8 @@ class ###Component###Model###View### 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'); @@ -99,21 +100,21 @@ class ###Component###Model###View### extends JModelLegacy // Make sure that file uploads are enabled in php if (!(bool) ini_get('file_uploads')) { - JError::raiseWarning('', JText::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTFILE')); + $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTFILE'), 'warning'); 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')); + $app->enqueueMessage(JText::_('COM_###COMPONENT###_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_###COMPONENT###_IMPORT_MSG_WARNIMPORTUPLOADERROR')); + $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTUPLOADERROR'), 'warning'); return false; } @@ -151,7 +152,8 @@ class ###Component###Model###View### 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'); @@ -159,7 +161,7 @@ class ###Component###Model###View### extends JModelLegacy // Did you give us a valid path? if (!file_exists($p_dir)) { - JError::raiseWarning('', JText::_('COM_###COMPONENT###_IMPORT_MSG_PLEASE_ENTER_A_PACKAGE_DIRECTORY')); + $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_PLEASE_ENTER_A_PACKAGE_DIRECTORY'), 'warning'); return false; } @@ -169,7 +171,7 @@ class ###Component###Model###View### extends JModelLegacy // Did you give us a valid package? if (!$type) { - JError::raiseWarning('', JText::_('COM_###COMPONENT###_IMPORT_MSG_PATH_DOES_NOT_HAVE_A_VALID_PACKAGE')); + $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_PATH_DOES_NOT_HAVE_A_VALID_PACKAGE'), 'warning'); } // check the extention @@ -180,7 +182,7 @@ class ###Component###Model###View### extends JModelLegacy break; default: - JError::raiseWarning('', JText::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE')); + $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning'); return false; break; } @@ -200,7 +202,8 @@ class ###Component###Model###View### 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'); @@ -208,7 +211,7 @@ class ###Component###Model###View### extends JModelLegacy // Did you give us a URL? if (!$url) { - JError::raiseWarning('', JText::_('COM_###COMPONENT###_IMPORT_MSG_ENTER_A_URL')); + $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_ENTER_A_URL'), 'warning'); return false; } @@ -218,7 +221,7 @@ class ###Component###Model###View### extends JModelLegacy // Was the package downloaded? if (!$p_file) { - JError::raiseWarning('', JText::_('COM_###COMPONENT###_IMPORT_MSG_INVALID_URL')); + $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_INVALID_URL'), 'warning'); return false; } @@ -239,6 +242,7 @@ class ###Component###Model###View### extends JModelLegacy */ protected function check($archivename) { + $app = JFactory::getApplication(); // Clean the name $archivename = JPath::clean($archivename); @@ -252,7 +256,7 @@ class ###Component###Model###View### extends JModelLegacy default: // Cleanup the import files $this->remove($archivename); - JError::raiseWarning('', JText::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE')); + $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning'); return false; break; } diff --git a/admin/compiler/joomla_3/JModelList_custom_admin.php b/admin/compiler/joomla_3/JModelList_custom_admin.php index 3ec564aad..df3d0241b 100644 --- a/admin/compiler/joomla_3/JModelList_custom_admin.php +++ b/admin/compiler/joomla_3/JModelList_custom_admin.php @@ -81,9 +81,10 @@ class ###Component###Model###SViews### extends JModelList // check if this user has permission to access items if (!$user->authorise('###sviews###.access', 'com_###component###')) { - JError::raiseWarning(500, JText::_('Not authorised!')); + $app = JFactory::getApplication(); + $app->enqueueMessage(JText::_('Not authorised!'), 'error'); // redirect away if not a correct (TODO for now we go to default view) - JFactory::getApplication()->redirect('index.php?option=com_###component###'); + $app->redirect('index.php?option=com_###component###'); return false; }###LICENSE_LOCKED_CHECK### ###CUSTOM_ADMIN_BEFORE_GET_ITEMS### // load parent items diff --git a/admin/compiler/joomla_3/JModelList_site.php b/admin/compiler/joomla_3/JModelList_site.php index 622377c2c..50878cf6e 100644 --- a/admin/compiler/joomla_3/JModelList_site.php +++ b/admin/compiler/joomla_3/JModelList_site.php @@ -81,9 +81,10 @@ class ###Component###Model###SViews### extends JModelList // check if this user has permission to access items if (!$user->authorise('site.###sview###.access', 'com_###component###')) { - JError::raiseWarning(500, JText::_('Not authorised!')); + $app = JFactory::getApplication(); + $app->enqueueMessage(JText::_('Not authorised!'), 'error'); // redirect away if not a correct (TODO for now we go to default view) - JFactory::getApplication()->redirect(JRoute::_('index.php?option=com_###component###&view=###SITE_DEFAULT_VIEW###')); + $app->redirect(JRoute::_('index.php?option=com_###component###&view=###SITE_DEFAULT_VIEW###')); return false; }###LICENSE_LOCKED_CHECK### ###SITE_BEFORE_GET_ITEMS### // load parent items diff --git a/admin/compiler/joomla_3/component_admin.php b/admin/compiler/joomla_3/component_admin.php index 6283be0a6..9fb7c0db8 100644 --- a/admin/compiler/joomla_3/component_admin.php +++ b/admin/compiler/joomla_3/component_admin.php @@ -32,7 +32,7 @@ defined('_JEXEC') or die('Restricted access'); // Access check. if (!JFactory::getUser()->authorise('core.manage', 'com_###component###')) { - return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR')); + return JError::raiseWaring(404, JText::_('JERROR_ALERTNOAUTHOR')); }; // Load cms libraries diff --git a/admin/compiler/joomla_3/default_custom_admin.php b/admin/compiler/joomla_3/default_custom_admin.php index 7874b3f6c..5bcfc66a7 100644 --- a/admin/compiler/joomla_3/default_custom_admin.php +++ b/admin/compiler/joomla_3/default_custom_admin.php @@ -35,20 +35,9 @@ JHtml::_('behavior.formvalidation'); JHtml::_('formbehavior.chosen', 'select'); JHtml::_('behavior.keepalive'); ?> -canDo->get('###sview###.access')): ?> - -
###CUSTOM_ADMIN_BODY### diff --git a/admin/compiler/joomla_3/default_import.php b/admin/compiler/joomla_3/default_import.php index e888680ae..3c5462882 100644 --- a/admin/compiler/joomla_3/default_import.php +++ b/admin/compiler/joomla_3/default_import.php @@ -32,6 +32,7 @@ defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED### JHtml::_('jquery.framework'); JHtml::_('bootstrap.tooltip'); JHtml::_('script', 'system/core.js', false, true); +JHtml::_('behavior.keepalive'); ?> +canDo->get('###sview###.access')): ?>###CUSTOM_ADMIN_SUBMITBUTTON_SCRIPT###