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\Form\FormHelper;
14
15FormHelper::loadFieldClass('list');
16
17/**
18 * Form Field class for the Joomla! CMS.
19 *
20 * @since  3.0
21 */
22class HeadertagField extends \JFormFieldList
23{
24	/**
25	 * The form field type.
26	 *
27	 * @var    string
28	 * @since  3.0
29	 */
30	protected $type = 'HeaderTag';
31
32	/**
33	 * Method to get the field options.
34	 *
35	 * @return  array  The field option objects.
36	 *
37	 * @since   3.0
38	 */
39	protected function getOptions()
40	{
41		$options = array();
42		$tags = array('h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p', 'div');
43
44		// Create one new option object for each tag
45		foreach ($tags as $tag)
46		{
47			$tmp = \JHtml::_('select.option', $tag, $tag);
48			$options[] = $tmp;
49		}
50
51		reset($options);
52
53		return $options;
54	}
55}
56