public function partial_paths($paths = array(), $base_name = '') { $paths = parent::partial_paths($paths, $base_name); if ($this->current_helper instanceof Templates_HelperInterface) { $cname = CMS::get_component_name_for($this->current_helper); if ($cname) { $component_paths = array(); foreach (array('app/views', 'views') as $v) { $component_paths[] = rtrim(CMS::component_dir($cname, $v), '/'); } $paths = array_merge($component_paths, $paths); } } $paths = array_merge(array(CMS::current_component_dir('app/views'), CMS::current_component_dir('views')), $paths); return $paths; }
protected function templates_dir() { return CMS::current_component_dir('views'); }
public function redefined_template($template) { if (!Core_Regexps::match('{\\.phtml$}', $template)) { $template .= '.phtml'; } if ($template[0] == '.' || $template[0] == '/') { return $template; } $dir = $this->templates_dir(); if ($dir && is_file("{$dir}/{$template}")) { return "{$dir}/{$template}"; } $dir = CMS::current_component_dir('views/admin'); if (is_file("{$dir}/{$template}")) { return "{$dir}/{$template}"; } return false; }