Skip to content
This repository
Browse code

fixing some include path issues

  • Loading branch information...
commit 96149b5bab6821e37058ef3a29c84f742918a18f 1 parent 1a16a40
Emerson Lackey authored

Showing 2 changed files with 4 additions and 6 deletions. Show diff stats Hide diff stats

  1. +1 2  example-plugin.php
  2. +3 4 framework/sanity.php
3  example-plugin.php
@@ -26,13 +26,12 @@ class ExamplePlugin extends SanityPluginFramework {
26 26 * Some required plugin information
27 27 */
28 28 var $version = '1.0';
29   - var $admin_js = array('hello');
30 29
31 30 /*
32 31 * Required __construct() function that initalizes the Sanity Framework
33 32 */
34 33 function __construct() {
35   - parent::__construct();
  34 + parent::__construct(__FILE__);
36 35 }
37 36
38 37 /*
7 framework/sanity.php
@@ -24,14 +24,13 @@ class SanityPluginFramework {
24 24 'plugin' => array()
25 25 );
26 26
27   - function __construct() {
  27 + function __construct($here = __FILE__) {
28 28 global $wpdb;
29   - $this->plugin_dir = basename(dirname(dirname(__FILE__)));
  29 + $this->plugin_dir = basename(dirname(dirname($here)));
30 30 $this->add_ajax_actions();
31 31 $this->wpdb = $wpdb;
32 32 $this->css_path = WP_PLUGIN_URL.'/'.$this->plugin_dir.'/css/';
33 33 $this->js_path = WP_PLUGIN_URL.'/'.$this->plugin_dir.'/js/';
34   - $this->plugin_dir = basename(dirname(dirname(__FILE__)));
35 34 add_action('wp_loaded', array(&$this, 'create_nonce'));
36 35 if(!empty($this->admin_css) || !empty($this->admin_js) ) {
37 36 add_action('admin_enqueue_scripts', array(&$this, 'load_admin_scripts'));
@@ -113,7 +112,7 @@ function add_ajax_actions() {
113 112 *
114 113 */
115 114 function render($view) {
116   - $template_path = dirname(dirname(__FILE__)).'/views/'.$view.'.php';
  115 + $template_path = $this->plugin_dir.'/views/'.$view.'.php';
117 116 ob_start();
118 117 include($template_path);
119 118 $output = ob_get_clean();

0 comments on commit 96149b5

Please sign in to comment.
Something went wrong with that request. Please try again.