Use PLUGINS_DIR constant to load plugin templates
This commit is contained in:
@@ -73,7 +73,7 @@ class Loader extends \Kanboard\Core\Base
|
|||||||
|
|
||||||
$instance = new $class($this->container);
|
$instance = new $class($this->container);
|
||||||
|
|
||||||
Tool::buildDic($this->container, $instance->getClasses());
|
Tool::buildDIC($this->container, $instance->getClasses());
|
||||||
Tool::buildDICHelpers($this->container, $instance->getHelpers());
|
Tool::buildDICHelpers($this->container, $instance->getHelpers());
|
||||||
|
|
||||||
$instance->initialize();
|
$instance->initialize();
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ class Template
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($plugin !== 'kanboard' && $plugin !== '') {
|
if ($plugin !== 'kanboard' && $plugin !== '') {
|
||||||
return implode(DIRECTORY_SEPARATOR, array(__DIR__, '..', '..', 'plugins', ucfirst($plugin), 'Template', $template.'.php'));
|
return implode(DIRECTORY_SEPARATOR, array(PLUGINS_DIR, ucfirst($plugin), 'Template', $template.'.php'));
|
||||||
}
|
}
|
||||||
|
|
||||||
return implode(DIRECTORY_SEPARATOR, array(__DIR__, '..', 'Template', $template.'.php'));
|
return implode(DIRECTORY_SEPARATOR, array(__DIR__, '..', 'Template', $template.'.php'));
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ class TemplateTest extends Base
|
|||||||
{
|
{
|
||||||
$template = new Template($this->container['helper']);
|
$template = new Template($this->container['helper']);
|
||||||
$this->assertStringEndsWith(
|
$this->assertStringEndsWith(
|
||||||
implode(DIRECTORY_SEPARATOR, array('app', 'Core', '..', '..', 'plugins', 'Myplugin', 'Template', 'a', 'b.php')),
|
implode(DIRECTORY_SEPARATOR, array(PLUGINS_DIR, 'Myplugin', 'Template', 'a', 'b.php')),
|
||||||
$template->getTemplateFile('myplugin:a'.DIRECTORY_SEPARATOR.'b')
|
$template->getTemplateFile('myplugin:a'.DIRECTORY_SEPARATOR.'b')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -36,7 +36,7 @@ class TemplateTest extends Base
|
|||||||
$template->setTemplateOverride('a'.DIRECTORY_SEPARATOR.'b', 'myplugin:c');
|
$template->setTemplateOverride('a'.DIRECTORY_SEPARATOR.'b', 'myplugin:c');
|
||||||
|
|
||||||
$this->assertStringEndsWith(
|
$this->assertStringEndsWith(
|
||||||
implode(DIRECTORY_SEPARATOR, array('app', 'Core', '..', '..', 'plugins', 'Myplugin', 'Template', 'c.php')),
|
implode(DIRECTORY_SEPARATOR, array(PLUGINS_DIR, 'Myplugin', 'Template', 'c.php')),
|
||||||
$template->getTemplateFile('a'.DIRECTORY_SEPARATOR.'b')
|
$template->getTemplateFile('a'.DIRECTORY_SEPARATOR.'b')
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user