- md5
- 638c9018fb13d0f80aa6e920a3ae2c73
- sha1
- 5fcda7486aef4b3dc305a3cb87987b656e2d2512
- sha256
- 983a1d7a68d113240e3f32b7fb655fe77917858ffc8e23c97329dc808bf00e81
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
<?php
/**
* @version $Id$
* @package Joomla.Installation
* @copyright Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('JPATH_BASE') or die;
jimport('joomla.html.html');
jimport('joomla.filesystem.folder');
jimport('joomla.filesystem.file');
jimport('joomla.language.helper');
jimport('joomla.form.formfield');
JLoader::register('JFormFieldList', JPATH_LIBRARIES.'/joomla/form/fields/list.php');
/**
* Sample data Form Field class.
*
* @package Joomla.Installation
* @subpackage Form
* @since 1.6
*/
class JFormFieldSample extends JFormFieldList
{
/**
* The form field type.
*
* @var string
* @since 1.6
*/
protected $type = 'Sample';
/**
* Method to get the field options.
*
* @return array The field option objects.
* @since 1.6
*/
protected function getOptions()
{
// Initialize variables.
$lang = JFactory::getLanguage();
$options = array();
$type = $this->form instanceof JForm ? $this->form->getValue('db_type') : 'mysql';
if ($type == 'mysqli') {
$type='mysql';
}
// Get a list of files in the search path with the given filter.
$files = JFolder::files(JPATH_INSTALLATION.'/sql/'.$type, '^sample.*\.sql$');
// Build the options list from the list of files.
if (is_array($files)) {
foreach($files as $file) {
$options[] = JHtml::_('select.option', $file, $lang->hasKey($key='INSTL_'.($file=JFile::stripExt($file)).'_SET')?JText::_($key):$file);
}
}
// Merge any additional options in the XML definition.
$options = array_merge(parent::getOptions(), $options);
return $options;
}
}
No other release has this exact content. See every version of this file.