From 8ecf481c795584a261869d2269422b99c5418570 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Thu, 9 Jan 2025 16:11:52 +0100 Subject: [PATCH] wait #7249 @1.5 --- framework/application/Bootstrap.php | 502 +++++++++--------- .../application/forms/CMS/Expertises.php | 23 - framework/application/forms/CMS/Services.php | 17 + .../application/forms/CMS/Twocolumns.php | 6 +- .../application/views/helpers/TextLayer.php | 4 +- .../views/scripts/templates/expertises.phtml | 12 - .../views/scripts/templates/services.phtml | 10 + less/02-utilities.less | 5 + less/common.less | 10 + 9 files changed, 303 insertions(+), 286 deletions(-) delete mode 100644 framework/application/forms/CMS/Expertises.php create mode 100644 framework/application/forms/CMS/Services.php delete mode 100644 framework/application/views/scripts/templates/expertises.phtml create mode 100644 framework/application/views/scripts/templates/services.phtml diff --git a/framework/application/Bootstrap.php b/framework/application/Bootstrap.php index 693bc39..849b21b 100644 --- a/framework/application/Bootstrap.php +++ b/framework/application/Bootstrap.php @@ -1,250 +1,260 @@ bootstrap('doctype'); - $this->bootstrap('scripts'); - } - - protected function _initRouter($initCms = true, $standard = true) { - $router = parent::_initRouter($initCms, $standard); - $router->addStandardRoute('rss'); - return $router; - } - - protected function _initAcl() { - $acl = parent::_initAcl(); - return $acl; - } - - protected function _makeNavigationOnePage(&$navigation, $r, $t, $isAdmin, $locale = false) { - $page = parent::_makeNavigationOnePage($navigation, $r, $t, $isAdmin, $locale); - - if (!$page) { - return; - } - - if ($page->getTemplate() == 'casestudies') { - $this->addStudiesPages($page, $locale, $isAdmin); - } - - if ($page->getTemplate() == 'realisations') { - $this->addRealisationsPages($page, $locale, $isAdmin); - } - } - - /** - * - * @param CubeIT_Navigation_Page_Locale $page - */ - protected function addRealisationsPages($page, $locale, $isAdmin) { - - $datas = $this->getCMSDatasOfNavigationPage($page); - $db = Zend_Db_Table::getDefaultAdapter(); - $s = $db->select()->from('realisations') - ->order('id ASC'); - $q = $s->query(); - - while ($r = $q->fetch()) { - $r = CubeIT_Util_Cms::unserialize($r, $locale); - if ($r->titre == '') { - continue; - } - $online = boolval($r->online); - if (!$online && !$isAdmin) { - continue; - } - - $p = new CubeIT_Navigation_Page_Locale(); - $p->setController('Realisations'); - $p->setId($page->getId() . '/' . $r->id); - $p->setUri(Cubedesigners_Util::generateAutoUri($r, $datas['seourl_rea'], $page->getLocale())); - $p->setSitemap($online); - $p->setEditable(false); - $p->setOnline($online); - $p->setDomain($page->getDomain()); - $p->setLabel($r->titre); - $p->setTitle($r->titre); - $p->setParams(array('realisation_id' => $r->id)); - $page->addPage($p); - } - } - - /** - * - * @param CubeIT_Navigation_Page_Locale $page - */ - protected function addStudiesPages($page, $locale, $isAdmin) { - $datas = $this->getCMSDatasOfNavigationPage($page); - $db = Zend_Db_Table::getDefaultAdapter(); - $s = $db->select()->from('casestudies') - ->order('id ASC'); - $q = $s->query(); - - while ($r = $q->fetch()) { - $r = CubeIT_Util_Cms::unserialize($r, $locale); - if ($r->titre == '') { - continue; - } - $online = boolval($r->online); - if (!$online && !$isAdmin) { - continue; - } - - $p = new CubeIT_Navigation_Page_Locale(); - $p->setController('Studies'); - $p->setId($page->getId() . '/' . $r->id); - $p->setAutoUri($r, $datas['seourl_stu'], $page->getLocale()); - $p->setSitemap($online); - $p->setTitle($r->titre); - $p->setEditable(false); - $p->setParams(array('casestudy_id' => $r->id)); - $p->setOnline($online); - $p->setDomain($page->getDomain()); - $p->setLabel($r->titre); - $page->addPage($p); - } - } - - /** - * - * @return array - */ - public function getCMSTemplates() { - - $templates = parent::getCMSTemplates(); - - $templates['text'] = 'Text page'; - $templates['agence'] = "About us"; - $templates['realisations'] = 'Réalisations'; - $templates['Etudes de cas'] = array('casestudies' => 'Accueil des études de cas', 'casestudies_detail' => 'Détail d\'étude de cas'); - $templates['Expertises'] = array('expertises' => 'Accueil de la rubrique Expertises', - 'expertise' => 'Page de détail d\'expertise'); - $templates['news'] = 'News'; - $templates['contact'] = 'Contact'; - - return $templates; - } - - /** - * - * @param Zend_Controller_Request_Http $req - * @return boolean|string - */ - public function handleRedirections($req) { - $res = parent::handleRedirections($req); - if ($res !== false) { - - return $res; - } - - $path = trim($req->getPathInfo(), '/ '); - $e = explode('/', $path); - $locale = array_shift($e); - fb($locale); - - $res = '/'; - - - if (!count($e)) { - return $res; - } - - if ($locale == 'references_web') { - $res .= 'Portfolio'; - return $res; - } - - if ($locale != 'fr' && $locale != 'en') { - return false; - } - - if ($locale == 'fr' && $_SERVER['HTTP_HOST'] == 'www.cubedesigners.com') { - return 'http://www.cubedesigners.fr/' . $_SERVER['REQUEST_URI']; - } - if ($locale == 'en' && $_SERVER['HTTP_HOST'] == 'www.cubedesigners.fr') { - return 'http://www.cubedesigners.com/' . $_SERVER['REQUEST_URI']; - } - - if (count($e) == 1) { - $u = $e[0]; - if ($u == 'en') { - return $res; - } - if ($u == '1-Sites-internet') { - $res .= 'Projets-Web'; - } elseif ($u == '2-Design-graphique') { - $res .= 'Graphisme'; - } elseif ($u == '3-Design-industriel') { - $res .= 'Design-industriel'; - } elseif ($u == '4-Multimedia-Jeux') { - $res .= 'Multimedia'; - } elseif ($u == '5-Films-Animation') { - $res .= 'Multimedia'; - } elseif ($u == '6-Applications-mobiles') { - $res .= 'Projets-Web'; - } elseif ($u == '7-En-attente') { - $res .= 'Graphisme'; - } elseif ($u == '1-Websites') { - $res .= 'Web-projects'; - } elseif ($u == '2-Graphic-design') { - $res .= 'Graphical-design'; - } elseif ($u == '3-Industrial-design') { - $res .= 'Industrial-design'; - } elseif ($u == '4-Multimedia-Games') { - $res .= 'Multimedia'; - } elseif ($u == '5-Motion-Graphics') { - $res .= 'Multimedia'; - } elseif ($u == '6-Mobile-applications') { - $res .= 'Web-projects'; - } elseif ($u == '7-Waiting') { - $res .= 'Graphical-design'; - } - - return $res; - } - - if (count($e) == 3) { - if ($e[0] == 'Sites-internet') { - $e[0] = 'Site-Web'; - } elseif ($e[0] == 'Multimedia-Jeux' || $e[0] == 'Multimedia-Games') { - $e[0] = 'Multimedia'; - } elseif ($e[0] == 'Motion-Graphics') { - $e[0] = 'Motion-graphics'; - } elseif ($e[0] == 'Graphic-design') { - $e[0] = 'Graphic-Design'; - } elseif ($e[0] == 'Mobile-applications') { - $e[0] = 'Websites'; - } - - // Projects - /// Mobile-applications/Heredis/114-Heredis-App => Applications-mobiles/Heredis-Heredis-App - $ee = explode('-', $e[2], 2); - $id = array_shift($ee); - /*$p=$this->getNavigation()->findOneBy('id',$locale.'/3/'.$id); - if(null!==$p){ - //return $p->getHref(); - }*/ - - $res .= $e[0] . '/' . $e[1] . '-' . implode('-', $ee); - return $res; - } - - return false; - } - - public function run() { - // run have to be the last call of bootstrap - parent::run(); - } - - function __destroy() { - endProfile(); - } +class Bootstrap extends CubeIT_Bootstrap +{ + + // protected $_cacheNavigation = false; + + 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'); + } + + protected function _initRouter($initCms = true, $standard = true) + { + $router = parent::_initRouter($initCms, $standard); + $router->addStandardRoute('rss'); + return $router; + } + + protected function _initAcl() + { + $acl = parent::_initAcl(); + return $acl; + } + + protected function _makeNavigationOnePage(&$navigation, $r, $t, $isAdmin, $locale = false) + { + $page = parent::_makeNavigationOnePage($navigation, $r, $t, $isAdmin, $locale); + + if (!$page) { + return; + } + + if ($page->getTemplate() == 'casestudies') { + $this->addStudiesPages($page, $locale, $isAdmin); + } + + if ($page->getTemplate() == 'realisations') { + $this->addRealisationsPages($page, $locale, $isAdmin); + } + } + + /** + * + * @param CubeIT_Navigation_Page_Locale $page + */ + protected function addRealisationsPages($page, $locale, $isAdmin) + { + + $datas = $this->getCMSDatasOfNavigationPage($page); + $db = Zend_Db_Table::getDefaultAdapter(); + $s = $db->select()->from('realisations') + ->order('id ASC'); + $q = $s->query(); + + while ($r = $q->fetch()) { + $r = CubeIT_Util_Cms::unserialize($r, $locale); + if ($r->titre == '') { + continue; + } + $online = boolval($r->online); + if (!$online && !$isAdmin) { + continue; + } + + $p = new CubeIT_Navigation_Page_Locale(); + $p->setController('Realisations'); + $p->setId($page->getId() . '/' . $r->id); + $p->setUri(Cubedesigners_Util::generateAutoUri($r, $datas['seourl_rea'], $page->getLocale())); + $p->setSitemap($online); + $p->setEditable(false); + $p->setOnline($online); + $p->setDomain($page->getDomain()); + $p->setLabel($r->titre); + $p->setTitle($r->titre); + $p->setParams(array('realisation_id' => $r->id)); + $page->addPage($p); + } + } + + /** + * + * @param CubeIT_Navigation_Page_Locale $page + */ + protected function addStudiesPages($page, $locale, $isAdmin) + { + $datas = $this->getCMSDatasOfNavigationPage($page); + $db = Zend_Db_Table::getDefaultAdapter(); + $s = $db->select()->from('casestudies') + ->order('id ASC'); + $q = $s->query(); + + while ($r = $q->fetch()) { + $r = CubeIT_Util_Cms::unserialize($r, $locale); + if ($r->titre == '') { + continue; + } + $online = boolval($r->online); + if (!$online && !$isAdmin) { + continue; + } + + $p = new CubeIT_Navigation_Page_Locale(); + $p->setController('Studies'); + $p->setId($page->getId() . '/' . $r->id); + $p->setAutoUri($r, $datas['seourl_stu'], $page->getLocale()); + $p->setSitemap($online); + $p->setTitle($r->titre); + $p->setEditable(false); + $p->setParams(array('casestudy_id' => $r->id)); + $p->setOnline($online); + $p->setDomain($page->getDomain()); + $p->setLabel($r->titre); + $page->addPage($p); + } + } + + /** + * + * @return array + */ + public function getCMSTemplates() + { + + $templates = parent::getCMSTemplates(); + + $templates['text'] = 'Text page'; + $templates['agence'] = "About us"; + $templates['realisations'] = 'Réalisations'; + $templates['Etudes de cas'] = array('casestudies' => 'Accueil des études de cas', 'casestudies_detail' => 'Détail d\'étude de cas'); + $templates['services'] = 'Services'; + $templates['news'] = 'News'; + $templates['contact'] = 'Contact'; + + return $templates; + } + + /** + * + * @param Zend_Controller_Request_Http $req + * @return boolean|string + */ + public function handleRedirections($req) + { + $res = parent::handleRedirections($req); + if ($res !== false) { + + return $res; + } + + $path = trim($req->getPathInfo(), '/ '); + $e = explode('/', $path); + $locale = array_shift($e); + fb($locale); + + $res = '/'; + + + if (!count($e)) { + return $res; + } + + if ($locale == 'references_web') { + $res .= 'Portfolio'; + return $res; + } + + if ($locale != 'fr' && $locale != 'en') { + return false; + } + + if ($locale == 'fr' && $_SERVER['HTTP_HOST'] == 'www.cubedesigners.com') { + return 'http://www.cubedesigners.fr/' . $_SERVER['REQUEST_URI']; + } + if ($locale == 'en' && $_SERVER['HTTP_HOST'] == 'www.cubedesigners.fr') { + return 'http://www.cubedesigners.com/' . $_SERVER['REQUEST_URI']; + } + + if (count($e) == 1) { + $u = $e[0]; + if ($u == 'en') { + return $res; + } + if ($u == '1-Sites-internet') { + $res .= 'Projets-Web'; + } elseif ($u == '2-Design-graphique') { + $res .= 'Graphisme'; + } elseif ($u == '3-Design-industriel') { + $res .= 'Design-industriel'; + } elseif ($u == '4-Multimedia-Jeux') { + $res .= 'Multimedia'; + } elseif ($u == '5-Films-Animation') { + $res .= 'Multimedia'; + } elseif ($u == '6-Applications-mobiles') { + $res .= 'Projets-Web'; + } elseif ($u == '7-En-attente') { + $res .= 'Graphisme'; + } elseif ($u == '1-Websites') { + $res .= 'Web-projects'; + } elseif ($u == '2-Graphic-design') { + $res .= 'Graphical-design'; + } elseif ($u == '3-Industrial-design') { + $res .= 'Industrial-design'; + } elseif ($u == '4-Multimedia-Games') { + $res .= 'Multimedia'; + } elseif ($u == '5-Motion-Graphics') { + $res .= 'Multimedia'; + } elseif ($u == '6-Mobile-applications') { + $res .= 'Web-projects'; + } elseif ($u == '7-Waiting') { + $res .= 'Graphical-design'; + } + + return $res; + } + + if (count($e) == 3) { + if ($e[0] == 'Sites-internet') { + $e[0] = 'Site-Web'; + } elseif ($e[0] == 'Multimedia-Jeux' || $e[0] == 'Multimedia-Games') { + $e[0] = 'Multimedia'; + } elseif ($e[0] == 'Motion-Graphics') { + $e[0] = 'Motion-graphics'; + } elseif ($e[0] == 'Graphic-design') { + $e[0] = 'Graphic-Design'; + } elseif ($e[0] == 'Mobile-applications') { + $e[0] = 'Websites'; + } + + // Projects + /// Mobile-applications/Heredis/114-Heredis-App => Applications-mobiles/Heredis-Heredis-App + $ee = explode('-', $e[2], 2); + $id = array_shift($ee); + /*$p=$this->getNavigation()->findOneBy('id',$locale.'/3/'.$id); + if(null!==$p){ + //return $p->getHref(); + }*/ + + $res .= $e[0] . '/' . $e[1] . '-' . implode('-', $ee); + return $res; + } + + return false; + } + + public function run() + { + // run have to be the last call of bootstrap + parent::run(); + } + + function __destroy() + { + endProfile(); + } } diff --git a/framework/application/forms/CMS/Expertises.php b/framework/application/forms/CMS/Expertises.php deleted file mode 100644 index 42aecfa..0000000 --- a/framework/application/forms/CMS/Expertises.php +++ /dev/null @@ -1,23 +0,0 @@ -setLabel('Citation'); - $citation->setAttrib('rows', 3); - $this->addElement($citation); - - $citation_author = new Zend_Form_Element_Text('citation_author'); - $citation_author->setLabel('Citation Author'); - $this->addElement($citation_author); - - $expertises = new Cubedesigners_Form_CMS_Sub_Home_Expertises(); - $expertises->setLegend('Domaines d\'expertises'); - $this->addSubForm($expertises, 'expertises'); - } - -} diff --git a/framework/application/forms/CMS/Services.php b/framework/application/forms/CMS/Services.php new file mode 100644 index 0000000..8df93c0 --- /dev/null +++ b/framework/application/forms/CMS/Services.php @@ -0,0 +1,17 @@ +setLabel('Picture'); + $this->addElement($photo); + + $titre = new CubeIT_Form_Element_Markitup('services'); + $titre->setLabel('Our services'); + $this->addElement($titre); + } + +} diff --git a/framework/application/forms/CMS/Twocolumns.php b/framework/application/forms/CMS/Twocolumns.php index 50ff278..c6d79aa 100644 --- a/framework/application/forms/CMS/Twocolumns.php +++ b/framework/application/forms/CMS/Twocolumns.php @@ -7,15 +7,15 @@ class Cubedesigners_Form_CMS_Twocolumns extends Cubedesigners_Form_CMS { parent::init(); $titre = new CubeIT_Form_Element_Markitup('titre'); - $titre->setLabel('Titre'); + $titre->setLabel('Title'); $this->addElement($titre); $left = new CubeIT_Form_Element_Markitup('colonnegauche'); - $left->setLabel('Colonne gauche'); + $left->setLabel('Left column'); $this->addElement($left); $right = new CubeIT_Form_Element_Markitup('colonnedroite'); - $right->setLabel('Colonne droite'); + $right->setLabel('Right column'); $this->addElement($right); } diff --git a/framework/application/views/helpers/TextLayer.php b/framework/application/views/helpers/TextLayer.php index 71644a5..61c5325 100644 --- a/framework/application/views/helpers/TextLayer.php +++ b/framework/application/views/helpers/TextLayer.php @@ -3,10 +3,10 @@ class Cubedesigners_View_Helper_TextLayer extends Zend_View_Helper_Abstract { - public function textLayer($text) + public function textLayer($text,$class="") { $this->view->headLink()->appendStylesheet('/less/twocols.less'); - $res = '
'; + $res = '
'; $res .= '
'; // Replacing
tags with normal line breaks to allow for more flexible styling via CSS white-space diff --git a/framework/application/views/scripts/templates/expertises.phtml b/framework/application/views/scripts/templates/expertises.phtml deleted file mode 100644 index d56e1e4..0000000 --- a/framework/application/views/scripts/templates/expertises.phtml +++ /dev/null @@ -1,12 +0,0 @@ -headScript()->addScriptAndStyle('expertises'); -echo $this->twocols(); - -if(!empty($this->citation)) { - $citation_author = isset($this->citation_author) ? $this->htmlElement($this->citation_author, 'div', array('class' => 'citation-author')) : ''; - $citation = $this->htmlElement($this->citation . $citation_author, 'blockquote'); - echo $this->htmlElement($citation, 'div', array('class' => 'citation')); -} - -echo $this->liste($this->expertises, true, array('id' => 'expertises')); diff --git a/framework/application/views/scripts/templates/services.phtml b/framework/application/views/scripts/templates/services.phtml new file mode 100644 index 0000000..06bf638 --- /dev/null +++ b/framework/application/views/scripts/templates/services.phtml @@ -0,0 +1,10 @@ +headScript()->addScriptAndStyle('expertises'); +echo $this->twocols(); + +?> +
imageSlideshowContinuous($this->photo, 650, array(), array('arrowspermanent' => 1)); ?>
+textLayer($this->services,'blue pb-4vw pt-4vw'); +?> \ No newline at end of file diff --git a/less/02-utilities.less b/less/02-utilities.less index 1d8651f..3fe5654 100644 --- a/less/02-utilities.less +++ b/less/02-utilities.less @@ -59,6 +59,11 @@ .pr-3vw { .constrain(padding-right, 3vw); } .pr-4vw { .constrain(padding-right, 4vw); } +.pt-2vw { .constrain(padding-top, 2vw); } +.pt-3vw { .constrain(padding-top, 3vw); } +.pt-4vw { .constrain(padding-top, 4vw); } + + // Text Colours .text-white { color: #fff; } diff --git a/less/common.less b/less/common.less index 534a1aa..6a790e4 100644 --- a/less/common.less +++ b/less/common.less @@ -208,6 +208,15 @@ a { } +.content { + &.blue { + background-color: @blue; + color: #fff; + margin:0; + + } +} + // Standard select dropdown .form-select { appearance: none; @@ -223,5 +232,6 @@ a { img { width: 100%; height: auto; + display: block; } } \ No newline at end of file -- 2.39.5