Permalink
Browse files

fixing some include path issues

  • Loading branch information...
1 parent 1a16a40 commit 96149b5bab6821e37058ef3a29c84f742918a18f Emerson Lackey committed Jul 26, 2011
Showing with 4 additions and 6 deletions.
  1. +1 −2 example-plugin.php
  2. +3 −4 framework/sanity.php
View
@@ -26,13 +26,12 @@ class ExamplePlugin extends SanityPluginFramework {
* Some required plugin information
*/
var $version = '1.0';
- var $admin_js = array('hello');
/*
* Required __construct() function that initalizes the Sanity Framework
*/
function __construct() {
- parent::__construct();
+ parent::__construct(__FILE__);
}
/*
View
@@ -24,14 +24,13 @@ class SanityPluginFramework {
'plugin' => array()
);
- function __construct() {
+ function __construct($here = __FILE__) {
global $wpdb;
- $this->plugin_dir = basename(dirname(dirname(__FILE__)));
+ $this->plugin_dir = basename(dirname(dirname($here)));
$this->add_ajax_actions();
$this->wpdb = $wpdb;
$this->css_path = WP_PLUGIN_URL.'/'.$this->plugin_dir.'/css/';
$this->js_path = WP_PLUGIN_URL.'/'.$this->plugin_dir.'/js/';
- $this->plugin_dir = basename(dirname(dirname(__FILE__)));
add_action('wp_loaded', array(&$this, 'create_nonce'));
if(!empty($this->admin_css) || !empty($this->admin_js) ) {
add_action('admin_enqueue_scripts', array(&$this, 'load_admin_scripts'));
@@ -113,7 +112,7 @@ function add_ajax_actions() {
*
*/
function render($view) {
- $template_path = dirname(dirname(__FILE__)).'/views/'.$view.'.php';
+ $template_path = $this->plugin_dir.'/views/'.$view.'.php';
ob_start();
include($template_path);
$output = ob_get_clean();

0 comments on commit 96149b5

Please sign in to comment.