You are here

public function MiniorangeSupport::buildForm in SAML SP 2.0 Single Sign On (SSO) - SAML Service Provider 8

Form constructor.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Return value

array The form structure.

Overrides FormInterface::buildForm

File

src/Form/MiniorangeSupport.php, line 22
Contains support form for miniOrange 2FA Login Module.

Class

MiniorangeSupport
Showing Support form info.

Namespace

Drupal\miniorange_saml\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $email = \Drupal::config('miniorange_saml.settings')
    ->get('miniorange_saml_customer_admin_email');
  $phone = \Drupal::config('miniorange_saml.settings')
    ->get('miniorange_saml_customer_admin_phone');
  $form['miniorange_saml_markup_library'] = array(
    '#attached' => array(
      'library' => array(
        'miniorange_saml/miniorange_saml.admin',
      ),
    ),
  );
  $form['markup_1'] = array(
    '#markup' => t('<div class="mo_saml_sp_table_layout_1"><div class="mo_saml_table_layout mo_saml_sp_container">'),
  );
  $form['mo_saml_vertical_tabs'] = array(
    '#type' => 'vertical_tabs',
    '#default_tab' => 'edit-publication',
  );

  /**
   * Support form
   */
  $form['miniorange_support'] = array(
    '#type' => 'details',
    '#title' => t('Support'),
    '#group' => 'mo_saml_vertical_tabs',
  );
  $form['miniorange_support']['markup_1'] = array(
    '#markup' => t('<h3>Support</h3><hr><p class="mo_saml_highlight_background_note">Need any help? We can help you with configuring miniOrange SAML SP module on your site. Just send us a query and we will get back to you soon.</p>'),
  );
  $form['miniorange_support']['mo_saml_support_email_address'] = array(
    '#type' => 'email',
    '#title' => t('Email <span style="color: red">*</span>'),
    '#default_value' => $email,
    '#attributes' => array(
      'placeholder' => t('Enter your email'),
      'style' => 'width:99%;margin-bottom:1%;',
    ),
  );
  $form['miniorange_support']['mo_saml_support_phone_number'] = array(
    '#type' => 'textfield',
    '#title' => t('Phone'),
    '#default_value' => $phone,
    '#attributes' => array(
      'placeholder' => t('Enter number with country code Eg. +00xxxxxxxxxx'),
      'style' => 'width:99%;margin-bottom:1%;',
    ),
  );
  $form['miniorange_support']['mo_saml_support_query'] = array(
    '#type' => 'textarea',
    '#title' => t('Query <span style="color: red">*</span>'),
    '#attributes' => array(
      'placeholder' => t('Describe your query here!'),
      'style' => 'width:99%',
    ),
    '#suffix' => '<br>',
  );
  $form['miniorange_support']['actions']['submit'] = array(
    '#type' => 'submit',
    '#button_type' => 'primary',
    '#value' => t('Submit query'),
  );
  $form['miniorange_support']['markup_support_note'] = array(
    '#markup' => t('<div><br/><br/>If you want custom features in the module, just drop an email to <a href="mailto:info@xecurify.com">info@xecurify.com</a> or <a href="mailto:' . MiniorangeSAMLConstants::SUPPORT_EMAIL . '">' . MiniorangeSAMLConstants::SUPPORT_EMAIL . '</a></div><br><hr><br>'),
  );

  /**
   * Request demo form
   */
  $form['miniorange_demo_request'] = array(
    '#type' => 'details',
    '#title' => t('Request demo'),
    '#group' => 'mo_saml_vertical_tabs',
  );
  $form['miniorange_demo_request']['markup_demo_request'] = array(
    '#markup' => t('<h3>Request Demo of Paid features</h3><hr><p class="mo_saml_highlight_background_note">Want to know about how the licensed module works? Let us know and we will arrange a demo for you.</p>'),
  );
  $form['miniorange_demo_request']['mo_saml_demo_email_address'] = array(
    '#type' => 'email',
    '#title' => t('Email <span style="color: red">*</span>'),
    '#default_value' => $email,
    '#attributes' => array(
      'placeholder' => t('Enter your email'),
      'style' => 'width:99%;margin-bottom:1%;',
    ),
  );
  $form['miniorange_demo_request']['mo_saml_demo_plan'] = array(
    '#type' => 'select',
    '#title' => t('Plan'),
    '#options' => array(
      'Drupal 8 SAML SP Standard' => t('Drupal 8 SAML SP Standard'),
      'Drupal 8 SAML SP Premium' => t('Drupal 8 SAML SP Premium'),
      'Drupal 8 SAML SP Enterprise' => t('Drupal 8 SAML SP Enterprise'),
      'Drupal 8 SAML SP + Website Security Premium' => t('Drupal 8 SAML SP + Website Security Premium'),
      'Not Sure' => t('Not Sure, Need help for selecting plan.'),
    ),
    '#attributes' => array(
      'style' => 'width:99%;height:30px;margin-bottom:1%;',
    ),
  );
  $form['miniorange_demo_request']['mo_saml_demo_description'] = array(
    '#type' => 'textarea',
    '#title' => t('Description <span style="color: red">*</span>'),
    '#attributes' => array(
      'placeholder' => t('Describe your use case here!'),
      'style' => 'width:99%;',
    ),
    '#suffix' => '<br>',
  );
  $form['miniorange_demo_request']['actions']['submit'] = array(
    '#type' => 'submit',
    '#button_type' => 'primary',
    '#value' => t('Send Request'),
  );
  $form['miniorange_demo_request']['markup_demo_note'] = array(
    '#markup' => t('<div><br/><br/>If you are not sure with which plan you should go with, get in touch with us on <a href="mailto:' . MiniorangeSAMLConstants::SUPPORT_EMAIL . '">' . MiniorangeSAMLConstants::SUPPORT_EMAIL . '</a> and we will assist you with the suitable plan.</div><br><hr><br>'),
  );

  /**
   * New 2fa feature request form
   */
  $form['miniorange_feature_request'] = array(
    '#type' => 'details',
    '#title' => t('New Feature Request'),
    '#group' => 'mo_saml_vertical_tabs',
  );
  $form['miniorange_feature_request']['markup_1'] = array(
    '#markup' => t('<h3>New Feature Request</h3><hr><p class="mo_saml_highlight_background_note">Need new feature or any customization in the module? Just send us a requirement so we can help you.'),
  );
  $form['miniorange_feature_request']['mo_saml_feature_email_address'] = array(
    '#type' => 'email',
    '#title' => t('Email <span style="color: red">*</span>'),
    '#default_value' => $email,
    '#attributes' => array(
      'placeholder' => t('Enter your email'),
      'style' => 'width:99%;margin-bottom:1%;',
    ),
  );
  $form['miniorange_feature_request']['mo_saml_feature_phone_number'] = array(
    '#type' => 'textfield',
    '#title' => t('Phone'),
    '#default_value' => $phone,
    '#attributes' => array(
      'placeholder' => t('Enter number with country code Eg. +00xxxxxxxxxx'),
      'style' => 'width:99%;margin-bottom:1%;',
    ),
  );
  $form['miniorange_feature_request']['mo_saml_feature_query'] = array(
    '#type' => 'textarea',
    '#title' => t('Description <span style="color: red">*</span>'),
    '#attributes' => array(
      'placeholder' => t('Describe your requirement here!'),
      'style' => 'width:99%',
    ),
    '#suffix' => '<br>',
  );
  $form['miniorange_feature_request']['actions']['submit'] = array(
    '#type' => 'submit',
    '#button_type' => 'primary',
    '#value' => t('Submit'),
  );
  $form['miniorange_feature_request']['markup_feature_request_note'] = array(
    '#markup' => t('<div><br/><br/>For any other queries, reach out to us using support form or just drop an email to <a href="mailto:info@xecurify.com">info@xecurify.com</a> or <a href="mailto:' . MiniorangeSAMLConstants::SUPPORT_EMAIL . '">' . MiniorangeSAMLConstants::SUPPORT_EMAIL . '</a></div><br><hr><br>'),
  );
  $form['miniorange_support_tab_end'] = array(
    '#markup' => t('</div>'),
  );
  Utilities::advertiseNetworkSecurity($form, $form_state);
  return $form;
}