1 <?php
2 3 4 5 6 7
8
9 defined('FOF_INCLUDED') or die;
10
11 12 13 14 15 16 17 18 19 20 21 22 23
24 class FOFLayoutFile extends JLayoutFile
25 {
26 27 28 29 30
31 protected function getPath()
32 {
33 $filesystem = FOFPlatform::getInstance()->getIntegrationObject('filesystem');
34
35 if (is_null($this->fullPath) && !empty($this->layoutId))
36 {
37 $parts = explode('.', $this->layoutId);
38 $file = array_pop($parts);
39
40 $filePath = implode('/', $parts);
41 $suffixes = FOFPlatform::getInstance()->getTemplateSuffixes();
42
43 foreach ($suffixes as $suffix)
44 {
45 $files[] = $file . $suffix . '.php';
46 }
47
48 $files[] = $file . '.php';
49
50 $platformDirs = FOFPlatform::getInstance()->getPlatformBaseDirs();
51 $prefix = FOFPlatform::getInstance()->isBackend() ? $platformDirs['admin'] : $platformDirs['root'];
52
53 $possiblePaths = array(
54 $prefix . '/templates/' . JFactory::getApplication()->getTemplate() . '/html/layouts/' . $filePath,
55 $this->basePath . '/' . $filePath
56 );
57
58 reset($files);
59
60 while ((list(, $fileName) = each($files)) && is_null($this->fullPath))
61 {
62 $r = $filesystem->pathFind($possiblePaths, $fileName);
63 $this->fullPath = $r === false ? null : $r;
64 }
65 }
66
67 return $this->fullPath;
68 }
69 }
70