| Server IP : 46.105.57.169 / Your IP : 216.73.216.144 Web Server : Apache System : Linux webd003.cluster120.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64 User : maitricfuz ( 93378) PHP Version : 8.4.10 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/maitricfuz/www/saint-martin-lg/plugins/system/nrframework/fields/ |
Upload File : |
<?php
/**
* @author Tassos Marinos <info@tassos.gr>
* @link https://www.tassos.gr
* @copyright Copyright © 2024 Tassos All Rights Reserved
* @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html> or later
*/
// No direct access to this file
defined('_JEXEC') or die;
use Joomla\Registry\Registry;
require_once __DIR__ . '/componentitems.php';
class JFormFieldJShoppingComponentItems extends JFormFieldComponentItems
{
/**
* Get query preset configuration for JShopping
*
* @return array Configuration array
*/
protected function getPresetConfig()
{
return [
'table' => 'jshopping_products',
'column_id' => 'product_id',
'column_title' => 'name_' . $this->getLanguage(),
'column_state' => 'product_publish'
];
}
public function init()
{
// Set preset so base class can pick it up
$this->element['preset'] = 'jshopping';
parent::init();
}
/**
* JoomShopping is using different columns per language. Therefore, we need to use their API to get the default language code.
*
* @return string
*/
private function getLanguage($default = 'en-GB')
{
// Silent inclusion.
@include_once JPATH_SITE . '/components/com_jshopping/lib/factory.php';
// JoomShopping 5.0+ fix
@include_once JPATH_SITE . '/components/com_jshopping/bootstrap.php';
if (!class_exists('JSFactory'))
{
return $default;
}
return JSFactory::getConfig()->defaultLanguage;
}
}