/**
  * Returns the current template directory
  *
  * @since 1.0
  * @see get_option
  * @todo This is dirrrty dirrrty code. Fix ASAP.
  *
  * @param string $view Name of the current view
  * @param string $prefix String to prefix to the cache ID, defaults to template name
  * @return string
  */
 public static function load($view = 'chrono', $prefix = '')
 {
     if (empty($prefix)) {
         $prefix = get_option('template');
     }
     $current = Templates::get_current();
     $view_file = $view . '.php';
     Templates::headers();
     if (file_exists($current['Template Dir'] . '/' . $view_file)) {
         require_once $current['Template Dir'] . '/' . $view_file;
     } else {
         require_once $current['Template Dir'] . '/index.php';
     }
 }
Example #2
0
 /**
  * Returns the current template directory
  *
  * @since 1.0
  * @see get_option
  * @todo This is dirrrty dirrrty code. Fix ASAP.
  *
  * @param string $view Name of the current view
  * @param string $prefix String to prefix to the cache ID, defaults to template name
  * @return string
  */
 public static function load($view = 'chrono', $prefix = '')
 {
     if (empty($prefix)) {
         $prefix = get_option('template');
     }
     $current = Templates::get_current();
     $view_file = $view . '.php';
     Templates::headers();
     $cache = new CacheHandler();
     $cache->begin_caching($prefix . $_SERVER['REQUEST_URI']);
     if (file_exists($current['Template Dir'] . '/' . $view_file)) {
         require_once $current['Template Dir'] . '/' . $view_file;
     } else {
         require_once $current['Template Dir'] . '/index.php';
     }
     $cache->end_caching($prefix . $_SERVER['REQUEST_URI']);
 }