From f2822722e5d938420fbd5ac066db042a9b4f6185 Mon Sep 17 00:00:00 2001 From: "bruno@cubedesigners.com" Date: Mon, 17 Feb 2014 16:34:07 +0000 Subject: [PATCH] --- framework/application/Bootstrap.php | 348 +++++++++--------- .../CMS/Sub/Realisations/Realisations.php | 99 ++--- .../views/helpers/CasestudiesDetail.php | 131 +++---- .../views/helpers/CasestudiesList.php | 79 ++-- .../views/helpers/RealisationsList.php | 73 ++-- .../views/scripts/templates/casestudies.phtml | 7 +- .../scripts/templates/realisations.phtml | 1 - less/realisations.less | 8 +- 8 files changed, 386 insertions(+), 360 deletions(-) diff --git a/framework/application/Bootstrap.php b/framework/application/Bootstrap.php index fe6c5a0..3d5cd78 100644 --- a/framework/application/Bootstrap.php +++ b/framework/application/Bootstrap.php @@ -2,184 +2,188 @@ 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'); + 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 _initScripts() { + parent::_initScripts(); + $this->getView()->headLink()->appendStylesheet('/css/fonts/fonts.css'); + $this->getView()->headScript()->addTagHandler(); + } + + protected function _initRouter($initCms = true) { + $router = parent::_initRouter($initCms); + return $router; + } + + /** + * + * @param \Doctrine\DBAL\Schema\Schema $schema + * @param array $options + */ + protected function _defineSchema(&$schema, $options) { + parent::_defineSchema($schema, $options); + + $user = $schema->createTable('user'); + $user->addColumn('id', 'integer', array('unsigned' => true, 'autoincrement' => true)); + $user->setPrimaryKey(array('id')); + $user->addColumn('username', 'string', array('length' => 64)); + $user->addUniqueIndex(array('username')); + $user->addColumn('password', 'string', array('length' => 255)); + $user->addColumn('role', 'string', array('length' => 32)); + + $tags = $schema->createTable('tags'); + $tags->addColumn('id', 'integer', array('unsigned' => true, 'autoincrement' => true)); + $tags->setPrimaryKey(array('id')); + $tags->addColumn('name', 'string', array('length' => 64)); + + $casestudies = $schema->createTable('casestudies'); + $casestudies->addColumn('id', 'integer', array('unsigned' => true, 'autoincrement' => true)); + $casestudies->setPrimaryKey(array('id')); + $casestudies->addColumn('online', 'boolean'); + $casestudies->addColumn('titre', 'text'); + $casestudies->addColumn('description', 'text'); + $casestudies->addColumn('url', 'text'); + $casestudies->addColumn('visuel', 'string', array('length' => 128)); + $casestudies->addColumn('visuel_detail', 'string', array('length' => 128)); + $casestudies->addColumn('legende', 'text'); + $casestudies->addColumn('couleur', 'text'); + $casestudies->addColumn('blocs', 'text'); + $casestudies->addColumn('tags', 'text'); + + + $realisations = $schema->createTable('realisations'); + $realisations->addColumn('id', 'integer', array('unsigned' => true, 'autoincrement' => true)); + $realisations->setPrimaryKey(array('id')); + $realisations->addColumn('online', 'boolean'); + $realisations->addColumn('titre', 'text'); + $realisations->addColumn('legende', 'text'); + $realisations->addColumn('agence', 'text'); + $realisations->addColumn('description', 'text'); + $realisations->addColumn('url', 'text'); + $realisations->addColumn('visuel', 'string', array('length' => 128)); + $realisations->addColumn('visuel_detail', 'text'); + $realisations->addColumn('tags', 'text'); + } + + 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; } - protected function _initScripts() { - parent::_initScripts(); - $this->getView()->headLink()->appendStylesheet('/css/fonts/fonts.css'); - $this->getView()->headScript()->addTagHandler(); + if ($page->getTemplate() == 'casestudies') { + $this->addStudiesPages($page, $locale); } - protected function _initRouter($initCms = true) { - $router = parent::_initRouter($initCms); - return $router; + if ($page->getTemplate() == 'realisations') { + $this->addRealisationsPages($page, $locale); } - - /** - * - * @param \Doctrine\DBAL\Schema\Schema $schema - * @param array $options - */ - protected function _defineSchema(&$schema, $options) { - parent::_defineSchema($schema, $options); - - $user = $schema->createTable('user'); - $user->addColumn('id', 'integer', array('unsigned' => true, 'autoincrement' => true)); - $user->setPrimaryKey(array('id')); - $user->addColumn('username', 'string', array('length' => 64)); - $user->addUniqueIndex(array('username')); - $user->addColumn('password', 'string', array('length' => 255)); - $user->addColumn('role', 'string', array('length' => 32)); - - $tags = $schema->createTable('tags'); - $tags->addColumn('id', 'integer', array('unsigned' => true, 'autoincrement' => true)); - $tags->setPrimaryKey(array('id')); - $tags->addColumn('name', 'string', array('length' => 64)); - - $casestudies = $schema->createTable('casestudies'); - $casestudies->addColumn('id', 'integer', array('unsigned' => true, 'autoincrement' => true)); - $casestudies->setPrimaryKey(array('id')); - $casestudies->addColumn('online', 'boolean'); - $casestudies->addColumn('titre', 'text'); - $casestudies->addColumn('description', 'text'); - $casestudies->addColumn('url', 'text'); - $casestudies->addColumn('visuel', 'string', array('length' => 128)); - $casestudies->addColumn('visuel_detail', 'string', array('length' => 128)); - $casestudies->addColumn('legende', 'text'); - $casestudies->addColumn('couleur', 'text'); - $casestudies->addColumn('blocs', 'text'); - $casestudies->addColumn('tags', 'text'); - - - $realisations = $schema->createTable('realisations'); - $realisations->addColumn('id', 'integer', array('unsigned' => true, 'autoincrement' => true)); - $realisations->setPrimaryKey(array('id')); - $realisations->addColumn('titre', 'text'); - $realisations->addColumn('legende', 'text'); - $realisations->addColumn('agence', 'text'); - $realisations->addColumn('description', 'text'); - $realisations->addColumn('url', 'text'); - $realisations->addColumn('visuel', 'string', array('length' => 128)); - $realisations->addColumn('visuel_detail', 'text'); - $realisations->addColumn('tags', 'text'); - } - - 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); - } - - if ($page->getTemplate() == 'realisations') { - $this->addRealisationsPages($page, $locale); - } - } - - /** - * - * @param CubeIT_Navigation_Page_Locale $page - */ - protected function addRealisationsPages($page, $locale) { - - $datas = $this->getCMSDatasOfNavigationPage($page); - //fb($datas); - $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; - } - $p = new CubeIT_Navigation_Page_Locale(); - $p->setController('Realisations'); - $p->setId($page->getId() . '/' . $r->id); - $p->setAutoUri($r, $datas['seourl_rea'], $page->getLocale()); - $p->setSitemap(true); - $p->setEditable(false); - $p->setDomain($page->getDomain()); - $p->setLabel($r->titre); - $p->setParams(array('realisation_id' => $r->id)); - $page->addPage($p); - } + } + + /** + * + * @param CubeIT_Navigation_Page_Locale $page + */ + protected function addRealisationsPages($page, $locale) { + + $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; + } + $p = new CubeIT_Navigation_Page_Locale(); + $p->setController('Realisations'); + $p->setId($page->getId() . '/' . $r->id); + $p->setAutoUri($r, $datas['seourl_rea'], $page->getLocale()); + $p->setSitemap(true); + $p->setEditable(false); + + if ($r->online != 1) + $p->setOnline(false); + + $p->setDomain($page->getDomain()); + $p->setLabel($r->titre); + $p->setParams(array('realisation_id' => $r->id)); + $page->addPage($p); } - - /** - * - * @param CubeIT_Navigation_Page_Locale $page - */ - protected function addStudiesPages($page, $locale) { - $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; - } - $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(true); - $p->setEditable(false); - $p->setParams(array('casestudy_id' => $r->id)); - - if ($r->online != 1) - $p->setOnline(false); - - $p->setDomain($page->getDomain()); - $p->setLabel($r->titre); - $page->addPage($p); - } - } - - /** - * - * @return array - */ - public function getCMSTemplates() { - - $templates = parent::getCMSTemplates(); - - $templates['Agence'] = array("agence" => "L'agence"); - $templates['Realisations'] = array('realisations' => 'Réalisations'); - $templates['Casestudies'] = array('casestudies' => 'Case-Studies'); - $templates['CasestudiesDetail'] = array('casestudies_detail' => 'Case-Studies (détail)'); - $templates['Expertises'] = array('expertises' => 'Expertises'); - $templates['Contact'] = array('contact' => 'Contact'); - $templates['Mentions'] = array('mentions' => 'Mentions légales'); - - return $templates; - } - - public function run() { - // run have to be the last call of bootstrap - parent::run(); - } - - function __destroy() { - endProfile(); + } + + /** + * + * @param CubeIT_Navigation_Page_Locale $page + */ + protected function addStudiesPages($page, $locale) { + $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; + } + $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(true); + $p->setEditable(false); + $p->setParams(array('casestudy_id' => $r->id)); + + if ($r->online != 1) + $p->setOnline(false); + + $p->setDomain($page->getDomain()); + $p->setLabel($r->titre); + $page->addPage($p); } + } + + /** + * + * @return array + */ + public function getCMSTemplates() { + + $templates = parent::getCMSTemplates(); + + $templates['Agence'] = array("agence" => "L'agence"); + $templates['Realisations'] = array('realisations' => 'Réalisations'); + $templates['Casestudies'] = array('casestudies' => 'Case-Studies'); + $templates['CasestudiesDetail'] = array('casestudies_detail' => 'Case-Studies (détail)'); + $templates['Expertises'] = array('expertises' => 'Expertises'); + $templates['Contact'] = array('contact' => 'Contact'); + $templates['Mentions'] = array('mentions' => 'Mentions légales'); + + return $templates; + } + + public function run() { + // run have to be the last call of bootstrap + parent::run(); + } + + function __destroy() { + endProfile(); + } } diff --git a/framework/application/forms/CMS/Sub/Realisations/Realisations.php b/framework/application/forms/CMS/Sub/Realisations/Realisations.php index ee31169..134b6e8 100644 --- a/framework/application/forms/CMS/Sub/Realisations/Realisations.php +++ b/framework/application/forms/CMS/Sub/Realisations/Realisations.php @@ -3,52 +3,59 @@ class Cubedesigners_Form_CMS_Sub_Realisations_Realisations extends CubeIT_Form_List { public function init() { - parent::init(); - $id = new CubeIT_Form_Element_Id(); - $this->addElement($id); - - $titre = new Zend_Form_Element_Text('titre'); - $titre->setLabel('Titre'); - $this->addElement($titre); - - $legende = new Zend_Form_Element_Text('legende'); - $legende->setLabel('Legende'); - $this->addElement($legende); - - $agence = new Zend_Form_Element_Text('agence'); - $agence->setLabel('Agence'); - $this->addElement($agence); - - $description = new CubeIT_Form_Element_Markitup_Basic('description'); - $description->setLabel('Description'); - $this->addElement($description); - - $url = new CubeIT_Form_Element_Url('url'); - $url->setLabel('URL du site'); - $this->addElement($url); - - $visuel = new CubeIT_Form_Element_File_Image('visuel'); - $visuel->setLabel('Visuel principal'); - $visuel->setMaxItems(1); - $this->addElement($visuel); - - $visuel_detail = new CubeIT_Form_Element_File_Image('visuel_detail'); - $visuel_detail->setLabel('Visuels du détail'); - $this->addElement($visuel_detail); - - $tags = new Cubedesigners_Form_Element_Tags('tags'); - $tags->setLabel('Tags'); - $this->addElement($tags); - - $bootstrap = Bootstrap::getInstance(); - $view = $bootstrap->getView(); - - $this->setListTitle('Réalisations') - ->setNewTitle('Créer une réalisation') - ->setEditTitle('Edition de la réalisation « $titre »') - ->setBaseTable('realisations') - ->setIdColumn('id') - ->setTitleColumn('titre'); + parent::init(); + + $isCompactTrad = false; + + $id = new CubeIT_Form_Element_Id(); + $this->addElement($id); + + $online = new Zend_Form_Element_Checkbox('online'); + $online->setLabel('En ligne'); + $this->addElement($online); + + $titre = new Zend_Form_Element_Text('titre'); + $titre->setLabel('Titre'); + $this->addElementLocalized($titre, $isCompactTrad); + + $legende = new Zend_Form_Element_Text('legende'); + $legende->setLabel('Legende'); + $this->addElementLocalized($legende, $isCompactTrad); + + $agence = new Zend_Form_Element_Text('agence'); + $agence->setLabel('Agence'); + $this->addElementLocalized($agence, $isCompactTrad); + + $description = new CubeIT_Form_Element_Markitup_Basic('description'); + $description->setLabel('Description'); + $this->addElementLocalized($description, $isCompactTrad); + + $url = new CubeIT_Form_Element_Url('url'); + $url->setLabel('URL du site'); + $this->addElementLocalized($url, $isCompactTrad); + + $visuel = new CubeIT_Form_Element_File_Image('visuel'); + $visuel->setLabel('Visuel principal'); + $visuel->setMaxItems(1); + $this->addElementLocalized($visuel, $isCompactTrad); + + $visuel_detail = new CubeIT_Form_Element_File_Image('visuel_detail'); + $visuel_detail->setLabel('Visuels du détail'); + $this->addElementLocalized($visuel_detail, $isCompactTrad); + + $tags = new Cubedesigners_Form_Element_Tags('tags'); + $tags->setLabel('Tags'); + $this->addElement($tags); + + $bootstrap = Bootstrap::getInstance(); + $view = $bootstrap->getView(); + + $this->setListTitle('Réalisations') + ->setNewTitle('Créer une réalisation') + ->setEditTitle('Edition de la réalisation « $titre »') + ->setBaseTable('realisations') + ->setIdColumn('id') + ->setTitleColumn('titre'); } } diff --git a/framework/application/views/helpers/CasestudiesDetail.php b/framework/application/views/helpers/CasestudiesDetail.php index 75f4fb1..9e9b1eb 100644 --- a/framework/application/views/helpers/CasestudiesDetail.php +++ b/framework/application/views/helpers/CasestudiesDetail.php @@ -4,94 +4,97 @@ class Cubedesigners_View_Helper_CasestudiesDetail extends Zend_View_Helper_Abstr public function CasestudiesDetail($studie) { - $visuel_detail = $this->view->imageProcess($studie->visuel_detail, $studie->titre, 980, 400); + $visuel_detail = $this->view->imageProcess($studie->visuel_detail, $studie->titre, 980, 400); - $res = '
'; - $res .= '
'; - $res .= '
' . $visuel_detail . '
'; + $res = '
'; + $res .= '
'; + $res .= '
' . $visuel_detail . '
'; - $res .= '
' . $studie->legende . '
'; + $res .= '
' . $studie->legende . '
'; - if ($studie->url != '') { - $res .= '' . __("Voir le site") . ''; - } + if ($studie->url != '') { + $res .= '' . __("Voir le site") . ''; + } - $res .= '
'; - $res .= '
'; + $res .= '
'; + $res .= '
'; - $style = ''; - if ($studie->couleur != '') { - $style = 'background-color:' . $studie->couleur; - } + $style = ''; + if ($studie->couleur != '') { + $style = 'background-color:' . $studie->couleur; + } - $res .= '
'; + $res .= '
'; - $blocs = json_decode($studie->blocs, true); - foreach ($blocs as $bloc) { - // fb($bloc); - $margin = ''; - if ($bloc["margin"] != '') { - $margin = 'margin-top:' . $bloc["margin"] . 'px;'; - } + //$blocs = json_decode($studie->blocs[0], true); + $blocs = $studie->blocs; + fb($blocs); + foreach ($blocs as $bloc) { - $zindex = ''; - if ($bloc["zindex"] != 'default') { - $zindex = 'z-index:' . $bloc["zindex"] . ';'; - } + // fb($bloc); + $margin = ''; + if ($bloc->margin != '') { + $margin = 'margin-top:' . $bloc->margin . 'px;'; + } - if ($bloc["selectedtype"] == "text") { + $zindex = ''; + if ($bloc->zindex != 'default') { + $zindex = 'z-index:' . $bloc->zindex . ';'; + } - $res .= '
'; - $res .= '
' . $bloc["titre"] . '
'; - $res .= '
' . $bloc["texte"] . '
'; - $res .= '
'; - } + if ($bloc->selectedtype == "text") { - if ($bloc["selectedtype"] == "visuel") { - $visuel = $this->view->imageProcess()->imageProcessGetUrl($bloc["visuel"], '', 1200, null); - $width = -1; - $height = -1; - CubeIT_Image::getDimensions($visuel, $width, $height); + $res .= '
'; + $res .= '
' . $bloc->titre . '
'; + $res .= '
' . $bloc->texte . '
'; + $res .= '
'; + } + if ($bloc->selectedtype == "visuel") { + $visuel = $this->view->imageProcess()->imageProcessGetUrl($bloc->visuel, '', 1200, null); + $width = -1; + $height = -1; + CubeIT_Image::getDimensions($visuel, $width, $height); - $res .= '
'; - } + $res .= '
'; + } - $addVideoBackground = false; - if ($bloc["video_background"] != false) { - $addVideoBackground = true; - } - if ($bloc["selectedtype"] == "video") { + $addVideoBackground = false; + if ($bloc->video_background != false) { + $addVideoBackground = true; + } - $res .= '
'; - $video = $this->view->videoWeb($bloc["video"], 980); + if ($bloc->selectedtype == "video") { - if ($addVideoBackground) { - $background = $this->view->imageProcess()->imageProcessGetUrl($bloc["video_background"], '', 1200, null); - $width = -1; - $height = -1; - CubeIT_Image::getDimensions($background, $width, $height); - $top = ($height - 550) / 2; - //fb($height); - $res.= '
'; - } - if ($addVideoBackground) { - $res.= "
"; - } + $res .= '
'; + $video = $this->view->videoWeb($bloc->video, 980); - $res .= '
' . $video . '
'; - $res .= '
'; - } - } - $res .= '
'; + if ($addVideoBackground) { + $background = $this->view->imageProcess()->imageProcessGetUrl($bloc->video_background, '', 1200, null); + $width = -1; + $height = -1; + CubeIT_Image::getDimensions($background, $width, $height); + $top = ($height - 550) / 2; + //fb($height); + $res.= '
'; + } + if ($addVideoBackground) { + $res.= "
"; + } - return $res; + $res .= '
' . $video . '
'; + $res .= '
'; + } + } + $res .= '
'; + + return $res; } } diff --git a/framework/application/views/helpers/CasestudiesList.php b/framework/application/views/helpers/CasestudiesList.php index f5ec0ce..2c80a85 100644 --- a/framework/application/views/helpers/CasestudiesList.php +++ b/framework/application/views/helpers/CasestudiesList.php @@ -4,63 +4,62 @@ class Cubedesigners_View_Helper_CasestudiesList extends Zend_View_Helper_Abstrac public function CasestudiesList($datas) { - // $acl = Bootstrap::getInstance()->getAcl(); - $acl = Bootstrap::getInstance()->isAllowed("edition"); + $acl = Bootstrap::getInstance()->isAllowed("edition"); - $db = Zend_Db_Table::getDefaultAdapter(); - $s = $db->select()->from('casestudies') - ->order('id ASC'); + $db = Zend_Db_Table::getDefaultAdapter(); + $s = $db->select()->from('casestudies') + ->order('id ASC'); - if (!$acl) { - $s->where('online = ?', 1); - } + if (!$acl) { + $s->where('online = ?', 1); + } - $q = $s->query(); + $q = $s->query(); - $count = 1; + $count = 1; - $res = ''; + $res = ''; - while ($r = $q->fetch()) { + while ($r = $q->fetch()) { - $r = CubeIT_Util_Cms::unserialize($r); + $r = CubeIT_Util_Cms::unserialize($r); - $addSpacer = false; + $addSpacer = false; - if ($count == 3) { - $count = 1; - $addClass = ''; - // $addSpacer = true; - } else { - $addClass = ' blocmargin'; - $count++; - } + if ($count == 3) { + $count = 1; + $addClass = ''; + // $addSpacer = true; + } else { + $addClass = ' blocmargin'; + $count++; + } - $addOffline = ''; - if ($acl && $r->online == 0) { - $addOffline = 'data-offline="1"'; - } + $addOffline = ''; + if ($acl && $r->online == 0) { + $addOffline = 'data-offline="1"'; + } - $image = $this->view->imageProcess($r->visuel, $r->titre, 300, 225); - $url = CubeIT_Navigation_Page::generateAutoUri($r, $datas['seourl_stu']); - $res .= ''; - $res .= '
'; - $res .= '
' . $image . '
'; - $res .= '
' . $r->titre . '
'; - $res .= '
' . $r->description . '
'; - $res .= '
'; - $res .= '
'; + $image = $this->view->imageProcess($r->visuel, $r->titre, 300, 225); + $url = CubeIT_Navigation_Page::generateAutoUri($r, $datas['seourl_stu']); + $res .= ''; + $res .= '
'; + $res .= '
' . $image . '
'; + $res .= '
' . $r->titre . '
'; + $res .= '
' . $r->description . '
'; + $res .= '
'; + $res .= '
'; - // if ($addSpacer) { - // $res .= '
'; - // } - } + // if ($addSpacer) { + // $res .= '
'; + // } + } - return $res; + return $res; } } diff --git a/framework/application/views/helpers/RealisationsList.php b/framework/application/views/helpers/RealisationsList.php index 27be614..3a48265 100644 --- a/framework/application/views/helpers/RealisationsList.php +++ b/framework/application/views/helpers/RealisationsList.php @@ -4,45 +4,58 @@ class Cubedesigners_View_Helper_RealisationsList extends Zend_View_Helper_Abstra public function RealisationsList($datas) { - $db = Zend_Db_Table::getDefaultAdapter(); - $s = $db->select()->from('realisations') - ->order('id ASC'); - $q = $s->query(); + $acl = Bootstrap::getInstance()->isAllowed("edition"); - $count = 1; + $db = Zend_Db_Table::getDefaultAdapter(); + $s = $db->select()->from('realisations') + ->order('id ASC'); - $res = ''; + if (!$acl) { + $s->where('online = ?', 1); + } + $q = $s->query(); + $count = 1; - while ($r = $q->fetch()) { - $addSpacer = false; + $res = ''; - if ($count == 6) { - $count = 1; - $addClass = ''; - // $addSpacer = true; - } else { - $addClass = ' blocmargin'; - $count++; - } + while ($r = $q->fetch()) { + $r = CubeIT_Util_Cms::unserialize($r); - $image = $this->view->imageProcess($r->visuel, $r->titre, 130, 130); - $url = CubeIT_Navigation_Page::generateAutoUri($r, $datas['seourl_rea']); - //$res .= ''; - $res .= ''; - $res .= '
'; - $res .= '
' . $image . '
'; - $res .= '
' . $r->titre . '
'; - $res .= '
'; - $res .= '
'; - // if ($addSpacer) { - // $res .= '
'; - // } - } + $addSpacer = false; - return $res; + if ($count == 4) { + $count = 1; + $addClass = ''; + // $addSpacer = true; + } else { + $addClass = ' blocmargin'; + $count++; + } + + $addOffline = ''; + if ($acl && $r->online == 0) { + $addOffline = 'data-offline="1"'; + } + + $image = $this->view->imageProcess($r->visuel, $r->titre, 230, 230); + $url = CubeIT_Navigation_Page::generateAutoUri($r, $datas['seourl_rea']); + //$res .= ''; + + $res .= ''; + $res .= '
'; + $res .= '
' . $image . '
'; + $res .= '
' . $r->titre . '
'; + $res .= '
'; + $res .= '
'; + // if ($addSpacer) { + // $res .= '
'; + // } + } + + return $res; } } diff --git a/framework/application/views/scripts/templates/casestudies.phtml b/framework/application/views/scripts/templates/casestudies.phtml index 242c414..b978e02 100644 --- a/framework/application/views/scripts/templates/casestudies.phtml +++ b/framework/application/views/scripts/templates/casestudies.phtml @@ -5,13 +5,14 @@ $this->headScript()->addScriptAndStyle('casestudies');
markupDotclear($this->titre); ?>
- CasestudiesTagsList($this->studies); ?> + CasestudiesTagsList($this->studies); + ?>
getCMSDatasOfPage($this->id); echo $this->CasestudiesList($datas); - //fb($datas); ?> -
+ \ No newline at end of file diff --git a/framework/application/views/scripts/templates/realisations.phtml b/framework/application/views/scripts/templates/realisations.phtml index 67a5986..87b1d97 100644 --- a/framework/application/views/scripts/templates/realisations.phtml +++ b/framework/application/views/scripts/templates/realisations.phtml @@ -8,7 +8,6 @@ $this->headScript()->addScriptAndStyle('realisations'); CasestudiesTagsList($this->studies); ?> -
getCMSDatasOfPage($this->id); diff --git a/less/realisations.less b/less/realisations.less index 8ad133b..280107d 100644 --- a/less/realisations.less +++ b/less/realisations.less @@ -43,7 +43,7 @@ overflow: hidden; .bloc { - width:130px; + width:230px; float:left; } @@ -52,8 +52,8 @@ } .bloc .project-photo { - width:130px; - height:130px; + width:230px; + height:230px; background-color: #ccc; margin:0 0 5px 0; } @@ -65,7 +65,7 @@ } .blocmargin { - margin-right:40px; + margin-right:15px; } .spacer { -- 2.39.5