<?php
-class Bootstrap extends CubeIT_Bootstrap {
-
- protected function _initMinimum() {
- parent::_initMinimum();
- // If a project with html display (don't activate by default for web services apps)
- $this->bootstrap('doctype');
- $this->bootstrap('scripts');
- }
-
- /**
- *
- * @return array
- */
- public function getCMSTemplates() {
- $templates['texte'] = 'Texte';
- $templates['fonctionnalites'] = 'Fonctionnalités générales';
- $templates['fonctionnalitessub'] = 'Détail fonctionnalité';
- $templates['exemples'] = 'Exemples';
- $templates['exemplessub'] = 'Exemples (niveau 2)';
- $templates['contact'] = 'Contact';
- $templates['landingcampaign'] = 'Landing Campagne (Intro + formulaire)';
- $templates['agences'] = 'Agences';
- $templates['faq'] = 'FAQ';
- $templates['blog'] = 'Blog';
- $templates = array_merge($templates, parent::getCMSTemplates());
- return $templates;
- }
-
- protected function _makeNavigationOnePage(&$navigation, $r, $t, $isAdmin, $locale = false) {
+class Bootstrap extends CubeIT_Bootstrap
+{
+
+ protected function _initMinimum()
+ {
+ parent::_initMinimum();
+ // If a project with html display (don't activate by default for web services apps)
+ $this->bootstrap('doctype');
+ $this->bootstrap('scripts');
+ }
+
+ /**
+ *
+ * @return array
+ */
+ public function getCMSTemplates()
+ {
+ $templates['texte'] = 'Texte';
+ $templates['fonctionnalites'] = 'Fonctionnalités générales';
+ $templates['fonctionnalitessub'] = 'Détail fonctionnalité';
+ $templates['exemples'] = 'Exemples';
+ $templates['exemplessub'] = 'Exemples (niveau 2)';
+ $templates['contact'] = 'Contact';
+ $templates['landingcampaign'] = 'Landing Campagne (Intro + formulaire)';
+ $templates['agences'] = 'Agences';
+ $templates['faq'] = 'FAQ';
+ $templates['blog'] = 'Blog';
+ $templates = array_merge($templates, parent::getCMSTemplates());
+ return $templates;
+ }
+
+ protected function _makeNavigationOnePage(&$navigation, $r, $t, $isAdmin, $locale = false)
+ {
$page = parent::_makeNavigationOnePage($navigation, $r, $t, $isAdmin, $locale);
if (!$page) return;
}
// URL template used for blog pages
- public static function getBlogPostURLTemplate() {
+ public static function getBlogPostURLTemplate()
+ {
return 'blog/%title%';
}
/* @param CubeIT_Navigation_Page_Locale $page */
- protected function addBlogPages($page, $locale, $isAdmin) {
+ protected function addBlogPages($page, $locale, $isAdmin)
+ {
//$datas = $this->getCMSDatasOfNavigationPage($page);
// How the URLs should be formed for the news articles
$p = new CubeIT_Navigation_Page_Locale();
$p->setController('Blogpost');
- $p->setId($locale .'/blog/'. $r->id);
+ $p->setId($page->getId() . '/' . $r->id);
$p->setAutoUri($r, $URL_template, $locale);
$p->setSitemap($online);
$p->setTitle($pageTitle);
$p->setOnline($online);
$p->setDomain($page->getDomain());
$p->setLabel($pageTitle);
+ $p->setVisible(false);
$page->addPage($p);
}
}
- public function _initRouter($initCms = true, $standard = true) {
- profile(__FILE__, __LINE__, 'Init Router');
- $router = parent::_initRouter($initCms, $standard);
- $router->addStaticRoute('15000', 'landing', 'quinzemille');
-
- return $router;
- }
-
- public function handleRedirections($req) {
- profile(__FILE__, __LINE__, 'Handle redirection');
-
- $path = explode('/', trim($req->getParam('page', '/'), '/'));
-
- if ($path[0] == 'fr' || $path[0] == 'en') {
- $locale = $path[0];
- $domain = $this->getOpt('locales.' . $path[0]);
- } else {
- return false;
- }
- array_shift($path);
-
- $path = implode('/', $path);
-
- // Si un des cas ci-dessus
- if (isset($name)) {
- $nav = $this->getNavigation()->getLocaleContainer($locale);
- $page = $nav->findOneBy('name', $name);
- if ($page !== null) {
- return $page->getHref();
- }
- }
- // Autres redirections
-
- $map = array();
- $map['fr'] = array(
- 'Questions-reponses' => 'fonctionnalites',
- 'Presentation-fonctionnalites-services' => 'fonctionnalites',
- 'Demande-de-devis' => 'contact',
- 'Revendeurs' => 'agences',
- 'References' => 'exemples',
- 'References/catalogues' => 'catalogue-interactif',
- 'References/rapports' => 'rapport-annuel',
- 'References/magazines' => 'magazine',
- 'References/brochures' => 'brochure',
- );
-
- $map['en'] = array(
- 'Faq' => 'fonctionnalites',
- 'Overview' => 'fonctionnalites',
- 'Quote-request' => 'contact',
- 'Resellers' => 'agences',
- 'Clients' => 'exemples',
- 'Clients/catalogues' => 'catalogue-interactif',
- 'Clients/rapports' => 'rapport-annuel',
- 'Clients/magazines' => 'magazine',
- 'Clients/brochures' => 'brochure',
- );
-
- if (!isset($map[$locale][$path]) && (strpos($path, 'References') === 0 || strpos($path, 'Clients') === 0)) {
- $nav = $this->getNavigation()->getLocaleContainer($locale);
- $page = $nav->findOneBy('name', 'exemples');
- if ($page != null) {
- return $page->getHref();
- }
- }
-
- if (isset($map[$locale][$path])) {
- $nav = $this->getNavigation()->getLocaleContainer($locale);
- $page = $nav->findOneBy('name', $map[$locale][$path]);
- if ($page != null) {
- return $page->getHref();
- }
- } else {
- $url = SITE_PROTOCOL . $domain . '/';
- }
-
- if (isset($url)) {
- return $url;
- }
-
- return false;
- }
-
-
- function __destroy() {
- endProfile();
- }
+ public function _initRouter($initCms = true, $standard = true)
+ {
+ profile(__FILE__, __LINE__, 'Init Router');
+ $router = parent::_initRouter($initCms, $standard);
+ $router->addStaticRoute('15000', 'landing', 'quinzemille');
+
+ return $router;
+ }
+
+ public function handleRedirections($req)
+ {
+ profile(__FILE__, __LINE__, 'Handle redirection');
+
+ $path = explode('/', trim($req->getParam('page', '/'), '/'));
+
+ if ($path[0] == 'fr' || $path[0] == 'en') {
+ $locale = $path[0];
+ $domain = $this->getOpt('locales.' . $path[0]);
+ } else {
+ return false;
+ }
+ array_shift($path);
+
+ $path = implode('/', $path);
+
+ // Si un des cas ci-dessus
+ if (isset($name)) {
+ $nav = $this->getNavigation()->getLocaleContainer($locale);
+ $page = $nav->findOneBy('name', $name);
+ if ($page !== null) {
+ return $page->getHref();
+ }
+ }
+ // Autres redirections
+
+ $map = array();
+ $map['fr'] = array(
+ 'Questions-reponses' => 'fonctionnalites',
+ 'Presentation-fonctionnalites-services' => 'fonctionnalites',
+ 'Demande-de-devis' => 'contact',
+ 'Revendeurs' => 'agences',
+ 'References' => 'exemples',
+ 'References/catalogues' => 'catalogue-interactif',
+ 'References/rapports' => 'rapport-annuel',
+ 'References/magazines' => 'magazine',
+ 'References/brochures' => 'brochure',
+ );
+
+ $map['en'] = array(
+ 'Faq' => 'fonctionnalites',
+ 'Overview' => 'fonctionnalites',
+ 'Quote-request' => 'contact',
+ 'Resellers' => 'agences',
+ 'Clients' => 'exemples',
+ 'Clients/catalogues' => 'catalogue-interactif',
+ 'Clients/rapports' => 'rapport-annuel',
+ 'Clients/magazines' => 'magazine',
+ 'Clients/brochures' => 'brochure',
+ );
+
+ if (!isset($map[$locale][$path]) && (strpos($path, 'References') === 0 || strpos($path, 'Clients') === 0)) {
+ $nav = $this->getNavigation()->getLocaleContainer($locale);
+ $page = $nav->findOneBy('name', 'exemples');
+ if ($page != null) {
+ return $page->getHref();
+ }
+ }
+
+ if (isset($map[$locale][$path])) {
+ $nav = $this->getNavigation()->getLocaleContainer($locale);
+ $page = $nav->findOneBy('name', $map[$locale][$path]);
+ if ($page != null) {
+ return $page->getHref();
+ }
+ } else {
+ $url = SITE_PROTOCOL . $domain . '/';
+ }
+
+ if (isset($url)) {
+ return $url;
+ }
+
+ return false;
+ }
+
+
+ function __destroy()
+ {
+ endProfile();
+ }
}