<?php

/**
 * Ahead WebSoft Technologies Pvt Ltd.
 * @copyright  Copyright 2006-2026 Ahead WebSoft Technologies Pvt Ltd.
 * @license    https://www.socialengine.com/policies
 */
class Core_Form_Admin_Language_Api extends Engine_Form
{
	public function init()
	{
		$this
			->setTitle('Google Translation API Key')
			->setAttrib('class', 'global_form_popup');

		$settings = Engine_Api::_()->getApi('settings', 'core');
		$this->addElement('Text', "core_googletranslatorapi", array(
			'label' => 'Google Translation API Key',
			'description' => "Enter your Google Translator API Key. To know the process of creation and configuration of the API key, <a target='_blank' href='https://console.developers.google.com/apis/library'>Click Here</a>.",
			'allowEmpty' => false,
			'required' => true,
			'value' => $settings->getSetting('core.googletranslatorapi', ''),
		));
		$this->getElement('core_googletranslatorapi')->getDecorator('Description')->setOptions(array('placement' => 'PREPEND', 'escape' => false));

		// Init submit
		$this->addElement('Button', 'submit', array(
			'label' => 'Save Changes',
			'type' => 'submit',
			'ignore' => true,
			'decorators' => array(
				'ViewHelper',
			),
		));

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

		$this->addDisplayGroup(array(
			'submit',
			'cancel'
		), 'buttons', array(
			'decorators' => array(
				'FormElements'
			)
		));
		$this->addDisplayGroup(array('submit', 'cancel'), 'buttons');
		$button_group = $this->getDisplayGroup('buttons');
	}
}
