/
Language.php
48 lines (42 loc) · 1.52 KB
/
Language.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
/**
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://getfrapi.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@getfrapi.com so we can send you a copy immediately.
*
* @license New BSD
* @package frapi-admin
*/
class Default_Form_Language extends Lupin_Form
{
public function init()
{
$tr = Zend_Registry::get('tr');
$locale = Zend_Registry::get('Zend_Locale');
$available_languages = array (
'en' => 'English',
'fr' => 'Francais',
'it' => 'Italiano',
'ru' => 'Русский',
);
$this->setAction('/language');
$this->setAttrib('id', 'language-form');
$languages = new Zend_Form_Element_Select('languages');
$languages->setLabel($tr->_('LANGUAGE'));
$languages->addMultiOptions($available_languages);
$languages->setValue(isset($locale->value) ? $locale->value : 'en');
$this->addElement($languages);
$system_wide = new Zend_Form_Element_Checkbox('system_wide');
$system_wide->setLabel($tr->_('UPDATE_SYSTEM_WIDE') . '?');
$system_wide->setRequired(false);
$this->addElement($system_wide);
$this->addElement(new Zend_Form_Element_Submit($tr->_('SAVE')));
parent::init();
}
}