| 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/sliderck/virtuemart/elements/ |
Upload File : |
<?php
/**
* @copyright Copyright (C) 2011 Cedric KEIFLIN alias ced1870
* https://www.joomlack.fr
* Module Maximenu CK
* @license GNU/GPL
* */
defined('JPATH_BASE') or die;
jimport('joomla.form.formfield');
class JFormFieldCkvirtuemartcategory extends \Joomla\CMS\Form\Field\ListField {
protected $type = 'ckvirtuemartcategory';
protected function getOptions() {
if (!class_exists( 'VmConfig' )) include(JPATH_ROOT .'/administrator/components/com_virtuemart/helpers/config.php');
VmConfig::loadConfig();
vmLanguage::loadJLang('com_virtuemart');
if(!is_array($this->value))$this->value = array($this->value);
$categorylist = ShopFunctions::categoryListTree($this->value);
// if VM is not installed
if (!is_dir(JPATH_ROOT . '/administrator/components/com_virtuemart')
OR !class_exists('ShopFunctions')) {
// add the root item
$option = new stdClass();
$option->text = \Sliderck\CKText::_('SLIDERCK_VIRTUEMART_NOTFOUND');
$option->value = '0';
$options[] = $option;
// Merge any additional options in the XML definition.
$options = array_merge(parent::getOptions(), $options);
return $options;
}
// extract names and values
preg_match_all('/>([^<]+)</i', $categorylist, $names);
preg_match_all('/value="([^">]+)"/i', $categorylist, $values);
// add the root item
$option = new stdClass();
$option->text = \Sliderck\CKText::_('SLIDERCK_VIRTUEMART_ROOTNODE');
$option->value = '0';
$options[] = $option;
foreach ($names[1] as $i => $name) {
$option = new stdClass();
$text = $names[1][$i];
$id = $values[1][$i];
$option->text = $text;
$option->value = $id;
$options[] = $option;
}
// Merge any additional options in the XML definition.
$options = array_merge(parent::getOptions(), $options);
return $options;
}
}