<?php
class ControllerCommonRobots extends Controller {
	public function index() {
    header('Content-Type: text/plain; charset=utf-8');

    if ($this->config->get('google_sitemap_status')) {
      echo 'Sitemap: '.$this->urlloja->link('feed/google_sitemap');
      echo "\n";
    }

    $disallows = explode("\n", trim($this->config->get('config_robots_disallow_pages')));

    echo 'User-agent: *';
    echo "\n";

    foreach ($disallows as $disallow) {
      if (isset($disallow) && trim($disallow)<>''){
        echo 'Disallow: '.$disallow;
        echo "\n";
      }
    }
  }
}
