| Server IP : 213.186.33.4 / Your IP : 216.73.216.193 Web Server : Apache System : Linux webm006.cluster103.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 : awebpaca ( 35430) PHP Version : 8.5.0 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/awebpaca/blog/libraries/kunena/form/fields/ |
Upload File : |
<?php
/**
* Kunena Component
* @package Kunena.Framework
* @subpackage Form
*
* @copyright (C) 2008 - 2018 Kunena Team. All rights reserved.
* @license https://www.gnu.org/copyleft/gpl.html GNU/GPL
* @link https://www.kunena.org
**/
defined('_JEXEC') or die();
jimport('joomla.form.formfield');
/**
* Class JFormFieldKunenaCategoryList
*/
class JFormFieldKunenaCategoryList extends JFormField
{
protected $type = 'KunenaCategoryList';
/**
* @return string
*/
protected function getInput()
{
if (!class_exists('KunenaForum') || !KunenaForum::installed())
{
echo '<a href="index.php?option=com_kunena">PLEASE COMPLETE KUNENA INSTALLATION</a>';
return '';
}
KunenaFactory::loadLanguage('com_kunena');
$size = $this->element['size'];
$class = $this->element['class'];
$attribs = ' ';
if ($size)
{
$attribs .= 'size="' . $size . '"';
}
if ($class)
{
$attribs .= 'class="' . $class . '"';
}
else
{
$attribs .= 'class="inputbox"';
}
if (!empty($this->element['multiple'])) {
$attribs .= ' multiple="multiple"';
}
// Get the field options.
$options = $this->getOptions();
return JHtml::_('kunenaforum.categorylist', $this->name, 0, $options, $this->element, $attribs, 'value', 'text', $this->value);
}
/**
* Method to get the field options.
*
* @return array The field option objects.
* @since 11.1
*/
protected function getOptions()
{
// Initialize variables.
$options = array();
foreach ($this->element->children() as $option)
{
// Only add <option /> elements.
if ($option->getName() != 'option')
{
continue;
}
// Create a new option object based on the <option /> element.
$tmp = JHtml::_('select.option', (string) $option['value'], JText::alt(trim((string) $option), preg_replace('/[^a-zA-Z0-9_\-]/', '_', $this->fieldname)), 'value', 'text', ((string) $option['disabled'] == 'true'));
// Set some option attributes.
$tmp->class = (string) $option['class'];
// Set some JavaScript option attributes.
$tmp->onclick = (string) $option['onclick'];
// Add the option object to the result set.
$options[] = $tmp;
}
reset($options);
return $options;
}
}