@copyright Copyright (C) 2015. All Rights Reserved @license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html A sermon distributor that links to Dropbox. /----------------------------------------------------------------------------------------------------------------------------------*/ // No direct access to this file defined('_JEXEC') or die('Restricted access'); use Joomla\CMS\Factory; use Joomla\CMS\Language\Text; use Joomla\CMS\HTML\HTMLHelper as Html; // import the list field type jimport('joomla.form.helper'); JFormHelper::loadFieldClass('list'); /** * Externalsourcefiles Form Field class for the Sermondistributor component */ class JFormFieldExternalsourcefiles extends JFormFieldList { /** * The externalsourcefiles field type. * * @var string */ public $type = 'externalsourcefiles'; /** * Method to get a list of options for a list input. * * @return array An array of Html options. */ protected function getOptions() { // set the default $options[] = Html::_('select.option', '', Text::_('COM_SERMONDISTRIBUTOR_THE_LOCAL_LISTING_OF_THE_MANUAL_EXTERNAL_SOURCE_FOLDERS_IS_EMPTY')); $selection = SermondistributorHelper::getExternalSourceLink('manual', 2, false, 'select'); if (SermondistributorHelper::checkArray($selection)) { $options = array(); foreach ($selection as $key => $name) { $options[] = Html::_('select.option', $key, $name); } } return $options; } }