%PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 49.231.201.246 / Your IP : 216.73.216.149 Web Server : Apache/2.4.18 (Ubuntu) System : User : root ( 0) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : exec,passthru,mail,shell_exec,system,proc_open,popen,ini_alter,dl,proc_close,curl_exec,curl_multi_exec,readfile,parse_ini_file,escapeshellarg,escapeshellcmd,show_source,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,mail,php_uname,phpinfo MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/old/plugins/system/web357framework/elements/ |
Upload File : |
<?php /* ====================================================== # Web357 Framework for Joomla! - v1.7.7 (Free version) # ------------------------------------------------------- # For Joomla! CMS # Author: Web357 (Yiannis Christodoulou) # Copyright (©) 2009-2019 Web357. All rights reserved. # License: GNU/GPLv3, http://www.gnu.org/licenses/gpl-3.0.html # Website: https:/www.web357.com/ # Demo: https://demo.web357.com/joomla/web357framework # Support: support@web357.com # Last modified: 11 Jun 2019, 13:11:45 ========================================================= */ // no direct access defined('JPATH_PLATFORM') or die; jimport('joomla.form.formfield'); class JFormFieldk2categories extends JFormField { protected $type = 'k2categories'; function getInput() { jimport('joomla.component.helper'); // Get Joomla's version $jversion = new JVersion; $short_version = explode('.', $jversion->getShortVersion()); // 3.8.10 $mini_version = $short_version[0].'.'.$short_version[1]; // 3.8 // Check if K2 Component is installed if (!version_compare($mini_version, "3.5", "<=")) : // j3x $is_installed = JComponentHelper::isInstalled('com_k2'); $is_enabled = ($is_installed == 1) ? JComponentHelper::isEnabled('com_k2') : 0; $style = ''; else: // j25x $db = JFactory::getDbo(); $db->setQuery("SELECT enabled FROM #__extensions WHERE name = 'com_k2'"); $is_enabled = $db->loadResult(); $is_installed = $is_enabled; $style = ' style="float: left; width: auto; margin: 5px 5px 5px 0;"'; endif; if(!$is_installed): return '<div class="control-label"'.$style.'>The <a href="https://getk2.org" target="_blank"><strong>K2 component</strong></a> is not installed.</div>'; // Check if K2 Component is active elseif(!$is_enabled): return '<div class="control-label"'.$style.'>The <a href="https://getk2.org" target="_blank"><strong>K2 component</strong></a> is not enabled.</div>'; // K2 is installed and active else: return $this->fetchElement($this->name, $this->value, $this->element, $this->options['control']); endif; } function fetchElement($name, $value, &$node, $control_name) { $db = JFactory::getDBO(); $query = 'SELECT m.* FROM #__k2_categories m WHERE trash = 0 ORDER BY parent, ordering'; $db->setQuery($query); $mitems = $db->loadObjectList(); $children = array(); if ($mitems) { foreach ($mitems 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(' ', ' -', $item->treename); $mitems[] = JHTML::_('select.option', $item->id, $item->treename); } $attributes = 'class="inputbox"'; if (K2_JVERSION != '15') { $attribute = K2_JVERSION == '25' ? $node->getAttribute('multiple') : $node->attributes()->multiple; if ($attribute) { $attributes .= ' multiple="multiple" size="10"'; } } else { if ($node->attributes('multiple')) { $attributes .= ' multiple="multiple" size="10"'; } } if (K2_JVERSION != '15') { $fieldName = $name; } else { $fieldName = $control_name.'['.$name.']'; if ($node->attributes('multiple')) { $fieldName .= '[]'; } } return JHTML::_('select.genericlist', $mitems, $fieldName, $attributes, 'value', 'text', $value); } }