forked from techjoomla/TJ-Notifications
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplatforms.php
More file actions
63 lines (56 loc) · 1.56 KB
/
platforms.php
File metadata and controls
63 lines (56 loc) · 1.56 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
53
54
55
56
57
58
59
60
61
62
63
<?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\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Form\Field\ListField;
/**
* Supports an HTML select list of platforms
*
* @since 2.0.0
*/
class JFormFieldPlatforms extends ListField
{
/**
* The form field type.
*
* @var string
* @since 2.0.0
*/
protected $type = 'platforms';
/**
* 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();
$options[] = HTMLHelper::_('select.option', '', Text::_('COM_TJNOTIFICATIONS_PLATFORM_LIST_CHOOSE'));
$options[] = HTMLHelper::_('select.option', 'android', Text::_('COM_TJNOTIFICATIONS_PLATFORM_ANDROID'));
$options[] = HTMLHelper::_('select.option', 'ios', Text::_('COM_TJNOTIFICATIONS_PLATFORM_IOS'));
$options[] = HTMLHelper::_('select.option', 'web', Text::_('COM_TJNOTIFICATIONS_PLATFORM_WEB'));
return array_merge(parent::getOptions(), array_values($options));
}
/**
* Method to get a list of options for a list input externally and not from xml.
*
* @return array An array of HTMLHelper options.
*
* @since 2.1
*/
public function getOptionsExternally()
{
return $this->getOptions();
}
}