Skip to content

Commit 7b6945b

Browse files
committed
Fix bug with wrong path to site directory in combination with a multisite setup
1 parent e580c16 commit 7b6945b

5 files changed

Lines changed: 10 additions & 36 deletions

TemplateEngine.php

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,6 @@
88
* @author Stefan Wanzenried <stefan.wanzenried@gmail.com>
99
* @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License, version 2
1010
*
11-
* ProcessWire 2.x
12-
* Copyright (C) 2014 by Ryan Cramer
13-
* Licensed under GNU/GPL v2, see LICENSE.TXT
14-
*
15-
* http://processwire.com
16-
*
1711
*/
1812
abstract class TemplateEngine extends Wire
1913
{
@@ -53,7 +47,6 @@ public function __construct($filename = '')
5347

5448
/**
5549
* Register the template engine when installing
56-
*
5750
*/
5851
public function install()
5952
{
@@ -63,20 +56,20 @@ public function install()
6356

6457
/**
6558
* Unregister template engine when uninstalling
66-
*
6759
*/
6860
public function uninstall()
6961
{
7062
$this->factory->unregisterEngine($this);
7163
}
7264

7365

74-
public function init() {}
66+
public function init()
67+
{
68+
}
7569

7670

7771
/**
7872
* Init engine, derived classes must use this method to setup the engine
79-
*
8073
*/
8174
abstract public function initEngine();
8275

@@ -126,7 +119,9 @@ public static function getDefaultConfig()
126119
* In our context, the config is loaded and available already in the constructor so just leave empty
127120
*
128121
*/
129-
public function setConfigData(array $data = array()) {}
122+
public function setConfigData(array $data = array())
123+
{
124+
}
130125

131126

132127
/**
@@ -222,7 +217,8 @@ public function setFilename($filename)
222217
public function getTemplatesPath()
223218
{
224219
$path = ltrim($this->getConfig('templates_path'), '/');
225-
return $this->config->paths->root . 'site/' . rtrim($path, '/') . '/';
220+
221+
return $this->wire('config')->paths->site . rtrim($path, '/') . '/';
226222
}
227223

228224

TemplateEngineCache.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,6 @@
99
*
1010
* @author Stefan Wanzenried <stefan.wanzenried@gmail.com>
1111
*
12-
* ProcessWire 2.x
13-
* Copyright (C) 2014 by Ryan Cramer
14-
* Licensed under GNU/GPL v2, see LICENSE.TXT
15-
*
16-
* http://processwire.com
17-
*
1812
*/
1913

2014
interface TemplateEngineCache {

TemplateEngineFactory.module

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,7 @@ require_once('TemplateEngineNull.php');
1414
*
1515
* @author Stefan Wanzenried <stefan.wanzenried@gmail.com>
1616
* @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License, version 2
17-
* @version 1.0.2
18-
*
19-
* ProcessWire 2.x
20-
* Copyright (C) 2014 by Ryan Cramer
21-
* Licensed under GNU/GPL v2, see LICENSE.TXT
22-
*
23-
* http://processwire.com
17+
* @version 1.0.3
2418
*
2519
*/
2620
class TemplateEngineFactory extends WireData implements Module, ConfigurableModule
@@ -267,7 +261,7 @@ class TemplateEngineFactory extends WireData implements Module, ConfigurableModu
267261
{
268262
return array(
269263
'title' => 'Template Engine Factory',
270-
'version' => 102,
264+
'version' => 103,
271265
'author' => 'Stefan Wanzenried',
272266
'summary' => 'This module aims to separate logic from markup.' .
273267
'Turns ProcessWire templates into controllers which can interact over a new API ' .

TemplateEngineNull.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@
66
*
77
* @author Stefan Wanzenried <stefan.wanzenried@gmail.com>
88
*
9-
* ProcessWire 2.x
10-
* Copyright (C) 2014 by Ryan Cramer
11-
* Licensed under GNU/GPL v2, see LICENSE.TXT
12-
*
13-
* http://processwire.com
149
*/
1510

1611
class TemplateEngineNull extends TemplateEngine

TemplateEngineProcesswire.module

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@ require_once('TemplateEngine.php');
88
* @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License, version 2
99
* @version 1.0.1
1010
*
11-
* ProcessWire 2.x
12-
* Copyright (C) 2014 by Ryan Cramer
13-
* Licensed under GNU/GPL v2, see LICENSE.TXT
14-
*
15-
* http://processwire.com
1611
*/
1712
class TemplateEngineProcesswire extends TemplateEngine implements Module, ConfigurableModule
1813
{

0 commit comments

Comments
 (0)