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('list');
13
14 /**
15 * Form Field class for the Joomla Platform.
16 * Provides a select list of session handler options.
17 *
18 * @since 11.1
19 */
20 class JFormFieldSessionHandler extends JFormFieldList
21 {
22 /**
23 * The form field type.
24 *
25 * @var string
26 * @since 11.1
27 */
28 protected $type = 'SessionHandler';
29
30 /**
31 * Method to get the session handler field options.
32 *
33 * @return array The field option objects.
34 *
35 * @since 11.1
36 */
37 protected function getOptions()
38 {
39 $options = array();
40
41 // Get the options from JSession.
42 foreach (JSession::getStores() as $store)
43 {
44 $options[] = JHtml::_('select.option', $store, JText::_('JLIB_FORM_VALUE_SESSION_' . $store), 'value', 'text');
45 }
46
47 // Merge any additional options in the XML definition.
48 $options = array_merge(parent::getOptions(), $options);
49
50 return $options;
51 }
52 }
53