?
<?php
class IndexController extends Zend_Controller_Action
{
public function init()
{
$session = Zend_Registry::get('session');
$translate = Zend_Registry::get('translate');
// si la langue n'existe pas
$projet = $this->_request->getParam('lang');
$this->view->actionCourante = $this->view->layout()->actionactif;
$ln = $this->_request->getParam('ln');
$this->view->ln = $ln;
if(isset($ln))
{
if ($translate->isAvailable($ln)) {
$locale = new Zend_Locale($ln);
$session->lang = $locale;
$translate->setLocale($locale->getLanguage());
Zend_Registry::set('translate', $translate);
}
else
{
$this->_redirect('/index-fr.html');
}
}
else
{
$this->_redirect('/index-'.$session->lang.'.html');
}
$this->view->translate = $translate;
$this->view->TitrePage = $translate->_("nomsite");
if(ENV == "preprod")
{
$this->view->robots = "noindex, nofollows";
}
else
{
$this->view->robots = "index, follows";
}
$actionCourante = $this->view->layout()->actionactif;
$page = $this->view->actionCourante;
$config = new Zend_Config_Xml(PUBLIC_PATH.'txt/meta.xml', "page".$session->lang);
$this->view->TitrePage = $this->view->TitrePage.", ".$config->$page->title;
$this->view->DescPage = $config->$page->description;
$this->view->caption = $config->$page->title;
$page = $actionCourante;
$config = new Zend_Config_Xml(PUBLIC_PATH.'txt/social.xml', "social");
foreach ($config->element as $value) {
if($value->name == "google")
{
$this->view->googleplus = $value->url;
}
}
$configmail = new Zend_Config_Ini('./application/config/mail.ini', ENV);
$this->view->mailcontact = $configmail->mail->contact;
$config = new Zend_Config_Ini('./application/config/config.ini', ENV);
$this->view->streetAddress = $config->adresse->streetAddress;
$this->view->telephone = $config->adresse->telephone;
$this->view->postalCode = $config->adresse->postalCode;
$this->view->addressLocality = $config->adresse->addressLocality;
$this->view->addressCountry = $config->adresse->addressCountry;
$this->view->lat = $config->adresse->lat;
$this->view->lng = $config->adresse->lng;
$this->view->openingHours1 = $config->adresse->openingHours1;
$this->view->openingHours2 = $config->adresse->openingHours2;
$this->view->googlemaps = $config->adresse->googlemaps;
$this->_helper->actionStack('header','header');
$this->_helper->actionStack('nav','nav');
$this->_helper->actionStack('footer','footer');
header('Accept-Encoding: gzip, deflate');
}
public function indexAction()
{
$session = Zend_Registry::get('session');
$translate = Zend_Registry::get('translate');
$this->_helper->layout()->setLayout('main');
$this->view->langue = $session->lang;
$listref = Data::listreferences();
$this->view->references = $listref;
$this->view->bodyclass = "";
}
public function brandingAction()
{
$session = Zend_Registry::get('session');
$translate = Zend_Registry::get('translate');
$this->_helper->layout()->setLayout('main');
$this->view->langue = $session->lang;
$this->view->bodyclass = "";
}
public function businessAction()
{
$session = Zend_Registry::get('session');
$translate = Zend_Registry::get('translate');
$this->_helper->layout()->setLayout('main');
$this->view->langue = $session->lang;
$this->view->bodyclass = "";
}
public function goodmorningAction()
{
$session = Zend_Registry::get('session');
$translate = Zend_Registry::get('translate');
$this->_helper->layout()->setLayout('main');
$this->view->langue = $session->lang;
$this->view->bodyclass = "";
}
public function referencesAction()
{
$session = Zend_Registry::get('session');
$translate = Zend_Registry::get('translate');
$this->_helper->layout()->setLayout('main');
$this->view->langue = $session->lang;
$this->view->bodyclass = "";
$this->view->langue = $session->lang;
$listref = Data::listreferences();
//exit(var_dump($listref));
$this->view->references = $listref;
}
public function referenceAction()
{
$session = Zend_Registry::get('session');
$translate = Zend_Registry::get('translate');
$this->_helper->layout()->setLayout('main');
$projet = $this->_request->getParam('projet');
$this->view->projet = $projet;
$this->view->langue = $session->lang;
$listref = Data::getreference2($projet);
//exit(var_dump($listref));
$path = $listref["parametres"]["path"];
$this->view->bandeaux = $listref["bandeaux"]["projets"]["contenu"]["elements"];
$this->view->logoblanc = $listref["logoblanc"]["projets"]["contenu"]["elements"];
$this->view->galerie = $listref["galerie"]["projets"]["contenu"]["elements"];
if(isset($listref["planche"]["projets"]["contenu"]["elements"])){
$this->view->planche = $listref["planche"]["projets"]["contenu"]["elements"];
}
//exit(var_dump($listref["galerie"]["projets"]["contenu"]["elements"]));
$config = new Zend_Config_Xml($path.'parametres.xml', "data".$session->lang);
$this->view->TitrePage = $this->view->TitrePage."".$config->meta->title;
$this->view->altreference = $config->meta->title;
$this->view->DescPage = $config->meta->description;
$this->view->texte = $config->meta->texte;
$this->view->sites = $config->meta->sites;
// exit(var_dump($listref[3]));
}
public function contactAction()
{
$session = Zend_Registry::get('session');
$translate = Zend_Registry::get('translate');
$this->_helper->layout()->setLayout('main');
$this->view->langue = $session->lang;
$this->view->bodyclass = "";
$this->view->TitrePage = $translate->_("nomsite").", ".$translate->_("Label_contact");
}
public function mentionsAction()
{
$session = Zend_Registry::get('session');
$translate = Zend_Registry::get('translate');
$this->_helper->layout()->setLayout('main');
$this->view->langue = $session->lang;
$this->view->bodyclass = "";
}
public function equipeAction()
{
$session = Zend_Registry::get('session');
$translate = Zend_Registry::get('translate');
$this->view->ln = $session->lang;
$this->_helper->layout()->setLayout('main');
$this->view->equipe = Data::listEquipe();
// exit(var_dump($listref[3]));
}
public function personneAction()
{
$session = Zend_Registry::get('session');
$translate = Zend_Registry::get('translate');
$this->_helper->layout()->setLayout('main');
$nom = $this->_request->getParam('nom');
$prenom = $this->_request->getParam('prenom');
$this->view->prenom = $prenom;
$this->view->nom = $nom;
$this->view->nl = $session->lang;
$listper = Data::getpersonne2($nom, $prenom);
$this->view->listper = $listper;
$this->view->TitrePage = $this->view->TitrePage."".$listper[0]["prenom"]." ".$listper[0]["nom"]." - ".$listper[0]["fonction"];
//$this->view->DescPage = $config->meta->description;
/*
$path = $listper["parametres"]["path"];
$this->view->photo = $listper["portrait"]["projets"]["contenu"]["elements"];
$config = new Zend_Config_Xml($path.'parametres.xml', "data".$session->lang);
$this->view->TitrePage = $this->view->TitrePage."".$config->meta->title;
$this->view->altportait = $config->meta->title;
$this->view->DescPage = $config->meta->description;
$this->view->texte = $config->meta->texte;
$this->view->sites = $config->meta->sites;
*/
}
}