Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace Fcm\Form;
- use Zend\Form\Form;
- use Zend\Form\Element;
- class CampaignAdd extends Form
- {
- public function __construct()
- {
- parent::__construct();
- $this->setName('add-campaign');
- $this->setAttribute('action', '/campaigns/add');
- $this->setAttribute('method', 'post');
- //Fieldset Campaign
- $this->add(array(
- 'name' => 'fsInfoCampaign',
- 'type' => 'Zend\Form\Fieldset',
- 'options' => array(
- 'legend' => 'Campagns informations',
- ),
- 'elements' => array(
- // Name
- array(
- 'spec' => array(
- 'name' => 'name',
- 'type' => 'Zend\Form\Element\Text',
- 'attributes' => array(
- ),
- 'options' => array(
- 'label' => 'Campaign name',
- ),
- ),
- ),
- // Start date
- array(
- 'spec' => array(
- 'name' => 'startdate',
- 'type' => 'Zend\Form\Element\Text',
- 'options' => array(
- 'label' => 'Start date',
- ),
- ),
- ),
- // End date
- array(
- 'spec' => array(
- 'name' => 'enddate',
- 'type' => 'Zend\Form\Element\Text',
- 'options' => array(
- 'label' => 'End date',
- ),
- ),
- ),
- // Campaign type
- array(
- 'spec' => array(
- 'name' => 'typecampaign',
- 'type' => 'Zend\Form\Element\Text',
- ),
- ),
- // Multiple choice fields
- array(
- 'spec' => array(
- 'name' => 'multiplechoice_question',
- 'type' => 'Zend\Form\Element\Text'
- ),
- ),
- array(
- 'spec' => array(
- 'name' => 'multiplechoice_correct_answer',
- 'type' => 'Zend\Form\Element\Text'
- ),
- ),
- array(
- 'spec' => array(
- 'name' => 'multiplechoice_wrong1',
- 'type' => 'Zend\Form\Element\Text'
- ),
- ),
- array(
- 'spec' => array(
- 'name' => 'multiplechoice_wrong2',
- 'type' => 'Zend\Form\Element\Text'
- ),
- ),
- array(
- 'spec' => array(
- 'name' => 'multiplechoice_wrong3',
- 'type' => 'Zend\Form\Element\Text'
- ),
- ),
- array(
- 'spec' => array(
- 'name' => 'multiplechoice_wrong4',
- 'type' => 'Zend\Form\Element\Text'
- ),
- ),
- // Answer/Question fields
- array(
- 'spec' => array(
- 'name' => 'answerquestion_question',
- 'type' => 'Zend\Form\Element\Text'
- ),
- ),
- array(
- 'spec' => array(
- 'name' => 'answerquestion_correct_answer',
- 'type' => 'Zend\Form\Element\Text'
- ),
- ),
- // Draw field
- array(
- 'spec' => array(
- 'name' => 'draw',
- 'type' => 'Zend\Form\Element\Text',
- 'option' => array(
- 'label' => 'Draw'
- )
- ),
- ),
- // Desired fields
- array(
- 'spec' => array(
- 'name' => 'desired_fields',
- 'type' => 'Zend\Form\Element\MultiCheckbox',
- 'options' => array(
- 'label' => 'Desired fields',
- 'value_options' => array(
- 'email' => 'Email',
- 'phone' => 'Phone',
- 'name' => 'Name',
- ),
- ),
- ),
- ),
- // Associate client
- array(
- 'spec' => array(
- 'name' => 'client',
- 'type' => 'Zend\Form\Element\Number',
- ),
- ),
- // Status
- array(
- 'spec' => array(
- 'name' => 'status',
- 'type' => 'Zend\Form\Element\Radio',
- 'options' => array(
- 'label' => 'Status',
- 'value_options' => array(
- true => 'Activite',
- false => 'Desactive'
- ),
- ),
- ),
- ),
- ),
- ));
- //Fieldset FB
- $this->add(array(
- 'name' => 'fsFB',
- 'type' => 'Zend\Form\Fieldset',
- 'options' => array(
- 'legend' => 'Facebook informations',
- ),
- 'elements' => array(
- // App ID
- array(
- 'spec' => array(
- 'name' => 'appid',
- 'type' => 'Zend\Form\Element\Text',
- 'attributes' => array(
- ),
- 'options' => array(
- 'label' => 'App ID',
- ),
- ),
- ),
- // App Secret
- array(
- 'spec' => array(
- 'name' => 'appsecret',
- 'type' => 'Zend\Form\Element\Text',
- 'attributes' => array(
- ),
- 'options' => array(
- 'label' => 'App Secret',
- ),
- ),
- ),
- // App URL
- array(
- 'spec' => array(
- 'name' => 'appurl',
- 'type' => 'Zend\Form\Element\Text',
- 'attributes' => array(
- ),
- 'options' => array(
- 'label' => 'App URL',
- ),
- ),
- ),
- // Landing Image
- array(
- 'spec' => array(
- 'name' => 'landing_bg',
- 'type' => 'Zend\Form\Element\File',
- 'attributes' => array(
- ),
- 'options' => array(
- 'label' => 'Landing page background',
- ),
- ),
- ),
- // Entry image
- array(
- 'spec' => array(
- 'name' => 'entry_bg',
- 'type' => 'Zend\Form\Element\File',
- 'attributes' => array(
- ),
- 'options' => array(
- 'label' => 'Entry page background',
- ),
- ),
- ),
- // Share image
- array(
- 'spec' => array(
- 'name' => 'share_img',
- 'type' => 'Zend\Form\Element\File',
- 'attributes' => array(
- ),
- 'options' => array(
- 'label' => 'Share image',
- ),
- ),
- ),
- // Legal Image
- array(
- 'spec' => array(
- 'name' => 'legal_bg',
- 'type' => 'Zend\Form\Element\File',
- 'attributes' => array(
- ),
- 'options' => array(
- 'label' => 'Legal page background',
- ),
- ),
- ),
- // Thank you Image
- array(
- 'spec' => array(
- 'name' => 'thank_you_bg',
- 'type' => 'Zend\Form\Element\File',
- 'attributes' => array(
- ),
- 'options' => array(
- 'label' => 'Thank you page background',
- ),
- ),
- ),
- // JavaScript file
- array(
- 'spec' => array(
- 'name' => 'js_file',
- 'type' => 'Zend\Form\Element\File',
- 'attributes' => array(
- ),
- 'options' => array(
- 'label' => 'JavaScript file',
- ),
- ),
- ),
- // Css file
- array(
- 'spec' => array(
- 'name' => 'css_file',
- 'type' => 'Zend\Form\Element\File',
- 'attributes' => array(
- ),
- 'options' => array(
- 'label' => 'Css file',
- ),
- ),
- ),
- // Landing
- array(
- 'spec' => array(
- 'name' => 'landing_textarea',
- 'type' => 'Zend\Form\Element\Textarea',
- 'attributes' => array(
- ),
- 'options' => array(
- 'label' => 'Textual content landing page',
- ),
- ),
- ),
- // Enter
- array(
- 'spec' => array(
- 'name' => 'enter_textarea',
- 'type' => 'Zend\Form\Element\Textarea',
- 'attributes' => array(
- ),
- 'options' => array(
- 'label' => 'Textual content Enter page',
- ),
- ),
- ),
- // Text term and privacyP
- array(
- 'spec' => array(
- 'name' => 'term_privacy_textarea',
- 'type' => 'Zend\Form\Element\Textarea',
- 'attributes' => array(
- ),
- 'options' => array(
- 'label' => 'Textual content term and Privacy policy',
- ),
- ),
- ),
- // Text for thank you
- array(
- 'spec' => array(
- 'name' => 'thank_you_textarea',
- 'type' => 'Zend\Form\Element\Textarea',
- 'attributes' => array(
- ),
- 'options' => array(
- 'label' => 'Textual content Thank you page',
- ),
- ),
- ),
- // Title share
- array(
- 'spec' => array(
- 'name' => 'title_share_Text',
- 'type' => 'Zend\Form\Element\Text',
- 'attributes' => array(
- ),
- 'options' => array(
- 'label' => 'Share title',
- ),
- ),
- ),
- // sub-title share
- array(
- 'spec' => array(
- 'name' => 'subtitle_share_text',
- 'type' => 'Zend\Form\Element\Text',
- 'attributes' => array(
- ),
- 'options' => array(
- 'label' => 'Share sub title',
- ),
- ),
- ),
- // Desc share
- array(
- 'spec' => array(
- 'name' => 'desc_share_textarea',
- 'type' => 'Zend\Form\Element\Text',
- 'attributes' => array(
- ),
- 'options' => array(
- 'label' => 'Share description',
- ),
- ),
- ),
- ),
- ));
- //Csrf
- $this->add(new Element\Csrf('csrf'));
- //Submit button
- $this->add(array(
- 'name' => 'submitBtn',
- 'type' => 'Zend\Form\Element\Submit',
- 'attributes' => array(
- 'value' => 'Add campaign',
- ),
- 'options' => array(
- 'primary' => true,
- ),
- ));
- //Reset button
- $this->add(array(
- 'name' => 'resetBtn',
- 'attributes' => array(
- 'type' => 'reset',
- 'value' => 'Reset',
- ),
- ));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement