1 <?php
2 /**
3 * @package Joomla.Platform
4 * @subpackage Form
5 *
6 * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
7 * @license GNU General Public License version 2 or later; see LICENSE
8 */
9
10 defined('JPATH_PLATFORM') or die;
11
12 JFormHelper::loadFieldClass('filelist');
13
14 /**
15 * Supports an HTML select list of image
16 *
17 * @since 11.1
18 */
19 class JFormFieldImageList extends JFormFieldFileList
20 {
21 /**
22 * The form field type.
23 *
24 * @var string
25 * @since 11.1
26 */
27 protected $type = 'ImageList';
28
29 /**
30 * Method to get the list of images field options.
31 * Use the filter attribute to specify allowable file extensions.
32 *
33 * @return array The field option objects.
34 *
35 * @since 11.1
36 */
37 protected function getOptions()
38 {
39 // Define the image file type filter.
40 $this->filter = '\.png$|\.gif$|\.jpg$|\.bmp$|\.ico$|\.jpeg$|\.psd$|\.eps$';
41
42 // Get the field options.
43 return parent::getOptions();
44 }
45 }
46