Файловый менеджер - Редактировать - /var/www/html/administrator/components/com_osmembership/libraries/mpf/form/field/sql.php
Ðазад
<?php /** * @package MPF * @subpackage Form * * @copyright Copyright (C) 2016 Ossolution Team, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE */ defined('_JEXEC') or die; use Joomla\CMS\Factory; use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Language\Text; /** * Supports an custom SQL select list * * @package Joomla.MPF * @subpackage Form */ class MPFFormFieldSQL extends MPFFormFieldList { /** * The form field type. * * @var string */ protected $type = 'SQL'; /** * The query. * * @var string */ protected $query; /** * Constructor. * * @param OSMembershipTableField $row * @param string $value * @param string $fieldSuffix */ public function __construct($row, $value, $fieldSuffix) { parent::__construct($row, $value, $fieldSuffix); $this->query = $row->default_values; } /** * Method to get the custom field options. * Use the query attribute to supply a query to generate the list. * * @return array The field option objects. * * @since 11.1 */ protected function getOptions() { try { /* @var \Joomla\Database\DatabaseDriver $db */ $db = Factory::getContainer()->get('db'); $db->setQuery($this->query); $options = []; if (!$this->multiple) { $options[] = HTMLHelper::_('select.option', '', $this->row->prompt_text ?: Text::_('OSM_SELECT')); } $rows = $db->loadObjectList(); // Prevent saved value from being lost when there is no options returned if (count($rows) === 0 && $this->value) { $options[] = HTMLHelper::_('select.option', $this->value, $this->value); } else { $options = array_merge($options, $rows); } } catch (Exception $e) { $options = []; } return $options; } }
| ver. 1.1 | |
.
| PHP 8.4.18 | Ð“ÐµÐ½ÐµÑ€Ð°Ñ†Ð¸Ñ Ñтраницы: 0 |
proxy
|
phpinfo
|
ÐаÑтройка