| Server IP : 46.105.57.169 / Your IP : 216.73.216.84 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/m/a/i/maitricfuz/www/saint-martin-lg/plugins/maximenuck/virtuemart/elements/ |
Upload File : |
<?php
/**
* @copyright Copyright (C) 2011 Cedric KEIFLIN alias ced1870
* http://www.joomlack.fr
* Module Maximenu CK
* @license GNU/GPL
* */
defined('_JEXEC') or die;
jimport('joomla.filesystem.file');
if (file_exists(JPATH_ROOT . '/administrator/components/com_virtuemart')) {
if (!class_exists('VmConfig')) {
if (file_exists(JPATH_ROOT . '/administrator/components/com_virtuemart/helpers/config.php'))
require(JPATH_ROOT . '/administrator/components/com_virtuemart/helpers/config.php');
}
if (!class_exists('ShopFunctions')) {
if (file_exists(JPATH_ROOT . '/administrator/components/com_virtuemart/helpers/shopfunctions.php'))
require(JPATH_ROOT . '/administrator/components/com_virtuemart/helpers/shopfunctions.php');
}
// if (!class_exists('TableCategories')) {
// if (file_exists(JPATH_ROOT . '/administrator/components/com_virtuemart/tables/categories.php'))
// require(JPATH_ROOT . '/administrator/components/com_virtuemart/tables/categories.php');
// }
}
jimport('joomla.form.formfield');
\Joomla\CMS\Form\FormHelper::loadFieldClass('list');
class JFormFieldCkvmcategory extends \Joomla\CMS\Form\Field\ListField {
protected $type = 'Ckvmcategory';
protected function getOptions() {
// 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 = \Maximenuck\CKText::_('MOD_MAXIMENUCK_VIRTUEMART_NOTFOUND');
$option->value = '0';
$options[] = $option;
// Merge any additional options in the XML definition.
$options = array_merge(parent::getOptions(), $options);
return $options;
}
VmConfig::loadConfig();
$categorylist = ShopFunctions::categoryListTree();
$categorylist = trim($categorylist, '</option>');
$categorylist = explode("</option><option", $categorylist);
// add the root item
$option = new stdClass();
$option->text = \Maximenuck\CKText::_('MOD_MAXIMENUCK_VIRTUEMART_ROOTNODE');
$option->value = '0';
$options[] = $option;
foreach ($categorylist as $cat) {
$option = new stdClass();
$text = explode(">", $cat);
$option->text = trim($text[1]);
$option->value = strval(trim(trim(trim($text[0]), '"'), 'value="'));
$options[] = $option;
}
// Merge any additional options in the XML definition.
$options = array_merge(parent::getOptions(), $options);
return $options;
}
}