Your IP : 216.73.216.224


Current Path : /var/www/html/administrator/components/com_jchat/Field/
Upload File :
Current File : /var/www/html/administrator/components/com_jchat/Field/SelectanswersField.php

<?php
namespace JExtstore\Component\JChat\Administrator\Field;
/**  
 * @package JCHAT::CONFIG::administrator::components::com_jchat 
 * @subpackage Field
 * @author Joomla! Extensions Store
 * @copyright (C) 2024 - Joomla! Extensions Store
 * @license GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html   
 */ 
defined ( '_JEXEC' ) or die ( 'Restricted access' );
use Joomla\CMS\Form\Field\ListField;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Component\ComponentHelper;

/**  
 * @package JCHAT::CONFIG::administrator::components::com_jchat 
 * @subpackage Field
 * @since 1.6
 */ 
class SelectanswersField extends ListField {
	/**
	 * The form field type.
	 *
	 * @var    string
	 *
	 * @since 1.6
	 */
	protected $type = 'selectanswers';
	
	/**
	 * Build the multiple select list for Menu Links/Pages
	 * 
	 * @access public
	 * @return array
	 */
	protected function getOptions() {
		$cParams = ComponentHelper::getParams('com_jchat');
		$options = $cParams->get('predefined_answers', array());
		$htmlOptions = array();
		
		foreach ( $options as $option ) {
			$htmlOptions [] = HTMLHelper::_ ( 'select.option', $option, $option );
		}
		
		return $htmlOptions;
	}
}