// template locator function to use for addons function template_locator($file, $default_locations, $append = '', $args = '') { $childThemePath = get_stylesheet_directory(); // Paths to check $paths = apply_filters('evo_file_template_paths', array(1 => TEMPLATEPATH . '/' . $this->template_url . $append, 2 => $childThemePath . '/', 3 => $childThemePath . '/' . $this->template_url . $append)); $location = $default_locations . $file; // FILE Exist if ($file) { // each path foreach ($paths as $path) { if (file_exists($path . $file)) { $location = $path . $file; break; } } } return $location; } } } // class exists // Main instance of eventon // @version 2.3.16 function EVO() { return EventON::instance(); } /** Init eventon class */ $GLOBALS['eventon'] = EVO(); //include_once('admin/update-notifier.php');
private static function update_evo_version($version = null) { delete_option('eventon_plugin_version'); add_option('eventon_plugin_version', is_null($version) ? EVO()->version : $version); }
public function get_email_body($part, $def_location, $args = '', $paths = '') { global $eventon; ob_start(); $file_location = EVO()->template_locator($part . '.php', $def_location, 'templates/email/'); include $file_location; return ob_get_clean(); /* $file_name = $part.'.php'; global $eventon; if(empty($paths) && !is_array($paths)){ $paths = array( 0=> TEMPLATEPATH.'/'.$eventon->template_url.'templates/email/', 1=> $def_location, ); } foreach($paths as $path){ // /echo $path.$file_name.'<br/>'; if(file_exists($path.$file_name) ){ $template = $path.$file_name; break; } } ob_start(); if($template) include($template); return ob_get_clean(); */ }