77 lines
2.6 KiB
PHP
77 lines
2.6 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';
|
|
$pathStyle = '/themes/'.$theme.'/styles';
|
|
$pathScript = '/themes/'.$theme.'/scripts';
|
|
$view->setEncoding('UTF-8');
|
|
$view->doctype('XHTML1_STRICT');
|
|
$view->headMeta()
|
|
->appendHttpEquiv('Content-Type', 'text/html; charset=UTF-8')
|
|
->appendHttpEquiv('Content-Language', 'fr-FR');
|
|
|
|
//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');
|
|
$view->headScript()
|
|
->appendFile($pathScript.'/jquery.js', 'text/javascript')
|
|
->appendFile($pathScript.'/jquery.bgiframe.js', 'text/javascript')
|
|
->appendFile($pathScript.'/jquery-ui.js', 'text/javascript')
|
|
->appendFile($pathScript.'/jquery.qtip.js', 'text/javascript')
|
|
->appendFile($pathScript.'/script.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();
|
|
$localauthRoute = new Zend_Controller_Router_Route('localauth/', array(
|
|
'controller' => 'user',
|
|
'action' => 'login'
|
|
));
|
|
$fichierRoute = new Zend_Controller_Router_Route('fichier/:action/:fichier', array(
|
|
'controller' => 'fichier',
|
|
'fichier' => '',
|
|
));
|
|
$printRoute = new Zend_Controller_Router_Route('editer/:action/:fichier', array(
|
|
'controller' => 'print',
|
|
'fichier' => '',
|
|
));
|
|
|
|
$router->addRoute('localauth', $localauthRoute);
|
|
$router->addRoute('fichier', $fichierRoute);
|
|
$router->addRoute('print', $printRoute);
|
|
return $router;
|
|
}
|
|
|
|
protected function _initLogging()
|
|
{
|
|
$writer = new Zend_Log_Writer_Firebug();
|
|
if(APPLICATION_ENV=='production') $writer->setEnabled(false);
|
|
$logger = new Zend_Log($writer);
|
|
Zend_Registry::set('firebug', $logger);
|
|
}
|
|
|
|
}
|
|
|