From 8551ee76a3110caa046f1cf917a8c17946e34ed4 Mon Sep 17 00:00:00 2001 From: "stephen@cubedesigners.com" Date: Tue, 10 Mar 2020 17:57:20 +0000 Subject: [PATCH] Wait #3413 @7.5 --- framework/application/configs/application.ini | 14 +++++ .../controllers/AdminajaxController.php | 10 +++- framework/application/models/News.php | 23 +++++++- .../application/views/helpers/Actualites.php | 4 +- framework/application/views/helpers/News.php | 3 +- .../views/scripts/common/footer.phtml | 1 + .../views/scripts/news/index.phtml | 2 +- images/facebook.svg | 15 ++++++ images/home-slider-next.svg | 18 +++++++ images/home-slider-prev.svg | 18 +++++++ images/play.svg | 9 ++++ images/slider-next.svg | 20 +++++++ images/slider-prev.svg | 20 +++++++ images/twitter.svg | 21 ++++++++ index.php | 6 ++- js/news-article.js | 53 ++++++++++++++++++- js/slick-lightbox.js | 2 - less/news-article.less | 20 +++++++ less/slick-lightbox.less | 23 ++++++-- 19 files changed, 266 insertions(+), 16 deletions(-) create mode 100644 images/facebook.svg create mode 100644 images/home-slider-next.svg create mode 100644 images/home-slider-prev.svg create mode 100644 images/play.svg create mode 100644 images/slider-next.svg create mode 100644 images/slider-prev.svg create mode 100644 images/twitter.svg diff --git a/framework/application/configs/application.ini b/framework/application/configs/application.ini index d88902e..25d2814 100644 --- a/framework/application/configs/application.ini +++ b/framework/application/configs/application.ini @@ -1,5 +1,6 @@ [base] dev = false +firephp = false ;Disabled because it can cause "502 bad gateway" errors minify.js = true minify.css = false @@ -69,6 +70,19 @@ httpauth.password = 20ccgm13 seo.robots = false +[dev : base] + +dev = true +webhost = dev.ccgm.fr + +;httpauth.username = ccgm +;httpauth.password = 20ccgm20 + +database.params.host = ccgmzwgfdev.mysql.db +database.params.username = ccgmzwgfdev +database.params.dbname = ccgmzwgfdev +database.params.password = nqSYJEaJ84r7xGoPnTjc + [dev-local : base] dev = true diff --git a/framework/application/controllers/AdminajaxController.php b/framework/application/controllers/AdminajaxController.php index 6998418..add9520 100644 --- a/framework/application/controllers/AdminajaxController.php +++ b/framework/application/controllers/AdminajaxController.php @@ -2,6 +2,12 @@ class AdminajaxController extends CubeIT_Controller_Admin_AdminajaxController { -} + public function saveselectlist($class, $element, $dataFilters, $reloadOnSave = false) { + + $this->clearCacheTag('navigation'); + $this->clearCacheTag('contents'); -?> + return parent::saveselectlist($class, $element, $dataFilters, $reloadOnSave); + } + +} diff --git a/framework/application/models/News.php b/framework/application/models/News.php index c331513..ea636c4 100644 --- a/framework/application/models/News.php +++ b/framework/application/models/News.php @@ -29,6 +29,27 @@ class CCGM_Model_News extends CubeIT_Model_Data_Table { return explode(PHP_EOL, $this->content)[0]; } + // Get the best image for the post + public function getPosterImage($width, $height, $class) { + + $this->view = Zend_Controller_Action_HelperBroker::getExistingHelper('ViewRenderer')->view; + + $img = $this->view->imageProcess($this->getImage(), '', $width, $height, ['class' => $class]); + + // No images found in 'image' field, so look for a video frame + if (!$img) { + $videos = $this->getVideoDetails(); + + if (count($videos) > 0) { + return '
'; + } else { + return false; + } + } + + return $img; + } + // Process YouTube URLs entered and get poster images public function getVideoDetails() { $video_list = trim($this->videos); @@ -48,7 +69,7 @@ class CCGM_Model_News extends CubeIT_Model_Data_Table { $videos[] = [ 'url' => $video_URL, 'image' => $video_image, - 'embed' => "https://www.youtube.com/embed/$video_ID", + 'embed' => "https://www.youtube.com/embed/$video_ID?enablejsapi=1&iv_load_policy=3&rel=0&showinfo=0", ]; } diff --git a/framework/application/views/helpers/Actualites.php b/framework/application/views/helpers/Actualites.php index 41d42c4..86b22d3 100644 --- a/framework/application/views/helpers/Actualites.php +++ b/framework/application/views/helpers/Actualites.php @@ -27,7 +27,7 @@ class CCGM_View_Helper_Actualites extends CubeIT_View_Helper_Abstract { protected function _actu($a) { $URL = CubeIT_Navigation_Page::generateAutoUri($a, Bootstrap::getNewsArticleURLTemplate()); - $img = $this->imageProcess($a->getImage(), '', 410, 266, ['class' => 'home-news-image']); + $img = $a->getPosterImage(410, 266, 'home-news-image'); if (!$img) { $img = '
'; @@ -37,7 +37,7 @@ class CCGM_View_Helper_Actualites extends CubeIT_View_Helper_Abstract { $res .= '
'; $res .= $this->link($this->htmlElement($a->getTitle(), 'h2'), $URL, ['class' => 'home-news-heading-link']); $res .= $this->markupDotclear($a->getExcerpt()); - $res .= $this->link("Voir toute l'actualité >", 'internal:news', ['class' => 'home-news-read-more']); + $res .= $this->link("Voir l'actualité >", 'internal:news', ['class' => 'home-news-read-more']); $res .= '
'; // .home-news-article-content $res = $this->htmlElement($res, 'article', ['class' => 'home-news-article']); return $this->htmlElement($res, 'div', ['class' => 'home-news-item']); diff --git a/framework/application/views/helpers/News.php b/framework/application/views/helpers/News.php index 8230677..77f8ba6 100644 --- a/framework/application/views/helpers/News.php +++ b/framework/application/views/helpers/News.php @@ -19,8 +19,7 @@ class CCGM_View_Helper_News extends CubeIT_View_Helper_Abstract { $URL = CubeIT_Navigation_Page::generateAutoUri($n, Bootstrap::getNewsArticleURLTemplate()); - - $img = $this->imageProcess($n->getImage(), '', 247, 247, ['class' => 'news-image']); + $img = $n->getPosterImage(247, 247, 'news-image'); if (!$img) { $img = '
'; diff --git a/framework/application/views/scripts/common/footer.phtml b/framework/application/views/scripts/common/footer.phtml index bc00357..c7c4737 100644 --- a/framework/application/views/scripts/common/footer.phtml +++ b/framework/application/views/scripts/common/footer.phtml @@ -27,6 +27,7 @@ $f = $this->options['footer'];