forked from techjoomla/TJ-Notifications
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtjnotificationsbackends.php
More file actions
52 lines (46 loc) · 1.17 KB
/
tjnotificationsbackends.php
File metadata and controls
52 lines (46 loc) · 1.17 KB
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
49
50
51
52
<?php
/**
* @package Tjnotifications
* @subpackage com_tjnotifications
*
* @copyright Copyright (C) 2009 - 2020 Techjoomla. All rights reserved.
* @license http:/www.gnu.org/licenses/gpl-2.0.html GNU/GPL
*/
// No direct access
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Form\FormHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Form\Field\ListField;
/**
* Supports an HTML select list of backends
*
* @since 2.0.0
*/
class JFormFieldTjnotificationsbackends extends ListField
{
/**
* The form field type.
*
* @var string
* @since 1.0.0
*/
protected $type = 'tjnotificationsbackends';
/**
* Method to get a list of options for a list input.
*
* @return array An array of HTMLHelper options.
*
* @since 2.0.0
*/
protected function getOptions()
{
$options = array();
$backends = explode(',', TJNOTIFICATIONS_CONST_BACKENDS_ARRAY);
foreach ($backends as $keyBackend => $backend)
{
$options[] = HTMLHelper::_('select.option', $backend, Text::_('COM_TJNOTIFICATIONS_BACKEND_' . strtoupper($backend)));
}
return array_merge(parent::getOptions(), array_values($options));
}
}