1 <?php
2 /**
3 * @package FrameworkOnFramework
4 * @subpackage form
5 * @copyright Copyright (C) 2010-2016 Nicholas K. Dionysopoulos / Akeeba Ltd. All rights reserved.
6 * @license GNU General Public License version 2 or later; see LICENSE.txt
7 */
8 // Protect from unauthorized access
9 defined('FOF_INCLUDED') or die;
10
11 /**
12 * Language field header
13 *
14 * @package FrameworkOnFramework
15 * @since 2.0
16 */
17 class FOFFormHeaderLanguage extends FOFFormHeaderFieldselectable
18 {
19 /**
20 * Method to get the filter options.
21 *
22 * @return array The filter option objects.
23 *
24 * @since 2.0
25 */
26 protected function getOptions()
27 {
28 // Initialize some field attributes.
29 $client = (string) $this->element['client'];
30
31 if ($client != 'site' && $client != 'administrator')
32 {
33 $client = 'site';
34 }
35
36 // Merge any additional options in the XML definition.
37 $options = array_merge(
38 parent::getOptions(), JLanguageHelper::createLanguageList($this->value, constant('JPATH_' . strtoupper($client)), true, true)
39 );
40
41 return $options;
42 }
43 }
44