Joomla Platform  13.1
Documentation des API du framework Joomla Platform
 Tout Classes Espaces de nommage Fichiers Fonctions Variables Pages
imagelist.php
Aller à la documentation de ce fichier.
1 <?php
2 /**
3  * @package Joomla.Platform
4  * @subpackage Form
5  *
6  * @copyright Copyright (C) 2005 - 2013 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  * @package Joomla.Platform
18  * @subpackage Form
19  * @since 11.1
20  */
22 {
23  /**
24  * The form field type.
25  *
26  * @var string
27  * @since 11.1
28  */
29  protected $type = 'ImageList';
30 
31  /**
32  * Method to get the list of images field options.
33  * Use the filter attribute to specify allowable file extensions.
34  *
35  * @return array The field option objects.
36  *
37  * @since 11.1
38  */
39  protected function getOptions()
40  {
41  // Define the image file type filter.
42  $filter = '\.png$|\.gif$|\.jpg$|\.bmp$|\.ico$|\.jpeg$|\.psd$|\.eps$';
43 
44  // Set the form field element attribute for file type filter.
45  $this->element->addAttribute('filter', $filter);
46 
47  // Get the field options.
48  return parent::getOptions();
49  }
50 }