public function prepareData()
 {
     parent::prepareData();
     $nodes = $this->data->documentElement->childNodes;
     for ($i = 0; $i < $nodes->length; $i++) {
         $component = $nodes->item($i);
         if ('folder' === $component->nodeName) {
             $offerFolder = $this->provider->getRootDir() . '/' . $this->provider->getSitePrefix() . '/' . $component->nodeValue;
             $offers = $this->getOffers($offerFolder);
             foreach ($offers as $offer) {
                 $node = $this->createOfferNode($offer);
                 $component->parentNode->appendChild($node);
             }
         }
     }
     unset($component);
 }
 public function render()
 {
     $enabled = $this->data->getElementsByTagName('enabled');
     if ($enabled->length < 0) {
         return parent::render();
     }
     if (false != getenv('DS_ENV')) {
         $env = getenv('DS_ENV');
     } else {
         $env = $this->provider->getEnvironement();
     }
     // turn off GA for test and dev environment
     if ('dev' == $env || 'test' == $env) {
         $enabled = $enabled->item(0);
         $enabled->nodeValue = 0;
     }
     return parent::render();
 }
 public function prepareData()
 {
     parent::prepareData();
     $nodes = $this->data->documentElement->childNodes;
     for ($i = 0; $i < $nodes->length; $i++) {
         $component = $nodes->item($i);
         if ('markdown' === $component->nodeName) {
             if ($component->hasAttribute('file')) {
                 $mdFile = $this->provider->getRootDir() . '/' . $this->provider->getSitePrefix() . '/' . $component->getAttribute('file');
                 $md = file_get_contents($mdFile);
             } else {
                 $md = $component->nodeValue;
             }
             $html = Markdown($md);
             $textNode = $this->data->importNode(new DOMElement('text', $html), true);
             $component->parentNode->replaceChild($textNode, $component);
         }
     }
     unset($component);
 }