File manager - Edit - /home/jardides/www/Jardi-design/j37/plugins/sliderck/k2/elements/ckk2category.php
Back
<?php /** * @copyright Copyright (C) 2011 Cedric KEIFLIN alias ced1870 * http://www.joomlack.fr * @license GNU/GPL * */ defined('JPATH_BASE') or die; jimport('joomla.filesystem.file'); jimport('joomla.form.formfield'); JFormHelper::loadFieldClass('cklist'); class JFormFieldCkk2category extends JFormFieldCklist { protected $type = 'ckk2category'; protected function getOptions() { // if the component is not installed if (!JFolder::exists(JPATH_ROOT . '/administrator/components/com_k2')) { // add the root item $option = new stdClass(); $option->text = JText::_('MOD_SLIDERCK_K2_NOTFOUND'); $option->value = '0'; $options[] = $option; // Merge any additional options in the XML definition. $options = array_merge(parent::getOptions(), $options); return $options; } // get the categories $cats = $this->getCategories(); $options = array(); // add the root item // $option = new stdClass(); // $option->text = JText::_('MOD_SLIDESHOWCK_K2_PRODUCT_CATEGORY'); // $option->value = '2'; // $options[] = $option; foreach ($cats as $cat) { $option = new stdClass(); $option->text = str_repeat(" - ", $cat->level) . $cat->name; $option->value = $cat->id; $options[] = $option; } // Merge any additional options in the XML definition. $options = array_merge(parent::getOptions(), $options); return $options; } protected function getCategories() { require_once(JPATH_ROOT . '/plugins/sliderck/k2/helper/helper_k2_categories.php'); // get the list of categories $items = array(); $k2Categories = new SliderckHelperK2Categories(); $k2Categories::recurseCategories(0, 0, $items, 0, 0); return $items; } }
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.01 |
proxy
|
phpinfo
|
Settings