<?php
/**
  * Ahead WebSoft Technologies Pvt Ltd.
  * @copyright  Copyright 2006-2026 Ahead WebSoft Technologies Pvt Ltd.
  * @license    https://www.socialengine.com/policies
*/

class Gdpr_Form_Admin_Service extends Engine_Form
{

  public function init()
  {

    $this->loadDefaultDecorators();
    $this->getDecorator('Description')->setOption('escape', false);

    $this
      ->setTitle('Add New Service')
      ->setDescription('Below you can add this 3rd party service which is used on your website directly or in any plugin / module installed on your website.');


    $this->addElement(
      'Text',
      'name',
      array(
        'label' => 'Service Name',
        'required' => true,
        'allowEmpty' => false
      )
    );

    $this->addElement(
      'Textarea',
      'description',
      array(
        'label' => 'Reason for Use',
        'required' => true,
        'allowEmpty' => false
      )
    );

    $this->addElement(
      'Text',
      'url',
      array(
        'label' => 'Website URL',
        'required' => true,
        'allowEmpty' => false
      )
    );

    $this->addElement(
      'Checkbox',
      'enabled',
      array(
        'label' => 'Enable this service',
        'required' => true,
        'allowEmpty' => false,
        'value' => 1
      )
    );


    $this->addElement(
      'Button',
      'Submit',
      array(
        'type' => 'submit',
        'ignore' => true,
        'decorators' => array('ViewHelper')
      )
    );

    $this->addElement(
      'Cancel',
      'cancel',
      array(
        'label' => 'Cancel',
        'link' => true,
        'prependText' => ' or ',
        'onclick' => 'javascript:parent.Smoothbox.close()',
        'decorators' => array(
          'ViewHelper',
        ),
      )
    );
    $this->addDisplayGroup(array('Submit', 'cancel'), 'buttons');
  }

}
