Continued to add the namespacing for the file and folder classes across the system. gh-682

This commit is contained in:
Llewellyn van der Merwe 2021-03-09 00:36:30 +02:00
parent 1279a5d2f9
commit 08d529aba9
Signed by: Llewellyn
GPG Key ID: EFC0C720A240551C
23 changed files with 164 additions and 100 deletions

View File

@ -147,7 +147,7 @@ TODO
+ *Version*: 2.12.8
+ *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **292190**
+ *Line count*: **292188**
+ *Field count*: **1629**
+ *File count*: **1935**
+ *Folder count*: **322**

View File

@ -147,7 +147,7 @@ TODO
+ *Version*: 2.12.8
+ *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **292190**
+ *Line count*: **292188**
+ *Field count*: **1629**
+ *File count*: **1935**
+ *Folder count*: **322**

View File

@ -17,6 +17,8 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Filesystem\Folder;
use Joomla\Utilities\ArrayHelper;
use PhpOffice\PhpSpreadsheet\IOFactory;
@ -227,7 +229,7 @@ class ###Component###ModelImport extends JModelLegacy
// Move uploaded file
jimport('joomla.filesystem.file');
$p_file = JFile::upload($tmp_src, $tmp_dest, $this->use_streams, $this->allow_unsafe, $this->safeFileOptions);
$p_file = File::upload($tmp_src, $tmp_dest, $this->use_streams, $this->allow_unsafe, $this->safeFileOptions);
// Was the package downloaded?
if (!$p_file)
@ -383,12 +385,12 @@ class ###Component###ModelImport extends JModelLegacy
// Is the package file a valid file?
if (is_file($package))
{
JFile::delete($package);
File::delete($package);
}
elseif (is_file(JPath::clean($package)))
{
// It might also be just a base filename
JFile::delete(JPath::clean($package));
File::delete(JPath::clean($package));
}
}###IMPORT_SETDATA_METHOD######IMPORT_SAVE_METHOD###

View File

@ -17,6 +17,8 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Filesystem\Folder;
use Joomla\Utilities\ArrayHelper;
use PhpOffice\PhpSpreadsheet\IOFactory;
@ -116,8 +118,7 @@ class ###Component###Model###View### extends JModelLegacy
$tmp_src = $userfile['tmp_name'];
// Move uploaded file
jimport('joomla.filesystem.file');
$p_file = JFile::upload($tmp_src, $tmp_dest, $this->use_streams, $this->allow_unsafe, $this->safeFileOptions);
$p_file = File::upload($tmp_src, $tmp_dest, $this->use_streams, $this->allow_unsafe, $this->safeFileOptions);
// Was the package downloaded?
if (!$p_file)
@ -274,12 +275,12 @@ class ###Component###Model###View### extends JModelLegacy
// Is the package file a valid file?
if (is_file($package))
{
JFile::delete($package);
File::delete($package);
}
elseif (is_file(JPath::clean($package)))
{
// It might also be just a base filename
JFile::delete(JPath::clean($package));
File::delete(JPath::clean($package));
}
}
###IMPORT_SETDATA_METHOD###

View File

@ -16,7 +16,7 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access'); ###LICENSE_LOCKED_DEFINED######CUSTOM_ADMIN_GET_MODULE_JIMPORT###
###CUSTOM_ADMIN_VIEW_HTML_HEADER###
/**
* ###Component### View class for the ###SView###
*/

View File

@ -16,7 +16,7 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED###
###ADMIN_VIEW_HTML_HEADER###
/**
* ###View### View class
*/

View File

@ -16,7 +16,7 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED###
###SITE_ADMIN_VIEW_HTML_HEADER###
/**
* ###View### View class
*/

View File

@ -16,7 +16,7 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED###
###ADMIN_VIEWS_HTML_HEADER###
/**
* ###Component### View class for the ###Views###
*/

View File

@ -16,7 +16,7 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED######CUSTOM_ADMIN_GET_MODULE_JIMPORT###
###CUSTOM_ADMIN_VIEWS_HTML_HEADER###
/**
* ###Component### View class for the ###SViews###
*/

View File

@ -16,7 +16,7 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED######SITE_GET_MODULE_JIMPORT###
###SITE_VIEWS_HTML_HEADER###
/**
* ###Component### View class for the ###SViews###
*/

View File

@ -16,7 +16,7 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');###LICENSE_LOCKED_DEFINED######SITE_GET_MODULE_JIMPORT###
###SITE_VIEW_HTML_HEADER###
/**
* ###Component### View class for the ###SView###
*/

View File

@ -17,6 +17,8 @@ defined('_JEXEC') or die('Restricted access');
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Filesystem\Folder;
JHTML::_('behavior.modal');
/**
@ -97,12 +99,12 @@ class com_###component###InstallerScript
{###PREINSTALLSCRIPT###
}
// check if the PHPExcel stuff is still around
if (JFile::exists(JPATH_ADMINISTRATOR . '/components/com_###component###/helpers/PHPExcel.php'))
if (File::exists(JPATH_ADMINISTRATOR . '/components/com_###component###/helpers/PHPExcel.php'))
{
// We need to remove this old PHPExcel folder
$this->removeFolder(JPATH_ADMINISTRATOR . '/components/com_###component###/helpers/PHPExcel');
// We need to remove this old PHPExcel file
JFile::delete(JPATH_ADMINISTRATOR . '/components/com_###component###/helpers/PHPExcel.php');
File::delete(JPATH_ADMINISTRATOR . '/components/com_###component###/helpers/PHPExcel.php');
}
return true;
}
@ -141,7 +143,7 @@ class com_###component###InstallerScript
*/
protected function removeFolder($dir, $ignore = false)
{
if (JFolder::exists($dir))
if (Folder::exists($dir))
{
$it = new RecursiveDirectoryIterator($dir);
$it = new RecursiveIteratorIterator($it, RecursiveIteratorIterator::CHILD_FIRST);
@ -171,7 +173,7 @@ class com_###component###InstallerScript
{
continue;
}
JFolder::delete($file_dir);
Folder::delete($file_dir);
}
else
{
@ -190,13 +192,13 @@ class com_###component###InstallerScript
{
continue;
}
JFile::delete($file_dir);
File::delete($file_dir);
}
}
// delete the root folder if not ignore found
if (!$this->checkArray($ignore))
{
return JFolder::delete($dir);
return Folder::delete($dir);
}
return true;
}

View File

@ -12,6 +12,8 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Filesystem\Folder;
// Use the component builder autoloader
ComponentbuilderHelper::autoLoader();
@ -391,7 +393,7 @@ class Compiler extends Infusion
// first we do the static files
foreach ($this->newFiles['static'] as $static)
{
if (JFile::exists($static['path']))
if (File::exists($static['path']))
{
$this->setFileContent(
$static['name'], $static['path'], $bom
@ -410,7 +412,7 @@ class Compiler extends Infusion
{
if ($file['view'] == $view)
{
if (JFile::exists($file['path']))
if (File::exists($file['path']))
{
$this->setFileContent(
$file['name'], $file['path'], $bom,
@ -492,7 +494,7 @@ class Compiler extends Infusion
// update the module files
foreach ($this->newFiles[$module->key] as $module_file)
{
if (JFile::exists($module_file['path']))
if (File::exists($module_file['path']))
{
$this->setFileContent(
$module_file['name'], $module_file['path'],
@ -573,7 +575,7 @@ class Compiler extends Infusion
// update the plugin files
foreach ($this->newFiles[$plugin->key] as $plugin_file)
{
if (JFile::exists($plugin_file['path']))
if (File::exists($plugin_file['path']))
{
$this->setFileContent(
$plugin_file['name'], $plugin_file['path'],
@ -674,7 +676,7 @@ class Compiler extends Infusion
$update_server_xml_path = $this->componentPath . '/'
. $this->updateServerFileName . '.xml';
// make sure we have the correct file
if (JFile::exists($update_server_xml_path)
if (File::exists($update_server_xml_path)
&& isset($this->componentData->update_server))
{
// move to server
@ -685,7 +687,7 @@ class Compiler extends Infusion
$this->componentData->update_server_protocol
);
// remove the local file
JFile::delete($update_server_xml_path);
File::delete($update_server_xml_path);
}
}
// move the plugins update server to host
@ -702,7 +704,7 @@ class Compiler extends Infusion
&& is_numeric($plugin->update_server)
&& $plugin->update_server > 0
&& isset($plugin->update_server_xml_path)
&& JFile::exists($plugin->update_server_xml_path)
&& File::exists($plugin->update_server_xml_path)
&& isset($plugin->update_server_xml_file_name)
&& ComponentbuilderHelper::checkString(
$plugin->update_server_xml_file_name
@ -716,7 +718,7 @@ class Compiler extends Infusion
$plugin->update_server_protocol
);
// remove the local file
JFile::delete($plugin->update_server_xml_path);
File::delete($plugin->update_server_xml_path);
}
}
}
@ -810,7 +812,7 @@ class Compiler extends Infusion
if (('README.md' === $static['name']
|| 'README.txt' === $static['name'])
&& $this->componentData->addreadme
&& JFile::exists($static['path']))
&& File::exists($static['path']))
{
$this->setReadMe($static['path']);
$two++;
@ -934,7 +936,7 @@ class Compiler extends Infusion
// remove old data
$this->removeFolder($repoFullPath, $this->componentData->toignore);
// set the new data
JFolder::copy($this->componentPath, $repoFullPath, '', true);
Folder::copy($this->componentPath, $repoFullPath, '', true);
// Trigger Event: jcb_ce_onAfterUpdateRepo
$this->triggerEvent(
'jcb_ce_onAfterUpdateRepo',
@ -967,7 +969,7 @@ class Compiler extends Infusion
$repoFullPath, $this->componentData->toignore
);
// set the new data
JFolder::copy(
Folder::copy(
$module->folder_path, $repoFullPath, '', true
);
// Trigger Event: jcb_ce_onAfterUpdateRepo
@ -1004,7 +1006,7 @@ class Compiler extends Infusion
$repoFullPath, $this->componentData->toignore
);
// set the new data
JFolder::copy(
Folder::copy(
$plugin->folder_path, $repoFullPath, '', true
);
// Trigger Event: jcb_ce_onAfterUpdateRepo
@ -1050,7 +1052,7 @@ class Compiler extends Infusion
&$this->componentData)
);
// copy the zip to backup path
JFile::copy(
File::copy(
$this->filepath['component'],
$this->backupPath . '/' . $this->componentBackupName
. '.zip'
@ -1144,7 +1146,7 @@ class Compiler extends Infusion
&$module)
);
// copy the zip to backup path
JFile::copy(
File::copy(
$this->filepath['modules'][$module->id],
$this->backupPath . '/' . $module->zip_name
. '.zip'
@ -1238,7 +1240,7 @@ class Compiler extends Infusion
&$plugin)
);
// copy the zip to backup path
JFile::copy(
File::copy(
$this->filepath['plugins'][$plugin->id],
$this->backupPath . '/' . $plugin->zip_name
. '.zip'
@ -1324,7 +1326,7 @@ class Compiler extends Infusion
}
$counter = 0;
// check if file exist
if (JFile::exists($file))
if (File::exists($file))
{
foreach (
new SplFileObject($file) as $lineNumber => $lineContent

View File

@ -12,6 +12,9 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Filesystem\Folder;
/**
* Compiler class
*/
@ -1010,11 +1013,9 @@ class Interpretation extends Fields
. " Prep the path a little";
$function[] = $this->_t(2)
. "\$path = '/'. trim(str_replace('//', '/', \$path), '/');";
$function[] = $this->_t(2)
. "jimport('joomla.filesystem.folder');";
$function[] = $this->_t(2) . "///" . $this->setLine(__LINE__)
$function[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
. " Check if folder exist";
$function[] = $this->_t(2) . "if (!JFolder::exists(\$path))";
$function[] = $this->_t(2) . "if (!Folder::exists(\$path))";
$function[] = $this->_t(2) . "{";
$function[] = $this->_t(3) . "//" . $this->setLine(__LINE__)
. " Lock key.";
@ -6660,7 +6661,7 @@ class Interpretation extends Fields
__LINE__
) . " check if the CSS file exists.";
$setter .= PHP_EOL . $tabV . $this->_t(5)
. "if (JFile::exists(JPATH_ROOT.'/media/com_"
. "if (File::exists(JPATH_ROOT.'/media/com_"
. $this->componentCodeName
. "/uikit-v2/css/components/'.\$name.\$style.\$size.'.css'))";
$setter .= PHP_EOL . $tabV . $this->_t(5) . "{";
@ -6679,7 +6680,7 @@ class Interpretation extends Fields
__LINE__
) . " check if the JavaScript file exists.";
$setter .= PHP_EOL . $tabV . $this->_t(5)
. "if (JFile::exists(JPATH_ROOT.'/media/com_"
. "if (File::exists(JPATH_ROOT.'/media/com_"
. $this->componentCodeName
. "/uikit-v2/js/components/'.\$name.\$size.'.js'))";
$setter .= PHP_EOL . $tabV . $this->_t(5) . "{";
@ -6717,11 +6718,6 @@ class Interpretation extends Fields
. $this->fileContentStatic[$this->hhh . 'Component'
. $this->hhh] . "Helper::checkArray(\$uikitComp))";
$setter .= PHP_EOL . $tabV . $this->_t(2) . "{";
$setter .= PHP_EOL . $tabV . $this->_t(3) . "//" . $this->setLine(
__LINE__
) . " load just in case.";
$setter .= PHP_EOL . $tabV . $this->_t(3)
. "jimport('joomla.filesystem.file');";
$setter .= PHP_EOL . $tabV . $this->_t(3) . "//" . $this->setLine(
__LINE__
) . " loading...";
@ -6736,7 +6732,7 @@ class Interpretation extends Fields
__LINE__
) . " check if the CSS file exists.";
$setter .= PHP_EOL . $tabV . $this->_t(5)
. "if (JFile::exists(JPATH_ROOT.'/media/com_"
. "if (File::exists(JPATH_ROOT.'/media/com_"
. $this->componentCodeName
. "/uikit-v2/css/components/'.\$name.\$style.\$size.'.css'))";
$setter .= PHP_EOL . $tabV . $this->_t(5) . "{";
@ -6755,7 +6751,7 @@ class Interpretation extends Fields
__LINE__
) . " check if the JavaScript file exists.";
$setter .= PHP_EOL . $tabV . $this->_t(5)
. "if (JFile::exists(JPATH_ROOT.'/media/com_"
. "if (File::exists(JPATH_ROOT.'/media/com_"
. $this->componentCodeName
. "/uikit-v2/js/components/'.\$name.\$size.'.js'))";
$setter .= PHP_EOL . $tabV . $this->_t(5) . "{";
@ -7225,7 +7221,7 @@ class Interpretation extends Fields
$file
))
{
if (JFile::exists($file['path']))
if (File::exists($file['path']))
{
$string = ComponentbuilderHelper::getFileContents(
$file['path']
@ -7241,7 +7237,7 @@ class Interpretation extends Fields
{
if (ComponentbuilderHelper::checkArray($doc))
{
if (JFile::exists($doc['path']))
if (File::exists($doc['path']))
{
$string
= ComponentbuilderHelper::getFileContents(
@ -8675,7 +8671,7 @@ class Interpretation extends Fields
$script[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
. " get all the folders";
$script[] = $this->_t(2)
. "\$folders = JFolder::folders(\$installPath);";
. "\$folders = Folder::folders(\$installPath);";
$script[] = $this->_t(2) . "//" . $this->setLine(__LINE__)
. " check if we have folders we may want to copy";
$script[] = $this->_t(2)
@ -8697,7 +8693,7 @@ class Interpretation extends Fields
$script[] = $this->_t(5) . "//" . $this->setLine(__LINE__)
. " now try to copy the folder";
$script[] = $this->_t(5)
. "if (!JFolder::copy(\$src, \$dest, '', true))";
. "if (!Folder::copy(\$src, \$dest, '', true))";
$script[] = $this->_t(5) . "{";
$script[] = $this->_t(6)
. "\$app->enqueueMessage('Could not copy '.\$folder.' folder into place, please make sure destination is writable!', 'error');";
@ -22388,6 +22384,26 @@ class Interpretation extends Fields
case 'site.views':
$headers = array();
break;
case 'admin.view.html':
case 'admin.views.html':
case 'site.admin.view.html':
case 'site.view.html':
case 'site.views.html':
case 'custom.admin.view.html':
case 'custom.admin.views.html':
// add a space
$headers = array('');
// load the file class if uikit is being loaded
if ((2 == $this->uikit || 1 == $this->uikit)
&& isset($this->uikitComp[$viewsCodeName])
&& ComponentbuilderHelper::checkArray(
$this->uikitComp[$viewsCodeName]
))
{
$headers[] = 'use Joomla\CMS\Filesystem\File;';
$headers[] = '';
}
break;
default:
$headers[] = 'use Joomla\Utilities\ArrayHelper;';
break;
@ -22735,7 +22751,7 @@ class Interpretation extends Fields
{
$imagePath = $this->componentPath . '/admin/assets/images';
// move the image to its place
JFile::copy(
File::copy(
JPATH_SITE . '/' . $path,
$imagePath . '/vdm-component.' . $type
);
@ -22984,7 +23000,7 @@ class Interpretation extends Fields
$imageName = $name . '.' . $type;
}
// move the image to its place
JFile::copy(
File::copy(
JPATH_SITE . '/' . $path, $imagePath . '/' . $imageName
);
}
@ -28187,9 +28203,9 @@ function vdm_dkim() {
$path = $module->folder_path . '/language/' . $tag
. '/';
// create path if not exist
if (!JFolder::exists($path))
if (!Folder::exists($path))
{
JFolder::create($path);
Folder::create($path);
// count the folder created
$this->folderCount++;
}
@ -28216,8 +28232,8 @@ function vdm_dkim() {
}
}
// get all files and folders in module folder
$files = JFolder::files($module->folder_path);
$folders = JFolder::folders($module->folder_path);
$files = Folder::files($module->folder_path);
$folders = Folder::folders($module->folder_path);
// the files/folders to ignore
$ignore = array('sql', 'language', 'script.php',
$module->file_name . '.xml',
@ -28545,9 +28561,9 @@ function vdm_dkim() {
$path = $plugin->folder_path . '/language/' . $tag
. '/';
// create path if not exist
if (!JFolder::exists($path))
if (!Folder::exists($path))
{
JFolder::create($path);
Folder::create($path);
// count the folder created
$this->folderCount++;
}
@ -28577,8 +28593,8 @@ function vdm_dkim() {
}
}
// get all files and folders in plugin folder
$files = JFolder::files($plugin->folder_path);
$folders = JFolder::folders($plugin->folder_path);
$files = Folder::files($plugin->folder_path);
$folders = Folder::folders($plugin->folder_path);
// the files/folders to ignore
$ignore = array('sql', 'language', 'script.php',
$plugin->file_name . '.xml',

View File

@ -648,6 +648,13 @@ class Infusion extends Interpretation
'site.admin.view.model',
$nameSingleCode
);
// SITE_ADMIN_VIEW_HTML_HEADER <<<DYNAMIC>>> add the header details for the view
$this->fileContentDynamic[$nameSingleCode][$this->hhh
. 'SITE_ADMIN_VIEW_HTML_HEADER' . $this->hhh]
= $this->setFileHeader(
'site.admin.view.html',
$nameSingleCode
);
// SITE_ADMIN_VIEW_HEADER <<<DYNAMIC>>> add the header details for the view
$this->fileContentDynamic[$nameSingleCode][$this->hhh
. 'SITE_ADMIN_VIEW_HEADER' . $this->hhh]
@ -677,6 +684,12 @@ class Infusion extends Interpretation
= $this->setFileHeader(
'admin.view.model', $nameSingleCode
);
// ADMIN_VIEW_HTML_HEADER <<<DYNAMIC>>> add the header details for the view
$this->fileContentDynamic[$nameSingleCode][$this->hhh
. 'ADMIN_VIEW_HTML_HEADER' . $this->hhh]
= $this->setFileHeader(
'admin.view.html', $nameSingleCode
);
// ADMIN_VIEW_HEADER <<<DYNAMIC>>> add the header details for the view
$this->fileContentDynamic[$nameSingleCode][$this->hhh
. 'ADMIN_VIEW_HEADER' . $this->hhh]
@ -1049,6 +1062,12 @@ class Infusion extends Interpretation
= $this->setFileHeader(
'admin.views.model', $nameListCode
);
// ADMIN_VIEWS_HTML_HEADER <<<DYNAMIC>>> add the header details for the views
$this->fileContentDynamic[$nameListCode][$this->hhh
. 'ADMIN_VIEWS_HTML_HEADER' . $this->hhh]
= $this->setFileHeader(
'admin.views.html', $nameListCode
);
// ADMIN_VIEWS_HEADER <<<DYNAMIC>>> add the header details for the views
$this->fileContentDynamic[$nameListCode][$this->hhh
. 'ADMIN_VIEWS_HEADER' . $this->hhh]
@ -1510,6 +1529,12 @@ class Infusion extends Interpretation
= $this->setFileHeader(
'custom.admin.view.model', $view['settings']->code
);
// CUSTOM_ADMIN_VIEW_HTML_HEADER <<<DYNAMIC>>> add the header details for the view
$this->fileContentDynamic[$view['settings']->code][$this->hhh
. 'CUSTOM_ADMIN_VIEW_HTML_HEADER' . $this->hhh]
= $this->setFileHeader(
'custom.admin.view.html', $view['settings']->code
);
// CUSTOM_ADMIN_VIEW_HEADER <<<DYNAMIC>>> add the header details for the view
$this->fileContentDynamic[$view['settings']->code][$this->hhh
. 'CUSTOM_ADMIN_VIEW_HEADER' . $this->hhh]
@ -1532,6 +1557,12 @@ class Infusion extends Interpretation
= $this->setFileHeader(
'custom.admin.views.model', $view['settings']->code
);
// CUSTOM_ADMIN_VIEWS_HTML_HEADER <<<DYNAMIC>>> add the header details for the view
$this->fileContentDynamic[$view['settings']->code][$this->hhh
. 'CUSTOM_ADMIN_VIEWS_HTML_HEADER' . $this->hhh]
= $this->setFileHeader(
'custom.admin.views.html', $view['settings']->code
);
// CUSTOM_ADMIN_VIEWS_HEADER <<<DYNAMIC>>> add the header details for the view
$this->fileContentDynamic[$view['settings']->code][$this->hhh
. 'CUSTOM_ADMIN_VIEWS_HEADER' . $this->hhh]
@ -2026,6 +2057,12 @@ class Infusion extends Interpretation
= $this->setFileHeader(
'site.view.model', $view['settings']->code
);
// SITE_VIEW_HTML_HEADER <<<DYNAMIC>>> add the header details for the view
$this->fileContentDynamic[$view['settings']->code][$this->hhh
. 'SITE_VIEW_HTML_HEADER' . $this->hhh]
= $this->setFileHeader(
'site.view.html', $view['settings']->code
);
// SITE_VIEW_HEADER <<<DYNAMIC>>> add the header details for the view
$this->fileContentDynamic[$view['settings']->code][$this->hhh
. 'SITE_VIEW_HEADER' . $this->hhh]
@ -2054,6 +2091,12 @@ class Infusion extends Interpretation
= $this->setFileHeader(
'site.views.model', $view['settings']->code
);
// SITE_VIEWS_HTML_HEADER <<<DYNAMIC>>> add the header details for the view
$this->fileContentDynamic[$view['settings']->code][$this->hhh
. 'SITE_VIEWS_HTML_HEADER' . $this->hhh]
= $this->setFileHeader(
'site.views.html', $view['settings']->code
);
// SITE_VIEWS_HEADER <<<DYNAMIC>>> add the header details for the view
$this->fileContentDynamic[$view['settings']->code][$this->hhh
. 'SITE_VIEWS_HEADER' . $this->hhh]

View File

@ -1184,9 +1184,6 @@ abstract class ComponentbuilderHelper
if ('compiler' === $type)
{
// import the Joomla librarys
jimport('joomla.filesystem.file');
jimport('joomla.filesystem.folder');
jimport('joomla.filesystem.archive');
jimport('joomla.application.component.modellist');
// include class to minify js
require_once JPATH_ADMINISTRATOR.'/components/com_componentbuilder/helpers/js.php';
@ -1195,9 +1192,6 @@ abstract class ComponentbuilderHelper
if ('smart' === $type)
{
// import the Joomla libraries
jimport('joomla.filesystem.file');
jimport('joomla.filesystem.folder');
jimport('joomla.filesystem.archive');
jimport('joomla.application.component.modellist');
}
// load this for all

View File

@ -12,6 +12,8 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Filesystem\Folder;
use Joomla\Utilities\ArrayHelper;
use PhpOffice\PhpSpreadsheet\IOFactory;
@ -222,7 +224,7 @@ class ComponentbuilderModelImport extends JModelLegacy
// Move uploaded file
jimport('joomla.filesystem.file');
$p_file = JFile::upload($tmp_src, $tmp_dest, $this->use_streams, $this->allow_unsafe, $this->safeFileOptions);
$p_file = File::upload($tmp_src, $tmp_dest, $this->use_streams, $this->allow_unsafe, $this->safeFileOptions);
// Was the package downloaded?
if (!$p_file)
@ -400,12 +402,12 @@ class ComponentbuilderModelImport extends JModelLegacy
// Is the package file a valid file?
if (is_file($package))
{
JFile::delete($package);
File::delete($package);
}
elseif (is_file(JPath::clean($package)))
{
// It might also be just a base filename
JFile::delete(JPath::clean($package));
File::delete(JPath::clean($package));
}
}

View File

@ -12,6 +12,8 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Filesystem\Folder;
use Joomla\Utilities\ArrayHelper;
use PhpOffice\PhpSpreadsheet\IOFactory;
@ -390,8 +392,7 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy
$tmp_src = $userfile['tmp_name'];
// Move uploaded file
jimport('joomla.filesystem.file');
$p_file = JFile::upload($tmp_src, $tmp_dest, $this->use_streams, $this->allow_unsafe, $this->safeFileOptions);
$p_file = File::upload($tmp_src, $tmp_dest, $this->use_streams, $this->allow_unsafe, $this->safeFileOptions);
// Was the package downloaded?
if (!$p_file)
@ -570,12 +571,12 @@ class ComponentbuilderModelImport_joomla_components extends JModelLegacy
// Is the package file a valid file?
if (is_file($package))
{
JFile::delete($package);
File::delete($package);
}
elseif (is_file(JPath::clean($package)))
{
// It might also be just a base filename
JFile::delete(JPath::clean($package));
File::delete(JPath::clean($package));
}
}

View File

@ -12,6 +12,8 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Filesystem\Folder;
use Joomla\Utilities\ArrayHelper;
use PhpOffice\PhpSpreadsheet\IOFactory;
@ -219,8 +221,7 @@ class ComponentbuilderModelImport_language_translations extends JModelLegacy
$tmp_src = $userfile['tmp_name'];
// Move uploaded file
jimport('joomla.filesystem.file');
$p_file = JFile::upload($tmp_src, $tmp_dest, $this->use_streams, $this->allow_unsafe, $this->safeFileOptions);
$p_file = File::upload($tmp_src, $tmp_dest, $this->use_streams, $this->allow_unsafe, $this->safeFileOptions);
// Was the package downloaded?
if (!$p_file)
@ -398,12 +399,12 @@ class ComponentbuilderModelImport_language_translations extends JModelLegacy
// Is the package file a valid file?
if (is_file($package))
{
JFile::delete($package);
File::delete($package);
}
elseif (is_file(JPath::clean($package)))
{
// It might also be just a base filename
JFile::delete(JPath::clean($package));
File::delete(JPath::clean($package));
}
}

View File

@ -12,6 +12,8 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Filesystem\File;
/**
* Componentbuilder View class for the Compiler
*/
@ -260,13 +262,13 @@ class ComponentbuilderViewCompiler extends JViewLegacy
foreach (ComponentbuilderHelper::$uk_components[$class] as $name)
{
// check if the CSS file exists.
if (JFile::exists(JPATH_ROOT.'/media/com_componentbuilder/uikit-v2/css/components/'.$name.$style.$size.'.css'))
if (File::exists(JPATH_ROOT.'/media/com_componentbuilder/uikit-v2/css/components/'.$name.$style.$size.'.css'))
{
// load the css.
$this->document->addStyleSheet(JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/components/'.$name.$style.$size.'.css', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
}
// check if the JavaScript file exists.
if (JFile::exists(JPATH_ROOT.'/media/com_componentbuilder/uikit-v2/js/components/'.$name.$size.'.js'))
if (File::exists(JPATH_ROOT.'/media/com_componentbuilder/uikit-v2/js/components/'.$name.$size.'.js'))
{
// load the js.
$this->document->addScript(JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/'.$name.$size.'.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true);

View File

@ -12,6 +12,8 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Filesystem\File;
/**
* Componentbuilder View class for the Get_snippets
*/
@ -104,13 +106,13 @@ class ComponentbuilderViewGet_snippets extends JViewLegacy
foreach (ComponentbuilderHelper::$uk_components[$class] as $name)
{
// check if the CSS file exists.
if (JFile::exists(JPATH_ROOT.'/media/com_componentbuilder/uikit-v2/css/components/'.$name.$style.$size.'.css'))
if (File::exists(JPATH_ROOT.'/media/com_componentbuilder/uikit-v2/css/components/'.$name.$style.$size.'.css'))
{
// load the css.
$this->document->addStyleSheet(JURI::root(true) .'/media/com_componentbuilder/uikit-v2/css/components/'.$name.$style.$size.'.css', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/css');
}
// check if the JavaScript file exists.
if (JFile::exists(JPATH_ROOT.'/media/com_componentbuilder/uikit-v2/js/components/'.$name.$size.'.js'))
if (File::exists(JPATH_ROOT.'/media/com_componentbuilder/uikit-v2/js/components/'.$name.$size.'.js'))
{
// load the js.
$this->document->addScript(JURI::root(true) .'/media/com_componentbuilder/uikit-v2/js/components/'.$name.$size.'.js', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('version' => 'auto') : 'text/javascript', (ComponentbuilderHelper::jVersion()->isCompatible('3.8.0')) ? array('type' => 'text/javascript', 'async' => 'async') : true);

View File

@ -12,6 +12,8 @@
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Filesystem\File;
use Joomla\CMS\Filesystem\Folder;
JHTML::_('behavior.modal');
/**
@ -5988,12 +5990,12 @@ class com_componentbuilderInstallerScript
{
}
// check if the PHPExcel stuff is still around
if (JFile::exists(JPATH_ADMINISTRATOR . '/components/com_componentbuilder/helpers/PHPExcel.php'))
if (File::exists(JPATH_ADMINISTRATOR . '/components/com_componentbuilder/helpers/PHPExcel.php'))
{
// We need to remove this old PHPExcel folder
$this->removeFolder(JPATH_ADMINISTRATOR . '/components/com_componentbuilder/helpers/PHPExcel');
// We need to remove this old PHPExcel file
JFile::delete(JPATH_ADMINISTRATOR . '/components/com_componentbuilder/helpers/PHPExcel.php');
File::delete(JPATH_ADMINISTRATOR . '/components/com_componentbuilder/helpers/PHPExcel.php');
}
return true;
}
@ -10887,7 +10889,7 @@ class com_componentbuilderInstallerScript
*/
protected function removeFolder($dir, $ignore = false)
{
if (JFolder::exists($dir))
if (Folder::exists($dir))
{
$it = new RecursiveDirectoryIterator($dir);
$it = new RecursiveIteratorIterator($it, RecursiveIteratorIterator::CHILD_FIRST);
@ -10917,7 +10919,7 @@ class com_componentbuilderInstallerScript
{
continue;
}
JFolder::delete($file_dir);
Folder::delete($file_dir);
}
else
{
@ -10936,13 +10938,13 @@ class com_componentbuilderInstallerScript
{
continue;
}
JFile::delete($file_dir);
File::delete($file_dir);
}
}
// delete the root folder if not ignore found
if (!$this->checkArray($ignore))
{
return JFolder::delete($dir);
return Folder::delete($dir);
}
return true;
}
@ -10988,7 +10990,7 @@ class com_componentbuilderInstallerScript
$installer = $parent->getParent();
$installPath = $installer->getPath('source');
// get all the folders
$folders = JFolder::folders($installPath);
$folders = Folder::folders($installPath);
// check if we have folders we may want to copy
$doNotCopy = array('media','admin','site'); // Joomla already deals with these
if (count((array) $folders) > 1)
@ -11003,7 +11005,7 @@ class com_componentbuilderInstallerScript
// set the destination path
$dest = JPATH_ROOT.'/'.$folder;
// now try to copy the folder
if (!JFolder::copy($src, $dest, '', true))
if (!Folder::copy($src, $dest, '', true))
{
$app->enqueueMessage('Could not copy '.$folder.' folder into place, please make sure destination is writable!', 'error');
}

View File

@ -1181,9 +1181,6 @@ abstract class ComponentbuilderHelper
if ('compiler' === $type)
{
// import the Joomla librarys
jimport('joomla.filesystem.file');
jimport('joomla.filesystem.folder');
jimport('joomla.filesystem.archive');
jimport('joomla.application.component.modellist');
// include class to minify js
require_once JPATH_ADMINISTRATOR.'/components/com_componentbuilder/helpers/js.php';
@ -1192,9 +1189,6 @@ abstract class ComponentbuilderHelper
if ('smart' === $type)
{
// import the Joomla libraries
jimport('joomla.filesystem.file');
jimport('joomla.filesystem.folder');
jimport('joomla.filesystem.archive');
jimport('joomla.application.component.modellist');
}
// load this for all