';
diff --git a/admin/compiler/joomla_3/BaseControllerSITE.php b/admin/compiler/joomla_3/BaseControllerSITE.php
index af2bde03e..cee5dbb72 100644
--- a/admin/compiler/joomla_3/BaseControllerSITE.php
+++ b/admin/compiler/joomla_3/BaseControllerSITE.php
@@ -3,8 +3,8 @@
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
- * @author Llewellyn van der Merwe
- * @github Joomla Component Builder
+ * @author Llewellyn van der Merwe
+ * @git Joomla Component Builder
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
@@ -17,8 +17,11 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
+use Joomla\CMS\Factory;
use Joomla\CMS\MVC\Controller\BaseController;
+use Joomla\CMS\Router\Route;
use Joomla\Utilities\ArrayHelper;
+use Joomla\CMS\Language\Text;
/**
* ###Component### Component Base Controller
@@ -37,51 +40,51 @@ class ###Component###Controller extends BaseController
function display($cachable = false, $urlparams = false)
{
// set default view if not set
- $view = $this->input->getCmd('view', '###SITE_DEFAULT_VIEW###');
+ $view = $this->input->getCmd('view', '###SITE_DEFAULT_VIEW###');
$this->input->set('view', $view);
- $isEdit = $this->checkEditView($view);
- $layout = $this->input->get('layout', null, 'WORD');
- $id = $this->input->getInt('id');
- // $cachable = true; (TODO) working on a fix [gh-238](https://github.com/vdm-io/Joomla-Component-Builder/issues/238)
-
+ $isEdit = $this->checkEditView($view);
+ $layout = $this->input->get('layout', null, 'WORD');
+ $id = $this->input->getInt('id');
+ // $cachable = true; (TODO) working on a fix [gh-238](https://github.com/vdm-io/Joomla-Component-Builder/issues/238)
+
// insure that the view is not cashable if edit view or if user is logged in
- $user = JFactory::getUser();
+ $user = Factory::getUser();
if ($user->get('id') || $isEdit)
{
$cachable = false;
}
-
+
// Check for edit form.
if($isEdit)
{
if ($layout == 'edit' && !$this->checkEditId('com_###component###.edit.'.$view, $id))
{
// Somehow the person just went to the form - we don't allow that.
- $this->setError(JText::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
+ $this->setError(Text::sprintf('JLIB_APPLICATION_ERROR_UNHELD_ID', $id));
$this->setMessage($this->getError(), 'error');
// check if item was opend from other then its own list view
- $ref = $this->input->getCmd('ref', 0);
- $refid = $this->input->getInt('refid', 0);
+ $ref = $this->input->getCmd('ref', 0);
+ $refid = $this->input->getInt('refid', 0);
// set redirect
- if ($refid > 0 && ###Component###Helper::checkString($ref))
+ if ($refid > 0 && Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($ref))
{
// redirect to item of ref
- $this->setRedirect(JRoute::_('index.php?option=com_###component###&view='.(string)$ref.'&layout=edit&id='.(int)$refid, false));
+ $this->setRedirect(Route::_('index.php?option=com_###component###&view='.(string)$ref.'&layout=edit&id='.(int)$refid, false));
}
- elseif (###Component###Helper::checkString($ref))
+ elseif (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($ref))
{
// redirect to ref
- $this->setRedirect(JRoute::_('index.php?option=com_###component###&view='.(string)$ref, false));
+ $this->setRedirect(Route::_('index.php?option=com_###component###&view='.(string)$ref, false));
}
else
{
// normal redirect back to the list default site view
- $this->setRedirect(JRoute::_('index.php?option=com_###component###&view=###SITE_DEFAULT_VIEW###', false));
+ $this->setRedirect(Route::_('index.php?option=com_###component###&view=###SITE_DEFAULT_VIEW###', false));
}
return false;
}
}
-
+
// we may need to make this more dynamic in the future. (TODO)
$safeurlparams = array(
'catid' => 'INT',
@@ -102,9 +105,9 @@ class ###Component###Controller extends BaseController
'Itemid' => 'INT');
// should these not merge?
- if (###Component###Helper::checkArray($urlparams))
+ if (Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($urlparams))
{
- $safeurlparams = ###Component###Helper::mergeArrays(array($urlparams, $safeurlparams));
+ $safeurlparams = Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::merge(array($urlparams, $safeurlparams));
}
return parent::display($cachable, $safeurlparams);
@@ -112,7 +115,7 @@ class ###Component###Controller extends BaseController
protected function checkEditView($view)
{
- if (###Component###Helper::checkString($view))
+ if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($view))
{
$views = array(###SITE_EDIT_VIEW_ARRAY###
);
diff --git a/admin/compiler/joomla_3/BaseController_custom_admin.php b/admin/compiler/joomla_3/BaseController_custom_admin.php
index 8ed50653a..3976b770a 100644
--- a/admin/compiler/joomla_3/BaseController_custom_admin.php
+++ b/admin/compiler/joomla_3/BaseController_custom_admin.php
@@ -3,8 +3,8 @@
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
- * @author Llewellyn van der Merwe
- * @github Joomla Component Builder
+ * @author Llewellyn van der Merwe
+ * @git Joomla Component Builder
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
@@ -31,7 +31,7 @@ class ###Component###Controller###SView### extends BaseController
public function dashboard()
{
- $this->setRedirect(JRoute::_('index.php?option=com_###component###', false));
+ $this->setRedirect(Route::_('index.php?option=com_###component###', false));
return;
}###CUSTOM_ADMIN_CUSTOM_BUTTONS_CONTROLLER###
}
diff --git a/admin/compiler/joomla_3/BaseController_import.php b/admin/compiler/joomla_3/BaseController_import.php
index 504c266f2..f5811358a 100644
--- a/admin/compiler/joomla_3/BaseController_import.php
+++ b/admin/compiler/joomla_3/BaseController_import.php
@@ -3,8 +3,8 @@
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
- * @author Llewellyn van der Merwe
- * @github Joomla Component Builder
+ * @author Llewellyn van der Merwe
+ * @git Joomla Component Builder
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
@@ -32,21 +32,21 @@ class ###Component###ControllerImport extends BaseController
public function import()
{
// Check for request forgeries
- JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
+ Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
$model = $this->getModel('import');
if ($model->import())
{
- $cache = JFactory::getCache('mod_menu');
+ $cache = Factory::getCache('mod_menu');
$cache->clean();
// TODO: Reset the users acl here as well to kill off any missing bits
}
- $app = JFactory::getApplication();
+ $app = Factory::getApplication();
$redirect_url = $app->getUserState('com_###component###.redirect_url');
if (empty($redirect_url))
{
- $redirect_url = JRoute::_('index.php?option=com_###component###&view=import', false);
+ $redirect_url = Route::_('index.php?option=com_###component###&view=import', false);
}
else
{
diff --git a/admin/compiler/joomla_3/BaseController_import_custom.php b/admin/compiler/joomla_3/BaseController_import_custom.php
index dbe424603..a9283454a 100644
--- a/admin/compiler/joomla_3/BaseController_import_custom.php
+++ b/admin/compiler/joomla_3/BaseController_import_custom.php
@@ -3,8 +3,8 @@
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
- * @author Llewellyn van der Merwe
- * @github Joomla Component Builder
+ * @author Llewellyn van der Merwe
+ * @git Joomla Component Builder
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
@@ -32,21 +32,21 @@ class ###Component###Controller###View### extends BaseController
public function import()
{
// Check for request forgeries
- JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
+ Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
$model = $this->getModel('###View###');
if ($model->import())
{
- $cache = JFactory::getCache('mod_menu');
+ $cache = Factory::getCache('mod_menu');
$cache->clean();
// TODO: Reset the users acl here as well to kill off any missing bits
}
- $app = JFactory::getApplication();
+ $app = Factory::getApplication();
$redirect_url = $app->getUserState('com_###component###.redirect_url');
if (empty($redirect_url))
{
- $redirect_url = JRoute::_('index.php?option=com_###component###&view=###view###', false);
+ $redirect_url = Route::_('index.php?option=com_###component###&view=###view###', false);
}
else
{
diff --git a/admin/compiler/joomla_3/BaseDatabaseModel_import.php b/admin/compiler/joomla_3/BaseDatabaseModel_import.php
index f7501c7ec..020739141 100644
--- a/admin/compiler/joomla_3/BaseDatabaseModel_import.php
+++ b/admin/compiler/joomla_3/BaseDatabaseModel_import.php
@@ -3,8 +3,8 @@
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
- * @author Llewellyn van der Merwe
- * @github Joomla Component Builder
+ * @author Llewellyn van der Merwe
+ * @git Joomla Component Builder
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
@@ -27,8 +27,8 @@ class ###Component###ModelImport extends BaseDatabaseModel
// set uploading values
protected $use_streams = false;
protected $allow_unsafe = false;
- protected $safeFileOptions = array();
-
+ protected $safeFileOptions = [];
+
/**
* @var object JTable object
*/
@@ -45,13 +45,13 @@ class ###Component###ModelImport extends BaseDatabaseModel
* @var string
*/
protected $_context = 'com_###component###.import';
-
+
/**
* Import Settings
*/
- protected $getType = NULL;
- protected $dataType = NULL;
-
+ protected $getType = NULL;
+ protected $dataType = NULL;
+
/**
* Method to auto-populate the model state.
*
@@ -62,7 +62,7 @@ class ###Component###ModelImport extends BaseDatabaseModel
*/
protected function populateState()
{
- $app = JFactory::getApplication('administrator');
+ $app = Factory::getApplication('administrator');
$this->setState('message', $app->getUserState('com_###component###.message'));
$app->setUserState('com_###component###.message', '');
@@ -82,14 +82,14 @@ class ###Component###ModelImport extends BaseDatabaseModel
public function import()
{
$this->setState('action', 'import');
- $app = JFactory::getApplication();
- $session = JFactory::getSession();
+ $app = Factory::getApplication();
+ $session = Factory::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);
+ $this->dataType = $session->get('dataType_VDM_IMPORTINTO', NULL);
if ($package === null)
{
@@ -110,9 +110,9 @@ class ###Component###ModelImport extends BaseDatabaseModel
break;
case 'continue':
- $continue = true;
- $package = $session->get('package', null);
- $package = json_decode($package, true);
+ $continue = true;
+ $package = $session->get('package', null);
+ $package = json_decode($package, true);
// clear session
$session->clear('package');
$session->clear('dataType');
@@ -120,7 +120,7 @@ class ###Component###ModelImport extends BaseDatabaseModel
break;
default:
- $app->setUserState('com_###component###.message', JText::_('COM_###COMPONENT###_IMPORT_NO_IMPORT_TYPE_FOUND'));
+ $app->setUserState('com_###component###.message', Text::_('COM_###COMPONENT###_IMPORT_NO_IMPORT_TYPE_FOUND'));
return false;
break;
@@ -134,10 +134,10 @@ class ###Component###ModelImport extends BaseDatabaseModel
$this->remove($package['packagename']);
}
- $app->setUserState('com_###component###.message', JText::_('COM_###COMPONENT###_IMPORT_UNABLE_TO_FIND_IMPORT_PACKAGE'));
+ $app->setUserState('com_###component###.message', Text::_('COM_###COMPONENT###_IMPORT_UNABLE_TO_FIND_IMPORT_PACKAGE'));
return false;
}
-
+
// first link data to table headers
if(!$continue){
$package = json_encode($package);
@@ -146,13 +146,13 @@ class ###Component###ModelImport extends BaseDatabaseModel
$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');
+ $msg = Text::_('COM_###COMPONENT###_IMPORT_ERROR');
$back = $session->get('backto_VDM_IMPORT', NULL);
if ($back)
{
@@ -164,12 +164,12 @@ class ###Component###ModelImport extends BaseDatabaseModel
else
{
// Package imported sucessfully
- $msg = JText::sprintf('COM_###COMPONENT###_IMPORT_SUCCESS', $package['packagename']);
+ $msg = Text::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');
+ $app->setUserState('com_###component###.redirect_url', 'index.php?option=com_###component###&view='.$back);
+ $session->clear('backto_VDM_IMPORT');
}
$result = true;
}
@@ -180,7 +180,7 @@ class ###Component###ModelImport extends BaseDatabaseModel
// remove file after import
$this->remove($package['packagename']);
$session->clear($this->getType.'_VDM_IMPORTHEADERS');
-
+
return $result;
}
@@ -190,48 +190,47 @@ class ###Component###ModelImport extends BaseDatabaseModel
* @return spreadsheet definition or false on failure
*/
protected function _getPackageFromUpload()
- {
+ {
// Get the uploaded file information
- $app = JFactory::getApplication();
+ $app = Factory::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');
-
+
// Make sure that file uploads are enabled in php
if (!(bool) ini_get('file_uploads'))
{
- $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTFILE'), 'warning');
+ $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTFILE'), 'warning');
return false;
}
// If there is no uploaded file, we have a problem...
if (!is_array($userfile))
{
- $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_NO_FILE_SELECTED'), 'warning');
+ $app->enqueueMessage(Text::_('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)
{
- $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTUPLOADERROR'), 'warning');
+ $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTUPLOADERROR'), 'warning');
return false;
}
// Build the appropriate paths
- $config = JFactory::getConfig();
+ $config = Factory::getConfig();
$tmp_dest = $config->get('tmp_path') . '/' . $userfile['name'];
$tmp_src = $userfile['tmp_name'];
// Move uploaded file
- jimport('joomla.filesystem.file');
$p_file = File::upload($tmp_src, $tmp_dest, $this->use_streams, $this->allow_unsafe, $this->safeFileOptions);
// Was the package downloaded?
if (!$p_file)
{
- $session = JFactory::getSession();
+ $session = Factory::getSession();
$session->clear('package');
$session->clear('dataType');
$session->clear('hasPackage');
@@ -253,16 +252,16 @@ class ###Component###ModelImport extends BaseDatabaseModel
*/
protected function _getPackageFromFolder()
{
- $app = JFactory::getApplication();
+ $app = Factory::getApplication();
$input = $app->input;
// Get the path to the package to import
$p_dir = $input->getString('import_directory');
- $p_dir = JPath::clean($p_dir);
+ $p_dir = Path::clean($p_dir);
// Did you give us a valid path?
if (!file_exists($p_dir))
{
- $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_PLEASE_ENTER_A_PACKAGE_DIRECTORY'), 'warning');
+ $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_PLEASE_ENTER_A_PACKAGE_DIRECTORY'), 'warning');
return false;
}
@@ -272,17 +271,17 @@ class ###Component###ModelImport extends BaseDatabaseModel
// Did you give us a valid package?
if (!$type)
{
- $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_PATH_DOES_NOT_HAVE_A_VALID_PACKAGE'), 'warning');
+ $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_PATH_DOES_NOT_HAVE_A_VALID_PACKAGE'), 'warning');
}
-
+
// check the extention
if(!$this->checkExtension($p_dir))
{
// set error message
- $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning');
+ $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning');
return false;
}
-
+
$package['packagename'] = null;
$package['dir'] = $p_dir;
$package['type'] = $type;
@@ -298,26 +297,26 @@ class ###Component###ModelImport extends BaseDatabaseModel
*/
protected function _getPackageFromUrl()
{
- $app = JFactory::getApplication();
+ $app = Factory::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)
{
- $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_ENTER_A_URL'), 'warning');
+ $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_ENTER_A_URL'), 'warning');
return false;
}
// Download the package at the URL given
- $p_file = JInstallerHelper::downloadPackage($url);
+ $p_file = InstallerHelper::downloadPackage($url);
// Was the package downloaded?
if (!$p_file)
{
- $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_INVALID_URL'), 'warning');
+ $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_INVALID_URL'), 'warning');
return false;
}
@@ -326,7 +325,7 @@ class ###Component###ModelImport extends BaseDatabaseModel
return $package;
}
-
+
/**
* Check a file and verifies it as a spreadsheet file
* Supports .csv .xlsx .xls and .ods
@@ -338,29 +337,29 @@ class ###Component###ModelImport extends BaseDatabaseModel
*/
protected function check($archivename)
{
- $app = JFactory::getApplication();
+ $app = Factory::getApplication();
// Clean the name
- $archivename = JPath::clean($archivename);
-
+ $archivename = Path::clean($archivename);
+
// check the extention
if(!$this->checkExtension($archivename))
{
// Cleanup the import files
$this->remove($archivename);
- $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning');
+ $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning');
return false;
}
-
- $config = JFactory::getConfig();
+
+ $config = Factory::getConfig();
// set Package Name
$check['packagename'] = $archivename;
-
+
// set directory
$check['dir'] = $config->get('tmp_path'). '/' .$archivename;
-
+
// set type
$check['type'] = $this->getType;
-
+
return $check;
}###IMPORT_EXT_METHOD###
@@ -375,8 +374,8 @@ class ###Component###ModelImport extends BaseDatabaseModel
protected function remove($package)
{
jimport('joomla.filesystem.file');
-
- $config = JFactory::getConfig();
+
+ $config = Factory::getConfig();
$package = $config->get('tmp_path'). '/' .$package;
// Is the package file a valid file?
@@ -384,23 +383,23 @@ class ###Component###ModelImport extends BaseDatabaseModel
{
File::delete($package);
}
- elseif (is_file(JPath::clean($package)))
+ elseif (is_file(Path::clean($package)))
{
// It might also be just a base filename
- File::delete(JPath::clean($package));
+ File::delete(Path::clean($package));
}
}###IMPORT_SETDATA_METHOD######IMPORT_SAVE_METHOD###
protected function getAlias($name,$type = false)
{
// sanitize the name to an alias
- if (JFactory::getConfig()->get('unicodeslugs') == 1)
+ if (Factory::getConfig()->get('unicodeslugs') == 1)
{
- $alias = JFilterOutput::stringURLUnicodeSlug($name);
+ $alias = OutputFilter::stringURLUnicodeSlug($name);
}
else
{
- $alias = JFilterOutput::stringURLSafe($name);
+ $alias = OutputFilter::stringURLSafe($name);
}
// must be a uniqe alias
if ($type)
@@ -409,7 +408,7 @@ class ###Component###ModelImport extends BaseDatabaseModel
}
return $alias;
}
-
+
/**
* Method to generate a uniqe value.
*
@@ -424,16 +423,16 @@ class ###Component###ModelImport extends BaseDatabaseModel
// insure the filed is always uniqe
while (isset($this->uniqeValueArray[$type][$field][$value]))
{
- $value = JString::increment($value, 'dash');
+ $value = StringHelper::increment($value, 'dash');
}
$this->uniqeValueArray[$type][$field][$value] = $value;
return $value;
}
-
+
protected function getAliasesUsed($table)
{
// Get a db connection.
- $db = JFactory::getDbo();
+ $db = Factory::getDbo();
// first we check if there is a alias column
$columns = $db->getTableColumns('#__###component###_'.$table);
if(isset($columns['alias'])){
diff --git a/admin/compiler/joomla_3/BaseDatabaseModel_import_custom.php b/admin/compiler/joomla_3/BaseDatabaseModel_import_custom.php
index 19be712eb..e429a0223 100644
--- a/admin/compiler/joomla_3/BaseDatabaseModel_import_custom.php
+++ b/admin/compiler/joomla_3/BaseDatabaseModel_import_custom.php
@@ -3,8 +3,8 @@
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
- * @author Llewellyn van der Merwe
- * @github Joomla Component Builder
+ * @author Llewellyn van der Merwe
+ * @git Joomla Component Builder
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
@@ -27,8 +27,8 @@ class ###Component###Model###View### extends BaseDatabaseModel
// set uploading values
protected $use_streams = false;
protected $allow_unsafe = false;
- protected $safeFileOptions = array();
-
+ protected $safeFileOptions = [];
+
/**
* @var object JTable object
*/
@@ -45,13 +45,13 @@ class ###Component###Model###View### extends BaseDatabaseModel
* @var string
*/
protected $_context = 'com_###component###.###view###';
-
+
/**
* Import Settings
*/
protected $getType = NULL;
protected $dataType = NULL;
-
+
/**
* Method to auto-populate the model state.
*
@@ -62,7 +62,7 @@ class ###Component###Model###View### extends BaseDatabaseModel
*/
protected function populateState()
{
- $app = JFactory::getApplication('administrator');
+ $app = Factory::getApplication('administrator');
$this->setState('message', $app->getUserState('com_###component###.message'));
$app->setUserState('com_###component###.message', '');
@@ -72,7 +72,7 @@ class ###Component###Model###View### extends BaseDatabaseModel
$this->setState('import.directory', $path);
parent::populateState();
}
- ###IMPORT_METHOD_CUSTOM###
+ ###IMPORT_METHOD_CUSTOM###
/**
* Works out an importation spreadsheet from a HTTP upload
@@ -80,37 +80,37 @@ class ###Component###Model###View### extends BaseDatabaseModel
* @return spreadsheet definition or false on failure
*/
protected function _getPackageFromUpload()
- {
+ {
// Get the uploaded file information
- $app = JFactory::getApplication();
+ $app = Factory::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');
-
+
// Make sure that file uploads are enabled in php
if (!(bool) ini_get('file_uploads'))
{
- $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTFILE'), 'warning');
+ $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTFILE'), 'warning');
return false;
}
// If there is no uploaded file, we have a problem...
if (!is_array($userfile))
{
- $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_NO_FILE_SELECTED'), 'warning');
+ $app->enqueueMessage(Text::_('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)
{
- $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTUPLOADERROR'), 'warning');
+ $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_WARNIMPORTUPLOADERROR'), 'warning');
return false;
}
// Build the appropriate paths
- $config = JFactory::getConfig();
+ $config = Factory::getConfig();
$tmp_dest = $config->get('tmp_path') . '/' . $userfile['name'];
$tmp_src = $userfile['tmp_name'];
@@ -120,7 +120,7 @@ class ###Component###Model###View### extends BaseDatabaseModel
// Was the package downloaded?
if (!$p_file)
{
- $session = JFactory::getSession();
+ $session = Factory::getSession();
$session->clear('package');
$session->clear('dataType');
$session->clear('hasPackage');
@@ -142,16 +142,16 @@ class ###Component###Model###View### extends BaseDatabaseModel
*/
protected function _getPackageFromFolder()
{
- $app = JFactory::getApplication();
+ $app = Factory::getApplication();
$input = $app->input;
// Get the path to the package to import
$p_dir = $input->getString('import_directory');
- $p_dir = JPath::clean($p_dir);
+ $p_dir = Path::clean($p_dir);
// Did you give us a valid path?
if (!file_exists($p_dir))
{
- $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_PLEASE_ENTER_A_PACKAGE_DIRECTORY'), 'warning');
+ $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_PLEASE_ENTER_A_PACKAGE_DIRECTORY'), 'warning');
return false;
}
@@ -161,17 +161,17 @@ class ###Component###Model###View### extends BaseDatabaseModel
// Did you give us a valid package?
if (!$type)
{
- $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_PATH_DOES_NOT_HAVE_A_VALID_PACKAGE'), 'warning');
+ $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_PATH_DOES_NOT_HAVE_A_VALID_PACKAGE'), 'warning');
}
-
+
// check the extention
if(!$this->checkExtension($p_dir))
{
// set error message
- $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning');
+ $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning');
return false;
}
-
+
$package['packagename'] = null;
$package['dir'] = $p_dir;
$package['type'] = $type;
@@ -187,7 +187,7 @@ class ###Component###Model###View### extends BaseDatabaseModel
*/
protected function _getPackageFromUrl()
{
- $app = JFactory::getApplication();
+ $app = Factory::getApplication();
$input = $app->input;
// Get the URL of the package to import
@@ -196,17 +196,17 @@ class ###Component###Model###View### extends BaseDatabaseModel
// Did you give us a URL?
if (!$url)
{
- $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_ENTER_A_URL'), 'warning');
+ $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_ENTER_A_URL'), 'warning');
return false;
}
// Download the package at the URL given
- $p_file = JInstallerHelper::downloadPackage($url);
+ $p_file = InstallerHelper::downloadPackage($url);
// Was the package downloaded?
if (!$p_file)
{
- $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_INVALID_URL'), 'warning');
+ $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_INVALID_URL'), 'warning');
return false;
}
@@ -215,7 +215,7 @@ class ###Component###Model###View### extends BaseDatabaseModel
return $package;
}
-
+
/**
* Check a file and verifies it as a spreadsheet file
* Supports .csv .xlsx .xls and .ods
@@ -227,29 +227,29 @@ class ###Component###Model###View### extends BaseDatabaseModel
*/
protected function check($archivename)
{
- $app = JFactory::getApplication();
+ $app = Factory::getApplication();
// Clean the name
- $archivename = JPath::clean($archivename);
-
+ $archivename = Path::clean($archivename);
+
// check the extention
if(!$this->checkExtension($archivename))
{
// Cleanup the import files
$this->remove($archivename);
- $app->enqueueMessage(JText::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning');
+ $app->enqueueMessage(Text::_('COM_###COMPONENT###_IMPORT_MSG_DOES_NOT_HAVE_A_VALID_FILE_TYPE'), 'warning');
return false;
}
-
- $config = JFactory::getConfig();
+
+ $config = Factory::getConfig();
// set Package Name
$check['packagename'] = $archivename;
-
+
// set directory
$check['dir'] = $config->get('tmp_path'). '/' .$archivename;
-
+
// set type
$check['type'] = $this->getType;
-
+
return $check;
}
###IMPORT_EXT_METHOD###
@@ -264,9 +264,7 @@ class ###Component###Model###View### extends BaseDatabaseModel
*/
protected function remove($package)
{
- jimport('joomla.filesystem.file');
-
- $config = JFactory::getConfig();
+ $config = Factory::getConfig();
$package = $config->get('tmp_path'). '/' .$package;
// Is the package file a valid file?
@@ -274,10 +272,10 @@ class ###Component###Model###View### extends BaseDatabaseModel
{
File::delete($package);
}
- elseif (is_file(JPath::clean($package)))
+ elseif (is_file(Path::clean($package)))
{
// It might also be just a base filename
- File::delete(JPath::clean($package));
+ File::delete(Path::clean($package));
}
}
###IMPORT_SETDATA_METHOD###
@@ -286,13 +284,13 @@ class ###Component###Model###View### extends BaseDatabaseModel
protected function getAlias($name,$type = false)
{
// sanitize the name to an alias
- if (JFactory::getConfig()->get('unicodeslugs') == 1)
+ if (Factory::getConfig()->get('unicodeslugs') == 1)
{
- $alias = JFilterOutput::stringURLUnicodeSlug($name);
+ $alias = OutputFilter::stringURLUnicodeSlug($name);
}
else
{
- $alias = JFilterOutput::stringURLSafe($name);
+ $alias = OutputFilter::stringURLSafe($name);
}
// must be a uniqe alias
if ($type)
@@ -301,7 +299,7 @@ class ###Component###Model###View### extends BaseDatabaseModel
}
return $alias;
}
-
+
/**
* Method to generate a uniqe value.
*
@@ -316,16 +314,16 @@ class ###Component###Model###View### extends BaseDatabaseModel
// insure the filed is always uniqe
while (isset($this->uniqeValueArray[$type][$field][$value]))
{
- $value = JString::increment($value, 'dash');
+ $value = StringHelper::increment($value, 'dash');
}
$this->uniqeValueArray[$type][$field][$value] = $value;
return $value;
}
-
+
protected function getAliasesUsed($table)
{
// Get a db connection.
- $db = JFactory::getDbo();
+ $db = Factory::getDbo();
// first we check if there is a alias column
$columns = $db->getTableColumns('#__###component###_'.$table);
if(isset($columns['alias'])){
diff --git a/admin/compiler/joomla_3/DASHJViewLagacy.php b/admin/compiler/joomla_3/DASHJViewLagacy.php
index c9a759f75..d8dc3d60f 100644
--- a/admin/compiler/joomla_3/DASHJViewLagacy.php
+++ b/admin/compiler/joomla_3/DASHJViewLagacy.php
@@ -3,8 +3,8 @@
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
- * @author Llewellyn van der Merwe
- * @github Joomla Component Builder
+ * @author Llewellyn van der Merwe
+ * @git Joomla Component Builder
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
@@ -22,7 +22,7 @@ defined('_JEXEC') or die('Restricted access');
/**
* ###Component### View class
*/
-class ###Component###View###Component### extends JViewLegacy
+class ###Component###View###Component### extends HtmlView
{
/**
* View display method
@@ -31,15 +31,15 @@ class ###Component###View###Component### extends JViewLegacy
function display($tpl = null)
{
// Assign data to the view
- $this->icons = $this->get('Icons');
- $this->contributors = ###Component###Helper::getContributors();###DASH_GET_CUSTOM_DATA###
-
+ $this->icons = $this->get('Icons');
+ $this->contributors = ###Component###Helper::getContributors();###DASH_GET_CUSTOM_DATA###
+
// get the manifest details of the component
$this->manifest = ###Component###Helper::manifest();
-
+
// Set the toolbar
$this->addToolBar();
-
+
// Check for errors.
if (count($errors = $this->get('Errors')))
{
@@ -59,18 +59,18 @@ class ###Component###View###Component### extends JViewLegacy
protected function addToolBar()
{
$canDo = ###Component###Helper::getActions('###component###');
- JToolBarHelper::title(JText::_('COM_###COMPONENT###_DASHBOARD'), 'grid-2');
+ ToolbarHelper::title(Text::_('COM_###COMPONENT###_DASHBOARD'), 'grid-2');
// set help url for this view if found
$this->help_url = ###Component###Helper::getHelpUrl('###component###');
- if (###Component###Helper::checkString($this->help_url))
+ if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($this->help_url))
{
- JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url);
+ ToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url);
}
if ($canDo->get('core.admin') || $canDo->get('core.options'))
{
- JToolBarHelper::preferences('com_###component###');
+ ToolbarHelper::preferences('com_###component###');
}
}
@@ -81,15 +81,17 @@ class ###Component###View###Component### extends JViewLegacy
*/
protected function setDocument()
{
- $document = JFactory::getDocument();
-
- // add dashboard style sheets
- $document->addStyleSheet(JURI::root() . "administrator/components/com_###component###/assets/css/dashboard.css");
-
+ if (!isset($this->document))
+ {
+ $this->document = Factory::getDocument();
+ }
// set page title
- $document->setTitle(JText::_('COM_###COMPONENT###_DASHBOARD'));
-
+ $this->document->setTitle(Text::_('COM_###COMPONENT###_DASHBOARD'));
+
// add manifest to page JavaScript
- $document->addScriptDeclaration("var manifest = jQuery.parseJSON('" . json_encode($this->manifest) . "');", "text/javascript");
+ $this->document->addScriptDeclaration("var manifest = jQuery.parseJSON('" . json_encode($this->manifest) . "');", "text/javascript");
+
+ // add dashboard style sheets
+ Html::_('stylesheet', "administrator/components/com_###component###/assets/css/dashboard.css", ['version' => 'auto']);
}
}
diff --git a/admin/compiler/joomla_3/DASHdefault.php b/admin/compiler/joomla_3/DASHdefault.php
index 14691c6cd..bda607bcf 100644
--- a/admin/compiler/joomla_3/DASHdefault.php
+++ b/admin/compiler/joomla_3/DASHdefault.php
@@ -3,8 +3,8 @@
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
- * @author Llewellyn van der Merwe
- * @github Joomla Component Builder
+ * @author Llewellyn van der Merwe
+ * @git Joomla Component Builder
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
diff --git a/admin/compiler/joomla_3/FormController.php b/admin/compiler/joomla_3/FormController.php
index feb4ec217..59827b281 100644
--- a/admin/compiler/joomla_3/FormController.php
+++ b/admin/compiler/joomla_3/FormController.php
@@ -3,8 +3,8 @@
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
- * @author Llewellyn van der Merwe
- * @github Joomla Component Builder
+ * @author Llewellyn van der Merwe
+ * @git Joomla Component Builder
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
@@ -40,13 +40,13 @@ class ###Component###Controller###View### extends FormController
*
* @since 1.6
*/
- public function __construct($config = array())
+ public function __construct($config = [])
{
$this->view_list = '###Views###'; // safeguard for setting the return view listing to the main view.
parent::__construct($config);
}###ADMIN_CUSTOM_BUTTONS_CONTROLLER###
- /**
+ /**
* Method override to check if you can add a new record.
*
* @param array $data An array of input data.
@@ -55,7 +55,7 @@ class ###Component###Controller###View### extends FormController
*
* @since 1.6
*/
- protected function allowAdd($data = array())
+ protected function allowAdd($data = [])
{###JCONTROLLERFORM_ALLOWADD###
}
@@ -69,7 +69,7 @@ class ###Component###Controller###View### extends FormController
*
* @since 1.6
*/
- protected function allowEdit($data = array(), $key = 'id')
+ protected function allowEdit($data = [], $key = 'id')
{###JCONTROLLERFORM_ALLOWEDIT###
}
@@ -94,12 +94,12 @@ class ###Component###Controller###View### extends FormController
// set the referral options
if ($refid && $ref)
- {
- $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append;
+ {
+ $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append;
}
elseif ($ref)
{
- $append = '&ref='. (string)$ref . $append;
+ $append = '&ref='. (string) $ref . $append;
}
return $append;
@@ -116,13 +116,13 @@ class ###Component###Controller###View### extends FormController
*/
public function batch($model = null)
{
- JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
+ Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
// Set the model
- $model = $this->getModel('###View###', '', array());
+ $model = $this->getModel('###View###', '', []);
// Preset the redirect
- $this->setRedirect(JRoute::_('index.php?option=com_###component###&view=###views###' . $this->getRedirectToListAppend(), false));
+ $this->setRedirect(Route::_('index.php?option=com_###component###&view=###views###' . $this->getRedirectToListAppend(), false));
return parent::batch($model);
}
@@ -147,13 +147,13 @@ class ###Component###Controller###View### extends FormController
$cancel = parent::cancel($key);
- if (!is_null($return) && JUri::isInternal(base64_decode($return)))
+ if (!is_null($return) && Uri::isInternal(base64_decode($return)))
{
$redirect = base64_decode($return);
// Redirect to the return value.
$this->setRedirect(
- JRoute::_(
+ Route::_(
$redirect, false
)
);
@@ -164,7 +164,7 @@ class ###Component###Controller###View### extends FormController
// Redirect to the item screen.
$this->setRedirect(
- JRoute::_(
+ Route::_(
'index.php?option=' . $this->option . $redirect, false
)
);
@@ -175,7 +175,7 @@ class ###Component###Controller###View### extends FormController
// Redirect to the list screen.
$this->setRedirect(
- JRoute::_(
+ Route::_(
'index.php?option=' . $this->option . $redirect, false
)
);
@@ -201,7 +201,7 @@ class ###Component###Controller###View### extends FormController
// Check if there is a return value
$return = $this->input->get('return', null, 'base64');
- $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return)));
+ $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return)));
if ($this->ref || $this->refid || $canReturn)
{
@@ -219,29 +219,29 @@ class ###Component###Controller###View### extends FormController
// Redirect to the return value.
$this->setRedirect(
- JRoute::_(
+ Route::_(
$redirect, false
)
);
}
elseif ($this->refid && $this->ref)
{
- $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid;
+ $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid;
// Redirect to the item screen.
$this->setRedirect(
- JRoute::_(
+ Route::_(
'index.php?option=' . $this->option . $redirect, false
)
);
}
elseif ($this->ref)
{
- $redirect = '&view=' . (string)$this->ref;
+ $redirect = '&view=' . (string) $this->ref;
// Redirect to the list screen.
$this->setRedirect(
- JRoute::_(
+ Route::_(
'index.php?option=' . $this->option . $redirect, false
)
);
@@ -253,15 +253,14 @@ class ###Component###Controller###View### extends FormController
* Function that allows child controller access to model data
* after the data has been saved.
*
- * @param JModel &$model The data model object.
- * @param array $validData The validated data.
+ * @param BaseDatabaseModel &$model The data model object.
+ * @param array $validData The validated data.
*
* @return void
*
* @since 11.1
*/
- protected function postSaveHook(JModelLegacy $model, $validData = array())
+ protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
{###POSTSAVEHOOK###
}
-
}
diff --git a/admin/compiler/joomla_3/FormController_custom_site.php b/admin/compiler/joomla_3/FormController_custom_site.php
index 8d6d30cd5..6f38faedb 100644
--- a/admin/compiler/joomla_3/FormController_custom_site.php
+++ b/admin/compiler/joomla_3/FormController_custom_site.php
@@ -3,8 +3,8 @@
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
- * @author Llewellyn van der Merwe
- * @github Joomla Component Builder
+ * @author Llewellyn van der Merwe
+ * @git Joomla Component Builder
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
@@ -33,7 +33,7 @@ class ###Component###Controller###SView### extends FormController
*/
protected $task;
- public function __construct($config = array())
+ public function __construct($config = [])
{
$this->view_list = '###SITE_DEFAULT_VIEW###'; // safeguard for setting the return view listing to the default site view.
parent::__construct($config);
@@ -51,13 +51,13 @@ class ###Component###Controller###SView### extends FormController
*
* @since 12.2
*/
- protected function allowEdit($data = array(), $key = 'id')
+ protected function allowEdit($data = [], $key = 'id')
{
// to insure no other tampering
return false;
}
- /**
+ /**
* Method override to check if you can add a new record.
*
* @param array $data An array of input data.
@@ -66,7 +66,7 @@ class ###Component###Controller###SView### extends FormController
*
* @since 1.6
*/
- protected function allowAdd($data = array())
+ protected function allowAdd($data = [])
{
// to insure no other tampering
return false;
@@ -101,7 +101,7 @@ class ###Component###Controller###SView### extends FormController
*
* @since 12.2
*/
- protected function postSaveHook(JModelLegacy $model, $validData = array())
+ protected function postSaveHook(JModelLegacy $model, $validData = [])
{
}
}
diff --git a/admin/compiler/joomla_3/FormController_site.php b/admin/compiler/joomla_3/FormController_site.php
index 530f3ac90..b55b176fc 100644
--- a/admin/compiler/joomla_3/FormController_site.php
+++ b/admin/compiler/joomla_3/FormController_site.php
@@ -3,8 +3,8 @@
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
- * @author Llewellyn van der Merwe
- * @github Joomla Component Builder
+ * @author Llewellyn van der Merwe
+ * @git Joomla Component Builder
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
@@ -40,13 +40,13 @@ class ###Component###Controller###View### extends FormController
*
* @since 1.6
*/
- public function __construct($config = array())
+ public function __construct($config = [])
{
$this->view_list = '###SITE_DEFAULT_VIEW###'; // safeguard for setting the return view listing to the default site view.
parent::__construct($config);
}###ADMIN_CUSTOM_BUTTONS_CONTROLLER###
- /**
+ /**
* Method override to check if you can add a new record.
*
* @param array $data An array of input data.
@@ -55,7 +55,7 @@ class ###Component###Controller###View### extends FormController
*
* @since 1.6
*/
- protected function allowAdd($data = array())
+ protected function allowAdd($data = [])
{###JCONTROLLERFORM_ALLOWADD###
}
@@ -69,7 +69,7 @@ class ###Component###Controller###View### extends FormController
*
* @since 1.6
*/
- protected function allowEdit($data = array(), $key = 'id')
+ protected function allowEdit($data = [], $key = 'id')
{###JCONTROLLERFORM_ALLOWEDIT###
}
@@ -94,12 +94,12 @@ class ###Component###Controller###View### extends FormController
// set the referral options
if ($refid && $ref)
- {
- $append = '&ref=' . (string)$ref . '&refid='. (int)$refid . $append;
+ {
+ $append = '&ref=' . (string) $ref . '&refid='. (int) $refid . $append;
}
elseif ($ref)
{
- $append = '&ref='. (string)$ref . $append;
+ $append = '&ref='. (string) $ref . $append;
}
return $append;
@@ -116,13 +116,13 @@ class ###Component###Controller###View### extends FormController
*/
public function batch($model = null)
{
- JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
+ Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
// Set the model
- $model = $this->getModel('###View###', '', array());
+ $model = $this->getModel('###View###', '', []);
// Preset the redirect
- $this->setRedirect(JRoute::_('index.php?option=com_###component###&view=###views###' . $this->getRedirectToListAppend(), false));
+ $this->setRedirect(Route::_('index.php?option=com_###component###&view=###views###' . $this->getRedirectToListAppend(), false));
return parent::batch($model);
}
@@ -147,35 +147,35 @@ class ###Component###Controller###View### extends FormController
$cancel = parent::cancel($key);
- if (!is_null($return) && JUri::isInternal(base64_decode($return)))
+ if (!is_null($return) && Uri::isInternal(base64_decode($return)))
{
$redirect = base64_decode($return);
// Redirect to the return value.
$this->setRedirect(
- JRoute::_(
+ Route::_(
$redirect, false
)
);
}
elseif ($this->refid && $this->ref)
{
- $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid;
+ $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid;
// Redirect to the item screen.
$this->setRedirect(
- JRoute::_(
+ Route::_(
'index.php?option=' . $this->option . $redirect, false
)
);
}
elseif ($this->ref)
{
- $redirect = '&view=' . (string)$this->ref;
+ $redirect = '&view=' . (string) $this->ref;
// Redirect to the list screen.
$this->setRedirect(
- JRoute::_(
+ Route::_(
'index.php?option=' . $this->option . $redirect, false
)
);
@@ -201,7 +201,7 @@ class ###Component###Controller###View### extends FormController
// Check if there is a return value
$return = $this->input->get('return', null, 'base64');
- $canReturn = (!is_null($return) && JUri::isInternal(base64_decode($return)));
+ $canReturn = (!is_null($return) && Uri::isInternal(base64_decode($return)));
if ($this->ref || $this->refid || $canReturn)
{
@@ -219,29 +219,29 @@ class ###Component###Controller###View### extends FormController
// Redirect to the return value.
$this->setRedirect(
- JRoute::_(
+ Route::_(
$redirect, false
)
);
}
elseif ($this->refid && $this->ref)
{
- $redirect = '&view=' . (string)$this->ref . '&layout=edit&id=' . (int)$this->refid;
+ $redirect = '&view=' . (string) $this->ref . '&layout=edit&id=' . (int) $this->refid;
// Redirect to the item screen.
$this->setRedirect(
- JRoute::_(
+ Route::_(
'index.php?option=' . $this->option . $redirect, false
)
);
}
elseif ($this->ref)
{
- $redirect = '&view=' . (string)$this->ref;
+ $redirect = '&view=' . (string) $this->ref;
// Redirect to the list screen.
$this->setRedirect(
- JRoute::_(
+ Route::_(
'index.php?option=' . $this->option . $redirect, false
)
);
@@ -253,14 +253,14 @@ class ###Component###Controller###View### extends FormController
* Function that allows child controller access to model data
* after the data has been saved.
*
- * @param JModel &$model The data model object.
- * @param array $validData The validated data.
+ * @param BaseDatabaseModel &$model The data model object.
+ * @param array $validData The validated data.
*
* @return void
*
* @since 11.1
*/
- protected function postSaveHook(JModelLegacy $model, $validData = array())
+ protected function postSaveHook(BaseDatabaseModel $model, $validData = [])
{###POSTSAVEHOOK###
}
diff --git a/admin/compiler/joomla_3/Helper.php b/admin/compiler/joomla_3/Helper.php
index ded32f2d4..6caa65c0a 100644
--- a/admin/compiler/joomla_3/Helper.php
+++ b/admin/compiler/joomla_3/Helper.php
@@ -3,8 +3,8 @@
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
- * @author Llewellyn van der Merwe
- * @github Joomla Component Builder
+ * @author Llewellyn van der Merwe
+ * @git Joomla Component Builder
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
@@ -29,7 +29,7 @@ abstract class ###Component###Helper
*
* @var array
*/
- protected static $composer = array();
+ protected static $composer = [];
/**
* The Main Active Language
@@ -80,7 +80,7 @@ abstract class ###Component###Helper
// check if set
if (!Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check(self::$JVersion))
{
- self::$JVersion = new JVersion();
+ self::$JVersion = new Version();
}
return self::$JVersion;
}
@@ -91,18 +91,18 @@ abstract class ###Component###Helper
public static function getContributors()
{
// get params
- $params = JComponentHelper::getParams('com_###component###');
+ $params = ComponentHelper::getParams('com_###component###');
// start contributors array
- $contributors = array();
+ $contributors = [];
// get all Contributors (max 20)
$searchArray = range('0','20');
foreach($searchArray as $nr)
- {
+ {
if ((NULL !== $params->get("showContributor".$nr)) && ($params->get("showContributor".$nr) == 1 || $params->get("showContributor".$nr) == 3))
{
// set link based of selected option
if($params->get("useContributor".$nr) == 1)
- {
+ {
$link_front = '';
$link_back = '';
}
@@ -116,8 +116,8 @@ abstract class ###Component###Helper
$link_front = '';
$link_back = '';
}
- $contributors[$nr]['title'] = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($params->get("titleContributor".$nr));
- $contributors[$nr]['name'] = $link_front.Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($params->get("nameContributor".$nr)).$link_back;
+ $contributors[$nr]['title'] = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($params->get("titleContributor".$nr));
+ $contributors[$nr]['name'] = $link_front.Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($params->get("nameContributor".$nr)).$link_back;
}
}
return $contributors;
@@ -129,7 +129,7 @@ abstract class ###Component###Helper
public static function addSubmenu($submenu)
{
// load user for access menus
- $user = JFactory::getUser();
+ $user = Factory::getUser();
// load the submenus to sidebar
###SUBMENU###
}###HELPER_CREATEUSER######HELPER_UIKIT######HELPER_EXEL###
@@ -211,7 +211,7 @@ abstract class ###Component###Helper
{
$type = 'item';
}
- $db = JFactory::getDbo();
+ $db = Factory::getDbo();
$query = $db->getQuery(true);
$query->select(array('a.published'));
$query->from('#__###component###_'.$type.' AS a');
@@ -229,7 +229,7 @@ abstract class ###Component###Helper
public static function getGroupName($id)
{
- $db = JFactory::getDBO();
+ $db = Factory::getDBO();
$query = $db->getQuery(true);
$query->select(array('a.title'));
$query->from('#__usergroups AS a');
@@ -238,7 +238,7 @@ abstract class ###Component###Helper
$db->execute();
$found = $db->getNumRows();
if($found)
- {
+ {
return $db->loadResult();
}
return $id;
@@ -254,7 +254,7 @@ abstract class ###Component###Helper
* @param string $component The target component
* @param object $user The user whose permissions we are loading
*
- * @return object The JObject of permission/authorised actions
+ * @return object The CMSObject of permission/authorised actions
*
*/
public static function getActions($view, &$record = null, $views = null, $target = null, $component = '###component###', $user = 'null')
@@ -263,22 +263,22 @@ abstract class ###Component###Helper
if (!Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($user))
{
// get the user object
- $user = JFactory::getUser();
+ $user = Factory::getUser();
}
- // load the JObject
- $result = new JObject;
+ // load the CMSObject
+ $result = new CMSObject;
// make view name safe (just incase)
$view = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($view);
if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($views))
{
$views = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($views);
- }
+ }
// get all actions from component
- $actions = JAccess::getActionsFromFile(
+ $actions = Access::getActionsFromFile(
JPATH_ADMINISTRATOR . '/components/com_' . $component . '/access.xml',
"/access/section[@name='component']/"
);
- // if non found then return empty JObject
+ // if non found then return empty CMSObject
if (empty($actions))
{
return $result;
@@ -445,14 +445,14 @@ abstract class ###Component###Helper
/**
* Get any component's model
*/
- public static function getModel($name, $path = JPATH_COMPONENT_ADMINISTRATOR, $Component = '###Component###', $config = array())
+ public static function getModel($name, $path = JPATH_COMPONENT_ADMINISTRATOR, $Component = '###Component###', $config = [])
{
// fix the name
$name = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($name);
// full path to models
$fullPathModels = $path . '/models';
// load the model file
- JModelLegacy::addIncludePath($fullPathModels, $Component . 'Model');
+ BaseDatabaseModel::addIncludePath($fullPathModels, $Component . 'Model');
// make sure the table path is loaded
if (!isset($config['table_path']) || !Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($config['table_path']))
{
@@ -460,7 +460,7 @@ abstract class ###Component###Helper
$config['table_path'] = JPATH_ADMINISTRATOR . '/components/com_' . strtolower($Component) . '/tables';
}
// get instance
- $model = JModelLegacy::getInstance($name, $Component . 'Model', $config);
+ $model = BaseDatabaseModel::getInstance($name, $Component . 'Model', $config);
// if model not found (strange)
if ($model == false)
{
@@ -495,14 +495,14 @@ abstract class ###Component###Helper
*/
public static function setAsset($id, $table, $inherit = true)
{
- $parent = JTable::getInstance('Asset');
+ $parent = Table::getInstance('Asset');
$parent->loadByName('com_###component###');
$parentId = $parent->id;
$name = 'com_###component###.'.$table.'.'.$id;
$title = '';
- $asset = JTable::getInstance('Asset');
+ $asset = Table::getInstance('Asset');
$asset->loadByName($name);
// Check for an error.
@@ -526,14 +526,14 @@ abstract class ###Component###Helper
$asset->title = $title;
// get the default asset rules
$rules = self::getDefaultAssetRules('com_###component###', $table, $inherit);
- if ($rules instanceof JAccessRules)
+ if ($rules instanceof AccessRules)
{
$asset->rules = (string) $rules;
}
if (!$asset->check() || !$asset->store())
{
- JFactory::getApplication()->enqueueMessage($asset->getError(), 'warning');
+ Factory::getApplication()->enqueueMessage($asset->getError(), 'warning');
return false;
}
else
@@ -546,7 +546,7 @@ abstract class ###Component###Helper
$object->asset_id = (int) $asset->id;
// Update their asset_id to link to the asset table.
- return JFactory::getDbo()->updateObject('#__###component###_'.$table, $object, 'id');
+ return Factory::getDbo()->updateObject('#__###component###_'.$table, $object, 'id');
}
}
return false;
@@ -563,7 +563,7 @@ abstract class ###Component###Helper
if (!$inherit)
{
// Need to find the asset id by the name of the component.
- $db = JFactory::getDbo();
+ $db = Factory::getDbo();
$query = $db->getQuery(true)
->select($db->quoteName('id'))
->from($db->quoteName('#__assets'))
@@ -578,8 +578,8 @@ abstract class ###Component###Helper
}
}
// get asset rules
- $result = JAccess::getAssetRules($assetId);
- if ($result instanceof JAccessRules)
+ $result = Access::getAssetRules($assetId);
+ if ($result instanceof AccessRules)
{
$_result = (string) $result;
$_result = json_decode($_result);
@@ -594,7 +594,7 @@ abstract class ###Component###Helper
elseif ($inherit)
{
// clear the value since we inherit
- $rule = array();
+ $rule = [];
}
}
// check if there are any view values remaining
@@ -602,8 +602,8 @@ abstract class ###Component###Helper
{
$_result = json_encode($_result);
$_result = array($_result);
- // Instantiate and return the JAccessRules object for the asset rules.
- $rules = new JAccessRules($_result);
+ // Instantiate and return the AccessRules object for the asset rules.
+ $rules = new AccessRules($_result);
// return filtered rules
return $rules;
}
@@ -648,7 +648,7 @@ abstract class ###Component###Helper
* @return null
* @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::attributes($xml, $attributes);
*/
- public static function xmlAddAttributes(&$xml, $attributes = array())
+ public static function xmlAddAttributes(&$xml, $attributes = [])
{
Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::attributes($xml, $attributes);
}
@@ -662,7 +662,7 @@ abstract class ###Component###Helper
* @return void
* @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::options($xml, $options);
*/
- public static function xmlAddOptions(&$xml, $options = array())
+ public static function xmlAddOptions(&$xml, $options = [])
{
Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::options($xml, $options);
}
@@ -733,7 +733,7 @@ abstract class ###Component###Helper
/**
* Check if have an json string
*
- * @input string The json string to check
+ * @input string The json string to check
*
* @returns bool true on success
* @deprecated 3.3 Use Super___4b225c51_d293_48e4_b3f6_5136cf5c3f18___Power::check($string);
@@ -746,7 +746,7 @@ abstract class ###Component###Helper
/**
* Check if have an object with a length
*
- * @input object The object to check
+ * @input object The object to check
*
* @returns bool true on success
* @deprecated 3.3 Use Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($object);
@@ -759,7 +759,7 @@ abstract class ###Component###Helper
/**
* Check if have an array with a length
*
- * @input array The array to check
+ * @input array The array to check
*
* @returns bool/int number of items in array on success
* @deprecated 3.3 Use Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($array, $removeEmptyString);
@@ -772,7 +772,7 @@ abstract class ###Component###Helper
/**
* Check if have a string with a length
*
- * @input string The string to check
+ * @input string The string to check
*
* @returns bool true on success
* @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($string);
@@ -792,7 +792,7 @@ abstract class ###Component###Helper
{
// If example.com is down, then probably the whole internet is down, since IANA maintains the domain. Right?
$connected = @fsockopen("www.example.com", 80);
- // website, port (try 80 or 443)
+ // website, port (try 80 or 443)
if ($connected)
{
//action when connected
@@ -810,7 +810,7 @@ abstract class ###Component###Helper
/**
* Merge an array of array's
*
- * @input array The arrays you would like to merge
+ * @input array The arrays you would like to merge
*
* @returns array on success
* @deprecated 3.3 Use Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::merge($arrays);
@@ -829,7 +829,7 @@ abstract class ###Component###Helper
/**
* Shorten a string
*
- * @input string The you would like to shorten
+ * @input string The you would like to shorten
*
* @returns string on success
* @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::shorten(...);
@@ -842,7 +842,7 @@ abstract class ###Component###Helper
/**
* Making strings safe (various ways)
*
- * @input string The you would like to make safe
+ * @input string The you would like to make safe
*
* @returns string on success
* @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe(...);
@@ -861,7 +861,7 @@ abstract class ###Component###Helper
/**
* Convert none English strings to code usable string
*
- * @input an string
+ * @input an string
*
* @returns a string
* @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::transliterate($string);
@@ -874,7 +874,7 @@ abstract class ###Component###Helper
/**
* make sure a string is HTML save
*
- * @input an html string
+ * @input an html string
*
* @returns a string
* @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html(...);
@@ -892,7 +892,7 @@ abstract class ###Component###Helper
/**
* Convert all int in a string to an English word string
*
- * @input an string with numbers
+ * @input an string with numbers
*
* @returns a string
* @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::numbers($string);
@@ -906,7 +906,7 @@ abstract class ###Component###Helper
* Convert an integer into an English word string
* Thanks to Tom Nicholson
*
- * @input an int
+ * @input an int
* @returns a string
* @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::number($x);
*/
diff --git a/admin/compiler/joomla_3/Helper_category.php b/admin/compiler/joomla_3/Helper_category.php
index ad4ed490c..193ebff3a 100644
--- a/admin/compiler/joomla_3/Helper_category.php
+++ b/admin/compiler/joomla_3/Helper_category.php
@@ -3,8 +3,8 @@
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
- * @author Llewellyn van der Merwe
- * @github Joomla Component Builder
+ * @author Llewellyn van der Merwe
+ * @git Joomla Component Builder
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
diff --git a/admin/compiler/joomla_3/Helper_category_view.php b/admin/compiler/joomla_3/Helper_category_view.php
index 53e2d88d3..ac2046a0e 100644
--- a/admin/compiler/joomla_3/Helper_category_view.php
+++ b/admin/compiler/joomla_3/Helper_category_view.php
@@ -3,8 +3,8 @@
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
- * @author Llewellyn van der Merwe
- * @github Joomla Component Builder
+ * @author Llewellyn van der Merwe
+ * @git Joomla Component Builder
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
@@ -28,7 +28,7 @@ class ###Component######View###Categories extends JCategories
* @param array $options Array of options
*
*/
- public function __construct($options = array())
+ public function __construct($options = [])
{
$options['table'] = '#__###component###_###view###';
$options['extension'] = 'com_###component###.###view###';
diff --git a/admin/compiler/joomla_3/Helper_email.php b/admin/compiler/joomla_3/Helper_email.php
index 309817cac..f51347eb9 100644
--- a/admin/compiler/joomla_3/Helper_email.php
+++ b/admin/compiler/joomla_3/Helper_email.php
@@ -3,8 +3,8 @@
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
- * @author Llewellyn van der Merwe
- * @github Joomla Component Builder
+ * @author Llewellyn van der Merwe
+ * @git Joomla Component Builder
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
@@ -17,6 +17,11 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
+use Joomla\CMS\Factory;
+use Joomla\CMS\Component\ComponentHelper;
+use Joomla\CMS\Mail\Mail;
+use Joomla\Registry\Registry;
+
/**
* ###Component### component email helper
*/
@@ -27,28 +32,28 @@ abstract class ###Component###Email
*
* @var activeRecipient (array)
*/
- public static $active = array();
+ public static $active = [];
/**
* Configuraiton object
*
- * @var JConfig
+ * @var Registry
*/
- public static $config = null;
+ public static ?Registry $config = null;
/**
* Mailer object
*
- * @var JMail
+ * @var Mail
*/
- public static $mailer = null;
+ public static ?Mail $mailer = null;
/**
* Custom Headers
*
* @var array
*/
- protected static $header = array();
+ protected static array $header = [];
/**
* Get a configuration object
@@ -58,7 +63,7 @@ abstract class ###Component###Email
{
if (!self::$config)
{
- self::$config = JComponentHelper::getParams('com_###component###');
+ self::$config = ComponentHelper::getParams('com_###component###');
}
return self::$config;
@@ -97,7 +102,7 @@ abstract class ###Component###Email
* @static
* @access public
*/
- public static function validateAddress($address, $patternselect = null)
+ public static function validateAddress($address, $patternselect = null): bool
{
return self::getMailerInstance()->validateAddress($address, $patternselect);
}
@@ -105,13 +110,13 @@ abstract class ###Component###Email
/**
* Get a mailer object.
*
- * Returns the global {@link JMail} object, only creating it if it doesn't already exist.
+ * Returns the global {@link Mail} object, only creating it if it doesn't already exist.
*
- * @return JMail object
+ * @return Mail object
*
- * @see JMail
+ * @see Mail
*/
- public static function getMailer()
+ public static function getMailer(): Mail
{
if (!self::$mailer)
{
@@ -126,58 +131,58 @@ abstract class ###Component###Email
/**
* Create a mailer object
*
- * @return JMail object
+ * @return Mail object
*
- * @see JMail
+ * @see Mail
*/
- protected static function createMailer()
+ protected static function createMailer(): Mail
{
// set component params
$conf = self::getConfig();
-
+
// now load the mailer
$mailer = $conf->get('mailer', 'global');
-
- // Create a JMail object
- $mail = JMail::getInstance();
+
+ // Create a Mail object
+ $mail = Mail::getInstance();
// check if set to global
if ('global' == $mailer)
{
// get the global details
- $globalConf = JFactory::getConfig();
-
- $mailer = $globalConf->get('mailer');
- $smtpauth = ($globalConf->get('smtpauth') == 0) ? null : 1;
- $smtpuser = $globalConf->get('smtpuser');
- $smtppass = $globalConf->get('smtppass');
- $smtphost = $globalConf->get('smtphost');
- $smtpsecure = $globalConf->get('smtpsecure');
- $smtpport = $globalConf->get('smtpport');
- $sendmail = $globalConf->get('sendmail');
- $mailfrom = $globalConf->get('mailfrom');
- $fromname = $globalConf->get('fromname');
- $replyto = $globalConf->get('replyto');
- $replytoname = $globalConf->get('replytoname');
+ $globalConf = Factory::getConfig();
+
+ $mailer = $globalConf->get('mailer');
+ $smtpauth = ($globalConf->get('smtpauth') == 0) ? null : 1;
+ $smtpuser = $globalConf->get('smtpuser');
+ $smtppass = $globalConf->get('smtppass');
+ $smtphost = $globalConf->get('smtphost');
+ $smtpsecure = $globalConf->get('smtpsecure');
+ $smtpport = $globalConf->get('smtpport');
+ $sendmail = $globalConf->get('sendmail');
+ $mailfrom = $globalConf->get('mailfrom');
+ $fromname = $globalConf->get('fromname');
+ $replyto = $globalConf->get('replyto');
+ $replytoname = $globalConf->get('replytoname');
}
else
{
- $smtpauth = ($conf->get('smtpauth') == 0) ? null : 1;
- $smtpuser = $conf->get('smtpuser');
- $smtppass = $conf->get('smtppass');
- $smtphost = $conf->get('smtphost');
- $smtpsecure = $conf->get('smtpsecure');
- $smtpport = $conf->get('smtpport');
- $sendmail = $conf->get('sendmail');
- $mailfrom = $conf->get('emailfrom');
- $fromname = $conf->get('fromname');
- $replyto = $conf->get('replyto');
- $replytoname = $conf->get('replytoname');
+ $smtpauth = ($conf->get('smtpauth') == 0) ? null : 1;
+ $smtpuser = $conf->get('smtpuser');
+ $smtppass = $conf->get('smtppass');
+ $smtphost = $conf->get('smtphost');
+ $smtpsecure = $conf->get('smtpsecure');
+ $smtpport = $conf->get('smtpport');
+ $sendmail = $conf->get('sendmail');
+ $mailfrom = $conf->get('emailfrom');
+ $fromname = $conf->get('fromname');
+ $replyto = $conf->get('replyto');
+ $replytoname = $conf->get('replytoname');
}
// Set global sender
$mail->setSender(array($mailfrom, $fromname));
-
+
// set the global reply-to if found
if ($replyto && $replytoname)
{
@@ -226,25 +231,25 @@ abstract class ###Component###Email
*/
public static function send($recipient, $subject, $body, $textonly, $mode = 0, $bounce_email = null, $idsession = null, $mailreply = null, $replyname = null , $mailfrom = null, $fromname = null, $cc = null, $bcc = null, $attachment = null, $embeded = null , $embeds = null)
{
- // Get a JMail instance
+ // Get a Mail instance
$mail = self::getMailer();
-
+
// set component params
$conf = self::getConfig();
-
+
// set if we have override
if ($mailfrom && $fromname)
{
$mail->setSender(array($mailfrom, $fromname));
}
-
+
// load the bounce email as sender if set
if (!is_null($bounce_email))
- {
+ {
$mail->Sender = $bounce_email;
}
-
- // Add tag to email to identify it
+
+ // Add tag to email to identify it
if (!is_null($idsession))
{
$mail->addCustomHeader('X-VDMmethodID:'.$idsession);
@@ -262,7 +267,7 @@ abstract class ###Component###Email
// set the subject & Body
$mail->setSubject($subject);
$mail->setBody($body);
-
+
// Are we sending the email as HTML?
if ($mode)
{
@@ -273,7 +278,7 @@ abstract class ###Component###Email
//embed images
if ($embeded)
{
- if(###Component###Helper::checkArray($embeds))
+ if(Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($embeds))
{
foreach($embeds as $embed)
{
@@ -308,21 +313,21 @@ abstract class ###Component###Email
{
if (!empty($conf->get('dkim_domain')) && !empty($conf->get('dkim_selector')) && !empty($conf->get('dkim_private')) && !empty($conf->get('dkim_public')))
{
- $mail->DKIM_domain = $conf->get('dkim_domain');
- $mail->DKIM_selector = $conf->get('dkim_selector');
- $mail->DKIM_identity = $conf->get('dkim_identity');
- $mail->DKIM_passphrase = $conf->get('dkim_passphrase');
-
- $tmp = tempnam(sys_get_temp_dir(), 'VDM');
- $h = fopen($tmp, 'w');
+ $mail->DKIM_domain = $conf->get('dkim_domain');
+ $mail->DKIM_selector = $conf->get('dkim_selector');
+ $mail->DKIM_identity = $conf->get('dkim_identity');
+ $mail->DKIM_passphrase = $conf->get('dkim_passphrase');
+
+ $tmp = tempnam(sys_get_temp_dir(), 'VDM');
+ $h = fopen($tmp, 'w');
fwrite($h, $conf->get('dkim_private'));
fclose($h);
- $mail->DKIM_private = $tmp;
+ $mail->DKIM_private = $tmp;
}
}
$sendmail = $mail->Send();
-
+
if ($conf->get('enable_dkim') && !empty($conf->get('dkim_domain')) && !empty($conf->get('dkim_selector')) && !empty($conf->get('dkim_private')) && !empty($conf->get('dkim_public')))
{
@unlink($tmp);
@@ -351,7 +356,7 @@ abstract class ###Component###Email
/**
* Set html text (in a row) and subject (as title) to a email table.
* do not use
instead use
- * in your html that you pass to this method
+ * in your html that you pass to this method
* since it is a table row it does not
* work well with paragraphs
*
@@ -360,7 +365,7 @@ abstract class ###Component###Email
*/
public static function setBasicBody($html, $subject)
{
- $body = array();
+ $body = [];
$body[] = "";
$body[] = "";
$body[] = "
";
@@ -397,7 +402,7 @@ abstract class ###Component###Email
/**
* Set html text (in a row) and subject (as title) to a email table.
* do not use
instead use
- * in your html that you pass to this method
+ * in your html that you pass to this method
* since it is a table row it does not
* work well with paragraphs
*
@@ -406,7 +411,7 @@ abstract class ###Component###Email
*/
public static function setTableBody($html, $subject)
{
- $body = array();
+ $body = [];
$body[] = "";
$body[] = "";
$body[] = "
";
diff --git a/admin/compiler/joomla_3/Helper_site.php b/admin/compiler/joomla_3/Helper_site.php
index 2f61d0c50..c831a708b 100644
--- a/admin/compiler/joomla_3/Helper_site.php
+++ b/admin/compiler/joomla_3/Helper_site.php
@@ -3,8 +3,8 @@
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
- * @author Llewellyn van der Merwe
- * @github Joomla Component Builder
+ * @author Llewellyn van der Merwe
+ * @git Joomla Component Builder
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
@@ -29,7 +29,7 @@ abstract class ###Component###Helper
*
* @var array
*/
- protected static $composer = array();
+ protected static $composer = [];
/**
* The Main Active Language
@@ -99,7 +99,7 @@ abstract class ###Component###Helper
// check if set
if (!Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check(self::$JVersion))
{
- self::$JVersion = new JVersion();
+ self::$JVersion = new Version();
}
return self::$JVersion;
}
@@ -110,9 +110,9 @@ abstract class ###Component###Helper
public static function getContributors()
{
// get params
- $params = JComponentHelper::getParams('com_###component###');
+ $params = ComponentHelper::getParams('com_###component###');
// start contributors array
- $contributors = array();
+ $contributors = [];
// get all Contributors (max 20)
$searchArray = range('0','20');
foreach($searchArray as $nr)
@@ -121,22 +121,22 @@ abstract class ###Component###Helper
{
// set link based of selected option
if($params->get("useContributor".$nr) == 1)
- {
+ {
$link_front = '';
$link_back = '';
}
- elseif($params->get("useContributor".$nr) == 2)
- {
+ elseif($params->get("useContributor".$nr) == 2)
+ {
$link_front = '';
$link_back = '';
}
- else
- {
+ else
+ {
$link_front = '';
$link_back = '';
}
- $contributors[$nr]['title'] = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($params->get("titleContributor".$nr));
- $contributors[$nr]['name'] = $link_front.Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($params->get("nameContributor".$nr)).$link_back;
+ $contributors[$nr]['title'] = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($params->get("titleContributor".$nr));
+ $contributors[$nr]['name'] = $link_front.Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($params->get("nameContributor".$nr)).$link_back;
}
}
return $contributors;
@@ -145,14 +145,14 @@ abstract class ###Component###Helper
/**
* Get any component's model
*/
- public static function getModel($name, $path = JPATH_COMPONENT_SITE, $Component = '###Component###', $config = array())
+ public static function getModel($name, $path = JPATH_COMPONENT_SITE, $Component = '###Component###', $config = [])
{
// fix the name
$name = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($name);
// full path to models
$fullPathModels = $path . '/models';
// load the model file
- JModelLegacy::addIncludePath($fullPathModels, $Component . 'Model');
+ BaseDatabaseModel::addIncludePath($fullPathModels, $Component . 'Model');
// make sure the table path is loaded
if (!isset($config['table_path']) || !Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($config['table_path']))
{
@@ -160,7 +160,7 @@ abstract class ###Component###Helper
$config['table_path'] = JPATH_ADMINISTRATOR . '/components/com_' . strtolower($Component) . '/tables';
}
// get instance
- $model = JModelLegacy::getInstance($name, $Component . 'Model', $config);
+ $model = BaseDatabaseModel::getInstance($name, $Component . 'Model', $config);
// if model not found (strange)
if ($model == false)
{
@@ -195,14 +195,14 @@ abstract class ###Component###Helper
*/
public static function setAsset($id, $table, $inherit = true)
{
- $parent = JTable::getInstance('Asset');
+ $parent = Table::getInstance('Asset');
$parent->loadByName('com_###component###');
$parentId = $parent->id;
$name = 'com_###component###.'.$table.'.'.$id;
$title = '';
- $asset = JTable::getInstance('Asset');
+ $asset = Table::getInstance('Asset');
$asset->loadByName($name);
// Check for an error.
@@ -226,14 +226,14 @@ abstract class ###Component###Helper
$asset->title = $title;
// get the default asset rules
$rules = self::getDefaultAssetRules('com_###component###', $table, $inherit);
- if ($rules instanceof JAccessRules)
+ if ($rules instanceof AccessRules)
{
$asset->rules = (string) $rules;
}
if (!$asset->check() || !$asset->store())
{
- JFactory::getApplication()->enqueueMessage($asset->getError(), 'warning');
+ Factory::getApplication()->enqueueMessage($asset->getError(), 'warning');
return false;
}
else
@@ -246,7 +246,7 @@ abstract class ###Component###Helper
$object->asset_id = (int) $asset->id;
// Update their asset_id to link to the asset table.
- return JFactory::getDbo()->updateObject('#__###component###_'.$table, $object, 'id');
+ return Factory::getDbo()->updateObject('#__###component###_'.$table, $object, 'id');
}
}
return false;
@@ -263,7 +263,7 @@ abstract class ###Component###Helper
if (!$inherit)
{
// Need to find the asset id by the name of the component.
- $db = JFactory::getDbo();
+ $db = Factory::getDbo();
$query = $db->getQuery(true)
->select($db->quoteName('id'))
->from($db->quoteName('#__assets'))
@@ -278,8 +278,8 @@ abstract class ###Component###Helper
}
}
// get asset rules
- $result = JAccess::getAssetRules($assetId);
- if ($result instanceof JAccessRules)
+ $result = Access::getAssetRules($assetId);
+ if ($result instanceof AccessRules)
{
$_result = (string) $result;
$_result = json_decode($_result);
@@ -294,7 +294,7 @@ abstract class ###Component###Helper
elseif ($inherit)
{
// clear the value since we inherit
- $rule = array();
+ $rule = [];
}
}
// check if there are any view values remaining
@@ -302,8 +302,8 @@ abstract class ###Component###Helper
{
$_result = json_encode($_result);
$_result = array($_result);
- // Instantiate and return the JAccessRules object for the asset rules.
- $rules = new JAccessRules($_result);
+ // Instantiate and return the AccessRules object for the asset rules.
+ $rules = new AccessRules($_result);
// return filtered rules
return $rules;
}
@@ -348,7 +348,7 @@ abstract class ###Component###Helper
* @return null
* @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::attributes($xml, $attributes);
*/
- public static function xmlAddAttributes(&$xml, $attributes = array())
+ public static function xmlAddAttributes(&$xml, $attributes = [])
{
Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::attributes($xml, $attributes);
}
@@ -362,7 +362,7 @@ abstract class ###Component###Helper
* @return void
* @deprecated 3.3 Use Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::options($xml, $options);
*/
- public static function xmlAddOptions(&$xml, $options = array())
+ public static function xmlAddOptions(&$xml, $options = [])
{
Super___1198aecf_84c6_45d2_aea8_d531aa4afdfa___Power::options($xml, $options);
}
@@ -488,7 +488,7 @@ abstract class ###Component###Helper
{
$type = 'item';
}
- $db = JFactory::getDbo();
+ $db = Factory::getDbo();
$query = $db->getQuery(true);
$query->select(array('a.published'));
$query->from('#__###component###_'.$type.' AS a');
@@ -506,7 +506,7 @@ abstract class ###Component###Helper
public static function getGroupName($id)
{
- $db = JFactory::getDBO();
+ $db = Factory::getDBO();
$query = $db->getQuery(true);
$query->select(array('a.title'));
$query->from('#__usergroups AS a');
@@ -531,7 +531,7 @@ abstract class ###Component###Helper
* @param string $component The target component
* @param object $user The user whose permissions we are loading
*
- * @return object The JObject of permission/authorised actions
+ * @return object The CMSObject of permission/authorised actions
*
*/
public static function getActions($view, &$record = null, $views = null, $target = null, $component = '###component###', $user = 'null')
@@ -540,22 +540,22 @@ abstract class ###Component###Helper
if (!Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($user))
{
// get the user object
- $user = JFactory::getUser();
+ $user = Factory::getUser();
}
- // load the JObject
- $result = new JObject;
+ // load the CMSObject
+ $result = new CMSObject;
// make view name safe (just incase)
$view = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($view);
if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($views))
{
$views = Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($views);
- }
+ }
// get all actions from component
- $actions = JAccess::getActionsFromFile(
+ $actions = Access::getActionsFromFile(
JPATH_ADMINISTRATOR . '/components/com_' . $component . '/access.xml',
"/access/section[@name='component']/"
);
- // if non found then return empty JObject
+ // if non found then return empty CMSObject
if (empty($actions))
{
return $result;
@@ -722,7 +722,7 @@ abstract class ###Component###Helper
/**
* Check if have an json string
*
- * @input string The json string to check
+ * @input string The json string to check
*
* @returns bool true on success
* @deprecated 3.3 Use Super___4b225c51_d293_48e4_b3f6_5136cf5c3f18___Power::check($string);
@@ -735,7 +735,7 @@ abstract class ###Component###Helper
/**
* Check if have an object with a length
*
- * @input object The object to check
+ * @input object The object to check
*
* @returns bool true on success
* @deprecated 3.3 Use Super___91004529_94a9_4590_b842_e7c6b624ecf5___Power::check($object);
@@ -748,7 +748,7 @@ abstract class ###Component###Helper
/**
* Check if have an array with a length
*
- * @input array The array to check
+ * @input array The array to check
*
* @returns bool/int number of items in array on success
* @deprecated 3.3 Use Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($array, $removeEmptyString);
@@ -761,7 +761,7 @@ abstract class ###Component###Helper
/**
* Check if have a string with a length
*
- * @input string The string to check
+ * @input string The string to check
*
* @returns bool true on success
* @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($string);
@@ -781,7 +781,7 @@ abstract class ###Component###Helper
{
// If example.com is down, then probably the whole internet is down, since IANA maintains the domain. Right?
$connected = @fsockopen("www.example.com", 80);
- // website, port (try 80 or 443)
+ // website, port (try 80 or 443)
if ($connected)
{
//action when connected
@@ -799,7 +799,7 @@ abstract class ###Component###Helper
/**
* Merge an array of array's
*
- * @input array The arrays you would like to merge
+ * @input array The arrays you would like to merge
*
* @returns array on success
* @deprecated 3.3 Use Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::merge($arrays);
@@ -818,7 +818,7 @@ abstract class ###Component###Helper
/**
* Shorten a string
*
- * @input string The you would like to shorten
+ * @input string The you would like to shorten
*
* @returns string on success
* @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::shorten(...);
@@ -831,7 +831,7 @@ abstract class ###Component###Helper
/**
* Making strings safe (various ways)
*
- * @input string The you would like to make safe
+ * @input string The you would like to make safe
*
* @returns string on success
* @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe(...);
@@ -850,7 +850,7 @@ abstract class ###Component###Helper
/**
* Convert none English strings to code usable string
*
- * @input an string
+ * @input an string
*
* @returns a string
* @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::transliterate($string);
@@ -863,7 +863,7 @@ abstract class ###Component###Helper
/**
* make sure a string is HTML save
*
- * @input an html string
+ * @input an html string
*
* @returns a string
* @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html(...);
@@ -881,7 +881,7 @@ abstract class ###Component###Helper
/**
* Convert all int in a string to an English word string
*
- * @input an string with numbers
+ * @input an string with numbers
*
* @returns a string
* @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::numbers($string);
@@ -895,7 +895,7 @@ abstract class ###Component###Helper
* Convert an integer into an English word string
* Thanks to Tom Nicholson
*
- * @input an int
+ * @input an int
* @returns a string
* @deprecated 3.3 Use Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::number($x);
*/
diff --git a/admin/compiler/joomla_3/HtmlView_custom_admin.php b/admin/compiler/joomla_3/HtmlView_custom_admin.php
index a7f97fbee..dc0f06ed4 100644
--- a/admin/compiler/joomla_3/HtmlView_custom_admin.php
+++ b/admin/compiler/joomla_3/HtmlView_custom_admin.php
@@ -3,8 +3,8 @@
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
- * @author Llewellyn van der Merwe
- * @github Joomla Component Builder
+ * @author Llewellyn van der Merwe
+ * @git Joomla Component Builder
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
@@ -15,9 +15,9 @@ defined('_JEXEC') or die('Restricted access');
###BOM###
// No direct access to this file
-defined('_JEXEC') or die('Restricted access'); ###LICENSE_LOCKED_DEFINED######CUSTOM_ADMIN_GET_MODULE_JIMPORT###
+defined('_JEXEC') or die('Restricted access'); ###LICENSE_LOCKED_DEFINED###
-###CUSTOM_ADMIN_VIEW_HTML_HEADER###
+###CUSTOM_ADMIN_VIEW_HTML_HEADER######CUSTOM_ADMIN_GET_MODULE_JIMPORT###
/**
* ###Component### Html View class for the ###SView###
@@ -28,11 +28,11 @@ class ###Component###View###SView### extends HtmlView
function display($tpl = null)
{
// get component params
- $this->params = JComponentHelper::getParams('com_###component###');
+ $this->params = ComponentHelper::getParams('com_###component###');
// get the application
- $this->app = JFactory::getApplication();
+ $this->app = Factory::getApplication();
// get the user object
- $this->user = JFactory::getUser();
+ $this->user = Factory::getUser();
// get global action permissions
$this->canDo = ###Component###Helper::getActions('###sview###');###CUSTOM_ADMIN_DIPLAY_METHOD###
}###CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS###
@@ -43,7 +43,7 @@ class ###Component###View###SView### extends HtmlView
protected function setDocument()
{###CUSTOM_ADMIN_LIBRARIES_LOADER######CUSTOM_ADMIN_DOCUMENT_METADATA######CUSTOM_ADMIN_UIKIT_LOADER######CUSTOM_ADMIN_GOOGLECHART_LOADER######CUSTOM_ADMIN_FOOTABLE_LOADER######CUSTOM_ADMIN_DOCUMENT_CUSTOM_PHP###
// add the document default css file
- JHtml::_('stylesheet', 'administrator/components/com_###component###/assets/css/###sview###.css', ['version' => 'auto']);###CUSTOM_ADMIN_DOCUMENT_CUSTOM_CSS######CUSTOM_ADMIN_DOCUMENT_CUSTOM_JS###
+ Html::_('stylesheet', 'administrator/components/com_###component###/assets/css/###sview###.css', ['version' => 'auto']);###CUSTOM_ADMIN_DOCUMENT_CUSTOM_CSS######CUSTOM_ADMIN_DOCUMENT_CUSTOM_JS###
}
/**
@@ -59,22 +59,22 @@ class ###Component###View###SView### extends HtmlView
// Check for empty title and add view name if param is set
if (empty($title))
{
- $title = JText::_('COM_###COMPONENT###_###SVIEW###');
+ $title = Text::_('COM_###COMPONENT###_###SVIEW###');
}
// add title to the page
- JToolbarHelper::title($title,'###ICOMOON###');###CUSTOM_ADMIN_CUSTOM_BUTTONS###
+ ToolbarHelper::title($title,'###ICOMOON###');###CUSTOM_ADMIN_CUSTOM_BUTTONS###
// set help url for this view if found
$this->help_url = ###Component###Helper::getHelpUrl('###sviews###');
- if (###Component###Helper::checkString($this->help_url))
+ if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($this->help_url))
{
- JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url);
+ ToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url);
}
// add the options comp button
if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
{
- JToolBarHelper::preferences('com_###component###');
+ ToolbarHelper::preferences('com_###component###');
}
}###CUSTOM_ADMIN_GET_MODULE###
@@ -88,7 +88,17 @@ class ###Component###View###SView### extends HtmlView
public function escape($var)
{
// use the helper htmlEscape method instead.
- return ###Component###Helper::htmlEscape($var, $this->_charset);
+ return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($var, $this->_charset);
+ }
+
+ /**
+ * Get the Document (helper method toward Joomla 4 and 5)
+ */
+ public function getDocument()
+ {
+ $this->document ??= JFactory::getDocument();
+
+ return $this->document;
}
}
?>
diff --git a/admin/compiler/joomla_3/HtmlView_edit.php b/admin/compiler/joomla_3/HtmlView_edit.php
index 309e298b9..a0c3431a5 100644
--- a/admin/compiler/joomla_3/HtmlView_edit.php
+++ b/admin/compiler/joomla_3/HtmlView_edit.php
@@ -3,8 +3,8 @@
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
- * @author Llewellyn van der Merwe
- * @github Joomla Component Builder
+ * @author Llewellyn van der Merwe
+ * @git Joomla Component Builder
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
@@ -31,7 +31,7 @@ class ###Component###View###View### extends HtmlView
public function display($tpl = null)
{
// set params
- $this->params = JComponentHelper::getParams('com_###component###');
+ $this->params = ComponentHelper::getParams('com_###component###');
// Assign the variables
$this->form = $this->get('Form');
$this->item = $this->get('Item');
@@ -40,7 +40,7 @@ class ###Component###View###View### extends HtmlView
// get action permissions
$this->canDo = ###Component###Helper::getActions('###view###', $this->item);
// get input
- $jinput = JFactory::getApplication()->input;
+ $jinput = Factory::getApplication()->input;
$this->ref = $jinput->get('ref', 0, 'word');
$this->refid = $jinput->get('refid', 0, 'int');
$return = $jinput->get('return', null, 'base64');
@@ -65,7 +65,7 @@ class ###Component###View###View### extends HtmlView
// Set the toolbar
$this->addToolBar();
-
+
// Check for errors.
if (count($errors = $this->get('Errors')))
{
@@ -99,11 +99,11 @@ class ###Component###View###View### extends HtmlView
{
if(strlen($var) > 30)
{
- // use the helper htmlEscape method instead and shorten the string
- return ###Component###Helper::htmlEscape($var, $this->_charset, true, 30);
+ // use the helper htmlEscape method instead and shorten the string
+ return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($var, $this->_charset, true, 30);
}
// use the helper htmlEscape method instead.
- return ###Component###Helper::htmlEscape($var, $this->_charset);
+ return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($var, $this->_charset);
}
/**
@@ -114,14 +114,20 @@ class ###Component###View###View### extends HtmlView
protected function setDocument()
{
$isNew = ($this->item->id < 1);
- if (!isset($this->document))
- {
- $this->document = JFactory::getDocument();
- }
- $this->document->setTitle(JText::_($isNew ? 'COM_###COMPONENT###_###VIEW###_NEW' : 'COM_###COMPONENT###_###VIEW###_EDIT'));
- $this->document->addStyleSheet(JURI::root() . "administrator/components/com_###component###/assets/css/###view###.css", (###Component###Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');###AJAXTOKE######LINKEDVIEWTABLESCRIPTS###
- $this->document->addScript(JURI::root() . $this->script, (###Component###Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
- $this->document->addScript(JURI::root() . "administrator/components/com_###component###/views/###view###/submitbutton.js", (###Component###Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); ###DOCUMENT_CUSTOM_PHP###
- JText::script('view not acceptable. Error');
+ $this->getDocument()->setTitle(Text::_($isNew ? 'COM_###COMPONENT###_###VIEW###_NEW' : 'COM_###COMPONENT###_###VIEW###_EDIT'));
+ Html::_('stylesheet', "administrator/components/com_###component###/assets/css/###view###.css", ['version' => 'auto']);###AJAXTOKE######LINKEDVIEWTABLESCRIPTS###
+ Html::_('script', $this->script, ['version' => 'auto']);
+ Html::_('script', "administrator/components/com_###component###/views/###view###/submitbutton.js", ['version' => 'auto']);###DOCUMENT_CUSTOM_PHP###
+ Text::script('view not acceptable. Error');
+ }
+
+ /**
+ * Get the Document (helper method toward Joomla 4 and 5)
+ */
+ public function getDocument()
+ {
+ $this->document ??= JFactory::getDocument();
+
+ return $this->document;
}
}
diff --git a/admin/compiler/joomla_3/HtmlView_edit_site.php b/admin/compiler/joomla_3/HtmlView_edit_site.php
index b2fd1f338..070fde9f5 100644
--- a/admin/compiler/joomla_3/HtmlView_edit_site.php
+++ b/admin/compiler/joomla_3/HtmlView_edit_site.php
@@ -3,8 +3,8 @@
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
- * @author Llewellyn van der Merwe
- * @github Joomla Component Builder
+ * @author Llewellyn van der Merwe
+ * @git Joomla Component Builder
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
@@ -31,7 +31,7 @@ class ###Component###View###View### extends HtmlView
public function display($tpl = null)
{
// set params
- $this->params = JComponentHelper::getParams('com_###component###');
+ $this->params = ComponentHelper::getParams('com_###component###');
// Assign the variables
$this->form = $this->get('Form');
$this->item = $this->get('Item');
@@ -40,7 +40,7 @@ class ###Component###View###View### extends HtmlView
// get action permissions
$this->canDo = ###Component###Helper::getActions('###view###', $this->item);
// get input
- $jinput = JFactory::getApplication()->input;
+ $jinput = Factory::getApplication()->input;
$this->ref = $jinput->get('ref', 0, 'word');
$this->refid = $jinput->get('refid', 0, 'int');
$return = $jinput->get('return', null, 'base64');
@@ -65,7 +65,7 @@ class ###Component###View###View### extends HtmlView
// Set the toolbar
$this->addToolBar();
-
+
// Check for errors.
if (count($errors = $this->get('Errors')))
{
@@ -86,7 +86,7 @@ class ###Component###View###View### extends HtmlView
protected function addToolBar()
{###ADDTOOLBAR###
// now initiate the toolbar
- $this->toolbar = JToolbar::getInstance();
+ $this->toolbar = Toolbar::getInstance();
}
/**
@@ -100,11 +100,11 @@ class ###Component###View###View### extends HtmlView
{
if(strlen($var) > 30)
{
- // use the helper htmlEscape method instead and shorten the string
- return ###Component###Helper::htmlEscape($var, $this->_charset, true, 30);
+ // use the helper htmlEscape method instead and shorten the string
+ return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($var, $this->_charset, true, 30);
}
// use the helper htmlEscape method instead.
- return ###Component###Helper::htmlEscape($var, $this->_charset);
+ return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($var, $this->_charset);
}
/**
@@ -115,11 +115,7 @@ class ###Component###View###View### extends HtmlView
protected function setDocument()
{
$isNew = ($this->item->id < 1);
- if (!isset($this->document))
- {
- $this->document = JFactory::getDocument();
- }
- $this->document->setTitle(JText::_($isNew ? 'COM_###COMPONENT###_###VIEW###_NEW' : 'COM_###COMPONENT###_###VIEW###_EDIT'));
+ $this->getDocument()->setTitle(Text::_($isNew ? 'COM_###COMPONENT###_###VIEW###_NEW' : 'COM_###COMPONENT###_###VIEW###_EDIT'));
// only add the ISIS template css & js if needed (default is 1 = true)
// you can override this in the global component options
// just add a (radio yes/no field) with a name called add_isis_template
@@ -127,14 +123,24 @@ class ###Component###View###View### extends HtmlView
if ($this->params->get('add_isis_template', 1))
{
// we need this to fix the form display (TODO)
- $this->document->addStyleSheet(JURI::root() . "administrator/templates/isis/css/template.css", (###Component###Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
- $this->document->addScript(JURI::root() . "administrator/templates/isis/js/template.js", (###Component###Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
+ Html::_('stylesheet', "administrator/templates/isis/css/template.css", ['version' => 'auto']);
+ Html::_('script', "administrator/templates/isis/js/template.js", ['version' => 'auto']);
}
// the default style of this view
- $this->document->addStyleSheet(JURI::root()."components/com_###component###/assets/css/###view###.css", (###Component###Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');###AJAXTOKE######LINKEDVIEWTABLESCRIPTS###
+ Html::_('stylesheet', "components/com_###component###/assets/css/###view###.css", ['version' => 'auto']);###AJAXTOKE######LINKEDVIEWTABLESCRIPTS###
// default javascript of this view
- $this->document->addScript(JURI::root(). $this->script, (###Component###Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript');
- $this->document->addScript(JURI::root(). "components/com_###component###/views/###view###/submitbutton.js", (###Component###Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript'); ###DOCUMENT_CUSTOM_PHP###
- JText::script('view not acceptable. Error');
+ Html::_('script', $this->script, ['version' => 'auto']);
+ Html::_('script', "components/com_###component###/views/###view###/submitbutton.js", ['version' => 'auto']);###DOCUMENT_CUSTOM_PHP###
+ Text::script('view not acceptable. Error');
+ }
+
+ /**
+ * Get the Document (helper method toward Joomla 4 and 5)
+ */
+ public function getDocument()
+ {
+ $this->document ??= JFactory::getDocument();
+
+ return $this->document;
}
}
diff --git a/admin/compiler/joomla_3/HtmlView_import.php b/admin/compiler/joomla_3/HtmlView_import.php
index c19e19f8d..9569a7aec 100644
--- a/admin/compiler/joomla_3/HtmlView_import.php
+++ b/admin/compiler/joomla_3/HtmlView_import.php
@@ -3,8 +3,8 @@
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
- * @author Llewellyn van der Merwe
- * @github Joomla Component Builder
+ * @author Llewellyn van der Merwe
+ * @git Joomla Component Builder
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
@@ -17,7 +17,10 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED###
+use Joomla\CMS\Factory;
+use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\View\HtmlView;
+use Joomla\CMS\Toolbar\ToolbarHelper;
/**
* ###Component### Import Html View
@@ -31,7 +34,7 @@ class ###Component###ViewImport extends HtmlView
protected $dataType;
public function display($tpl = null)
- {
+ {
if ($this->getLayout() !== 'modal')
{
// Include helper submenu
@@ -44,7 +47,7 @@ class ###Component###ViewImport extends HtmlView
$this->paths = &$paths;
$this->state = &$state;
- // get global action permissions
+ // get global action permissions
$this->canDo = ###Component###Helper::getActions('import');
// We don't need toolbar in the modal window.
@@ -55,18 +58,18 @@ class ###Component###ViewImport extends HtmlView
}
// get the session object
- $session = JFactory::getSession();
+ $session = Factory::getSession();
// check if it has package
- $this->hasPackage = $session->get('hasPackage', false);
- $this->dataType = $session->get('dataType', false);
+ $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);
+ $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');
}
-
+
// Check for errors.
if (count($errors = $this->get('Errors')))
{
@@ -82,19 +85,19 @@ class ###Component###ViewImport extends HtmlView
*/
protected function addToolBar()
{
- JToolBarHelper::title(JText::_('COM_###COMPONENT###_IMPORT_TITLE'), 'upload');
+ ToolbarHelper::title(Text::_('COM_###COMPONENT###_IMPORT_TITLE'), 'upload');
JHtmlSidebar::setAction('index.php?option=com_###component###&view=import');
if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
{
- JToolBarHelper::preferences('com_###component###');
+ ToolbarHelper::preferences('com_###component###');
}
// set help url for this view if found
$this->help_url = ###Component###Helper::getHelpUrl('import');
- if (###Component###Helper::checkString($this->help_url))
+ if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($this->help_url))
{
- JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url);
+ ToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url);
}
}
}
diff --git a/admin/compiler/joomla_3/HtmlView_import_custom.php b/admin/compiler/joomla_3/HtmlView_import_custom.php
index bee878fc1..68390de5b 100644
--- a/admin/compiler/joomla_3/HtmlView_import_custom.php
+++ b/admin/compiler/joomla_3/HtmlView_import_custom.php
@@ -3,8 +3,8 @@
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
- * @author Llewellyn van der Merwe
- * @github Joomla Component Builder
+ * @author Llewellyn van der Merwe
+ * @git Joomla Component Builder
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
@@ -17,7 +17,13 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED###
+use Joomla\CMS\Factory;
+use Joomla\CMS\Language\Text;
+use Joomla\CMS\Form\FormHelper;
use Joomla\CMS\MVC\View\HtmlView;
+use Joomla\CMS\Toolbar\ToolbarHelper;
+use Joomla\CMS\Component\ComponentHelper;
+use Joomla\CMS\HTML\HTMLHelper as Html;
/**
* ###Component### ###View### Html View
@@ -30,19 +36,19 @@ class ###Component###View###View### extends HtmlView
*/
protected function addToolBar()
{
- JToolBarHelper::title(JText::_('COM_###COMPONENT###_IMPORT_TITLE'), 'upload');
+ ToolbarHelper::title(Text::_('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###');
+ ToolbarHelper::preferences('com_###component###');
}
// set help url for this view if found
$this->help_url = ###Component###Helper::getHelpUrl('###view###');
- if (###Component###Helper::checkString($this->help_url))
+ if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($this->help_url))
{
- JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url);
+ ToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url);
}
}
}
diff --git a/admin/compiler/joomla_3/HtmlView_list.php b/admin/compiler/joomla_3/HtmlView_list.php
index 740a8c545..f00898087 100644
--- a/admin/compiler/joomla_3/HtmlView_list.php
+++ b/admin/compiler/joomla_3/HtmlView_list.php
@@ -3,8 +3,8 @@
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
- * @author Llewellyn van der Merwe
- * @github Joomla Component Builder
+ * @author Llewellyn van der Merwe
+ * @git Joomla Component Builder
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
@@ -40,10 +40,10 @@ class ###Component###View###Views### extends HtmlView
$this->items = $this->get('Items');
$this->pagination = $this->get('Pagination');
$this->state = $this->get('State');
- $this->user = JFactory::getUser();###ADMIN_DIPLAY_METHOD###
+ $this->user = Factory::getUser();###ADMIN_DIPLAY_METHOD###
$this->saveOrder = $this->listOrder == 'a.ordering';
// set the return here value
- $this->return_here = urlencode(base64_encode((string) JUri::getInstance()));
+ $this->return_here = urlencode(base64_encode((string) Uri::getInstance()));
// get global action permissions
$this->canDo = ###Component###Helper::getActions('###view###');###JVIEWLISTCANDO###
@@ -58,7 +58,7 @@ class ###Component###View###Views### extends HtmlView
$this->batchDisplay = JHtmlBatch_::render();
}
}
-
+
// Check for errors.
if (count($errors = $this->get('Errors')))
{
@@ -77,32 +77,32 @@ class ###Component###View###Views### extends HtmlView
*/
protected function addToolBar()
{
- JToolBarHelper::title(JText::_('COM_###COMPONENT###_###VIEWS###'), '###ICOMOON###');
JHtmlSidebar::setAction('index.php?option=com_###component###&view=###views###');
- JFormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');
+ ToolbarHelper::title(Text::_('COM_###COMPONENT###_###VIEWS###'), '###ICOMOON###');
+ FormHelper::addFieldPath(JPATH_COMPONENT . '/models/fields');
if ($this->canCreate)
{
- JToolBarHelper::addNew('###view###.add');
+ ToolbarHelper::addNew('###view###.add');
}
// Only load if there are items
- if (###Component###Helper::checkArray($this->items))
+ if (Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($this->items))
{
if ($this->canEdit)
{
- JToolBarHelper::editList('###view###.edit');
+ ToolbarHelper::editList('###view###.edit');
}
if ($this->canState)
{
- JToolBarHelper::publishList('###views###.publish');
- JToolBarHelper::unpublishList('###views###.unpublish');
- JToolBarHelper::archiveList('###views###.archive');
+ ToolbarHelper::publishList('###views###.publish');
+ ToolbarHelper::unpublishList('###views###.unpublish');
+ ToolbarHelper::archiveList('###views###.archive');
if ($this->canDo->get('core.admin'))
{
- JToolBarHelper::checkin('###views###.checkin');
+ ToolbarHelper::checkin('###views###.checkin');
}
}
@@ -110,11 +110,11 @@ class ###Component###View###Views### extends HtmlView
if ($this->canBatch && $this->canCreate && $this->canEdit && $this->canState)
{
// Get the toolbar object instance
- $bar = JToolBar::getInstance('toolbar');
+ $bar = Toolbar::getInstance('toolbar');
// set the batch button name
- $title = JText::_('JTOOLBAR_BATCH');
+ $title = Text::_('JTOOLBAR_BATCH');
// Instantiate a new JLayoutFile instance and render the batch button
- $layout = new JLayoutFile('joomla.toolbar.batch');
+ $layout = new FileLayout('joomla.toolbar.batch');
// add the button to the page
$dhtml = $layout->render(array('title' => $title));
$bar->appendButton('Custom', $dhtml, 'batch');
@@ -122,25 +122,25 @@ class ###Component###View###Views### extends HtmlView
if ($this->state->get('filter.published') == -2 && ($this->canState && $this->canDelete))
{
- JToolbarHelper::deleteList('', '###views###.delete', 'JTOOLBAR_EMPTY_TRASH');
+ ToolbarHelper::deleteList('', '###views###.delete', 'JTOOLBAR_EMPTY_TRASH');
}
elseif ($this->canState && $this->canDelete)
{
- JToolbarHelper::trash('###views###.trash');
+ ToolbarHelper::trash('###views###.trash');
}###EXPORTBUTTON###
}###ADMIN_CUSTOM_FUNCTION_ONLY_BUTTONS_LIST######IMPORTBUTTON###
// set help url for this view if found
$this->help_url = ###Component###Helper::getHelpUrl('###views###');
- if (###Component###Helper::checkString($this->help_url))
+ if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($this->help_url))
{
- JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url);
+ ToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url);
}
// add the options comp button
if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
{
- JToolBarHelper::preferences('com_###component###');
+ ToolbarHelper::preferences('com_###component###');
}###FILTERFIELDDISPLAYHELPER######BATCHDISPLAYHELPER###
}
@@ -153,10 +153,10 @@ class ###Component###View###Views### extends HtmlView
{
if (!isset($this->document))
{
- $this->document = JFactory::getDocument();
+ $this->document = Factory::getDocument();
}
- $this->document->setTitle(JText::_('COM_###COMPONENT###_###VIEWS###'));
- $this->document->addStyleSheet(JURI::root() . "administrator/components/com_###component###/assets/css/###views###.css", (###Component###Helper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');###ADMIN_ADD_JAVASCRIPT_FILE###
+ $this->document->setTitle(Text::_('COM_###COMPONENT###_###VIEWS###'));
+ Html::_('stylesheet', "administrator/components/com_###component###/assets/css/###views###.css", ['version' => 'auto']);###ADMIN_ADD_JAVASCRIPT_FILE###
}
/**
@@ -171,19 +171,29 @@ class ###Component###View###Views### extends HtmlView
if(strlen($var) > 50)
{
// use the helper htmlEscape method instead and shorten the string
- return ###Component###Helper::htmlEscape($var, $this->_charset, true);
+ return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($var, $this->_charset, true);
}
// use the helper htmlEscape method instead.
- return ###Component###Helper::htmlEscape($var, $this->_charset);
+ return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($var, $this->_charset);
}
/**
* Returns an array of fields the table can be sorted by
*
- * @return array Array containing the field name to sort by as the key and display text as value
+ * @return array Array containing the field name to sort by as the key and display text as value
*/
protected function getSortFields()
{
###SORTFIELDS###
+ }
+
+ /**
+ * Get the Document (helper method toward Joomla 4 and 5)
+ */
+ public function getDocument()
+ {
+ $this->document ??= JFactory::getDocument();
+
+ return $this->document;
}###FILTERFUNCTIONS###
}
diff --git a/admin/compiler/joomla_3/HtmlView_list_custom_admin.php b/admin/compiler/joomla_3/HtmlView_list_custom_admin.php
index 171226444..ebea61327 100644
--- a/admin/compiler/joomla_3/HtmlView_list_custom_admin.php
+++ b/admin/compiler/joomla_3/HtmlView_list_custom_admin.php
@@ -3,8 +3,8 @@
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
- * @author Llewellyn van der Merwe
- * @github Joomla Component Builder
+ * @author Llewellyn van der Merwe
+ * @git Joomla Component Builder
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
@@ -15,9 +15,9 @@ defined('_JEXEC') or die('Restricted access');
###BOM###
// No direct access to this file
-defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED######CUSTOM_ADMIN_GET_MODULE_JIMPORT###
+defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED###
-###CUSTOM_ADMIN_VIEWS_HTML_HEADER###
+###CUSTOM_ADMIN_VIEWS_HTML_HEADER######CUSTOM_ADMIN_GET_MODULE_JIMPORT###
/**
* ###Component### Html View class for the ###SViews###
@@ -28,11 +28,11 @@ class ###Component###View###SViews### extends HtmlView
function display($tpl = null)
{
// get component params
- $this->params = JComponentHelper::getParams('com_###component###');
+ $this->params = ComponentHelper::getParams('com_###component###');
// get the application
- $this->app = JFactory::getApplication();
+ $this->app = Factory::getApplication();
// get the user object
- $this->user = JFactory::getUser();
+ $this->user = Factory::getUser();
// get global action permissions
$this->canDo = ###Component###Helper::getActions('###sview###');###CUSTOM_ADMIN_DIPLAY_METHOD###
}###CUSTOM_ADMIN_EXTRA_DIPLAY_METHODS###
@@ -43,7 +43,7 @@ class ###Component###View###SViews### extends HtmlView
protected function setDocument()
{###CUSTOM_ADMIN_LIBRARIES_LOADER######CUSTOM_ADMIN_UIKIT_LOADER######CUSTOM_ADMIN_GOOGLECHART_LOADER######CUSTOM_ADMIN_FOOTABLE_LOADER######CUSTOM_ADMIN_DOCUMENT_CUSTOM_PHP###
// add the document default css file
- JHtml::_('stylesheet', 'administrator/components/com_###component###/assets/css/###sviews###.css', ['version' => 'auto']);###CUSTOM_ADMIN_DOCUMENT_CUSTOM_CSS######CUSTOM_ADMIN_DOCUMENT_CUSTOM_JS###
+ Html::_('stylesheet', 'administrator/components/com_###component###/assets/css/###sviews###.css', ['version' => 'auto']);###CUSTOM_ADMIN_DOCUMENT_CUSTOM_CSS######CUSTOM_ADMIN_DOCUMENT_CUSTOM_JS###
}
/**
@@ -52,19 +52,19 @@ class ###Component###View###SViews### extends HtmlView
protected function addToolBar()
{###HIDEMAINMENU###
// add title to the page
- JToolbarHelper::title(JText::_('COM_###COMPONENT###_###SVIEWS###'),'###ICOMOON###');###CUSTOM_ADMIN_CUSTOM_BUTTONS###
+ ToolbarHelper::title(Text::_('COM_###COMPONENT###_###SVIEWS###'),'###ICOMOON###');###CUSTOM_ADMIN_CUSTOM_BUTTONS###
// set help url for this view if found
$this->help_url = ###Component###Helper::getHelpUrl('###sviews###');
- if (###Component###Helper::checkString($this->help_url))
+ if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($this->help_url))
{
- JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url);
+ ToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url);
}
// add the options comp button
if ($this->canDo->get('core.admin') || $this->canDo->get('core.options'))
{
- JToolBarHelper::preferences('com_###component###');
+ ToolbarHelper::preferences('com_###component###');
}
}###CUSTOM_ADMIN_GET_MODULE###
@@ -78,6 +78,16 @@ class ###Component###View###SViews### extends HtmlView
public function escape($var)
{
// use the helper htmlEscape method instead.
- return ###Component###Helper::htmlEscape($var, $this->_charset);
+ return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($var, $this->_charset);
+ }
+
+ /**
+ * Get the Document (helper method toward Joomla 4 and 5)
+ */
+ public function getDocument()
+ {
+ $this->document ??= JFactory::getDocument();
+
+ return $this->document;
}
}
diff --git a/admin/compiler/joomla_3/HtmlView_list_site.php b/admin/compiler/joomla_3/HtmlView_list_site.php
index e981783d2..424a6acae 100644
--- a/admin/compiler/joomla_3/HtmlView_list_site.php
+++ b/admin/compiler/joomla_3/HtmlView_list_site.php
@@ -3,8 +3,8 @@
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
- * @author Llewellyn van der Merwe
- * @github Joomla Component Builder
+ * @author Llewellyn van der Merwe
+ * @git Joomla Component Builder
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
@@ -15,9 +15,9 @@ defined('_JEXEC') or die('Restricted access');
###BOM###
// No direct access to this file
-defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED######SITE_GET_MODULE_JIMPORT###
+defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED###
-###SITE_VIEWS_HTML_HEADER###
+###SITE_VIEWS_HTML_HEADER######SITE_GET_MODULE_JIMPORT###
/**
* ###Component### Html View class for the ###SViews###
@@ -26,13 +26,13 @@ class ###Component###View###SViews### extends HtmlView
{
// Overwriting JView display method
function display($tpl = null)
- {
+ {
// get combined params of both component and menu
- $this->app = JFactory::getApplication();
+ $this->app = Factory::getApplication();
$this->params = $this->app->getParams();
$this->menu = $this->app->getMenu()->getActive();
// get the user object
- $this->user = JFactory::getUser();###SITE_DIPLAY_METHOD###
+ $this->user = Factory::getUser();###SITE_DIPLAY_METHOD###
}###SITE_EXTRA_DIPLAY_METHODS###
/**
@@ -41,7 +41,7 @@ class ###Component###View###SViews### extends HtmlView
protected function _prepareDocument()
{###SITE_LIBRARIES_LOADER######SITE_UIKIT_LOADER######SITE_GOOGLECHART_LOADER######SITE_FOOTABLE_LOADER######SITE_DOCUMENT_METADATA######SITE_DOCUMENT_CUSTOM_PHP###
// add the document default css file
- JHtml::_('stylesheet', 'components/com_###component###/assets/css/###sview###.css', ['version' => 'auto']);###SITE_DOCUMENT_CUSTOM_CSS######SITE_DOCUMENT_CUSTOM_JS######SITE_JAVASCRIPT_FOR_BUTTONS###
+ Html::_('stylesheet', 'components/com_###component###/assets/css/###sview###.css', ['version' => 'auto']);###SITE_DOCUMENT_CUSTOM_CSS######SITE_DOCUMENT_CUSTOM_JS######SITE_JAVASCRIPT_FOR_BUTTONS###
}
/**
@@ -49,15 +49,15 @@ class ###Component###View###SViews### extends HtmlView
*/
protected function addToolBar()
{###SITE_CUSTOM_BUTTONS###
-
+
// set help url for this view if found
$this->help_url = ###Component###Helper::getHelpUrl('###sviews###');
- if (###Component###Helper::checkString($this->help_url))
+ if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($this->help_url))
{
- JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url);
+ ToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url);
}
// now initiate the toolbar
- $this->toolbar = JToolbar::getInstance();
+ $this->toolbar = Toolbar::getInstance();
}###SITE_GET_MODULE###
/**
@@ -70,6 +70,16 @@ class ###Component###View###SViews### extends HtmlView
public function escape($var, $sorten = false, $length = 40)
{
// use the helper htmlEscape method instead.
- return ###Component###Helper::htmlEscape($var, $this->_charset, $sorten, $length);
+ return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($var, $this->_charset, $sorten, $length);
+ }
+
+ /**
+ * Get the Document (helper method toward Joomla 4 and 5)
+ */
+ public function getDocument()
+ {
+ $this->document ??= JFactory::getDocument();
+
+ return $this->document;
}
}
diff --git a/admin/compiler/joomla_3/HtmlView_site.php b/admin/compiler/joomla_3/HtmlView_site.php
index 13bc3fd01..5c4ca5ecd 100644
--- a/admin/compiler/joomla_3/HtmlView_site.php
+++ b/admin/compiler/joomla_3/HtmlView_site.php
@@ -3,8 +3,8 @@
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
- * @author Llewellyn van der Merwe
- * @github Joomla Component Builder
+ * @author Llewellyn van der Merwe
+ * @git Joomla Component Builder
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
@@ -15,9 +15,9 @@ defined('_JEXEC') or die('Restricted access');
###BOM###
// No direct access to this file
-defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED######SITE_GET_MODULE_JIMPORT###
+defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED###
-###SITE_VIEW_HTML_HEADER###
+###SITE_VIEW_HTML_HEADER######SITE_GET_MODULE_JIMPORT###
/**
* ###Component### Html View class for the ###SView###
@@ -26,22 +26,22 @@ class ###Component###View###SView### extends HtmlView
{
// Overwriting JView display method
function display($tpl = null)
- {
+ {
// get combined params of both component and menu
- $this->app = JFactory::getApplication();
+ $this->app = Factory::getApplication();
$this->params = $this->app->getParams();
$this->menu = $this->app->getMenu()->getActive();
// get the user object
- $this->user = JFactory::getUser();###SITE_DIPLAY_METHOD###
+ $this->user = Factory::getUser();###SITE_DIPLAY_METHOD###
}###SITE_EXTRA_DIPLAY_METHODS###
/**
* Prepares the document
*/
protected function _prepareDocument()
- {###SITE_LIBRARIES_LOADER######SITE_UIKIT_LOADER######SITE_GOOGLECHART_LOADER######SITE_FOOTABLE_LOADER######SITE_DOCUMENT_METADATA######SITE_DOCUMENT_CUSTOM_PHP###
+ {###SITE_LIBRARIES_LOADER######SITE_UIKIT_LOADER######SITE_GOOGLECHART_LOADER######SITE_FOOTABLE_LOADER######SITE_DOCUMENT_METADATA######SITE_DOCUMENT_CUSTOM_PHP###
// add the document default css file
- JHtml::_('stylesheet', 'components/com_###component###/assets/css/###sview###.css', ['version' => 'auto']);###SITE_DOCUMENT_CUSTOM_CSS######SITE_DOCUMENT_CUSTOM_JS######SITE_JAVASCRIPT_FOR_BUTTONS###
+ Html::_('stylesheet', 'components/com_###component###/assets/css/###sview###.css', ['version' => 'auto']);###SITE_DOCUMENT_CUSTOM_CSS######SITE_DOCUMENT_CUSTOM_JS######SITE_JAVASCRIPT_FOR_BUTTONS###
}
/**
@@ -52,12 +52,12 @@ class ###Component###View###SView### extends HtmlView
// set help url for this view if found
$this->help_url = ###Component###Helper::getHelpUrl('###sview###');
- if (###Component###Helper::checkString($this->help_url))
+ if (Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::check($this->help_url))
{
- JToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url);
+ ToolbarHelper::help('COM_###COMPONENT###_HELP_MANAGER', false, $this->help_url);
}
// now initiate the toolbar
- $this->toolbar = JToolbar::getInstance();
+ $this->toolbar = Toolbar::getInstance();
}###SITE_GET_MODULE###
/**
@@ -70,6 +70,16 @@ class ###Component###View###SView### extends HtmlView
public function escape($var, $sorten = false, $length = 40)
{
// use the helper htmlEscape method instead.
- return ###Component###Helper::htmlEscape($var, $this->_charset, $sorten, $length);
+ return Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::html($var, $this->_charset, $sorten, $length);
+ }
+
+ /**
+ * Get the Document (helper method toward Joomla 4 and 5)
+ */
+ public function getDocument()
+ {
+ $this->document ??= JFactory::getDocument();
+
+ return $this->document;
}
}
diff --git a/admin/compiler/joomla_3/ItemModel_custom_admin.php b/admin/compiler/joomla_3/ItemModel_custom_admin.php
index 56f08cab1..c8c49b430 100644
--- a/admin/compiler/joomla_3/ItemModel_custom_admin.php
+++ b/admin/compiler/joomla_3/ItemModel_custom_admin.php
@@ -3,8 +3,8 @@
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
- * @author Llewellyn van der Merwe
- * @github Joomla Component Builder
+ * @author Llewellyn van der Merwe
+ * @git Joomla Component Builder
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
@@ -31,7 +31,7 @@ class ###Component###Model###SView### extends ItemModel
*/
protected $_context = 'com_###component###.###sview###';
- /**
+ /**
* Model user data.
*
* @var strings
@@ -61,7 +61,7 @@ class ###Component###Model###SView### extends ItemModel
*/
protected function populateState()
{
- $this->app = JFactory::getApplication();
+ $this->app = Factory::getApplication();
$this->input = $this->app->input;
// Get the item main id
$id = $this->input->getInt('id', null);
@@ -80,12 +80,12 @@ class ###Component###Model###SView### extends ItemModel
*/
public function getItem($pk = null)
{
- $this->user = JFactory::getUser();
+ $this->user = Factory::getUser();
// check if this user has permission to access item
if (!$this->user->authorise('###sview###.access', 'com_###component###'))
{
- $app = JFactory::getApplication();
- $app->enqueueMessage(JText::_('Not authorised!'), 'error');
+ $app = Factory::getApplication();
+ $app->enqueueMessage(Text::_('Not authorised!'), 'error');
// redirect away if not a correct to cPanel/default view
$app->redirect('index.php?option=com_###component###');
return false;
@@ -98,10 +98,10 @@ class ###Component###Model###SView### extends ItemModel
$this->initSet = true;
$pk = (!empty($pk)) ? $pk : (int) $this->getState('###sview###.id');###CUSTOM_ADMIN_BEFORE_GET_ITEM###
-
+
if ($this->_item === null)
{
- $this->_item = array();
+ $this->_item = [];
}###LICENSE_LOCKED_CHECK###
if (!isset($this->_item[$pk]))
@@ -114,7 +114,7 @@ class ###Component###Model###SView### extends ItemModel
if ($e->getCode() == 404)
{
// Need to go thru the error handler to allow Redirect to work.
- JError::raiseWarning(404, $e->getMessage());
+ JError::raiseError(404, $e->getMessage());
}
else
{
diff --git a/admin/compiler/joomla_3/ItemModel_site.php b/admin/compiler/joomla_3/ItemModel_site.php
index 621f2f1c7..ca73e7e3e 100644
--- a/admin/compiler/joomla_3/ItemModel_site.php
+++ b/admin/compiler/joomla_3/ItemModel_site.php
@@ -3,8 +3,8 @@
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
- * @author Llewellyn van der Merwe
- * @github Joomla Component Builder
+ * @author Llewellyn van der Merwe
+ * @git Joomla Component Builder
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
@@ -61,7 +61,7 @@ class ###Component###Model###SView### extends ItemModel
*/
protected function populateState()
{
- $this->app = JFactory::getApplication();
+ $this->app = Factory::getApplication();
$this->input = $this->app->input;
// Get the itme main id
$id = $this->input->getInt('id', null);
@@ -82,7 +82,7 @@ class ###Component###Model###SView### extends ItemModel
*/
public function getItem($pk = null)
{
- $this->user = JFactory::getUser();###USER_PERMISSION_CHECK_ACCESS###
+ $this->user = Factory::getUser();###USER_PERMISSION_CHECK_ACCESS###
$this->userId = $this->user->get('id');
$this->guest = $this->user->get('guest');
$this->groups = $this->user->get('groups');
@@ -91,10 +91,10 @@ class ###Component###Model###SView### extends ItemModel
$this->initSet = true;
$pk = (!empty($pk)) ? $pk : (int) $this->getState('###sview###.id');###SITE_BEFORE_GET_ITEM###
-
+
if ($this->_item === null)
{
- $this->_item = array();
+ $this->_item = [];
}###LICENSE_LOCKED_CHECK###
if (!isset($this->_item[$pk]))
@@ -107,7 +107,7 @@ class ###Component###Model###SView### extends ItemModel
if ($e->getCode() == 404)
{
// Need to go thru the error handler to allow Redirect to work.
- JError::raiseWarning(404, $e->getMessage());
+ JError::raiseError(404, $e->getMessage());
}
else
{
diff --git a/admin/compiler/joomla_3/JFormFieldCheckboxes.php b/admin/compiler/joomla_3/JFormFieldCheckboxes.php
index d5a12f4ba..f852886b6 100644
--- a/admin/compiler/joomla_3/JFormFieldCheckboxes.php
+++ b/admin/compiler/joomla_3/JFormFieldCheckboxes.php
@@ -3,8 +3,8 @@
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
- * @author Llewellyn van der Merwe
- * @github Joomla Component Builder
+ * @author Llewellyn van der Merwe
+ * @git Joomla Component Builder
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
@@ -17,6 +17,10 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
+use Joomla\CMS\Factory;
+use Joomla\CMS\Language\Text;
+use Joomla\CMS\HTML\HTMLHelper as Html;
+
// import the list field type
jimport('joomla.form.helper');
JFormHelper::loadFieldClass('checkboxes');
@@ -29,14 +33,14 @@ class ###JPREFIX###FormField###Type### extends JFormFieldCheckboxes
/**
* The ###type### field type.
*
- * @var string
+ * @var string
*/
public $type = '###type###';
/**
* Method to get a list of options for a list input.
*
- * @return array An array of JHtml options.
+ * @return array An array of Html options.
*/
protected function getOptions()
{
diff --git a/admin/compiler/joomla_3/JFormFieldCustom.php b/admin/compiler/joomla_3/JFormFieldCustom.php
index ee8b72e07..307bc608a 100644
--- a/admin/compiler/joomla_3/JFormFieldCustom.php
+++ b/admin/compiler/joomla_3/JFormFieldCustom.php
@@ -3,8 +3,8 @@
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
- * @author Llewellyn van der Merwe
- * @github Joomla Component Builder
+ * @author Llewellyn van der Merwe
+ * @git Joomla Component Builder
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
@@ -17,7 +17,7 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
-###JFORM_TYPE_HEADER###
+###FORM_CUSTOM_FIELD_HEADER###
/**
* ###Type### Form Field class for the ###Component### component
@@ -27,7 +27,7 @@ class ###JPREFIX###FormField###Type### extends JFormField###JFORM_EXTENDS###
/**
* The ###type### field type.
*
- * @var string
+ * @var string
*/
- public $type = '###type###';###JFORM_TYPE_PHP###
+ public $type = '###type###';###FORM_CUSTOM_FIELD_PHP###
}
diff --git a/admin/compiler/joomla_3/JFormFieldList.php b/admin/compiler/joomla_3/JFormFieldList.php
index 5a56cd132..504167838 100644
--- a/admin/compiler/joomla_3/JFormFieldList.php
+++ b/admin/compiler/joomla_3/JFormFieldList.php
@@ -3,8 +3,8 @@
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
- * @author Llewellyn van der Merwe
- * @github Joomla Component Builder
+ * @author Llewellyn van der Merwe
+ * @git Joomla Component Builder
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
@@ -17,6 +17,10 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
+use Joomla\CMS\Factory;
+use Joomla\CMS\Language\Text;
+use Joomla\CMS\HTML\HTMLHelper as Html;
+
// import the list field type
jimport('joomla.form.helper');
JFormHelper::loadFieldClass('list');
@@ -29,14 +33,14 @@ class ###JPREFIX###FormField###Type### extends JFormFieldList
/**
* The ###type### field type.
*
- * @var string
+ * @var string
*/
public $type = '###type###';###ADD_BUTTON###
/**
* Method to get a list of options for a list input.
*
- * @return array An array of JHtml options.
+ * @return array An array of Html options.
*/
protected function getOptions()
{
diff --git a/admin/compiler/joomla_3/JFormFieldRadio.php b/admin/compiler/joomla_3/JFormFieldRadio.php
index ac9412514..75ec4e5c5 100644
--- a/admin/compiler/joomla_3/JFormFieldRadio.php
+++ b/admin/compiler/joomla_3/JFormFieldRadio.php
@@ -3,8 +3,8 @@
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
- * @author Llewellyn van der Merwe
- * @github Joomla Component Builder
+ * @author Llewellyn van der Merwe
+ * @git Joomla Component Builder
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
@@ -17,6 +17,10 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
+use Joomla\CMS\Factory;
+use Joomla\CMS\Language\Text;
+use Joomla\CMS\HTML\HTMLHelper as Html;
+
// import the list field type
jimport('joomla.form.helper');
JFormHelper::loadFieldClass('radio');
@@ -29,14 +33,14 @@ class ###JPREFIX###FormField###Type### extends JFormFieldRadio
/**
* The ###type### field type.
*
- * @var string
+ * @var string
*/
public $type = '###type###';
/**
* Method to get a list of options for a list input.
*
- * @return array An array of JHtml options.
+ * @return array An array of Html options.
*/
protected function getOptions()
{
diff --git a/admin/compiler/joomla_3/JFormFieldUser.php b/admin/compiler/joomla_3/JFormFieldUser.php
index 4a9966db1..85ed69077 100644
--- a/admin/compiler/joomla_3/JFormFieldUser.php
+++ b/admin/compiler/joomla_3/JFormFieldUser.php
@@ -3,8 +3,8 @@
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
- * @author Llewellyn van der Merwe
- * @github Joomla Component Builder
+ * @author Llewellyn van der Merwe
+ * @git Joomla Component Builder
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
@@ -17,6 +17,10 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
+use Joomla\CMS\Factory;
+use Joomla\CMS\Language\Text;
+use Joomla\CMS\HTML\HTMLHelper as Html;
+
// import the list field type
jimport('joomla.form.helper');
JFormHelper::loadFieldClass('user');
@@ -29,7 +33,7 @@ class ###JPREFIX###FormField###Type### extends JFormFieldUser
/**
* The ###type### field type.
*
- * @var string
+ * @var string
*/
public $type = '###type###';
diff --git a/admin/compiler/joomla_3/JFormRule.php b/admin/compiler/joomla_3/JFormRule.php
index 830ed92a0..34b02fefa 100644
--- a/admin/compiler/joomla_3/JFormRule.php
+++ b/admin/compiler/joomla_3/JFormRule.php
@@ -3,8 +3,8 @@
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
- * @author Llewellyn van der Merwe
- * @github Joomla Component Builder
+ * @author Llewellyn van der Merwe
+ * @git Joomla Component Builder
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
@@ -17,9 +17,12 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('JPATH_PLATFORM') or die;
+use Joomla\CMS\Factory;
+use Joomla\CMS\Language\Text;
use Joomla\CMS\Form\Form;
use Joomla\CMS\Form\FormRule;
use Joomla\Registry\Registry;
+use Joomla\CMS\HTML\HTMLHelper as Html;
/**
* Form Rule (###Name###) class for the Joomla Platform.
diff --git a/admin/compiler/joomla_3/ListModel.php b/admin/compiler/joomla_3/ListModel.php
index 2d45037ab..f2d12e963 100644
--- a/admin/compiler/joomla_3/ListModel.php
+++ b/admin/compiler/joomla_3/ListModel.php
@@ -3,8 +3,8 @@
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
- * @author Llewellyn van der Merwe
- * @github Joomla Component Builder
+ * @author Llewellyn van der Merwe
+ * @git Joomla Component Builder
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
@@ -24,10 +24,10 @@ defined('_JEXEC') or die('Restricted access');
*/
class ###Component###Model###Views### extends ListModel
{
- public function __construct($config = array())
+ public function __construct($config = [])
{
if (empty($config['filter_fields']))
- {
+ {
$config['filter_fields'] = array(
###FILTER_FIELDS###
);
@@ -49,7 +49,7 @@ class ###Component###Model###Views### extends ListModel
*/
protected function populateState($ordering = null, $direction = null)
{
- $app = JFactory::getApplication();
+ $app = Factory::getApplication();
// Adjust the context to support modal layouts.
if ($layout = $app->input->get('layout'))
@@ -60,7 +60,7 @@ class ###Component###Model###Views### extends ListModel
// List state information.
parent::populateState($ordering, $direction);
}
-
+
/**
* Method to get an array of data items.
*
@@ -70,21 +70,21 @@ class ###Component###Model###Views### extends ListModel
{###LICENSE_LOCKED_CHECK######CHECKINCALL###
// load parent items
$items = parent::getItems();###GET_ITEMS_METHOD_STRING_FIX######SELECTIONTRANSLATIONFIX######GET_ITEMS_METHOD_AFTER_ALL###
-
+
// return items
return $items;
}###SELECTIONTRANSLATIONFIXFUNC###
-
+
/**
* Method to build an SQL query to load the list data.
*
- * @return string An SQL query
+ * @return string An SQL query
*/
protected function getListQuery()
{###LICENSE_LOCKED_CHECK###
###LISTQUERY###
}###MODELEXPORTMETHOD######LICENSE_LOCKED_SET_BOOL###
-
+
/**
* Method to get a store id based on model configuration state.
*
diff --git a/admin/compiler/joomla_3/ListModelAjax.php b/admin/compiler/joomla_3/ListModelAjax.php
index cf9cb916f..18d5f23b7 100644
--- a/admin/compiler/joomla_3/ListModelAjax.php
+++ b/admin/compiler/joomla_3/ListModelAjax.php
@@ -3,8 +3,8 @@
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
- * @author Llewellyn van der Merwe
- * @github Joomla Component Builder
+ * @author Llewellyn van der Merwe
+ * @git Joomla Component Builder
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
@@ -25,12 +25,12 @@ defined('_JEXEC') or die('Restricted access');
class ###Component###ModelAjax extends ListModel
{
protected $app_params;
-
- public function __construct()
- {
- parent::__construct();
+
+ public function __construct()
+ {
+ parent::__construct();
// get params
- $this->app_params = JComponentHelper::getParams('com_###component###');
-
+ $this->app_params = ComponentHelper::getParams('com_###component###');
+
}###AJAX_MODEL_METHODS###
}
diff --git a/admin/compiler/joomla_3/ListModelAjaxSite.php b/admin/compiler/joomla_3/ListModelAjaxSite.php
index 2aacc4948..d02c9bfca 100644
--- a/admin/compiler/joomla_3/ListModelAjaxSite.php
+++ b/admin/compiler/joomla_3/ListModelAjaxSite.php
@@ -3,8 +3,8 @@
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
- * @author Llewellyn van der Merwe
- * @github Joomla Component Builder
+ * @author Llewellyn van der Merwe
+ * @git Joomla Component Builder
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
@@ -30,7 +30,7 @@ class ###Component###ModelAjax extends ListModel
{
parent::__construct();
// get params
- $this->app_params = JComponentHelper::getParams('com_###component###');
+ $this->app_params = ComponentHelper::getParams('com_###component###');
}###AJAX_SITE_MODEL_METHODS###
}
diff --git a/admin/compiler/joomla_3/ListModelDASH.php b/admin/compiler/joomla_3/ListModelDASH.php
index ad8357abb..25f57f5eb 100644
--- a/admin/compiler/joomla_3/ListModelDASH.php
+++ b/admin/compiler/joomla_3/ListModelDASH.php
@@ -3,8 +3,8 @@
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
- * @author Llewellyn van der Merwe
- * @github Joomla Component Builder
+ * @author Llewellyn van der Merwe
+ * @git Joomla Component Builder
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
@@ -27,9 +27,9 @@ class ###Component###Model###Component### extends ListModel
public function getIcons()
{
// load user for access menus
- $user = JFactory::getUser();
+ $user = Factory::getUser();
// reset icon array
- $icons = array();
+ $icons = [];
// view groups array
$viewGroups = array(
'main' => array(###DASHBOARDICONS###)
@@ -38,7 +38,7 @@ class ###Component###Model###Component### extends ListModel
foreach($viewGroups as $group => $views)
{
$i = 0;
- if (###Component###Helper::checkArray($views))
+ if (Super___0a59c65c_9daf_4bc9_baf4_e063ff9e6a8a___Power::check($views))
{
foreach($views as $view)
{
@@ -50,11 +50,11 @@ class ###Component###Model###Component### extends ListModel
if (count($dwd) == 3)
{
list($type, $name, $url) = $dwd;
- $viewName = $name;
- $alt = $name;
- $url = $url;
- $image = $name . '.' . $type;
- $name = 'COM_###COMPONENT###_DASHBOARD_' . ###Component###Helper::safeString($name,'U');
+ $viewName = $name;
+ $alt = $name;
+ $url = $url;
+ $image = $name . '.' . $type;
+ $name = 'COM_###COMPONENT###_DASHBOARD_' . Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($name,'U');
}
}
// internal views
@@ -76,11 +76,11 @@ class ###Component###Model###Component### extends ListModel
switch($action)
{
case 'add':
- $url = 'index.php?option=com_###component###&view=' . $name . '&layout=edit';
- $image = $name . '_' . $action. '.' . $type;
- $alt = $name . ' ' . $action;
- $name = 'COM_###COMPONENT###_DASHBOARD_'.###Component###Helper::safeString($name,'U').'_ADD';
- $add = true;
+ $url = 'index.php?option=com_###component###&view=' . $name . '&layout=edit';
+ $image = $name . '_' . $action. '.' . $type;
+ $alt = $name . ' ' . $action;
+ $name = 'COM_###COMPONENT###_DASHBOARD_'.Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($name,'U').'_ADD';
+ $add = true;
break;
default:
// check for new convention (more stable)
@@ -93,34 +93,34 @@ class ###Component###Model###Component### extends ListModel
{
$extension = 'com_###component###.' . $name;
}
- $url = 'index.php?option=com_categories&view=categories&extension=' . $extension;
- $image = $name . '_' . $action . '.' . $type;
- $alt = $viewName . ' ' . $action;
- $name = 'COM_###COMPONENT###_DASHBOARD_' . ###Component###Helper::safeString($name,'U') . '_' . ###Component###Helper::safeString($action,'U');
+ $url = 'index.php?option=com_categories&view=categories&extension=' . $extension;
+ $image = $name . '_' . $action . '.' . $type;
+ $alt = $viewName . ' ' . $action;
+ $name = 'COM_###COMPONENT###_DASHBOARD_' . Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($name,'U') . '_' . Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($action,'U');
break;
}
}
else
{
- $viewName = $name;
- $alt = $name;
- $url = 'index.php?option=com_###component###&view=' . $name;
- $image = $name . '.' . $type;
- $name = 'COM_###COMPONENT###_DASHBOARD_' . ###Component###Helper::safeString($name,'U');
- $hover = false;
+ $viewName = $name;
+ $alt = $name;
+ $url = 'index.php?option=com_###component###&view=' . $name;
+ $image = $name . '.' . $type;
+ $name = 'COM_###COMPONENT###_DASHBOARD_' . Super___1f28cb53_60d9_4db1_b517_3c7dc6b429ef___Power::safe($name,'U');
+ $hover = false;
}
}
else
{
- $viewName = $view;
- $alt = $view;
- $url = 'index.php?option=com_###component###&view=' . $view;
- $image = $view . '.png';
- $name = ucwords($view).'