From 0181005ab6fc9cf985f5c18f2d65742cfe981b0a Mon Sep 17 00:00:00 2001 From: "stephen@cubedesigners.com" Date: Wed, 29 Jun 2016 15:12:37 +0000 Subject: [PATCH] Refactor introduction block and quote form into view helpers. Done #509 @0:45 --- framework/application/forms/RequestQuote.php | 10 ++++- .../application/views/helpers/IntroBlock.php | 40 +++++++++++++++++++ .../application/views/helpers/QuoteForm.php | 21 ++++++++++ 3 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 framework/application/views/helpers/IntroBlock.php create mode 100644 framework/application/views/helpers/QuoteForm.php diff --git a/framework/application/forms/RequestQuote.php b/framework/application/forms/RequestQuote.php index bb1b23e..5c4aace 100644 --- a/framework/application/forms/RequestQuote.php +++ b/framework/application/forms/RequestQuote.php @@ -26,7 +26,11 @@ class Fluidbook_Form_RequestQuote extends CubeIT_Form { $contact_type = new Zend_Form_Element_Select('contact_type'); $contact_type->setLabel(__('Vous êtes')); $contact_type->setMultiOptions(array( - '' => __("???"), // Todo: set options + '' => '', + 'agency' => 'Une agence de communication', + 'freelancer' => 'Un créatif freelance', + 'company' => 'Une société', + 'other' => 'Autre', )); $contact_type->setAttrib('required', 'required'); // Needed so we can style the first element when nothing selected $contact_type->setRequired(true); @@ -49,6 +53,10 @@ class Fluidbook_Form_RequestQuote extends CubeIT_Form { $comments->setLabel(__('Commentaires sur votre projet')); $this->addElement($comments); + $tips = new CubeIT_Form_Element_Html('tips'); + $tips->setContent(''); // Just a placeholder for CMS content + $this->addElement($tips); + $submit = new Zend_Form_Element_Button('submit'); $submit->setLabel(__('Envoyer la demande')); $submit->setAttrib('class', 'submit-button'); diff --git a/framework/application/views/helpers/IntroBlock.php b/framework/application/views/helpers/IntroBlock.php new file mode 100644 index 0000000..381402c --- /dev/null +++ b/framework/application/views/helpers/IntroBlock.php @@ -0,0 +1,40 @@ +'; + + $res .= '
'; + $res .= '
'; + + $res .= '

'. nl2br($title) .'

'; + $res .= $content; + + $res .= '
'; // .col-2 + $res .= '
'; // .grid + $res .= ''; // .content-wrapper + + return $res; + } +} \ No newline at end of file diff --git a/framework/application/views/helpers/QuoteForm.php b/framework/application/views/helpers/QuoteForm.php new file mode 100644 index 0000000..5104436 --- /dev/null +++ b/framework/application/views/helpers/QuoteForm.php @@ -0,0 +1,21 @@ +'; + $res .= '
'; + $res .= '

'. nl2br($this->option('quote_heading')) .'

'; + $res .= $this->markupDotclear($this->option('quote_description')); + $res .= '
'; // .col-2 + $res .= '
'; + $form = new Fluidbook_Form_RequestQuote(); + $tips = $this->markupDotclear($this->option('quote_form_tips'), [], ['class' => 'tips']); + $res .= str_replace('', '
'. $tips .'
', $form); // Inject tips HTML into form via placeholder + $res .= '
'; // .col-4 + $res .= ''; // .request-quote + + return $res; + } +} \ No newline at end of file -- 2.39.5