/** * parse this directory * * @return none */ protected function parseDir() { $this->clear(); $iter = new RecursiveDirectoryIterator($this->getPath()); while ($iter->valid()) { $curr = (string) $iter->getSubPathname(); if (!$iter->isDot() && $curr[0] != '.') { $this->addItem(Varien_Directory_Factory::getFactory($iter->current(), $this->getRecursion(), $this->getRecursionLevel())); } $iter->next(); } }
/** * Search for the template name in all themes & process all of those files * * @param $template string * @param null $types * * @internal param string $type */ protected function _processtemplate($template, $types = null) { if (!$types) { $types = array('frontend', 'adminhtml', 'install'); } $types = (array) $types; foreach ($types as $type) { $dir = array_filter(array_diff(scandir(Mage::getBaseDir('design') . DS . $type), array('..', '.')), 'is_dir'); foreach ($dir as $package) { $themes = array_filter(array_diff(scandir(Mage::getBaseDir('design') . DS . $type . DS . $package), array('..', '.')), 'is_dir'); foreach ($themes as &$theme) { $theme = Mage::getBaseDir('design') . DS . $type . DS . $package . DS . $theme; } unset($theme); foreach ($themes as $theme) { if (is_dir($theme . DS . 'template')) { if (is_readable($theme . DS . 'template' . DS . $template)) { $file = Varien_Directory_Factory::getFactory($theme . DS . 'template' . DS . $template); if ($file instanceof Varien_File_Object) { $this->processPHTML($file); } unset($file); } } } } } }