]> _ Git - ccgm.git/commitdiff
WIP #3413 @7
authorstephen@cubedesigners.com <stephen@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 4 Mar 2020 18:40:13 +0000 (18:40 +0000)
committerstephen@cubedesigners.com <stephen@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Wed, 4 Mar 2020 18:40:13 +0000 (18:40 +0000)
framework/application/configs/application.ini
framework/application/forms/CMS/Sub/News/News.php
framework/application/models/News.php
framework/application/views/scripts/news/index.phtml

index 4361fadb00be7c1dd332f081d262ea622958fbd3..d88902e05999b312efa9d2f2e663b36a61fc0b06 100644 (file)
@@ -72,9 +72,12 @@ seo.robots = false
 [dev-local : base]
 
 dev = true
+firephp = false
 webhost = ccgm.test
 session.domain = .ccgm.test
 
+bin.imagemagick = /usr/local/bin/convert
+
 minify.js = true
 minify.css = true
 
index 8b70c960950ab00ee599a7ec15c5390de9daa5c6..c53c5de81ce0e0228b742377286c9d2e6bdaf526 100644 (file)
@@ -20,14 +20,24 @@ class CCGM_Form_CMS_Sub_News_News extends CubeIT_Form_List_Model {
                $this->addElement($date);\r
 \r
                $image = new CubeIT_Form_Element_File_Image('image');\r
-               $image->setLabel('Image');\r
-               $image->setMaxItems(1);\r
+               $image->setLabel('Images');\r
                $this->addElement($image);\r
 \r
+               $videos = new Zend_Form_Element_Textarea('videos');\r
+               $videos->setLabel('Vidéos (YouTube) : une URL par ligne');\r
+               $videos->setAttrib('placeholder', 'https://www.youtube.com/watch?v=xxxxxx');\r
+               $videos->setAttrib('rows', 4);\r
+               $this->addElement($videos);\r
+\r
                $content = new CubeIT_Form_Element_Markitup_Basic('content');\r
                $content->setLabel(__('Contents'));\r
                $this->addElement($content);\r
 \r
+               $pdf = new CubeIT_Form_Element_File('pdf');\r
+               $pdf->setLabel('PDF à télécharger');\r
+               $pdf->setMaxItems(1);\r
+               $this->addElement($pdf);\r
+\r
                $link = new CubeIT_Form_Element_Link();\r
                $link->setLabel('Lien');\r
                $this->addSubForm($link,'link');\r
index 08334299492e9ed6c74e5ef6ba6ad611b6ba0173..8f0ecff2bdcd2dd8125d119f68db29cd59984f33 100644 (file)
@@ -3,11 +3,13 @@
 class CCGM_Model_News extends CubeIT_Model_Data_Table {
 
        protected static $_table = 'news';
+       protected $title;
        protected $date;
        protected $content;
        protected $link;
        protected $image;
-       protected $title;
+       protected $videos;
+       protected $pdf;
 
        protected $_types = ['link' => 'json'];
 
@@ -18,6 +20,8 @@ class CCGM_Model_News extends CubeIT_Model_Data_Table {
                $table->addColumn('content', 'text');
                $table->addColumn('link', 'text');
                $table->addColumn('image', 'text');
+               $table->addColumn('videos', 'text');
+               $table->addColumn('pdf', 'text');
        }
 
-}
\ No newline at end of file
+}
index 1f95d41a7aeb426f82954d95896247e5860dd5c2..704cac57ca4c6911e6dc6e418e00e8991b1dc51f 100644 (file)
@@ -1,11 +1,29 @@
 <?php
 
+$this->showtopimage = false;
 $this->showsidebar = false;
+$news = CubeIT_Util_CMS::unserialize($this->news);
 
 ?>
 
+<h1><?= $news->title ?></h1>
+
+<div class="news-body">
+
+    <?php
+        foreach($news->image as $image) {
+            echo $this->imageProcess($image, '', 1000, null);
+        }
+    ?>
+
+    <?= $this->markupDotclear($news->content); ?>
+
+    <?= $this->linkCMS($news->link); ?>
+
+</div>
+
 <pre>
 <?php
-    print_r($this->news);
+    print_r($news);
 ?>
 </pre>