Advertisement
Eddz

Untitled

Aug 30th, 2013
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 14.26 KB | None | 0 0
  1. <?php
  2.  
  3. namespace Fcm\Form;
  4.  
  5. use Zend\Form\Form;
  6. use Zend\Form\Element;
  7.  
  8. class CampaignAdd extends Form
  9. {
  10.  
  11.     public function __construct()
  12.     {
  13.         parent::__construct();
  14.         $this->setName('add-campaign');
  15.         $this->setAttribute('action', '/campaigns/add');
  16.         $this->setAttribute('method', 'post');
  17.  
  18.  
  19.         //Fieldset Campaign
  20.         $this->add(array(
  21.             'name' => 'fsInfoCampaign',
  22.             'type' => 'Zend\Form\Fieldset',
  23.             'options' => array(
  24.                 'legend' => 'Campagns informations',
  25.             ),
  26.             'elements' => array(
  27.                 // Name
  28.                 array(
  29.                     'spec' => array(
  30.                         'name' => 'name',
  31.                         'type' => 'Zend\Form\Element\Text',
  32.                         'attributes' => array(
  33.                         ),
  34.                         'options' => array(
  35.                             'label' => 'Campaign name',
  36.                         ),
  37.                     ),
  38.                 ),
  39.                 // Start date
  40.                 array(
  41.                     'spec' => array(
  42.                         'name' => 'startdate',
  43.                         'type' => 'Zend\Form\Element\Text',
  44.                         'options' => array(
  45.                             'label' => 'Start date',
  46.                         ),
  47.                     ),
  48.                 ),
  49.                 // End date
  50.                 array(
  51.                     'spec' => array(
  52.                         'name' => 'enddate',
  53.                         'type' => 'Zend\Form\Element\Text',
  54.                         'options' => array(
  55.                             'label' => 'End date',
  56.                         ),
  57.                     ),
  58.                 ),
  59.                 // Campaign type
  60.                 array(
  61.                     'spec' => array(
  62.                         'name' => 'typecampaign',
  63.                         'type' => 'Zend\Form\Element\Text',
  64.                     ),
  65.                 ),
  66.                 // Multiple choice fields
  67.                 array(
  68.                     'spec' => array(
  69.                         'name' => 'multiplechoice_question',
  70.                         'type' => 'Zend\Form\Element\Text'
  71.                     ),
  72.                 ),
  73.                 array(
  74.                     'spec' => array(
  75.                         'name' => 'multiplechoice_correct_answer',
  76.                         'type' => 'Zend\Form\Element\Text'
  77.                     ),
  78.                 ),
  79.                 array(
  80.                     'spec' => array(
  81.                         'name' => 'multiplechoice_wrong1',
  82.                         'type' => 'Zend\Form\Element\Text'
  83.                     ),
  84.                 ),
  85.                 array(
  86.                     'spec' => array(
  87.                         'name' => 'multiplechoice_wrong2',
  88.                         'type' => 'Zend\Form\Element\Text'
  89.                     ),
  90.                 ),
  91.                 array(
  92.                     'spec' => array(
  93.                         'name' => 'multiplechoice_wrong3',
  94.                         'type' => 'Zend\Form\Element\Text'
  95.                     ),
  96.                 ),
  97.                 array(
  98.                     'spec' => array(
  99.                         'name' => 'multiplechoice_wrong4',
  100.                         'type' => 'Zend\Form\Element\Text'
  101.                     ),
  102.                 ),
  103.                 // Answer/Question fields
  104.                 array(
  105.                     'spec' => array(
  106.                         'name' => 'answerquestion_question',
  107.                         'type' => 'Zend\Form\Element\Text'
  108.                     ),
  109.                 ),
  110.                 array(
  111.                     'spec' => array(
  112.                         'name' => 'answerquestion_correct_answer',
  113.                         'type' => 'Zend\Form\Element\Text'
  114.                     ),
  115.                 ),
  116.                 // Draw field
  117.                 array(
  118.                     'spec' => array(
  119.                         'name' => 'draw',
  120.                         'type' => 'Zend\Form\Element\Text',
  121.                         'option' => array(
  122.                             'label' => 'Draw'
  123.                         )
  124.                     ),
  125.                 ),
  126.                 // Desired fields
  127.                 array(
  128.                     'spec' => array(
  129.                         'name' => 'desired_fields',
  130.                         'type' => 'Zend\Form\Element\MultiCheckbox',
  131.                         'options' => array(
  132.                             'label' => 'Desired fields',
  133.                             'value_options' => array(
  134.                                 'email' => 'Email',
  135.                                 'phone' => 'Phone',
  136.                                 'name' => 'Name',
  137.                             ),
  138.                         ),
  139.                     ),
  140.                 ),
  141.                 // Associate client
  142.                 array(
  143.                     'spec' => array(
  144.                         'name' => 'client',
  145.                         'type' => 'Zend\Form\Element\Number',
  146.                     ),
  147.                 ),
  148.                 // Status
  149.                 array(
  150.                     'spec' => array(
  151.                         'name' => 'status',
  152.                         'type' => 'Zend\Form\Element\Radio',
  153.                         'options' => array(
  154.                             'label' => 'Status',
  155.                             'value_options' => array(
  156.                                 true => 'Activite',
  157.                                 false => 'Desactive'
  158.                             ),
  159.                         ),
  160.                     ),
  161.                 ),
  162.             ),
  163.         ));
  164.  
  165.         //Fieldset FB
  166.         $this->add(array(
  167.             'name' => 'fsFB',
  168.             'type' => 'Zend\Form\Fieldset',
  169.             'options' => array(
  170.                 'legend' => 'Facebook informations',
  171.             ),
  172.             'elements' => array(
  173.                 // App ID
  174.                 array(
  175.                     'spec' => array(
  176.                         'name' => 'appid',
  177.                         'type' => 'Zend\Form\Element\Text',
  178.                         'attributes' => array(
  179.                         ),
  180.                         'options' => array(
  181.                             'label' => 'App ID',
  182.                         ),
  183.                     ),
  184.                 ),
  185.                 // App Secret
  186.                 array(
  187.                     'spec' => array(
  188.                         'name' => 'appsecret',
  189.                         'type' => 'Zend\Form\Element\Text',
  190.                         'attributes' => array(
  191.                         ),
  192.                         'options' => array(
  193.                             'label' => 'App Secret',
  194.                         ),
  195.                     ),
  196.                 ),
  197.                 // App URL
  198.                 array(
  199.                     'spec' => array(
  200.                         'name' => 'appurl',
  201.                         'type' => 'Zend\Form\Element\Text',
  202.                         'attributes' => array(
  203.                         ),
  204.                         'options' => array(
  205.                             'label' => 'App URL',
  206.                         ),
  207.                     ),
  208.                 ),
  209.                 // Landing Image
  210.                 array(
  211.                     'spec' => array(
  212.                         'name' => 'landing_bg',
  213.                         'type' => 'Zend\Form\Element\File',
  214.                         'attributes' => array(
  215.                         ),
  216.                         'options' => array(
  217.                             'label' => 'Landing page background',
  218.                         ),
  219.                     ),
  220.                 ),
  221.                 // Entry image
  222.                 array(
  223.                     'spec' => array(
  224.                         'name' => 'entry_bg',
  225.                         'type' => 'Zend\Form\Element\File',
  226.                         'attributes' => array(
  227.                         ),
  228.                         'options' => array(
  229.                             'label' => 'Entry page background',
  230.                         ),
  231.                     ),
  232.                 ),
  233.                 // Share image
  234.                 array(
  235.                     'spec' => array(
  236.                         'name' => 'share_img',
  237.                         'type' => 'Zend\Form\Element\File',
  238.                         'attributes' => array(
  239.                         ),
  240.                         'options' => array(
  241.                             'label' => 'Share image',
  242.                         ),
  243.                     ),
  244.                 ),
  245.                 // Legal Image
  246.                 array(
  247.                     'spec' => array(
  248.                         'name' => 'legal_bg',
  249.                         'type' => 'Zend\Form\Element\File',
  250.                         'attributes' => array(
  251.                         ),
  252.                         'options' => array(
  253.                             'label' => 'Legal page background',
  254.                         ),
  255.                     ),
  256.                 ),
  257.                 // Thank you Image
  258.                 array(
  259.                     'spec' => array(
  260.                         'name' => 'thank_you_bg',
  261.                         'type' => 'Zend\Form\Element\File',
  262.                         'attributes' => array(
  263.                         ),
  264.                         'options' => array(
  265.                             'label' => 'Thank you page background',
  266.                         ),
  267.                     ),
  268.                 ),
  269.                 // JavaScript file
  270.                 array(
  271.                     'spec' => array(
  272.                         'name' => 'js_file',
  273.                         'type' => 'Zend\Form\Element\File',
  274.                         'attributes' => array(
  275.                         ),
  276.                         'options' => array(
  277.                             'label' => 'JavaScript file',
  278.                         ),
  279.                     ),
  280.                 ),
  281.                 // Css file
  282.                 array(
  283.                     'spec' => array(
  284.                         'name' => 'css_file',
  285.                         'type' => 'Zend\Form\Element\File',
  286.                         'attributes' => array(
  287.                         ),
  288.                         'options' => array(
  289.                             'label' => 'Css file',
  290.                         ),
  291.                     ),
  292.                 ),
  293.                 // Landing
  294.                 array(
  295.                     'spec' => array(
  296.                         'name' => 'landing_textarea',
  297.                         'type' => 'Zend\Form\Element\Textarea',
  298.                         'attributes' => array(
  299.                         ),
  300.                         'options' => array(
  301.                             'label' => 'Textual content landing page',
  302.                         ),
  303.                     ),
  304.                 ),
  305.                 // Enter
  306.                 array(
  307.                     'spec' => array(
  308.                         'name' => 'enter_textarea',
  309.                         'type' => 'Zend\Form\Element\Textarea',
  310.                         'attributes' => array(
  311.                         ),
  312.                         'options' => array(
  313.                             'label' => 'Textual content Enter page',
  314.                         ),
  315.                     ),
  316.                 ),
  317.                 // Text term and privacyP
  318.                 array(
  319.                     'spec' => array(
  320.                         'name' => 'term_privacy_textarea',
  321.                         'type' => 'Zend\Form\Element\Textarea',
  322.                         'attributes' => array(
  323.                         ),
  324.                         'options' => array(
  325.                             'label' => 'Textual content term and Privacy policy',
  326.                         ),
  327.                     ),
  328.                 ),
  329.                 // Text for thank you
  330.                 array(
  331.                     'spec' => array(
  332.                         'name' => 'thank_you_textarea',
  333.                         'type' => 'Zend\Form\Element\Textarea',
  334.                         'attributes' => array(
  335.                         ),
  336.                         'options' => array(
  337.                             'label' => 'Textual content Thank you page',
  338.                         ),
  339.                     ),
  340.                 ),
  341.                 // Title share
  342.                 array(
  343.                     'spec' => array(
  344.                         'name' => 'title_share_Text',
  345.                         'type' => 'Zend\Form\Element\Text',
  346.                         'attributes' => array(
  347.                         ),
  348.                         'options' => array(
  349.                             'label' => 'Share title',
  350.                         ),
  351.                     ),
  352.                 ),
  353.                 // sub-title share
  354.                 array(
  355.                     'spec' => array(
  356.                         'name' => 'subtitle_share_text',
  357.                         'type' => 'Zend\Form\Element\Text',
  358.                         'attributes' => array(
  359.                         ),
  360.                         'options' => array(
  361.                             'label' => 'Share sub title',
  362.                         ),
  363.                     ),
  364.                 ),
  365.                 // Desc share
  366.                 array(
  367.                     'spec' => array(
  368.                         'name' => 'desc_share_textarea',
  369.                         'type' => 'Zend\Form\Element\Text',
  370.                         'attributes' => array(
  371.                         ),
  372.                         'options' => array(
  373.                             'label' => 'Share description',
  374.                         ),
  375.                     ),
  376.                 ),
  377.             ),
  378.         ));
  379.         //Csrf
  380.         $this->add(new Element\Csrf('csrf'));
  381.  
  382.         //Submit button
  383.         $this->add(array(
  384.             'name' => 'submitBtn',
  385.             'type' => 'Zend\Form\Element\Submit',
  386.             'attributes' => array(
  387.                 'value' => 'Add campaign',
  388.             ),
  389.             'options' => array(
  390.                 'primary' => true,
  391.             ),
  392.         ));
  393.  
  394.         //Reset button
  395.         $this->add(array(
  396.             'name' => 'resetBtn',
  397.             'attributes' => array(
  398.                 'type' => 'reset',
  399.                 'value' => 'Reset',
  400.             ),
  401.         ));
  402.     }
  403.  
  404. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement