<?php

class SiteBootstrap extends Pampa_Bootstrap {

  public function _initView() {
    $view = new Zend_View();

    $view->doctype('HTML5');
    $view->headMeta()
    ->appendHttpEquiv('content-type', 'text/html;charset=utf-8')
    ->appendHttpEquiv('content-style-type', 'text/css')
    ->appendHttpEquiv('content-script-type', 'text/javascript')
    ->appendName('description', 'Portal de ensino à distância do centro universitário de estudos e pesquisas sobre desastres')
    ->appendName('keywords', '');

    // get the registry
    $siteConfig = Zend_Registry::get("_site_config");
    $view->headTitle($siteConfig->title);

    $view->headTitle()->setSeparator(' - ');

    // stylesheets
    $view->headLink()
    
    ->appendStylesheet('assets/css/ceped.css')    
    ->appendStylesheet('assets/css/ie10-viewport-bug-workaround.css');

    // javascripts
    $view->headScript()
    // ->appendFile("assets/js/ie8-responsive-file-warning.js",'text/javascript')
    ->appendFile("assets/javascripts/jquery.js",'text/javascript')
    ->appendFile("assets/javascripts/bootstrap.min.js",'text/javascript')
    ->appendFile("assets/javascripts/jquery.maskedinput.min.js",'text/javascript')
    ->appendFile("assets/javascripts/flickity.pkgd.min.js",'text/javascript')
    ->appendFile("assets/javascripts/main.js",'text/javascript')
    ->appendFile("assets/javascripts/ie10-viewport-bug-workaround.js",'text/javascript')
    ;

         // conditional extra colorbox
    if(Pampa_Auth_Cms::getInstance()->hasIdentity() === FALSE){
      // $view->headLink()->appendStylesheet('assets/css/colorbox/colorbox.css', 'all');
      // $view->headScript()->appendFile('assets/js/jquery.colorbox-min.js', 'text/javascript');
    }

    $locale = new Zend_Locale('pt_BR');
    Zend_Registry::set('Zend_Locale', $locale);
    date_default_timezone_set( 'America/Sao_Paulo' );
    
    // the default escape
    $view->setEscape('stripslashes');

    // helpers path
    $view->addHelperPath('Pampa/View/Helper', 'Pampa_View_Helper');
    

    // Add it to the ViewRenderer
    $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');
    $viewRenderer->setView($view);
}

}