Skip to content
This repository has been archived by the owner on Sep 17, 2018. It is now read-only.

CS #3

Merged
merged 1 commit into from
May 23, 2018
Merged

CS #3

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions administrator/components/com_templates/Model/TemplateModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ public function getDirectoryTree($dir)
/**
* Method to get the core file of override file
*
* @param string $file Override file
* @param integer $client Client Id
* @param string $file Override file
* @param integer $client_id Client Id
*
* @return string $corefile The full path and file name for the target file, or boolean false if the file is not found in any of the paths.
*
Expand All @@ -170,7 +170,7 @@ public function getCoreFile($file, $client_id)
$explodeArray = explode(DIRECTORY_SEPARATOR, $filePath);

// Only allow html/ folder
if($explodeArray['1'] !== 'html')
if ($explodeArray['1'] !== 'html')
{
$app->enqueueMessage(Text::_('COM_TEMPLATES_ERROR_ONLY_HTML_FOLDER_ALLOWED'), 'error');

Expand Down Expand Up @@ -205,7 +205,7 @@ public function getCoreFile($file, $client_id)
// The old scheme, if a view has a tmpl folder
$oldHtmlPath = Path::clean($componentPath . $folder . '/views/' . $subFolder . '/tmpl/');

if(!$coreFile = Path::find($oldHtmlPath, $fileName))
if (!$coreFile = Path::find($oldHtmlPath, $fileName))
{
// The new scheme, the views are directly in the component/tmpl folder
$newHtmlPath = Path::clean($componentPath . $folder . '/tmpl/' . $subFolder . '/');
Expand All @@ -221,7 +221,7 @@ public function getCoreFile($file, $client_id)
// For Jlayouts
$subtype = $explodeArray['3'];

if(stristr($subtype, 'com_'))
if (stristr($subtype, 'com_'))
{
$folder = $explodeArray['3'];
$subFolder = array_slice($explodeArray, 4, -1);
Expand Down Expand Up @@ -270,11 +270,11 @@ private function getSafeName($name)
$size = count($explodeArray);
$date = $explodeArray[$size-2] . '-' . str_replace('.' . $extension, '', $explodeArray[$size-1]);

if($this->validateDate($date))
if ($this->validateDate($date))
{
$nameWithoutExtension = implode('-', array_slice($explodeArray, 0, -2));

//Filtered name
// Filtered name
$name = $nameWithoutExtension . '.' . $extension;
}
}
Expand All @@ -300,10 +300,10 @@ private function validateDate($date)
}

/**
* Find file in given folde
* Find file in given folder.
*
* @param string $path An path or array of path to search.
* @param string $file The file name to look for.
* @param string $paths An path or array of path to search.
* @param string $file The file name to look for.
*
* @return mixed $path The full path and file name for the target file, or boolean false if the file is not found in any of the paths.
*
Expand All @@ -313,7 +313,7 @@ private function findPath($paths, $file)
{
$app = Factory::getApplication();

if(!$path = Path::find($paths, $file))
if (!$path = Path::find($paths, $file))
{
$app->enqueueMessage(Text::_('COM_TEMPLATES_ERROR_CORE_FILE_NOT_FOUND'), 'error');
}
Expand Down