-
Notifications
You must be signed in to change notification settings - Fork 1
/
bfox_root_plugin_controller.php
47 lines (39 loc) · 1.06 KB
/
bfox_root_plugin_controller.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
/**
* All Biblefox plugins have a root controller which extends from this class
*
* @author richard
*
*/
class BfoxRootPluginController extends BfoxBaseRootPluginController {
/**
* @var BfoxCoreController
*/
var $core;
/**
* @var BfoxOptions
*/
var $options;
function __construct($core, $slug, $prefix, $version, $buildVersion) {
$this->core = $core;
parent::__construct($slug, $prefix, $version, $buildVersion);
$this->options = new BfoxOptions($prefix);
}
/**
* Returns a path for a Biblefox theme template file, first trying to load from the theme, then from the plugin
*/
function templatePath($template) {
$template .= '.php';
$path = locate_template(array($template));
if (empty($path)) $path = $this->dir . '/theme/' . $template;
return apply_filters($this->filterName('template_path'), $path, $template);
}
/**
* Loads a Biblefox theme template file, first trying to load from the theme, then from the plugin
*/
function loadTemplate($template) {
$path = $this->templatePath($template);
load_template($path);
}
}
?>