extranet/application/Bootstrap.php

68 lines
2.1 KiB
PHP
Raw Normal View History

2010-11-22 13:50:12 +01:00
<?php
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
//Initialisation global des paramètres de vue
protected function _initViewSettings()
{
2011-01-11 09:43:13 +01:00
$this->bootstrap('view');
2010-11-22 13:50:12 +01:00
$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);
*/
2011-01-05 10:59:49 +01:00
$theme = 'default';
2010-11-22 13:50:12 +01:00
$view->setEncoding('UTF-8');
$view->doctype('XHTML1_STRICT');
$view->headMeta()
->appendHttpEquiv('Content-Type', 'text/html; charset=UTF-8')
->appendHttpEquiv('Content-Language', 'fr-FR');
2011-01-05 10:59:49 +01:00
$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');
2011-01-07 18:16:07 +01:00
$view->headTitle()->setSeparator(' - ');
2010-11-22 13:50:12 +01:00
$view->headTitle('Extranet Scores & Décisions');
}
2011-01-05 10:59:49 +01:00
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();
2011-01-05 16:14:23 +01:00
$view->navigation($menu);
2011-01-05 10:59:49 +01:00
}
2011-01-07 18:16:07 +01:00
protected function _initLogging(){
$writer = new Zend_Log_Writer_Firebug();
$logger = new Zend_Log($writer);
Zend_Registry::set('firebug', $logger);
}
2011-01-11 09:43:13 +01:00
2010-11-22 13:50:12 +01:00
//protected function _initDb(){}
2011-01-05 10:59:49 +01:00
2010-11-22 13:50:12 +01:00
}