Field_ImageList   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 30
rs 10
c 0
b 0
f 0
wmc 1
lcom 1
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A getOptions() 0 11 1
1
<?php
2
/**
3
 * Part of the Joomla Framework Form Package
4
 *
5
 * @copyright  Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved.
6
 * @license    GNU General Public License version 2 or later; see LICENSE
7
 */
8
9
namespace Joomla\Form;
10
11
FormHelper::loadFieldClass('fileList');
12
13
/**
14
 * Supports an HTML select list of image
15
 *
16
 * @since       1.0
17
 * @deprecated  The joomla/form package is deprecated
18
 */
19
class Field_ImageList extends Field_FileList
0 ignored issues
show
Deprecated Code introduced by
The class Joomla\Form\Field_FileList has been deprecated with message: The joomla/form package is deprecated

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
20
{
21
	/**
22
	 * The form field type.
23
	 *
24
	 * @var    string
25
	 * @since  1.0
26
	 */
27
	public $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   1.0
36
	 */
37
	protected function getOptions()
38
	{
39
		// Define the image file type filter.
40
		$filter = '\.png$|\.gif$|\.jpg$|\.bmp$|\.ico$|\.jpeg$|\.psd$|\.eps$';
41
42
		// Set the form field element attribute for file type filter.
43
		$this->element->addAttribute('filter', $filter);
44
45
		// Get the field options.
46
		return parent::getOptions();
47
	}
48
}
49