www_archline_hu/deployed/akeeba/libraries/fof30/Layout/LayoutFile.php
LÁZÁR Imre AI Agent 263c9b6713 feat(deployed): add Akeeba Backup 6.1.1 (no-source, vetted live)
Akeeba Backup Core (Akeeba Ltd) + FOF 2.4.3/FOF30 3.3.4/FEF libraries; exact 6.1.1 not publicly downloadable -> deployed files (code only, no backup archives).

Signed-off-by: LÁZÁR Imre <imre@illusion.hu>
Assisted-by: claude-code@claude-opus-4-8
2026-07-16 11:24:42 +02:00

83 lines
2.1 KiB
PHP

<?php
/**
* @package FOF
* @copyright Copyright (c)2010-2018 Nicholas K. Dionysopoulos / Akeeba Ltd
* @license GNU GPL version 2 or later
*/
namespace FOF30\Layout;
use FOF30\Container\Container;
use JLayoutFile;
defined('_JEXEC') or die;
/**
* Base class for rendering a display layout
* loaded from from a layout file
*
* This class searches for Joomla! version override Layouts. For example,
* if you have run this under Joomla! 3.0 and you try to load
* mylayout.default it will automatically search for the
* layout files default.j30.php, default.j3.php and default.php, in this
* order.
*
* @package FrameworkOnFramework
*/
class LayoutFile extends JLayoutFile
{
/** @var Container The component container */
public $container = null;
/**
* Method to finds the full real file path, checking possible overrides
*
* @return string The full path to the layout file
*/
protected function getPath()
{
if (is_null($this->container))
{
$component = $this->options->get('component');
$this->container = Container::getInstance($component);
}
$filesystem = $this->container->filesystem;
if (is_null($this->fullPath) && !empty($this->layoutId))
{
$parts = explode('.', $this->layoutId);
$file = array_pop($parts);
$filePath = implode('/', $parts);
$suffixes = $this->container->platform->getTemplateSuffixes();
foreach ($suffixes as $suffix)
{
$files[] = $file . $suffix . '.php';
}
$files[] = $file . '.php';
$platformDirs = $this->container->platform->getPlatformBaseDirs();
$prefix = $this->container->platform->isBackend() ? $platformDirs['admin'] : $platformDirs['root'];
$possiblePaths = array(
$prefix . '/templates/' . $this->container->platform->getTemplate() . '/html/layouts/' . $filePath,
$this->basePath . '/' . $filePath,
$platformDirs['root'] . '/layouts/' . $filePath,
);
reset($files);
while ((list(, $fileName) = each($files)) && is_null($this->fullPath))
{
$r = $filesystem->pathFind($possiblePaths, $fileName);
$this->fullPath = $r === false ? null : $r;
}
}
return $this->fullPath;
}
}