extranet/application/Bootstrap.php

77 lines
2.3 KiB
PHP
Raw Normal View History

2010-11-22 12:50:12 +00:00
<?php
class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
//Initialisation global des paramètres de vue
protected function _initViewSettings()
{
2011-01-11 08:43:13 +00:00
$this->bootstrap('view');
2010-11-22 12:50:12 +00: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 09:59:49 +00:00
$theme = 'default';
2011-04-01 12:14:40 +00:00
$pathStyle = '/themes/'.$theme.'/styles';
$pathScript = '/themes/'.$theme.'/scripts';
2010-11-22 12:50:12 +00: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-04-01 12:14:40 +00:00
//Get controller name + action name to define css and js to load
$view->headLink()
->appendStylesheet($pathStyle.'/reset.css', 'all')
->appendStylesheet($pathStyle.'/main.css', 'all')
->appendStylesheet($pathStyle.'/menu.css', 'all')
->appendStylesheet($pathStyle.'/jquery-ui.css', 'all');
2011-01-05 09:59:49 +00:00
$view->headScript()
2011-04-01 12:14:40 +00:00
->appendFile($pathScript.'/jquery.js', 'text/javascript')
->appendFile($pathScript.'/jquery.bgiframe.js', 'text/javascript')
2011-04-04 11:27:20 +00:00
->appendFile($pathScript.'/jquery-ui.js', 'text/javascript')
->appendFile($pathScript.'/script.js', 'text/javascript');
2011-01-07 17:16:07 +00:00
$view->headTitle()->setSeparator(' - ');
2010-11-22 12:50:12 +00:00
$view->headTitle('Extranet Scores & Décisions');
}
2011-01-05 09:59:49 +00: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()
{
2011-04-15 09:05:30 +00:00
/*
2011-01-05 09:59:49 +00:00
$view = $this->bootstrap('layout')->getResource('layout')->getView();
2011-04-15 09:05:30 +00:00
require_once 'Scores/Menu.php';
$computeMenu = new Menu();
2011-01-05 09:59:49 +00:00
$menu = $computeMenu->getMenu();
2011-01-05 15:14:23 +00:00
$view->navigation($menu);
2011-04-15 09:05:30 +00:00
*/
2011-01-05 09:59:49 +00:00
}
2011-01-07 17:16:07 +00:00
protected function _initLogging(){
$writer = new Zend_Log_Writer_Firebug();
$logger = new Zend_Log($writer);
Zend_Registry::set('firebug', $logger);
}
2011-01-11 08:43:13 +00:00
2010-11-22 12:50:12 +00:00
//protected function _initDb(){}
2011-01-05 09:59:49 +00:00
2010-11-22 12:50:12 +00:00
}