| 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/flexicontent/elements/ |
Upload File : |
<?php
/**
* @copyright Copyright (C) 2011 Cedric KEIFLIN alias ced1870
* https://www.joomlack.fr
* @license GNU/GPL
* */
defined('JPATH_BASE') or die;
jimport('joomla.form.formfield');
// \Joomla\CMS\Form\FormHelper::loadFieldClass('cklist');
class JFormFieldCkflexicontentimage extends \Joomla\CMS\Form\Field\ListField {
protected $type = 'ckflexicontentimage';
protected function getOptions() {
// if the component is not installed
if (!is_dir(JPATH_ROOT . '/administrator/components/com_flexicontent')) {
// add the root item
$option = new stdClass();
$option->text = \Sliderck\CKText::_('SLIDERCK_FLEXICONTENT_NOTFOUND');
$option->value = '-1';
$options[] = $option;
// Merge any additional options in the XML definition.
$options = array_merge(parent::getOptions(), $options);
return $options;
}
// get the categories
$items = $this->getFields();
// add the root item
/*$option = new stdClass();
$option->text = \Sliderck\CKText::_('SLIDERCK_FLEXICONTENT_ARTICLEFROMINTROIMAGE_OPTION');
$option->value = 'introimage';
$options[] = $option;
$option2 = new stdClass();
$option2->text = \Sliderck\CKText::_('SLIDERCK_FLEXICONTENT_ARTICLEFROMFIRSTIMAGE_OPTION');
$option2->value = 'firstimage';
$options[] = $option2;*/
foreach ($items as $item) {
$option = new stdClass();
$option->text = $item->name;
$option->value = $item->id;
$options[] = $option;
}
// Merge any additional options in the XML definition.
$options = array_merge(parent::getOptions(), $options);
return $options;
}
protected function getFields() {
$db = \Joomla\CMS\Factory::getDBO();
$query = "SELECT label as name, id, published"
. " FROM #__flexicontent_fields"
. " WHERE published = 1"
. " AND field_type = 'image'"
. " ORDER BY name ASC";
$db->setQuery($query);
if ($db->execute()) {
$rows = $db->loadObjectList('id');
} else {
echo '<p style="color:red;font-weight:bold;">Error loading SQL data : loading the hikashop categories in Maximenu CK</p>';
return false;
}
if (empty($rows)) {
$option = new stdClass();
$option->name = \Sliderck\CKText::_('SLIDERCK_FLEXICONTENT_CUSTOM_IMAGE_NOT_FOUND');
$option->id = '0';
return array('0' => $option);
}
return $rows;
}
}