public function __call($method, $arguments)
 {
     $extensions = array(".html", ".md", ".markdown", ".textile");
     $html = null;
     foreach ($extensions as $extension) {
         $full_src = Path::assemble(BASE_PATH, Config::getCurrentThemePath(), 'partials', ltrim($method . $extension, '/'));
         if (File::exists($full_src)) {
             // Merge additional variables passed as parameters
             Statamic_View::$_dataStore = $arguments + Statamic_View::$_dataStore;
             if ($this->fetchParam('use_context', false, false, true, false)) {
                 $html = Parse::contextualTemplate(File::get($full_src), Statamic_View::$_dataStore, $this->context, 'Statamic_View::callback');
             } else {
                 $html = Parse::template(File::get($full_src), Statamic_View::$_dataStore, 'Statamic_View::callback');
             }
             // parse contents if needed
             if ($extension == ".md" || $extension == ".markdown") {
                 $html = Parse::markdown($html);
             } elseif ($extension == ".textile") {
                 $html = Parse::textile($html);
             }
         }
     }
     if (Config::get('enable_smartypants', TRUE)) {
         $html = Parse::smartypants($html);
     }
     return $html;
 }
Example #2
0
File: statamic.php Project: nob/joi
 public static function get_theme_path()
 {
     Log::warn("Use of Statamic::get_theme_path() is deprecated. Use Config::getCurrentThemePath() instead.", "core", "Statamic");
     return Config::getCurrentThemePath();
 }
Example #3
0
File: theme.php Project: nob/joi
 /**
  * Returns the path to the current theme
  *
  * @return string
  */
 public static function getPath()
 {
     return Config::getCurrentThemePath();
 }
Example #4
0
 /**
  * Get Globals & Theme Variables
  *
  * Create global variables from v1 globals and theme variables
  *
  * @return array
  */
 private function createGlobals()
 {
     $globals = array('settings' => array(), 'global' => array(), 'theme' => array());
     // Get a list of variables added to _config/settings.yaml
     // Anything not also in the defaults will be considered a global added manually.
     $defaults = array_keys(YAML::parseFile(Config::getAppConfigPath() . '/default.settings.yaml'));
     $settings = array_keys(YAML::parseFile(Config::getConfigPath() . '/settings.yaml'));
     $settings_globals = array_diff($settings, $defaults);
     foreach ($settings_globals as $setting) {
         $setting = ltrim($setting, '_');
         $globals['settings'][$setting] = Config::get($setting);
     }
     // Get a list of variables in _config/global.yaml
     $site_globals = Config::getConfigPath() . '/global.yaml';
     if (File::exists($site_globals)) {
         $globals['global'] = YAML::parse($site_globals);
     }
     // Get a list of variables in the theme.yaml
     $theme_globals = Config::getCurrentThemePath() . 'theme.yaml';
     if (File::exists($theme_globals)) {
         $globals['theme'] = YAML::parse($theme_globals);
     }
     $this->migration['globals'] = $globals;
 }