From 5c3636cfb60e470455e2d1a5b46d7a167cfc1131 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Mon, 19 Sep 2016 16:40:42 +0000 Subject: [PATCH] wip #738 @1 --- framework/application/forms/CMS/Sub/Asset.php | 26 ++++++++++ .../application/forms/CMS/Sub/Assets.php | 16 +++++++ .../application/forms/CMS/Sub/Operation.php | 48 +++++++++++-------- 3 files changed, 70 insertions(+), 20 deletions(-) create mode 100644 framework/application/forms/CMS/Sub/Asset.php create mode 100644 framework/application/forms/CMS/Sub/Assets.php diff --git a/framework/application/forms/CMS/Sub/Asset.php b/framework/application/forms/CMS/Sub/Asset.php new file mode 100644 index 0000000..3b80a7d --- /dev/null +++ b/framework/application/forms/CMS/Sub/Asset.php @@ -0,0 +1,26 @@ +setLabel('Titre'); + $this->addElement($title); + + $url = new CubeIT_Form_Element_Url("url"); + $url->setLabel('URL de la vidéo ou du document'); + $this->addElement($url); + + $thumbnail = new CubeIT_Form_Element_File_Image('thumbnail'); + $thumbnail->setMaxItems(1); + $thumbnail->setLabel('Miniature'); + $this->addElement($thumbnail); + } +} \ No newline at end of file diff --git a/framework/application/forms/CMS/Sub/Assets.php b/framework/application/forms/CMS/Sub/Assets.php new file mode 100644 index 0000000..9814d9d --- /dev/null +++ b/framework/application/forms/CMS/Sub/Assets.php @@ -0,0 +1,16 @@ +setBaseLegend('Editer la ressource « $title »') + ->setNewLegend('Nouvelle ressource') + ->setBaseSubForm(new Simeox_Form_CMS_Sub_Asset()); + } +} \ No newline at end of file diff --git a/framework/application/forms/CMS/Sub/Operation.php b/framework/application/forms/CMS/Sub/Operation.php index 55cea2f..0fdfe75 100644 --- a/framework/application/forms/CMS/Sub/Operation.php +++ b/framework/application/forms/CMS/Sub/Operation.php @@ -2,32 +2,40 @@ class Simeox_Form_CMS_Sub_Operation extends CubeIT_Form_SubForm { - public function init() { - parent::init(); + public function init() { + parent::init(); - $heading = new Zend_Form_Element_Text('heading'); - $heading->setLabel('Titre'); - $this->addElement($heading); + $heading = new Zend_Form_Element_Text('heading'); + $heading->setLabel('Titre'); + $this->addElement($heading); - $subheading = new Zend_Form_Element_Text('subheading'); - $subheading->setAttrib('rows', 2); - $subheading->setLabel('Sous-titre'); - $this->addElement($subheading); + $subheading = new Zend_Form_Element_Text('subheading'); + $subheading->setAttrib('rows', 2); + $subheading->setLabel('Sous-titre'); + $this->addElement($subheading); - $content = new Simeox_Form_Element_Markitup('content'); - $content->setLabel('Contenus'); - $this->addElement($content); + $content = new Simeox_Form_Element_Markitup('content'); + $content->setLabel('Contenus'); + $this->addElement($content); - $video = new CubeIT_Form_Element_WebVideo('video'); - $video->setLabel('Video'); - $this->addElement($video); + $video = new CubeIT_Form_Element_WebVideo('video'); + $video->setLabel('Video'); + $this->addElement($video); - $bg_image = new CubeIT_Form_Element_File_Image('bg_image'); - $bg_image->setLabel("Image de fond"); - $bg_image->setMaxItems(1); - $this->addElement($bg_image); + $videos = new Simeox_Form_CMS_Sub_Assets('videos'); + $video->setLabel('Vidéos'); + $this->addSubForm($videos, 'videos'); - } + $documents = new Simeox_Form_CMS_Sub_Assets('documents'); + $documents->setLabel('Documents'); + $this->addSubForm($documents, 'documents'); + + $bg_image = new CubeIT_Form_Element_File_Image('bg_image'); + $bg_image->setLabel("Image de fond"); + $bg_image->setMaxItems(1); + $this->addElement($bg_image); + + } } \ No newline at end of file -- 2.39.5