1 <?php
2 /**
3 * @package Joomla.Libraries
4 * @subpackage Form
5 *
6 * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
7 * @license GNU General Public License version 2 or later; see LICENSE.txt
8 */
9
10 defined('JPATH_PLATFORM') or die;
11
12 JFormHelper::loadFieldClass('predefinedlist');
13
14 /**
15 * Field to show a list of available user active statuses
16 *
17 * @since 3.2
18 */
19 class JFormFieldUserActive extends JFormFieldPredefinedList
20 {
21 /**
22 * The form field type.
23 *
24 * @var string
25 * @since 3.2
26 */
27 protected $type = 'UserActive';
28
29 /**
30 * Available statuses
31 *
32 * @var array
33 * @since 3.2
34 */
35 protected $predefinedOptions = array(
36 '0' => 'COM_USERS_ACTIVATED',
37 '1' => 'COM_USERS_UNACTIVATED',
38 );
39
40 /**
41 * Method to instantiate the form field object.
42 *
43 * @param JForm $form The form to attach to the form field object.
44 *
45 * @since 11.1
46 */
47 public function __construct($form = null)
48 {
49 parent::__construct($form);
50
51 // Load the required language
52 $lang = JFactory::getLanguage();
53 $lang->load('com_users', JPATH_ADMINISTRATOR);
54 }
55 }
56