<?php

class CmsBootstrap extends Pampa_Bootstrap {

  public function _initAuth(){
		$frontController = Zend_Controller_Front::getInstance();
		$frontController->registerPlugin(new Pampa_Acl_Cms());
	}

  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');

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



    // stylesheets
    $view->headLink()
        ->appendStylesheet('css/bootstrap.css')
        ->appendStylesheet('css/bootstrap-responsive.css')
        ->appendStylesheet('css/datepicker.css')
        ->appendStylesheet('css/padrao.css')

          ->appendStylesheet('js/colorbox/css/colorbox.css');
            

    // javascripts
    $view->headScript()
       // ->appendFile('http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js', 'text/javascript')
        ->appendFile('js/bootstrap-transition.js', 'text/javascript')
        ->appendFile('js/bootstrap-alert.js', 'text/javascript')
        ->appendFile('js/bootstrap-modal.js', 'text/javascript')
        ->appendFile('js/bootstrap-dropdown.js', 'text/javascript')
        ->appendFile('js/bootstrap-scrollspy.js', 'text/javascript')
        ->appendFile('js/bootstrap-tab.js', 'text/javascript')
        ->appendFile('js/bootstrap-tooltip.js', 'text/javascript')
        ->appendFile('js/bootstrap-popover.js', 'text/javascript')
        ->appendFile('js/bootstrap-button.js', 'text/javascript')
        ->appendFile('js/bootstrap-collapse.js', 'text/javascript')
        ->appendFile('js/bootstrap-carousel.js', 'text/javascript')
        ->appendFile('js/bootstrap-typeahead.js', 'text/javascript')
        ->appendFile('js/bootstrap-datepicker.js', 'text/javascript')
        // ->appendFile('js/jquery.maskedinput.min.js', 'text/javascript')

        ->appendFile('js/jquery.maskedinput.min.js', 'text/javascript')

          ->appendFile('tinymce/tinymce.min.js', 'text/javascript')
          // ->appendFile('js/tiny_mce/jquery.tinymce.js', 'text/javascript')
          // ->appendFile('js/tiny_mce/plugins/tinybrowser/tb_tinymce.js.php', 'text/javascript')
          ->appendFile("js/colorbox/js/jquery.colorbox-min.js", "text/javascript")
          ->appendFile('js/PampaExtras.min.js', 'text/javascript')
          ->appendFile('js/PampaForms.js?1', 'text/javascript')
          ->appendFile('js/pampa.js?1', 'text/javascript');

    // 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);
  }

  public function _initControllerHelpers(){
    // register the actions helpers
    Zend_Controller_Action_HelperBroker::addHelper(new Pampa_Controller_Action_Helper_Messenger());
  }

}