HEX
Server: Apache
System: Linux webm010.cluster103.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User: iestorre (46869)
PHP: 8.0.30
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/iestorre/biologia/administrator/components/com_oziogallery3/models/fields/menuitemslist.php
<?php
/**
* This file is part of Ozio Gallery
*
* Ozio Gallery 4 is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* Foobar is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Foobar.  If not, see <http://www.gnu.org/licenses/>.
*
* @copyright Copyright (C) 2010 Open Source Solutions S.L.U. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see RT-LICENSE.php
*/
// Doesn't work on Joomla 1.6.3
// defined('JPATH_PLATFORM') or die;

defined('JPATH_BASE') or die;

JFormHelper::loadFieldClass('list');

class JFormFieldMenuItemsList extends JFormFieldList
{
	public $type = "MenuItemsList";

	protected function getOptions()
	{
		// Initialize variables.
		$options = array();
		// Get the database object.
		$db = JFactory::getDBO();

		// Query on the menu types
		$query = $db->getQuery(true);
		$query->select($db->quoteName("menutype") . "," . $db->quoteName("title"));
		$query->from($db->quoteName("#__menu_types"));
		$db->setQuery($query);
		$menus = $db->loadObjectlist() or $menus = new stdClass();

		foreach ($menus as $menu)
		{

			// Recycle
			$query->clear();
			$query->select("id, title, menutype, link, published");
			$query->from('#__menu');
			// Filter on the extension name
			$query->where("link LIKE '%option=" . (string)$this->element["component"] . "&view=%'");
			$query->where("link NOT LIKE '%&view=list%'");
			// Filter on the menu type
			$query->where("menutype" . "=" . $db->quote($menu->menutype));
			// Filter on the published state.
			$query->where("published = 1");

			$query->order($db->quoteName("lft"));

			// Set the query and get the result list.
			$db->setQuery($query);

			$items = $db->loadObjectlist() or $items = new stdClass();

			$options[] = JHtml::_('select.optgroup', $menu->title);
			foreach ($items as $item)
			{
				$options[] = JHtml::_('select.option', $item->{"id"}, $item->{"title"});
			}
			$options[] = JHtml::_('select.optgroup', $menu->title);

		}

		// Merge any additional options in the XML definition.
		$options = array_merge(parent::getOptions(), $options);

		return $options;
	}
}