AnonSec Shell
Server IP : 54.36.91.62  /  Your IP : 216.73.217.117
Web Server : Apache
System : Linux webm013.cluster127.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 : coopiak ( 151928)
PHP Version : 8.3.23
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/c/o/o/coopiak/amisdesseniors-fr/plugins/content/jlexreview/elements/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/c/o/o/coopiak/amisdesseniors-fr/plugins/content/jlexreview/elements/categoryk2.php
<?php
defined('_JEXEC') or die;

$j5 = JPATH_ROOT.'/administrator/components/com_jlexreview/libs/j5.php';
if(file_exists($j5))
    require_once $j5;

jimport('joomla.form.formfield');

class JFormFieldCategoryK2 extends JFormField
{
	protected $type = 'CategoryK2';
	protected function getInput()
	{
		$loader = JPATH_ROOT.'/components/com_k2/k2.php';
		if(!is_file($loader))
		{
			return '<span style="color:red">K2 not installed.</span>';
		}
		
		$db = JFactory::getDBO();
		$query = $db->getQuery(true);

		$query->select("name, id, parent")
			  ->from("#__k2_categories")
			  ->where("trash=0")
			  ->order("parent ASC, ordering ASC");

		$items = $db->setQuery($query)->loadObjectList();
		$children = array();

		if(empty($items)) 
		{
			return '<span style="color:red">No category found.</span>';
		}

		foreach($items as $v)
		{
			if(K2_JVERSION!='15')
			{
				$v->title = $v->name;
				$v->parent_id = $v->parent;
			}

			$pt = $v->parent;
			$list = @$children[$pt] ? $children[$pt] : array();
			array_push($list, $v);
			$children[$pt] = $list;
		}

		$list = JHtml::_( 'menu.treerecurse', 0, '', array(), $children, 9999, 0, 0);
		$mitems = array();
		
		foreach($list as $item)
		{
			$item->treename = JString::str_ireplace('&#160;', '- ', $item->treename);
			$mitems[] = JHtml::_( 'select.option', $item->id, '   ' . $item->treename);
		}
		$fieldName = $this->name.'[]';
		
		$output = JHTML::_('select.genericlist', $mitems, $fieldName, 'class="inputbox custom-select" multiple="multiple" size="10"', 'value', 'text', $this->value);
		
		return $output;
	}
}

Anon7 - 2022
AnonSec Team