Jo Code php2
Jo Code php2
<?php
/**
* @package Joomla.Installation
*
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('JPATH_BASE') or die;
JFormHelper::loadFieldClass('radio');
/**
* Install Sample Data field.
*
* @since 1.6
*/
class InstallationFormFieldSample extends JFormFieldRadio
{
/**
* 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()
{
$options = array();
$type = $this->form->getValue('db_type');
// Some database drivers share DDLs; point these drivers to the correct parent
if ($type === 'mysqli' || $type === 'pdomysql')
{
$type = 'mysql';
}
elseif ($type === 'sqlsrv')
{
$type = 'sqlazure';
}
elseif ($type === 'pgsql')
{
$type = 'postgresql';
}
// Get a list of files in the search path with the given filter.
$files = JFolder::files(JPATH_INSTALLATION . '/sql/' . $type, '^sample.*\.sql$');
-1-
C:\Users\Ionut\AppData\Local\Temp\Rar$DIa7036.27831\sample.php marți, 13 septembrie 2022 18:15
return $options;
}
/**
* Method to get the field input markup.
*
* @return string The field input markup.
*
* @since 1.6
*/
protected function getInput()
{
if (!$this->value)
{
$conf = JFactory::getConfig();
if ($conf->get('sampledata'))
{
$this->value = $conf->get('sampledata');
}
else
{
$this->value = '';
}
}
return parent::getInput();
}
}
-2-