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