extranet/application/Bootstrap.php
2011-01-11 08:43:13 +00:00

68 lines
2.1 KiB
PHP

<?php
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
//Initialisation global des paramètres de vue
protected function _initViewSettings()
{
$this->bootstrap('view');
$view = $this->getResource('view');
/*
* Si on détecte un périphérique mobile alors on charge
* les bons scripts
$theme = 'mobile';
$path = realpath(APPLICATION_PATH.'/views/'.$theme);
$view = new Zend_View();
$view->addBasePath($path);
*/
$theme = 'default';
$view->setEncoding('UTF-8');
$view->doctype('XHTML1_STRICT');
$view->headMeta()
->appendHttpEquiv('Content-Type', 'text/html; charset=UTF-8')
->appendHttpEquiv('Content-Language', 'fr-FR');
$view->headLink()
->appendStylesheet('/themes/'.$theme.'/styles/reset.css', 'all')
->appendStylesheet('/themes/'.$theme.'/styles/main.css', 'all')
->appendStylesheet('/themes/'.$theme.'/styles/menu.css', 'all');
$view->headScript()
->appendFile('/themes/'.$theme.'/scripts/jquery.js', 'text/javascript')
->appendFile('/themes/'.$theme.'/scripts/jquery.bgiframe.js', 'text/javascript')
->appendFile('/themes/'.$theme.'/scripts/jquery-ui.js', 'text/javascript');
$view->headTitle()->setSeparator(' - ');
$view->headTitle('Extranet Scores & Décisions');
}
protected function _initRouter()
{
$this->bootstrap('frontController');
$front = $this->getResource('frontController');
$router = $front->getRouter();
$route = new Zend_Controller_Router_Route('localauth/', array(
'controller' => 'user',
'action' => 'login'
));
$router->addRoute('localauth', $route);
return $router;
}
protected function _initNavigation()
{
$view = $this->bootstrap('layout')->getResource('layout')->getView();
require_once 'Scores/Menu.php';
$computeMenu = new Menu();
$menu = $computeMenu->getMenu();
$view->navigation($menu);
}
protected function _initLogging(){
$writer = new Zend_Log_Writer_Firebug();
$logger = new Zend_Log($writer);
Zend_Registry::set('firebug', $logger);
}
//protected function _initDb(){}
}